/* ══════════════════════════════════════════════════════════════
   RESPONSIVE LAYER — loaded last, so it has the final word.
   One place for how the app reshapes itself:

     ≥1600px   wide desktop — content stops stretching
     941–1599  laptop / iPad landscape — rail on the left
     701–940   tablet portrait — rail becomes a top bar with tabs
     ≤700      phone — bottom tab bar, cards instead of tables
     ≤380      small phone — tighter still
     short + landscape — phone on its side: everything compacts

   Plus: touch vs mouse, reduced motion, high contrast, print.
   ══════════════════════════════════════════════════════════════ */

/* ── Fluid basics ── */
:root {
  --gutter: clamp(14px, 3.2vw, 30px);
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas, iframe { max-width: 100%; }
.page-title { font-size: clamp(21px, 2.6vw + 10px, 30px); }
.main { min-width: 0; }
.pane, .topbar { min-width: 0; }
/* long names, emails and links never push the page sideways */
.cell-strong, .cell-sub, .meta-val, .oc-num, .picker-name, .empty-body,
.bubble, .modal-title, .modal-msg { overflow-wrap: anywhere; }
.table-wrap, .tscroll { max-width: 100%; }

/* Delta rows: the PDF controls stay together */
.delta-pdf-btns { display: inline-flex; gap: 6px; align-items: center; vertical-align: middle; }
.delta-pdf a { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
               white-space: nowrap; vertical-align: bottom; }

/* ── Delta's table is the widest in the app (stage pills + PDF + actions),
   so it turns into cards earlier than the others: on small laptops too.
   (At 940px and below every table is a card — see PHONE & TABLET POLISH.) ── */
@media (min-width: 941px) and (max-width: 1100px) {
  #delta-content .tscroll { overflow-x: visible; }
  #delta-content table.grid { display: block; min-width: 0 !important; }
  #delta-content table.grid thead { display: none; }
  #delta-content table.grid tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  #delta-content table.grid tr { display: block; padding: 13px 15px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); }
  #delta-content table.grid tbody tr:hover { background: none; }
  #delta-content table.grid td {
    display: flex; gap: 14px; align-items: baseline; justify-content: space-between;
    width: 100%; border: none; padding: 5px 0; text-align: right;
  }
  #delta-content table.grid td::before {
    content: attr(data-label); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--faint); flex: 0 0 30%; text-align: left; white-space: nowrap;
  }
  #delta-content table.grid td:first-child { display: block; text-align: left; padding-bottom: 9px; }
  #delta-content table.grid td:first-child::before { display: none; }
  #delta-content table.grid td.acts { justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 11px; }
  #delta-content table.grid td.acts::before { display: none; }
}
/* the stage pills and PDF controls wrap neatly inside a card */
@media (max-width: 1100px) {
  #delta-content td:has(.pill) { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  #delta-content td:has(.tag) { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  #delta-content td:has(.tag)::before { flex-basis: 100%; }
  #delta-content td.acts .delta-pdf-btns { margin-right: auto; }
}

/* Invoice PDF + email */
.inv-head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: none; padding: 6px 0 0; font-size: 11.5px; color: var(--gold);
            text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.attach-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px;
              border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2); }
.attach-row > svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.attach-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-sub { font-size: 11.5px; color: var(--muted); }
.mail-warn { display: none; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.5;
             background: var(--danger-bg); border: 1px solid var(--danger-ln); color: var(--danger); }
