/* style.css, part 11 of 13: the wider panel: shape grid, inline field labels in g2, music button.
   A contiguous range of the pre-M7 style.css, linked from index.html in
   source order so the cascade is unchanged; see src/tokens.css. */

/* ====================================================================
   THE SHAPE GRID AT THE WIDER PANEL (2026-09-01 bigger-panel round).

   21 chips are visible (22 in the markup, Squircle hidden). At six
   columns that is FOUR rows with a remainder; at seven it is exactly
   THREE full rows, and 21 = 3 x 7 is why seven and not eight — eight
   makes the chips NARROWER than the six-column ones at this width
   (measured: 42.7px vs 45.9px) for a ragged 8/8/5.

   So the row the width buys is spent on the chip itself: 46x28 with a
   14px icon becomes 48x40 with a 19px icon — a third taller and the
   icon half again as big, which is the half of the owner's sentence
   that says "the icon [is] a bit too small there".

   DESKTOP ONLY, and the media query is load-bearing rather than tidy.
   The six-column rule above is (0,1,1)+id = it already wins inside
   src/mobile.css's own `@media (max-width: 768px) .shape-grid` block,
   so a bare seven-column rule here would narrow the PHONE grid too
   (375px / 7 = 43px cells). Equal specificity, later in source, gated
   at 769px: desktop takes seven, the phone keeps the six it was tuned
   for. Verified at 375px, not assumed. */
@media (min-width: 769px) {
    #shp-shape-host .shape-grid,
    .revamp-more-host #shapeGrid {
        grid-template-columns: repeat(7, 1fr);
        gap: var(--space-chip);
    }
    #shp-shape-host .shape-chip,
    .revamp-more-host .shape-chip {
        min-height: 44px;
        padding: var(--space-hug) 0.1rem;
        gap: 0.1rem;
    }
    #shp-shape-host .shape-chip .shape-emoji svg,
    .revamp-more-host .shape-chip .shape-emoji svg {
        width: 19px;
        height: 19px;
    }
}
/* ====================================================================
   INLINE FIELD LABELS IN g2 — THIS IS WHAT THE EXTRA WIDTH IS FOR.

   Every g2 field was label-on-its-own-line + control-underneath. Five of
   those lines per card, 19px of text plus the label gap each, is ~110px
   of the 611px card spent on words that fit comfortably BESIDE their
   control once the panel is 470px wide instead of 400px. Moving them
   there is the entire funding for the taller chips, the taller palette
   strip, the 13px slider track and the wider --space-* rhythm; without
   it the round is a choice between "bigger" and the zero-scroll law, and
   the law wins every time (measured: pure widening 400 -> 520 changes the
   card height by exactly 0px, because nothing in it wrapped).

   It also reads better, which is why it is not a compromise: "Smoothness
   [Subtle][Medium][Max]" on one line is the shape of a settings row, and
   the pills still get 95-125px each at every width down to 1280.

   THE WRAP IS THE SAFETY NET. `row wrap` + a 55% basis on the control
   means a label that ever needs more than 45% of the card pushes its own
   control back onto a second line — i.e. it degrades to exactly the
   stacked layout it replaced, rather than crushing either half. A `small`
   helper under a field keeps its own full-width line the same way.

   DESKTOP ONLY: the phone panel is a full-width sheet with its own rules
   in src/mobile.css and 44px targets; a label beside a control there
   would cost the control its width. Verified at 375px. */
