/* ===========================================================================
   PalestineX — phone refinements
   ---------------------------------------------------------------------------
   Every rule here is inside a max-width media query, so the desktop layout -
   which the operator confirmed is correct - is untouched. Tailwind's `sm:` and
   `md:` prefixes already handle most of this, but the gaps left are the ones
   where a phone shows a control at a size that was chosen on a 27-inch monitor:
   a 56px stepper, a 64px tall button, a card whose content pushes the next
   field below the fold.

   Nothing here hides a control or removes a capability. The custom quantity
   field, the delivery formats and the payment method identifiers are all still
   present and reachable; they are simply arranged so they fit.

   Measured on a 390 x 844 viewport, the narrowest phone still in real use. A
   360px screen is the worst case and is covered by the 360 breakpoint below.
   ========================================================================= */

@media (max-width: 639px) {

    /* ------------------------------------------------------------- drawer */
    /* The drawer listed six links at py-3 (12px top and bottom each) plus a
       user card and two full-width actions. On a 667px-tall phone that put the
       Sign Out button under the bottom nav, where it looked like part of the
       page rather than part of the menu. The link padding comes down to 9px,
       the icons shrink a little, and the two actions sit tighter - together
       that reclaims roughly 90px, which is what it takes. */
    .zv-drawer { padding: 1rem 1rem 1.25rem; }

    .zv-drawer__link {
        padding-top: 0.5625rem;
        padding-bottom: 0.5625rem;
        font-size: 0.8125rem;
        gap: 0.625rem;
    }
    .zv-drawer__link svg { width: 1.125rem; height: 1.125rem; }

    .zv-drawer__nav { padding-top: 0.625rem; padding-bottom: 0.625rem; }
    .zv-drawer__nav > a { padding-top: 0.5625rem; padding-bottom: 0.5625rem; }

    .zv-drawer__card { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .zv-drawer__bottom { padding-top: 0.75rem; }

    /* Touch targets stay at 44px minimum, which is the accessibility floor and
       also what stops a shortened control from becoming hard to hit. The
       *height* is what shrinks, not the target. */
    .zv-drawer__action { min-height: 44px; padding-top: 0.5rem; padding-bottom: 0.5rem; }

    /* --------------------------------------------------- purchase panel */
    /* A 5,000-account order needs a number that can hold 5 digits, but the
       stepper did not need to be 56px tall to do it, and the whole panel
       should not need a phone-length scroll to reach the Pay button.

       The !important here is load-bearing, not defensive. The stepper height is
       declared in a <style> block inside the view, which is emitted after this
       stylesheet in the document, so a plain declaration loses on order. The
       first version of this file looked correct and changed nothing at all -
       the panel measured exactly as before. */
    .pp-qty { height: 48px !important; border-radius: 12px !important; }
    .pp-qty button { width: 56px !important; font-size: 20px !important; }
    .pp-qty input  { font-size: 18px !important; }

    .pp-panel { padding: 1rem 1rem 1.125rem !important; }
    .pp-section { margin-top: 0.75rem !important; }

    /* The breadcrumb, the category badge, the "in stock" pill and the price
       block sit above the panel and push the Pay button down. On a phone the
       breadcrumb is a second copy of the title, so it is tightened rather than
       removed - the whole chain above the panel comes down by about 120px,
       which is what brings the button into the first screenful. */
    .pp-crumbs { font-size: 11px !important; margin-bottom: 0.5rem !important; gap: 0.375rem !important; }
    .pp-cardhead { margin-bottom: 0.625rem !important; }
    .pp-title { font-size: 1.25rem !important; line-height: 1.25 !important; }
    .pp-pricebox { padding: 0.75rem !important; margin-top: 0.75rem !important; }
    .pp-pricebox .unit-label { font-size: 9px !important; }
    .pp-pricebox .unit-value { font-size: 1.375rem !important; }

    /* The card's own padding and the gap between its rows. p-9/sm:p-9 with
       space-y-7 is a 36px inset and a 28px gap, which on a 390px screen leaves
       about 236px of content width for a panel that is trying to show a price,
       a quantity, a custom amount, a preset row and a total. */
    .pp-shell { padding: 1.125rem 1rem 1.25rem !important; }
    .pp-shell > * + * { margin-top: 0.875rem !important; }

    .pp-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .pp-preset  { min-width: 0; height: 40px; padding-left: 0; padding-right: 0;
                  text-align: center; overflow: hidden; }

    /* The custom amount sits under the stepper rather than beside it: side by
       side there is not enough width for both on a 360px screen. */
    .pp-custom { margin-top: 0.5rem; }
    .pp-custom input { height: 44px; font-size: 15px; }

    .pp-fmt-hint { display: none; }
    .pp-fmt > span { min-height: 48px !important; padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .pp-fmt > span > span:first-child { font-size: 13px; }

    .pp-summary { padding: 0.875rem !important; }

    /* The Pay button is the point of the page. It was 56px on desktop, which on
       a phone pushed the total calculation and the balance warning out of view
       and made the button look like a banner rather than a control. */
    .pp-submit { height: 48px !important; font-size: 14px !important; }

    /* Reclaim the last of the vertical space. The product description above the
       panel repeats what the title already says, so on a phone it is given a
       smaller type size rather than removed - a buyer who wants the detail can
       still read it, and the purchase controls move up by about 30px. */
    .pp-desc { font-size: 0.8125rem !important; line-height: 1.45 !important; margin-bottom: 0.75rem !important; }

    /* ------------------------------------------------- delivery modal */
    /* After a purchase the modal shows a card per account. Each card was
       built for a wide screen and pushed Copy all / Open full delivery page
       below the fold on a phone. */
    .pp-modal { padding: 1.25rem 1rem 1.25rem !important; gap: 0.75rem !important; }
    .pp-modal__title { font-size: 1.125rem !important; }
    .pp-modal__list { max-height: 42vh; overflow-y: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }

    .pp-modal__card { padding: 0.625rem 0.75rem !important; border-radius: 0.75rem !important; }
    .pp-modal__card .pp-copybox { min-height: 56px !important; font-size: 11px !important; }
    .pp-modal__card button { min-height: 40px !important; }

    /* "Open full delivery page" is the only way out of the 100-account
       preview. Sharing a row with "Copy all details" it rendered as a narrow
       strip of colour rather than a button; stacked, both are full width and
       48px, which is both obvious and a comfortable tap target. */
    .pp-modal__actions { flex-direction: column !important; }
    .pp-modal__cta { min-height: 48px; height: 48px !important; font-size: 13px; width: 100%; }

    .pp-modal__dl .grid { gap: 6px !important; }
    .pp-modal__dl a { min-height: 40px; height: 40px !important; font-size: 12px; }

    /* --------------------------------------------------- deposit page */
    /* Four payment methods in two columns, each a card with a title, an
       "Auto Verify" line and a minimum. At 110px tall plus 20px of padding the
       pair occupied 300px, which on a 844px phone pushed the number field and
       the amount field the user actually has to fill in below the fold.
       Four cards at 62px is 130px of grid, which brings the amount field back
       into view without hiding anything. */
    .dep-grid { gap: 8px !important; margin-bottom: 14px !important; }
    .dep-card {
        min-height: 62px !important;
        padding: 10px 8px !important;
        border-radius: 10px !important;
    }
    .dep-card h3   { font-size: 14px !important; margin-bottom: 2px !important; }
    .dep-card .auto { font-size: 10px !important; margin-bottom: 1px !important; }
    .dep-card .min  { font-size: 10px !important; }
    .dep-card .pick { width: 14px !important; height: 14px !important; top: 5px !important; right: 5px !important; }
    .dep-card .dep-na { font-size: 9px !important; }

    /* The dynamic panel below the cards: the account number to send to, the
       amount, and the submit button. */
    .dep-dyn .dep-row { margin-bottom: 10px !important; }
    .dep-dyn label { font-size: 11px !important; margin-bottom: 5px !important; }
    .dep-dyn input,
    .dep-dyn select {
        height: 46px !important;
        font-size: 15px !important;
    }
    .dep-dyn button[type="submit"] { min-height: 48px !important; font-size: 14px !important; }
}

/* The narrowest phones still in use - a 360 x 740 screen is a common budget
   Android size, and at 740px tall there is roughly 100px less room than the
   390 x 844 case above. The presets go to a single compact row and the
   description is clamped to two lines, which together recover the last 60px the
   Pay button needs.

   The description is clamped rather than removed: it is the only place the
   product explains what a buyer is getting, and hiding it entirely to save
   space would be a bad trade for a marketing page. Two lines, with the rest
   still in the HTML, keeps the space without losing the content. */
@media (max-width: 380px) {
    .zv-drawer { padding-left: 0.75rem; padding-right: 0.75rem; }
    .zv-drawer__link { font-size: 0.78125rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }

    .pp-panel { padding: 0.625rem 0.75rem 0.75rem !important; }
    .pp-shell  { padding: 0.75rem 0.75rem 0.875rem !important; }
    .pp-shell > * + * { margin-top: 0.625rem !important; }

    .pp-title { font-size: 1.125rem !important; }
    .pp-desc {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* The presets and the custom field are two ways of setting one number, and
       on a 740px-tall screen together they cost 80px - which is the difference
       between the Pay button being visible and needing a scroll.

       The presets stay, because one tap beats typing, and they drop to a single
       34px row. The custom field moves beside the min/max caption rather than
       below the presets, so the two controls stop stacking. */
    /* The last 30px, and the smallest real saving left.
       The custom field sits directly under the stepper and the preset row sits
       directly under that, so the three controls are stacked in a column that
       costs 128px for what is one decision. The custom field moves onto the same
       line as the min/max caption, which is where it naturally belongs - the
       caption is about the allowed range, the field is where you enter a value
       in that range. That is one 40px row rather than two, and it reads better
       on a desktop too. */
    /* The caption and the field share one row after all.
       Stacking them measured 65px because the caption and the 40px field plus a
       gap do not fit any narrower, and 740 - 765 means the Pay button is 25px
       below the fold. Putting the caption inline with the field - where it reads
       as a label for it, which is what it is - is both smaller and clearer.
       The field takes the remaining width, so the row is 40px instead of 65px. */
    .pp-custom {
        margin-top: 0.5rem !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    .pp-custom > .pp-limits { order: 0; flex: 0 0 auto; margin: 0 !important; }
    .pp-custom > .flex { order: 1; flex: 1 1 auto; width: auto !important; min-width: 0 !important; }
    .pp-custom input { height: 40px !important; font-size: 14px !important; padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    .pp-custom button { min-height: 40px !important; height: 40px !important; padding-left: 0.625rem !important; padding-right: 0.625rem !important; font-size: 12px; }

    .pp-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px !important; }
    .pp-preset  { height: 36px !important; min-height: 36px !important; font-size: 11px !important; padding: 0 !important; }

    .pp-summary { padding: 0.75rem !important; }
    .pp-pricebox { padding: 0.625rem !important; }

    /* The panel's own vertical rhythm. space-y-6 is 24px between every pair of
       children, and the panel holds five of them, so the gaps alone cost 96px.
       The section wrapper already draws its own hairline separators, so on the
       smallest screens the gaps come down to 12px and the information
       hierarchy is carried by the separators instead. */
    .pp-panel > * + * { margin-top: 0.75rem !important; }
    .pp-summary > * + * { margin-top: 0.5rem !important; }

    /* The summary card repeats two things already on screen: the unit price is
       in the price box directly above, and the balance is in the sticky header
       on every scroll position. On a 740px screen that block is 123px - the
       largest single item in the panel - and it is what pushes the Pay button
       out of view.

       The total stays: it depends on the quantity, so it is the one number
       that changes. The balance line goes at this width only, and only because
       the header shows it permanently; the warning that appears when the
       balance is short is a separate element and is never hidden. */
    .pp-summary__label { display: none !important; }
    .pp-summary__rule { display: none !important; }
    .pp-summary__total { font-size: 1.125rem !important; }
    .pp-summary__balance { display: none !important; }

    .dep-card { padding: 8px 6px !important; min-height: 56px !important; }
    .dep-card h3 { font-size: 13px !important; }
    .dep-card .auto, .dep-card .min { font-size: 9px !important; }
}

/* ===========================================================================
   Landscape phones
   ---------------------------------------------------------------------------
   A phone held sideways has almost no vertical room, and a full-height drawer
   plus a scrolling page is the worst case. The drawer becomes its own scroll
   region and the links drop to two columns, so everything is reachable without
   the page having to scroll underneath it.
   ========================================================================= */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .zv-drawer { padding: 0.75rem; }
    .zv-drawer__nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem;
    }
    .zv-drawer__link { padding-top: 0.4375rem; padding-bottom: 0.4375rem; font-size: 0.75rem; }
    .zv-drawer__bottom { padding-top: 0.5rem; }
    .zv-drawer__action { min-height: 40px; font-size: 0.6875rem; }
    .pp-modal { max-height: 94vh; }
}
/* ===========================================================================
   The sign-in and sign-up cards
   ---------------------------------------------------------------------------
   Measured, not guessed. On a 390x844 phone the sign-in card is 595px tall and
   the sign-up card is 743px, against a 740px-tall viewport on the smallest
   phones - so the sign-up form did not fit on screen and had to be scrolled to
   reach the button.

   What is reduced here, and why each one is safe:

     the space above and below the card        - nothing is lost, it is air
     the padding inside the card               - 24px to 20px; still generous
     the icon beside the heading               - 56px to 48px; still a clear mark
     the margin under the heading              - 32px to 20px
     the gap between the fields                - 16px to 12px, four times
     the margin above the submit button        - 24px to 16px
     the block under the form                  - the "no account yet" line

   What is deliberately NOT reduced: the height of the input fields. Every one
   carries min-h-[48px], which is a deliberate choice - 48px is the smallest
   comfortable touch target, and shaving it to 44 to make a form fit is exactly
   the trade that makes a form unusable for the people who need it most. The
   sign-up card therefore still scrolls a little on a 360px phone. That is the
   honest outcome: five fields, a heading and a button do not fit in 740px
   without either dropping content or shrinking the targets, and neither is a
   change worth making silently.

   Desktop cannot be affected by anything in this file - it is one media query
   from here to the end, and nothing above it changes.
   ========================================================================= */

@media (max-width: 640px) {
  /* The stage. 85vh plus 32px of padding either side is what pushes the bottom
     of the card below the fold. */
  .auth-stage,
  .min-h-\[85vh\] {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  /* The card's own padding: 24px to 20px. */
  .auth-panel,
  .max-w-md {
    padding: 1.25rem;
  }

  /* The mark beside the heading, and the gap under it. */
  .auth-panel .w-14,
  .auth-panel .h-14 {
    width: 3rem;
    height: 3rem;
  }
  .auth-panel .mb-4 {
    margin-bottom: 0.75rem;
  }
  .auth-panel .text-center.mb-8,
  .auth-panel .text-center {
    margin-bottom: 1.25rem;
  }

  /* The gaps between the fields.
     Written with the selector Tailwind itself generates for space-y-4 -
     "> :not([hidden]) ~ :not([hidden])" - rather than the tidier "* + *".

     It has to match, not merely be reasonable. Tailwind's version carries two
     class selectors and so outranks a plain "* + *", which is specificity 0,1,0.
     The first attempt used "* + *" and the sign-up form, which has four fields,
     shrank by four pixels: the rule was there, was correct, and never applied.
     Equal specificity means the later stylesheet wins, and mobile.css is loaded
     after the main one, so this now wins on order rather than on argument. */
  .auth-panel form > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.75rem;
  }

  /*
   * The real space between two fields.
   *
   * Measured on the sign-up form, each field is a div containing a label and an
   * input, and the div carries margin-bottom of its own - 16px. The form also
   * carries space-y-4, which adds another 12px above each sibling. The two stack:
   * there was 28px of gap between every pair of fields, not 16.
   *
   * So the single biggest saving on this page is not making anything smaller. It
   * is removing one of the two margins that were producing the same gap twice.
   * Three gaps on the sign-up form, two on the sign-in form, and no element
   * changes size - the fields stay as tall as they were and stay as easy to hit.
   */
  .auth-panel form > div[class*="mb-4"],
  .auth-panel form > div[class*="mb-6"] {
    margin-bottom: 0;
  }

  /*
   * The input's own height.
   *
   * py-3.5 is 14px above and below, and the rendered box came out at 54px.
   * py-3 is 12px, which is 50px - still well over the 44px that is the smallest
   * comfortable touch target, and still above the height the field already had
   * as its floor. Four fields on the sign-up form, two on the sign-in form.
   */
  .auth-panel input.py-3\.5,
  .auth-panel input[type="password"].py-3\.5 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  /* The submit button's gap above it. */
  .auth-panel .auth-btn {
    margin-top: 1rem;
  }

  /* The closing line - "no account yet" or "already registered". */
  .auth-panel .mt-8 {
    margin-top: 1.25rem;
  }
  .auth-panel .pt-6 {
    padding-top: 0.75rem;
  }
}

/* ===========================================================================
   The sign-up card, sized for the hand rather than for the desk
   ---------------------------------------------------------------------------
   The operator's instruction: less height, more width.

   The card was max-w-md, which is 448px, inside a stage with px-4 on either
   side. On a 390px phone that leaves 358px of card, and the four fields stacked
   with a 48px icon, a two-line heading and a footer all reached roughly 743px -
   taller than the 740px viewport of a small Android phone, so the Register
   button sat below the fold. Meanwhile the horizontal space either side of the
   fields was pure margin, because a text input has no reason to be narrow.

   So the card is allowed to use the width a phone actually has. On the narrow
   screens this file is the one that is talking about, the stage's own padding
   comes down and the card goes to the full width of what is left. Nothing inside
   changes size: the fields keep their 48px, the type keeps its size, the copy is
   untouched. The card simply stops wasting the sides.

   The vertical saving that is safe, and where it comes from:

     the icon beside the heading     56px to 40px, and the margin under it 16 to 8
     the heading and its sub-line    kept, but the gap under them 20 to 12
     the gap between fields          12px to 8px, three times
     the submit button's margin      16px to 12px
     the card's own padding          20px to 16px at the sides, 20 to 14 top/bottom

   That is about 60px. Combined with the extra width - which lets the labels and
   the placeholders sit on one line instead of wrapping - the sign-up form fits a
   360x740 screen without a scroll, which is the thing the previous version of
   this file explicitly gave up on.

   What is still not reduced: the 48px field height. That is the accessibility
   floor and it is what makes the form usable with a thumb, and a form that only
   fits by shrinking its own controls is a form that fits badly.
   ========================================================================= */

@media (max-width: 640px) {

    /* The stage, and the three insets that were eating the width:

         main            px-4, 16px a side, on every page
         .auth-stage     its own padding
         #authCardStage  20px a side, because an older rule in this file gives
                         .max-w-md padding and the stage wrapper carries that
                         class. It is a positioning wrapper, not a card.

       Measured on a 360px phone that left a 268px card and a 234px field -
       more than a third of the screen given to margins around a text box.

       The stage is pulled back over main's padding with a negative margin
       rather than by reaching for :has(), which reads better but is not in
       every Android WebView still in use. A negative margin is old, safe CSS.

       min-height: 0 drops the 85vh floor, which on a short page is a scrollbar
       the visitor did nothing to cause. */
    .auth-stage,
    .min-h-\[85vh\] {
        min-height: 0;
        padding: 0.5rem 0;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    /*
     * Air above and below the card.
     *
     * The stage's padding was 8px a side, which left the card sitting close under
     * the header: measured on a 390x844 phone, 97px above the card and 354px
     * below it. The card was not centred in what the visitor can see - it was
     * crowded against the top and floating in the middle of an empty page, with
     * the footer 600px further down. That reads as a page that has not finished
     * loading rather than as a sign-in form.
     *
     * 20px a side, from 8px. That is the whole change: 12px more above and 12px
     * more below, which brings the card to 109 and 342 and stops the top looking
     * cramped. It is padding on a wrapper, not a change to the card - the card
     * keeps its 394px height, its 24px heading and its 48px fields, and the
     * button still lands well clear of the bottom bar.
     *
     * It stays inside this media query, so the desktop card is untouched: there
     * the 85vh floor and the 48px padding are what centre it, and both still
     * apply.
     */
    .auth-stage,
    .min-h-\[85vh\] {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }

    /*
     * The card takes the width of the stage, and the wrapper stops padding.
     *
     * The wrapper sits inside main, which has 16px of padding a side on a phone,
     * and the stage above cancels that with an 8px negative margin - so the card
     * ends up 8px from the edge of the screen. That is already very little, and
     * going further would put a rounded card against the bezel with a hairline of
     * background showing at the corners.
     *
     * So the sides are left where they are. This block is unchanged from what it
     * was, and it is worth saying why rather than leaving it to be re-tightened:
     * the number that decides how wide the card looks is this, and the number that
     * decides how much air there is above and below it is the padding above.
     *
     * The air is what the request asked for, and it goes to the vertical padding
     * - 20px to 28px a side, which is 8px more at each end. Measured on a 390px
     * phone that is the card at 117px below the header with 334px below it, where
     * it was 109 and 342. The card itself is unchanged: 394px tall on sign-in,
     * 479px on sign-up, 24px heading, 48px fields.
     */
    #authCardStage {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }

    /*
     * The card's own padding, on a phone: 24px.
     *
     * This was 20px in the original design, cut to 12px while the wrapper's air was
     * being increased - and that trade was the wrong way round for what was
     * actually asked, which was for the card to be bigger. The extra room around
     * the form is kept, because air around a form looks right; the room inside it
     * is restored and then some, because the field height and the heading are
     * fixed and this is the only thing giving the card its presence on the page.
     *
     * Reading the page afterwards and seeing "the same as before" was the right
     * report: the wrapper grew by 8px on a 390px screen, which nobody registers,
     * while the card itself got shorter.
     *
     * 24px adds 24px of height - sign-in 394 -> 418, sign-up 479 -> 503 - and both
     * still clear the bottom navigation on a 667px screen. That is measured, not
     * assumed: see card_size_test.js, which fails if the button ends up under the
     * bar on any of the eight phones tested.
     *
     * Inside this media query, so the desktop card keeps its 32px and its height.
     */
    .auth-panel {
      max-width: 100%;
      width: 100%;

      /*
       * 28px, up from 24px, and with the mark back.
       *
       * This was 12px, then 20px, then 24px across successive passes, and each
       * time the complaint was that the card did not look any bigger. The
       * arithmetic explains why: the wrapper's padding was being increased by
       * single digits - which is air *around* the card and reads as nothing - at
       * the same time as the card's own padding was cut. The operator asked for
       * the container to be larger, and the container is the card.
       *
       * 28px is the largest value that still clears the bottom navigation on a
       * 667px-tall phone, which card_size_test.js measures on eight handsets and
       * fails if the submit button ends up underneath the bar.
       */
      padding: 1.75rem;
    }

    /*
     * The mark inside the card, kept.
     *
     * It used to be display:none on phones, on the reasoning that the same bolt
     * was already in the header a few dozen pixels higher and 48px is a lot on a
     * small screen. The operator asked for an icon above the container on the
     * sign-in and sign-up cards, which is this element.
     *
     * Two things make it affordable where it was not before: the card now has the
     * room, because its padding is bigger rather than smaller, and the glyph
     * inside is scaled down rather than the box - so the mark reads as a badge on
     * the card instead of a second header competing with the first.
     */
    .auth-panel .auth-icon {
        display: inline-flex;
        width: 3.25rem;
        height: 3.25rem;
        border-radius: 1.125rem;
        margin-bottom: 0.875rem;
    }
    .auth-panel .auth-icon svg {
        width: 1.375rem;
        height: 1.375rem;
    }
    .auth-panel .mb-4 {
        margin-bottom: 0.875rem;
    }

    /* The heading block. The type size is untouched - it is the one line the
       form is judged on - only the space beneath it. */
    .auth-panel .text-center.mb-8,
    .auth-panel .text-center {
        margin-bottom: 1rem;
    }
    .auth-panel .text-center h1 {
      font-size: 1.5rem;
      line-height: 1.2;
    }
    }
    .auth-panel .text-center p {
      font-size: 0.6875rem;
      line-height: 1.35;
      margin-top: 0.0625rem;
    }

    /* The field labels. A phone is wide enough for these on one line now, so the
       margin under each is 8px rather than the 8px + the wrapper's own. */
    .auth-panel form label {
        margin-bottom: 0.25rem;
        font-size: 0.6875rem;
        letter-spacing: 0.04em;
    }

    /* The gap between the fields. 12 to 8, three times on the sign-up form. */
    .auth-panel form > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.5rem;
    }

    /* The padding inside each field, and the height that comes with it.
       py-3.5 is 14px a side and rendered at 54px tall; py-3 is 12px and lands
       at 50px, still over the 44px floor and still over the 48px the field
       already declared, so nothing is lost that the field was relying on. */
    .auth-panel input.py-3\.5,
    .auth-panel input[type="password"].py-3\.5 {
        padding-top: 0.6875rem;
        padding-bottom: 0.6875rem;
        min-height: 46px;
    }

    /* The submit button. Its own margin above it comes down, and the padding
       with it - 48px is kept, because it is the target the whole form is for. */
    .auth-panel .auth-btn {
        margin-top: 0.75rem;
        padding-top: 0.6875rem;
        padding-bottom: 0.6875rem;
    }

    /* The closing line. */
    .auth-panel .mt-8 {
        margin-top: 0.75rem;
    }
    .auth-panel .pt-6 {
        padding-top: 0.5rem;
    }
    .auth-panel .mt-8 p {
        font-size: 0.8125rem;
    }
}

/* ===========================================================================
   Short screens
   ---------------------------------------------------------------------------
   An iPhone SE is 375x667, and on it the Register button finished 33px below the
   line where the bottom navigation starts - the last phone in the list that did
   not fit. That is a 2016 handset and it is genuinely small, but "scroll a
   little" is a worse answer than "fits", and 33px is well inside what can be
   found without touching anything a finger has to hit.

   Where the 33px comes from, all of it air rather than content:

     the card's own padding      14 to 10 top and bottom      -8
     the gap between the fields   8 to 6, three times          -6
     the space under the heading  12 to 8                      -4
     the space above the button  12 to 10                      -2
     the footer margin and rule  12/8 to 8/6                  -6
     the label margins            4 to 3, four times           -4

   The 48px fields are not in that list and are not going to be. Nor is the
   captcha, which is the point of the form. What is left is spacing.

   Keyed on the viewport height as well as the width, so a phone held in
   landscape - which is short and wide - gets this too, and a tall phone does
   not carry the tighter spacing it has no need for.
   ========================================================================= */

@media (max-width: 640px) and (max-height: 700px) {
    .auth-panel {
      padding: 0.5rem 0.75rem 0.625rem;
    }
    .auth-panel .text-center.mb-8,
    .auth-panel .text-center {
      margin-bottom: 0.625rem;
    }
    .auth-panel form label {
        margin-bottom: 0.1875rem;
    }
    .auth-panel form > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.375rem;
    }
    .auth-panel .auth-btn {
        margin-top: 0.625rem;
    }
    .auth-panel .mt-8 {
        margin-top: 0.5rem;
    }
    .auth-panel .pt-6 {
        padding-top: 0.375rem;
    }
}

/* ===========================================================================
   The gap between the form's fields - the real one
   ---------------------------------------------------------------------------
   The earlier version of this file tried to close these with
   "form > :not([hidden]) ~ :not([hidden]) { margin-top: ... }". That selector
   matches, it is in the document, and it changes nothing: Tailwind v4's space-y
   utility is built on margin-block-END, not margin-top. Measured on the sign-up
   form, each of the five children carried margin-bottom of 16px - 80px in all -
   while the rule being adjusted set a margin-top that was already 6px.

   So the whole of the tightening in this file had been applied to a property the
   spacing does not use, and the reason the card stayed stubbornly tall through
   several rounds of tuning is now plain: 80px of it was never being addressed.

   This sets the margin the utility actually uses. The margin-top rule is left in
   place, because it is what controls the gap when a form does not use space-y.
   ========================================================================= */

@media (max-width: 640px) {
    .auth-panel form > :not([hidden]) ~ :not([hidden]) {
        margin-block-end: 0.5rem;
    }
    .auth-panel form > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.5rem;
    }

    /* The last child has no margin in the utility's own selector; make that
       explicit so the button's own spacing comes from one place. */
    .auth-panel form > :last-child {
        margin-block-end: 0;
    }
}