.mail-warn.show { display: block; }
.inv-emailed { color: var(--st-store) !important; }
.sheet-over-acts { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
#invpdf-frame { width: 100%; height: 100%; border: 0; background: #525659; }
@media (max-width: 700px) {
  .inv-head-acts { width: 100%; }
  .inv-head-acts .btn { flex: 1; }
  .sheet-over-bar { flex-wrap: wrap; }
}

/* ── Restricted accounts (Delta): the list, and nothing else ──
   No rail, no title bar, no counts, no search or filters — the
   orders as they stand, and a way out in the corner. */
html.role-restricted .admin-only,
html.role-restricted .rail,
html.role-restricted .rail-new,
html.role-restricted .rail-group,
html.role-restricted .nav-item:not(#nav-delta),
html.role-restricted .topbar,
html.role-restricted .tabbar,
html.role-restricted #delta-stats,
html.role-restricted #pane-delta .toolbar { display: none !important; }
html.role-restricted .shell { display: block; }
html.role-restricted .pane { padding: 62px 26px 40px; }

/* the way out, pinned to the corner since there is no bar to hold it */
.ro-out { display: none; }
html.role-restricted .ro-out {
  display: inline-flex; position: fixed; z-index: 60;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(20px + env(safe-area-inset-right));
  box-shadow: 0 1px 2px rgba(22, 21, 15, .06);
}

html.role-readonly .pill.ro { cursor: default; }
html.role-readonly .pill.ro:not([class*="st-"]) { opacity: .55; }
@media (max-width: 700px) {
  html.role-restricted .pane { padding: 58px 12px calc(28px + env(safe-area-inset-bottom)); }
  html.role-restricted .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
  html.role-restricted .ro-out { top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
}

/* ── Wide desktop: keep lines readable ── */
@media (min-width: 1600px) {
  .topbar, .pane { padding-left: 40px; padding-right: 40px; }
  .pane > * { max-width: 1480px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ── Laptop / iPad landscape: slimmer rail when space is tight ── */
@media (min-width: 941px) and (max-width: 1180px) {
  :root { --rail: 208px; }
  .topbar, .pane { padding-left: 22px; padding-right: 22px; }
}

/* ── Tablet & phone: the rail is a header, never a full-height column.
   (The 100dvh rule for the desktop rail used to win here and filled the
   whole screen with the dark menu.) ── */
@media (max-width: 940px) {
  .rail { height: auto !important; min-height: 0; }
  .shell { min-height: 100vh; }
  @supports (height: 100dvh) { .shell { min-height: 100dvh; } }
  .topbar { padding-left: var(--gutter); padding-right: var(--gutter); }
  .pane   { padding-left: var(--gutter); padding-right: var(--gutter); }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .split-list { max-height: 40vh; }
  /* search keeps a usable width; the filter buttons wrap below it if needed */
  .search-wrap { min-width: min(100%, 340px); }
}

/* ── Phone ── */
@media (max-width: 700px) {
  /* header buttons share the row and wrap instead of running off-screen */
  .topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .topbar-actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 0 10px; }
  .topbar-actions .btn.gold { flex-basis: 100%; order: -1; }

  /* filter buttons: one swipeable row rather than a wall of wrapped pills */
  .toolbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
             scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter));
             padding: 2px var(--gutter) 4px; scroll-padding-inline: var(--gutter); }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex-shrink: 0; }
  .toolbar .toolbar-sep { display: none; }
  /* a toolbar holding the search box: search gets its own full row,
     its buttons wrap underneath (no sideways scroll to hide them) */
  .toolbar:has(.search-wrap) { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
  .toolbar .search-wrap { flex: 1 1 100%; min-width: 0; }
  .topbar .eyebrow { display: none; }
  .topbar { gap: 10px; }

  .section-head { flex-wrap: wrap; align-items: center; row-gap: 8px; }
  .empty { padding: 44px 18px; }
  .order-card { border-radius: 12px; }
  .oc-head { padding: 12px 14px; }
  .stat { padding: 12px 13px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot > span[style*="flex:1"] { display: none; }
  .modal-foot .btn.ghost-danger { flex: 0 0 100%; order: 3; }
  .more-actions { grid-template-columns: 1fr; }
}

/* ── Small phone (iPhone SE, older Androids) ── */
@media (max-width: 380px) {
  :root { --gutter: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 7px; }
  .stat-val { font-size: 20px; }
  .stat-sub { display: none; }
  .tab-btn { font-size: 8.5px; letter-spacing: .02em; }
  .tab-btn svg { width: 19px; height: 19px; }
  table.grid td::before { flex-basis: 42%; }
  .wordmark { font-size: 20px; }
}

/* ── Phone on its side: short screen, so every bar gets thinner ── */
@media (orientation: landscape) and (max-height: 500px) {
  .rail-head { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .wordmark { font-size: 18px; }
  .topbar { padding-top: 8px; padding-bottom: 8px; gap: 10px; flex-direction: row; align-items: center; }
  .eyebrow { display: none; }
  .page-title { font-size: 20px; }
  .topbar-actions { width: auto; flex-wrap: nowrap; }
  .topbar-actions .btn { flex: 0 0 auto; }
  .tab-btn { min-height: 44px; padding: 4px 2px; flex-direction: row; gap: 6px; }
  .tab-btn .tab-dot { top: 2px; }
  .modal, .modal.narrow { max-height: 96vh; }
  @supports (height: 100dvh) { .modal, .modal.narrow { max-height: 96dvh; } }
  .chat-pane { height: calc(100dvh - 110px); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: calc(56px + env(safe-area-inset-bottom)); }
}

/* ── Touch: comfortable targets everywhere ── */
@media (pointer: coarse) {
  .btn, .icon-btn, .chip, .pill, .yn { touch-action: manipulation; }
  .search-wrap .field { height: 44px; }
}

/* ── People who ask for less motion get none ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── High contrast / Windows forced colours ── */
@media (prefers-contrast: more) {
  :root { --line: #B9B4A8; --faint: #6E6A61; --muted: #4A473F; }
}
@media (forced-colors: active) {
  .btn, .field, .pill, .chip, .tab-btn.on, .nav-item.on { border: 1px solid CanvasText; }
  .sync-dot { forced-color-adjust: none; }
}

/* ── Print: just the page, full width ── */
@media print {
  .tabbar, .page-actions, .topbar-actions, #ops-sync-note { display: none !important; }
  .pane > * { max-width: none; }
  table.grid { display: table !important; }
  table.grid thead { display: table-header-group !important; }
  table.grid tr { display: table-row !important; }
  table.grid td { display: table-cell !important; }
  table.grid td::before { content: none !important; }
}

/* ── Sign-in page: scrolls instead of clipping on a short screen ── */
.auth-over { overflow-y: auto; -webkit-overflow-scrolling: touch;
             padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.auth-over.open { align-items: safe center; }
.auth-card { margin: auto; }
@media (max-height: 500px) {
  .auth-card { padding: 18px 22px; }
  .auth-sub { margin: 4px 0 12px; }
}


/* ══════════════════════════════════════════════════════════════
   PHONE & TABLET POLISH
   Found by rendering every screen at 360, 390 and 430 wide and on an
   iPad in portrait, with long real-world names and emails:
     · a table cell holding more than one thing (name + phone + email)
       was split into squeezed side-by-side columns — "Enst / ein / Loh"
     · long emails ran off the edge of the card and were cut
     · order cards lined their details up differently from card to card
     · a lone delete or ✕ button was left on a row of its own
     · labels at 8.5–9.5px were hard to read at arm's length
     · on an iPad in portrait, invoice numbers split in half and the
       buttons ran off the side of the table
   ══════════════════════════════════════════════════════════════ */

/* The fitting thread's hairline sat above the dots once the touch pass
   made them bigger (17px, 6px padding). It runs through their middle. */
.thread-stage::before { top: 14px; }

/* An invoice or order number never breaks in the middle, and on a full
   table an amount stays on one line ("S$ 1,958.00", not "S$" over it). */
table.grid .num, .cell-strong.num, .oc-num { overflow-wrap: normal; }
@media (min-width: 941px) { table.grid td.num { white-space: nowrap; } }

/* ── Tables become cards at 940px and below: phones, and tablets in
   portrait, where a seven-column table could only be read by scrolling
   it sideways. ── */
@media (max-width: 940px) {
  .tscroll { overflow-x: visible; }
  table.grid { display: block; min-width: 0 !important; }
  table.grid thead { display: none; }
  table.grid tbody { display: block; width: 100%; }
  table.grid tbody tr { display: block; width: 100%; padding: 12px 15px 10px; border-bottom: 1px solid var(--line); }
  table.grid tbody tr:last-child { border-bottom: none; }
  table.grid tbody tr:hover { background: none; }

  /* The label sits in a fixed left column. Everything the cell holds —
     however many pieces — stacks in order in the right-hand column,
     instead of being squeezed side by side. */
  table.grid td {
    display: grid; width: 100%;
    grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
    column-gap: 12px; row-gap: 0;
    justify-items: end; align-items: start;
    padding: 6px 0; border: none;
    font-size: 14px; line-height: 20px; text-align: right;
    overflow-wrap: anywhere;
  }
  table.grid td > * { grid-column: 2; max-width: 100%; }
  table.grid td::before {
    content: attr(data-label);
    /* spans every row the value might need, so nothing can land under it */
    grid-column: 1; grid-row: 1 / span 30;
    justify-self: start; align-self: start;
    padding-top: 3px; line-height: 14px;
    font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--faint); text-align: left;
    white-space: normal; overflow-wrap: normal;
  }
  table.grid td .cell-sub { text-align: right; font-size: 12.5px; line-height: 18px; margin-top: 1px; }

  /* the first cell is the card's title */
  table.grid td:first-child { display: block; justify-items: normal; text-align: left; padding: 0 0 8px; font-size: 15px; line-height: 1.35; }
  table.grid td:first-child::before { display: none; }
  table.grid td:first-child .cell-sub { text-align: left; }

  /* buttons along the bottom of the card */
  table.grid td.acts {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
    gap: 8px; padding: 10px 0 2px; white-space: normal;
  }
  table.grid td.acts::before { display: none; }

  /* several tags in one cell (Delta add-ons) sit in a row and wrap */
  table.grid td:has(> .tag + .tag) { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  table.grid td:has(> .tag + .tag)::before { flex: 1 0 36%; margin-right: auto; }

  /* price-list cells: one width, figures lined up on the right */
  table.grid td:has(> .pcell) { padding: 3px 0; }
  table.grid td:has(> .pcell)::before { padding-top: 13px; }
  table.grid td > .pcell { min-width: 96px; justify-content: flex-end; }

  /* Delta's due date is tapped to change it */
  table.grid td.tap-date { padding-top: 10px; padding-bottom: 10px; }

  /* a flagged row (due soon, to reorder, follow up) is tinted as a
     whole card, not as a block floating inside it */
  table.grid tr.row-low, table.grid tr.row-flag { background: #FFFBF0; }
  table.grid tr.row-low td, table.grid tr.row-low:hover td,
  table.grid tr.row-flag td, table.grid tr.row-flag:hover td { background: none; }

  /* Delta stage: the label on its own line, three equal buttons below */
  #delta-content table.grid td.delta-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
    justify-items: stretch; padding-top: 8px;
  }
  #delta-content table.grid td.delta-stage::before { grid-column: 1 / -1; grid-row: auto; padding-top: 0; }
  #delta-content table.grid td.delta-stage > .pill { grid-column: auto; min-width: 0 !important; padding: 0 6px; }
  /* the Paid / Unpaid button lines up with the label, like any value */
  #delta-content table.grid td.delta-pay::before { padding-top: 12px; }
  /* one pill or one tag keeps the card's spacing: the 6px gap from the
     tablet rule above would otherwise open between every one of the
     label's rows and leave a tall empty space in the card */
  #delta-content table.grid td.delta-pay,
  #delta-content table.grid td:has(> .tag):not(:has(> .tag + .tag)) { gap: 0 12px; }
}

/* The price list's two dropdowns share one row under the search box,
   half each, instead of one dangling on a line of its own. */
@media (max-width: 940px) {
  .toolbar:has(#price-brand) .search-wrap { flex: 1 1 100%; }
  #price-brand, #price-tier { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; height: 44px !important; }
}

/* Tablet in portrait: two cards side by side rather than one stretched. */
@media (min-width: 761px) and (max-width: 940px) {
  table.grid tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  table.grid tbody tr, table.grid tbody tr:last-child { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); }
  .stat-val { font-size: 24px; }
}

/* ── Phone: labels big enough to read, filters that line up ── */
@media (max-width: 700px) {
  .meta-key, .oc-ref-label { font-size: 10px; letter-spacing: .14em; }
  .thread-date { font-size: 10px; height: 13px; }
  .thread-name { font-size: 9.5px; }
  .stat-key, .toolbar-label { font-size: 10px; }
  .field-label { font-size: 10.5px; }
  .auth-sub { font-size: 10px; }
  .cloth-card label, .cloth-row label { font-size: 10px; }
  .tab-btn { font-size: 10px; }


  /* a row of filters that scrolls sideways fades at the edge, so the
     half-visible last button reads as "more this way", not as broken */
  .toolbar:not(:has(.search-wrap)) {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--gutter)), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - var(--gutter)), transparent);
  }
}

/* ── Order cards on a phone ── */
@media (max-width: 620px) {
  /* The details sit on one grid, so every card lines up the same way:
     client | phone, then the email across, then the three dates. */
  .oc-meta { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
  .oc-meta > .meta-cell { grid-column: span 2; min-width: 0; }
  .oc-meta > .mc-client { grid-column: span 4; }
  .oc-meta > .mc-email { grid-column: 1 / -1; }
  .oc-meta > .mc-date { grid-column: span 2; }
  .oc-meta:not(:has(> .mc-phone)) > .mc-client { grid-column: 1 / -1; }
  .oc-meta:not(:has(> .mc-client)) > .mc-phone { grid-column: 5 / -1; }
  .meta-val { font-size: 14px; }
  .mc-client .meta-val, .mc-email .meta-val { white-space: normal; overflow-wrap: anywhere; }
  /* the Fitting and Due dates are tapped to change them */
  .meta-cell.tap { padding: 4px 0; margin: -4px 0; }

  /* Buttons on a fixed grid, so none is ever left alone on a line:
     the PDF across the top, then Invoice | Archive | edit | delete. */
  .oc-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px 40px; gap: 10px; align-items: center; }
  .oc-tools > .thread { grid-column: 1 / -1; }
  .oc-tools > .btn { width: 100%; min-width: 0; padding: 0 8px; }
  .oc-tools > .btn.gold, .oc-tools > .btn[disabled] { grid-column: 1 / -1; }
  .oc-tools > .btn:has(+ .icon-btn[aria-label="Replace the PDF"]) { grid-column: 1 / 3; }
  .oc-tools > .btn:has(+ .icon-btn[aria-label="Delete"]) { grid-column: 1 / 4; }

  /* the fitting thread spreads across the card */
  .oc-tools > .thread { width: 100%; padding: 2px 0 4px; }
  .thread-stage { flex: 1 1 0; width: auto; }
  .thread-stage::before { left: -50%; width: 100%; }
  .thread-cut { width: 34px; height: 34px; font-size: 13px; margin-top: 2px; }
  .thread-spacer { height: 0; }

  /* Garments: remove-✕ in the corner by the name, cloth and lining on
     their own lines, the three status buttons in one even row. */
  .g-row { position: relative; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .g-name { padding-right: 50px; font-size: 15px; }
  .g-cloth { font-size: 13px; line-height: 1.5; min-width: 0; }
  .gc-part { display: block; }
  .gc-sep { display: none; }
  .g-tools { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; width: 100%; }
  .g-tools > .pill, .g-tools > .tag {
    width: 100%; min-width: 0; padding: 0 6px; letter-spacing: .05em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .g-tools > .tag { height: 38px; justify-content: center; border-radius: 20px; font-size: 11px; }
  .g-tools > .icon-btn { position: absolute; top: 6px; right: 18px; }

  /* invoice line items: quantity and unit price side by side */
  .cloth-card .row3 { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .cloth-card .row3 > :nth-child(3) { grid-column: 1 / -1; }
}

/* ── Touch: two small controls that stayed small ── */
@media (hover: none) {
  .link-btn { min-height: 36px; padding: 8px 2px; }
  /* iPad too: the Fitting / Due dates and the undo-fitting ✕ */
  .meta-cell.tap { padding: 4px 0; margin: -4px 0; }
  .thread-cut { min-width: 30px; min-height: 30px; font-size: 12px; }
}
@media (pointer: coarse) {
  .chat-bar textarea { font-size: 16px; }   /* under 16px, an iPhone zooms in */
}
/* An iPad in a keyboard case with a trackpad says it can hover, so the
   (hover: none) rule above missed it and every tap on a box zoomed the
   page. It still has a touch screen: any-pointer catches it. */
@media (any-pointer: coarse) {
  .field, .mfield input, .cloth-row input, .inv-lines input,
  input[type=text], input[type=tel], input[type=email], input[type=date],
  input[type=number], textarea, select { font-size: 16px !important; }
}

/* ── Long lists: drawn a page at a time ── */
.list-more {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; font-size: 12.5px; color: var(--muted);
}
.table-wrap .list-more { border-top: 1px solid var(--line-soft); }

/* A labelled price in the invoice's price search ("2 piece" over "2,400").
   The tap-size rule made every price cell one row, so on an iPad the label
   ran straight into the figure: "2 PIECE2,400". Label above, figure below. */
.pcell:has(> em) { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }

/* ── Sign out on a phone or iPad in portrait ──
   The rail's corner (name · Password · Sign out) is hidden at 940px and
   under, so the top bar carries its own Sign out. */
.head-acct { display: none; }
@media (max-width: 940px) {
  .head-acct {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 12px;
    border: 1px solid rgba(255,255,255,0.16); border-radius: 20px; background: none;
    color: rgba(255,255,255,0.82); font: inherit; font-size: 13px; cursor: pointer;
    touch-action: manipulation; white-space: nowrap;
  }
  .head-acct svg { width: 17px; height: 17px; }
  .head-acct:active { background: rgba(255,255,255,0.08); }
}
html.role-restricted .head-acct { display: none !important; }   /* Delta has its own, top right */
.more-signout { grid-column: 1 / -1; }
#acct-modal .modal-body { padding-top: 6px; padding-bottom: 14px; }