@media (min-width: 769px) {
    #art-g2 .revamp-card .revamp-field,
    #shp-g2 .revamp-card .revamp-field,
    #art-g3 .revamp-card .revamp-field,
    #shp-g3 .revamp-card .revamp-field {
        flex-flow: row wrap;
        align-items: center;
        gap: var(--space-hug) var(--space-chip);
    }
    /* A FIXED label column, not a shrink-to-fit one. With `auto` widths the
       controls start wherever their own label happens to end — "Rounded" at
       116px, "Subtle" at 124, the size slider at 165 — and the card reads as
       a ragged stack (visible in fleet/panelbig-2026-09-01/after-*, first
       pass). One quarter of the card puts every control on the same left
       edge, which is what makes an inline-label card look composed rather
       than improvised, and it hands the controls a predictable 283px
       instead of whatever is left over.

       25% is chosen so the four longest labels wrap to two lines at tidy
       word breaks ("How the halves / fit", "How big? / (60 mm)") and cost
       nothing doing it — every row they sit in is already >= 38px tall. */
    #art-g2 .revamp-card .revamp-field > label,
    #shp-g2 .revamp-card .revamp-field > label,
    #art-g3 .revamp-card .revamp-field > label,
    #shp-g3 .revamp-card .revamp-field > label {
        flex: 0 0 25%;
        max-width: 25%;
        /* `text-wrap: balance` used to sit here, to stop the greedy first
           line breaking "How big? (60 mm)" after "(60" and orphaning
           "mm)". It needs Blink 114 / Gecko 121 / WebKit 17.5 against
           this product's floor of 98 / 114 / 16.4, so
           tests/browser-floor-gate.mjs refused it. Deleted rather than
           waived: a waiver is for a feature the product needs, and an
           orphaned "mm)" on browsers that would have honoured it is not
           worth spending the floor on. The label column is wide enough
           that the greedy break is rare, and the fix if it ever matters
           is a narrower label, not a newer browser. */
    }
    #art-g2 .revamp-card .revamp-field > :not(label),
    #shp-g2 .revamp-card .revamp-field > :not(label),
    #art-g3 .revamp-card .revamp-field > :not(label),
    #shp-g3 .revamp-card .revamp-field > :not(label) {
        flex: 1 1 auto;
        min-width: 0;
    }
    #art-g2 .revamp-card .revamp-field > small,
    #shp-g2 .revamp-card .revamp-field > small,
    #art-g2 .revamp-card .revamp-field > .in-row,
    #shp-g2 .revamp-card .revamp-field > .in-row,
    #art-g3 .revamp-card .revamp-field > small,
    #shp-g3 .revamp-card .revamp-field > small,
    #art-g3 .revamp-card .revamp-field > .in-row,
    #shp-g3 .revamp-card .revamp-field > .in-row {
        flex: 0 0 100%;
    }
    /* "Where it clicks (mm from centre)" is the one field that keeps its
       label on its own line: the row under it already carries X slider +
       X box + Y slider + Y box + Centre, and there is no width left to
       rent to a 180px label. Two ids so it actually outranks the (1,2,0)
       rule above rather than losing silently. */
    #art-g2 .revamp-card #proxy-switch-pos-field,
    #shp-g2 .revamp-card #shp-proxy-switch-pos-field {
        flex-flow: column nowrap;
        align-items: stretch;
    }
    #art-g2 .revamp-card #proxy-switch-pos-field > label,
    #shp-g2 .revamp-card #shp-proxy-switch-pos-field > label {
        max-width: 100%;
        flex: 0 0 auto;
    }
    /* THE FONT UPLOAD IS AN INVITE, NOT A FIELD. It is the same
       full-width dashed affordance as the picture dropzone, so renting
       a quarter of its row to a label squeezed the button itself to 97px
       — measured at 1440 the moment the inline-label rule above shipped,
       and caught by the smoke's `width > 100` clause rather than by eye.
       It spans, like the .in-row and <small> rows above it do. */
    #art-g3 .revamp-card #proxy-font-upload-host,
    #shp-g3 .revamp-card #shp-proxy-font-upload-host {
        flex-flow: column nowrap;
        align-items: stretch;
    }
    /* And the button itself is a <label for="customFontInput">, so the
       25% label column above was capping it directly — that, not the row
       direction, is what made it 97px. */
    #art-g3 .revamp-card #proxy-font-upload-host > label,
    #shp-g3 .revamp-card #shp-proxy-font-upload-host > label {
        flex: 0 0 auto;
        max-width: 100%;
    }
}

/* Same reasoning as .revamp-more above: the group gap is the separator. */
/* Below ~1400px the panel sits at its 444px floor, and a 25% label column
   leaves the two-up grids 132px a cell against a MEASURED 131px need — one
   px, i.e. one font-metric change, from wrapping "Base hugs the top" onto a
   second line and costing the group 16px it does not have there. 22% at
   those widths restores a ~7px cell margin. Every label that stops fitting
   on one line at 22% was already wrapping at 25%, so nothing new wraps.
   Its own top-level block rather than a nest inside the 769px one: the
   sheet is parsed by tests/a11y-dom.mjs's flat CSS reader. */
@media (min-width: 769px) and (max-width: 1399px) {
    #art-g2 .revamp-card .revamp-field > label,
    #shp-g2 .revamp-card .revamp-field > label,
    #art-g3 .revamp-card .revamp-field > label,
    #shp-g3 .revamp-card .revamp-field > label {
        flex-basis: 22%;
        max-width: 22%;
    }
}

#art-g2 .revamp-confirm-btn,
#shp-g2 .revamp-confirm-btn,
#art-g3 .revamp-confirm-btn,
#shp-g3 .revamp-confirm-btn {
    margin-top: 0;
}
#art-g2 .in-row > small,
#shp-g2 .in-row > small,
#art-g3 .in-row > small,
#shp-g3 .in-row > small {
    line-height: 1.15;
}
/* Smoothness row (BRIEF-124): text-only picks, no icon. This used to carry
   its own 30px/0.3rem-0.25rem scale here, but `.revamp-edge-smoothness
   .revamp-pick` (2 classes) never actually wins against the ID-scoped
   `#art-g2 .revamp-pick` / `#shp-g2 .revamp-pick` rule above (1 id + 1
   class beats 2 classes regardless of source order) — so that rule was
   dead the moment g2 got the compact scale, silently rendering at 32px/
   0.15rem-0.35rem the whole time. Seat V (standardisation pass) removes
   the dead rule rather than leave a second, contradictory number on
   record; the scoped rule above is the one true source for this row too. */

