/* ==========================================================================
   THE MEMBER WEB AT LAPTOP WIDTH · DESKTOP_WIDE

   The founder's "A on all five" (31 Oct 2026 ~21:3x), UX's frames in
   04-app-design/web-desktop-1031 (home-A, read, exp-A, exp-A-1920, sal-A,
   bill-A, vis-A). Linked by `base.html` only while the flag is on, and only on
   a member page (`app/rail/wide.py` marks the body `data-wide="<layout>"`).

   **Nothing changes below 1000px.** Every rule that shows or moves anything
   is inside `@media (min-width: 1000px)`. The rules outside it hide the
   markup only the laptop draws (`.dw-only`) under that width and make its
   column wrappers no box (`display: contents`), so a phone with the flag on
   reads exactly the page it reads with the flag off.

   Tokens only: no colour is named here. The anti-coupon law (core.css's
   header) holds: no new strikethrough, no badge, no red.
   ========================================================================== */

/* What only the laptop draws, put away under 1000px — whatever display its
   own classes give it above. */
@media not all and (min-width: 1000px) {
  .dw-only { display: none !important; }
  /* The laptop's columns hold the page's own blocks; under 1000px they are
     no box at all, so each block sits in the page's column as it always did. */
  .dw-cols, .dw-main, .dw-side { display: contents; }
}

/* A page drawn inside the open-item pane (`?in=pane`) is the page alone. */
body[data-pane] > .pagefoot { display: none; }
/* The pane is the open visit and the list is beside it, so the visit's own
   ways out — *Done* to Home, the quiet button back to the salon's week —
   lead nowhere new there (UX, 9 Nov). Only in the pane; the full page keeps
   both. */
body[data-pane] .sent > a.btn[href="/"],
body[data-pane] main > a.btn.quiet[href^="/s/"] { display: none; }