/* Pictured palette strip (BRIEF-124): one .revamp-pick per PALETTES entry,
   dot pair + the palette's own name (owner, seat V scope addition: "bring
   back the name, its cool to have" — name text comes from PALETTES.name in
   revamp.js, never hardcoded here). A single horizontally-scrolling row,
   never a wrap, so a 28-palette table still fits the 1440x900 zero-scroll
   budget — the name text makes each chip wider, not taller, so it costs
   width (absorbed by the scroll) and not the vertical zero-scroll budget.
   Chip height/padding come from the #art-g2/#shp-g2 .revamp-pick rule
   above (higher specificity, already the single source for this scale);
   gap here matches the same compact pick-grid's 0.2rem so the strip reads
   as one row with everything else in the card, not its own rhythm. Dot
   colours are set inline per palette (see revamp.js) — nothing here for
   the type-ladder gate to track. */
/* Palettes flow DOWN, not sideways (owner: "make the colour scrolling top
   to bottom rather than left right"): chips wrap into rows and the block
   scrolls vertically past three rows, so the card itself never grows past
   the zero-scroll budget. */
.revamp-palette-strip {
    display: flex;
    flex-wrap: wrap;
    overflow-x: hidden;
    overflow-y: auto;
    /* Two BREATHING rows visible (owner: more spacing, bigger panel), the
       rest scroll down — three rows at this scale broke the zero-scroll
       budget in the smoke's own measurement env. */
    /* Exactly two 36px rows plus their gap and inset (36 + 4.48 + 36 + 4
       = 80.5), so the window shows two whole rows of the bigger chips and
       never a sliver of a third — a half-row peeking is what made the
       old 68px window read as "constricted" as much as the chip size did.
       The third row and beyond scroll, top to bottom (owner). */
    max-height: 82px;
    gap: var(--space-chip);
    /* Right inset clears the strip's own scrollbar so the last chip in a
       row never sits under it (2026-09-01 spacing pass). */
    padding: 2px 8px 2px 3px;
}
/* The strip's own scrollbar was half the owner's "very constricted": the
   platform default draws a hairline track with two 15px stepper ARROWS at
   the ends, so a block that is already the densest thing in the card gets
   a pair of tiny grey triangles stapled to it. The arrows go, the track
   goes transparent, and the thumb becomes a soft pill inset from the edge
   — the same shape language as every chip beside it. Nothing here changes
   the scrolling itself, only what it is drawn as.

   DELIBERATELY webkit-only: setting `scrollbar-width`/`scrollbar-color`
   as well switches Chromium to the STANDARD scrollbar renderer, which
   ignores every ::-webkit-scrollbar-* rule below — the arrows came back
   and the first attempt at this fix looked like it had done nothing
   (verified in after-shp-g2-colours-1440.png before the properties were
   dropped). Firefox keeps its own thin native bar, which never had the
   stepper arrows this is here to remove. */
.revamp-palette-strip::-webkit-scrollbar {
    width: 11px;
}
.revamp-palette-strip::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}
.revamp-palette-strip::-webkit-scrollbar-track {
    background: transparent;
}
.revamp-palette-strip::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: var(--radius-chip);
}
.revamp-palette-strip::-webkit-scrollbar-thumb:hover {
    background: var(--icon-accent);
    background-clip: content-box;
}
.revamp-palette-strip .revamp-pick {
    min-height: 36px;
    padding: var(--space-hug) 0.55rem;
}
.revamp-palette-strip .revamp-palette-dot {
    width: 15px;
    height: 15px;
}
/* g2 rides the zero-scroll ceiling exactly (the smoke measured 778 against
   a 776+2 budget before this pass), so its beat is --space-field, one step
   under g3's --space-card, and every widened pixel here is funded by the
   Centre-button reclaim below plus the panel's trimmed top inset. */
#art-g2 .revamp-card,
#shp-g2 .revamp-card,
/* mc-g2 joins the same beat (2026-09-01 cut-picker pass) — its pictured
   trio + the intersection draw surface ride the same 776px ceiling. */
#tree-model-cut .revamp-card {
    padding-top: var(--space-field);
    padding-bottom: var(--space-field);
    gap: var(--space-field);
}
/* The one-tap Centre stays inside the offset row's height — and the
   selector has to actually WIN: the bare .revamp-offset-centre class
   (0,1,0) loses both its padding and its margin to `.revamp-card
   button:not(.primary-btn):not(.preset-btn)` (0,3,1) and .secondary-btn's
   own margin-top:0.7rem, which had the button rendering 39px tall and
   riding 11px below the row's centre line (measured 2026-09-01: the row
   was 50px against ~30px of actual content, in BOTH trees' g2). Same
   specificity as the card rule, later in source, so it wins; the ~20px it
   returns to each g2 group is what pays for the wider field beat above. */
.revamp-card .revamp-colours-row button.revamp-offset-centre {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 0.1rem 0.5rem;
    margin-top: 0;
    width: auto;
    font-size: var(--fs-sm);
}
/* The roomier palette block is paid for by the rest of the card: slimmer
   custom swatches and zero label float. */
#art-g2 .revamp-field > label,
#shp-g2 .revamp-field > label,
#proxy-top-base-color > label,
#shp-proxy-top-base-color > label {
    margin-bottom: 0;
}
/* The Button/Base wells: 56x30 shaved to fund an earlier round, now 72x40
   on the heading's own row where the space was already going unused. */
#proxy-top-base-color input[type="color"],
#shp-proxy-top-base-color input[type="color"] {
    width: 72px;
    height: 40px;
    min-height: 40px;
}
.revamp-palette-chip {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 3px;
}
.revamp-palette-name {
    white-space: nowrap;
}
.revamp-palette-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border: 1.5px solid var(--c-white-a90);
    box-shadow: 0 1px 3px var(--shadow-soft);
}

/* Features: the letter-colour row rides centred (owner: minimalist). */
#proxy-letter-colour-host .color-row,
#shp-proxy-letter-colour-host .color-row {
    justify-content: center;
}

/* Migrated tips read as quiet captions on the surface. */
.revamp-card > #uploadTip,
.revamp-field > #pictureStyleHelp {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    margin: 0.3rem 0 var(--space-hug);
}

/* Drag-anywhere hints (BRIEF-124): same quiet-caption treatment, reusing the
   rule above's own tokens. :not([hidden]) keeps the [hidden] attribute (set
   by src/revamp.js's bindDragHint, on) in charge of show/hide — this only
   styles the shown state, so it never fights the UA display:none default. */
.revamp-drag-hint:not([hidden]) {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    margin: 0.3rem 0 var(--space-hug);
}

/* The recolour swatches pop like every other button (owner). */
#proxy-swatch-row input,
#proxy-swatch-row button {
    transition: transform var(--dur-150) ease, box-shadow var(--dur-150) ease;
}
#proxy-swatch-row input:hover,
#proxy-swatch-row button:hover {
    transform: scale(1.12) translateY(-1px);
    box-shadow: 0 5px 14px var(--c-violet-a30);
}
#proxy-swatch-row input:active,
#proxy-swatch-row button:active {
    transform: scale(1.05);
}
/* Migrated tip rows sit as quiet captions. */
.revamp-card .in-row,
.revamp-field .in-row {
    margin: 0.25rem 0;
}

/* The music corner: one round button, a small card above it. White-on-#fff
   camouflaged against the pale canvas (owner: "more pop" for chrome) — now
   the same house gradient as the panel drawer handle (.revamp-panel-toggle)
   with a plain white glyph, so the two fixed chrome buttons read as one
   family instead of one popping and one vanishing. */
#music-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--c-rose-700), var(--c-violet-600));
    box-shadow: 0 6px 20px rgba(150, 80, 190, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1600;
    transition: transform var(--dur-150) ease, box-shadow var(--dur-150) ease;
}
#music-fab svg path {
    fill: var(--c-white);
}
#music-fab:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 8px 24px rgba(150, 80, 190, 0.45);
}
#music-pop {
    position: fixed;
    right: 18px;
    bottom: 76px;
    width: 260px;
    background: var(--c-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: 0 10px 30px var(--c-violet-a30);
    padding: 0.7rem;
    z-index: 1600;
}
#music-pop[hidden] {
    display: none !important;
}
#music-pop #musicPanel {
    border: none;
    box-shadow: none;
    margin: 0;
    background: transparent;
}
.beacon-pop {
    position: fixed;
    /* Q3-4: below the mode tabs (src/revamp.js placeRefusalPop measures them). */
    top: max(calc(max(10px, env(safe-area-inset-top, 10px)) + 50px), var(--beacon-pop-below, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 320px;
    background: var(--c-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: 0 10px 30px var(--c-violet-a30);
    padding: 1rem;
    z-index: 1600;
}
.beacon-pop[hidden] {
    display: none !important;
}
#beacon-pop-text {
    margin: 0 0 0.5rem 0;
    font-size: var(--fs-sm);
    line-height: var(--lh-tight);
    color: var(--text-main);
}