@media (min-width: 1000px) {
  /* ── 1 · The frame, the bar and the type ─────────────────────────────── */

  /* Body ~16.5; the small grey text a step darker — the faint and struck
     greys take `--sub`, a token, never a new colour. */
  body[data-wide] {
    --t-body: 16.5px;
    --faint: var(--sub);
    --struck: var(--sub);
  }

  /* **One frame.** The bar runs the full width (its hairline already does);
     its content sits in the same 1,200px column as the page. */
  body[data-wide] .hd {
    max-inline-size: 1200px;
    padding-inline: 40px;
    block-size: 76px;
    justify-content: flex-start;
    gap: 36px;
  }

  body[data-wide] .hd .mark .ar { font-size: 31px; }
  body[data-wide] .hd a.mark .en { font-size: 11px; }

  /* The tabs beside the mark; the seal, her initial or *Sign in* at the end. */
  body[data-wide] .hd nav {
    flex: 1;
    gap: 30px;
  }
  body[data-wide] .hd nav a:not(.seal):not(.signin-pill) { font-size: 17px; }
  body[data-wide] .hd nav .seal,
  body[data-wide] .hd nav .signin-pill { margin-inline-start: auto; }

  body[data-wide] .hd.hd-w1 nav {
    order: 1;
    flex: 0 1 auto;
    margin-inline-start: 0;
    gap: 30px;
  }
  body[data-wide] .hd.hd-w1 .w1-corner {
    order: 3;
    margin-inline-start: auto;
  }

  /* The page in the same column as the bar, on the five picked layouts. A
     member page with no picked layout keeps its own column under the bar. */
  body:is([data-wide="home"], [data-wide="explore"], [data-wide="salon"], [data-wide="bill"],
    [data-wide="visits"], [data-wide="gifts"], [data-wide="you"]) .page {
    max-inline-size: 1200px;
    padding: 44px 40px 56px;
  }

  /* Type: h1 52/58, h2 32/38, the lede 18; the small line one step up. */
  body[data-wide] .greet {
    font-size: 52px;
    line-height: 58px;
  }
  body[data-wide] .sect {
    font-size: 32px;
    line-height: 38px;
  }
  body[data-wide] .lede { font-size: 18px; }
  body[data-wide] :is(.s, .note) { font-size: 14.5px; }

  /* ── Home, signed in (home-A): the greeting and the invitation side by
     side, her salons below, three to a row. ───────────────────────────── */
  body[data-wide="home"] .page:has(> .invite) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 40px;
    row-gap: 0;
    align-items: start;
  }
  /* Rows of a grid do not share the column's gap, so the rhythm is a margin
     — at zero specificity, so a block's own spacing still wins. */
  :where(body[data-wide="home"] .page:has(> .invite)) > * { margin-block-end: 14px; }
  body[data-wide="home"] .page:has(> .invite) > * { grid-column: 1; }
  body[data-wide="home"] .page > .invite {
    grid-column: 2;
    grid-row: 1 / span 8;
  }
  body[data-wide="home"] .page:has(> .invite) > :is(.sect, .spreads, .rows, .grove, .empty, .favs) {
    grid-column: 1 / -1;
  }
  body[data-wide="home"] .home-next { font-size: 18px; }
  body[data-wide="home"] .dw-go {
    justify-self: start;
    inline-size: auto;
    padding-inline: 24px;
    margin-block-start: 8px;
  }
  body[data-wide="home"] .rows,
  body[data-wide="home"] .grove {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
  }
  /* Cards in a row are one height (the founder, 9 Nov 2026); the rows stay at start. */
  body[data-wide="home"] .grove { align-items: stretch; }

  /* ── Vivid Home A (the founder's pick, 9 Nov 2026): the visit card's
     plate a 250 column at its start, the chip on it, on Home and Visits; the favourites three
     across with the plate at 170, no sideways scroll. ─────────────────── */
  body:is([data-wide="home"], [data-wide="visits"]) .ticket.vc.vt {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-content: start;
  }
  body:is([data-wide="home"], [data-wide="visits"]) .vt > .vt-art {
    grid-column: 1;
    grid-row: 1 / span 3;
    block-size: auto;
    border-start-end-radius: 0;
    border-end-start-radius: 23px;
  }
  body:is([data-wide="home"], [data-wide="visits"]) .vt > :not(.vt-art) {
    grid-column: 2;
    margin-inline: 24px;
  }
  body:is([data-wide="home"], [data-wide="visits"]) .vt > .vc-open { padding-block-start: 22px; }
  body:is([data-wide="home"], [data-wide="visits"]) .vt .vc-chip {
    inset-block-start: auto;
    inset-block-end: 14px;
    transform: none;
    max-inline-size: 222px;
  }
  body[data-wide="home"] .favs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  body[data-wide="home"] .fav-art { block-size: 170px; }

  /* ── 2 · Explore and the front page (exp-A, exp-A-1920) ──────────────── */

  /* **Search moves into the bar**: Explore's own GET, beside the tabs. */
  body[data-wide] .hd .dw-search {
    flex: 0 1 360px;
    display: flex;
    align-items: center;
    gap: 10px;
    block-size: 46px;
    padding-inline: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-chip);
    background: var(--card);
    color: var(--sub);
  }
  body[data-wide] .hd.hd-w1 > .dw-search { order: 2; }
  body[data-wide] .hd .dw-search:focus-within {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
  }
  body[data-wide] .hd .dw-search svg {
    inline-size: 20px;
    block-size: 20px;
    flex: none;
  }
  body[data-wide] .hd .dw-search input {
    flex: 1;
    min-inline-size: 0;
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    font-size: 16.5px;
    color: var(--ink);
    outline: none;
  }
  body[data-wide] .hd .dw-search input::placeholder { color: var(--placeholder); }

  /* Explore keeps its title; its own search is the bar's now. */
  body[data-wide="explore"] .explore .search > :not(summary),
  body[data-wide="explore"] .explore .search > summary > svg { display: none; }
  :root body[data-wide="explore"] .explore .explore-head > .search[open] > summary {
    position: static;
    display: flex;
    inline-size: auto;
    block-size: auto;
  }

  /* **Every chip shows**, wrapping; none is cut at the edge. `:root` first:
     core.css's after-Apple `:root.c0 .explore .tags` keeps the phone's row
     unwrapped, and would win over this rule without it. */
  :root body[data-wide="explore"] .explore .tags {
    flex-wrap: wrap;
    overflow: visible;
  }
  /* A salon card's chips, too: the phone keeps one row and puts a chip that
     would wrap out of sight (`core.css`'s `.nchips-card`); the laptop card
     shows every chip, on a second row when it needs one (UX, 9 Nov). */
  body:is([data-wide="explore"], [data-wide="home"]) .grove .nchips-card {
    max-block-size: none;
    overflow: visible;
  }

  /* Three salons a row (four from 1,600). */
  body:is([data-wide="explore"], [data-wide="home"]) .grove:not(.grove-stay) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  /* **The front page** wears Explore's grid: one column, every salon in it,
     the newest one in its own place in the list. */
  body[data-wide="home"] .page:has(> .door) {
    max-inline-size: 1200px;
  }
  body[data-wide="home"] .door { grid-template-columns: minmax(0, 1fr); }
  body[data-wide="home"] .door > .doorside { display: none; }
  body[data-wide="home"] .door:has(.doorside) .door-spotlit { display: flex; }
  body[data-wide] .greet.door-h1 {
    font-size: 52px;
    line-height: 58px;
  }

  /* ── 3 · The salon page (sal-A): the name over three pictures; the
     services beside "Your visit", the phone's bar moved to the side. ───── */
  body[data-wide="salon"] .page > .salon-lock {
    order: -1;
    margin-block-start: 0;
  }
  body[data-wide="salon"] .salon-lock .n:not(.n-long) {
    font-size: 52px;
    line-height: 58px;
  }
  body[data-wide="salon"] .plate-head.band-room {
    margin: 0;
    aspect-ratio: auto;
    max-block-size: none;
    block-size: 310px;
    border-radius: var(--radius-card);
  }
  body[data-wide="salon"] .plate-head .shots .shots-strip {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 150px 150px;
    gap: 10px;
    overflow: hidden;
    scroll-snap-type: none;
  }
  body[data-wide="salon"] .plate-head .shots-strip > img:first-child,
  body[data-wide="salon"] .plate-head .shots-strip > img:nth-child(2):last-child {
    grid-row: 1 / span 2;
  }
  body[data-wide="salon"] .plate-head .shots-strip > img:only-child { grid-column: 1 / -1; }
  body[data-wide="salon"] .plate-head .shots-strip > img:nth-child(n + 4),
  body[data-wide="salon"] .plate-head .shots-dots { display: none; }

  body[data-wide="salon"] .withaside {
    grid-template-columns: minmax(0, 1fr) 380px;
    column-gap: 40px;
  }
  /* The panel names itself "Your visit"; the card's own head is the phone's. */
  body[data-wide="salon"] #ask > h2.lbl:not(.dw-visit) { display: none; }
  body[data-wide="salon"] #ask .dw-free {
    margin-block-start: 10px;
    text-align: center;
  }

  /* ── 4 · The bill (bill-A): the bill on the left, paying on the right,
     like any checkout. Layout only: every figure and button is the phone's. */
  body[data-wide="bill"] .dw-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 40px;
    align-items: start;
  }
  body[data-wide="bill"] :is(.dw-main, .dw-side) {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-inline-size: 0;
  }
  body[data-wide="bill"] .dw-side {
    position: sticky;
    inset-block-start: 20px;
  }
  /* The panel's head in the small capitals "Your visit" wears. */
  body[data-wide="bill"] .paycard .dw-pay {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sub);
    margin: 0;
  }
  body[data-wide="bill"] .saidcard:has(.dw-change) {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  /* "Change" stands beside the card; the phone's line under it steps aside. */
  body[data-wide="bill"] .paycard > p.note:has(> a[href*="use_new_card"]) { display: none; }

  /* ── 5 · Visits, Gifts and My MIORA (vis-A): the list on the left, the
     one she opens on the right, on the same address. ─────────────────── */
  body:is([data-wide="visits"], [data-wide="you"], [data-wide="gifts"]) .dw-cols {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    column-gap: 36px;
    align-items: start;
  }
  body:is([data-wide="visits"], [data-wide="you"], [data-wide="gifts"]) .dw-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-inline-size: 0;
  }
  .dw-pane {
    position: sticky;
    inset-block-start: 20px;
  }
  .dw-pane iframe {
    display: block;
    inline-size: 100%;
    block-size: calc(100vh - 140px);
    min-block-size: 480px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--ground);
  }
  /* Gifts: the first gift stands beside the list, so its copy at the top of
     the list steps aside. With a script a row's gift opens there; without
     one the row opens under itself, as on a phone. */
  body[data-wide="gifts"] .dw-main > .mm-gcs { display: none; }
  /* The open gift is the phone's own card, 268 by 164, drawn larger as one
     piece. Stretched to the column, its picture was cut: the bow lost its top
     (UX, 9 Nov). At 1.6 it is 429 by 262, whole, and fits from 1,000px. */
  body[data-wide="gifts"] .dw-gift .gc {
    flex: none;
    inline-size: 268px;
    zoom: 1.6;
  }
  /* The row that is open, ringed in ink, as the frame draws it: the ring
     stands clear of the row, on a fill, so nothing in the row moves. */
  body[data-wide] .dw-on {
    background: var(--raised);
    border-radius: var(--radius-card);
    box-shadow: 0 0 0 8px var(--raised), 0 0 0 9px var(--ink);
  }
  /* A gift's row sits inside its card, flush to the edge: the ring inside. */
  body[data-wide] :is(.mm-grow, .dw-grow).dw-on {
    border-radius: 0;
    box-shadow: inset 0 0 0 1px var(--ink);
  }
  /* The first gift's row is the laptop's own (no `.mm-grow`, so a phone's
     first row keeps its edge): it wears a row's rule and arrow here. */
  body[data-wide="gifts"] .dw-grow + .mm-grow { border-block-start: 1px solid var(--line); }
  body[data-wide="gifts"] .dw-grow .row-go { color: var(--sub); }

  /* ── Terms, Privacy, Help and Sign in (read): one 720px reading column,
     centred, at 18/30. The bar keeps the frame. ───────────────────────── */
  body[data-wide="read"] .page {
    max-inline-size: 800px;
    padding: 44px 40px 56px;
  }
  body[data-wide="read"] .page :is(p, li) {
    font-size: 18px;
    line-height: 30px;
  }
}

@media (min-width: 1600px) {
  body[data-wide] .hd { max-inline-size: 1360px; }
  body:is([data-wide="home"], [data-wide="explore"], [data-wide="salon"], [data-wide="bill"],
    [data-wide="visits"], [data-wide="gifts"], [data-wide="you"]) .page {
    max-inline-size: 1360px;
  }
  body[data-wide="explore"] .grove:not(.grove-stay),
  body[data-wide="home"] .door .grove,
  body[data-wide="home"] .door .favs-door {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body[data-wide="home"] .page:has(> .door) { max-inline-size: 1360px; }
}
