/* style.css, part 3 of 13: the export dock and the classic control widgets (chrome icons, text input, spinner, artwork cards).
   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. */

/* ============================================================
   SAVE & SHARE — the export dock, a strip along the bottom of the 3D view.

   It used to be sticky to the bottom of the sidebar, which cost the control
   stack ~200 px of its height permanently and grew every time a printability
   warning got longer. It is an overlay on the viewport now, and it folds to a
   pill.

   WHY A WIDE STRIP RATHER THAN A CORNER PANEL. As a 400 px column down the
   right it was ~460 px tall, and it ate the part of the view a model is
   actually in. Laid out along the bottom the same content is ~150 px tall,
   because the reading half and the button half sit SIDE BY SIDE instead of
   stacking their heights — so the model keeps the full width of the canvas
   and all but the last sixth of its height.

   Every size here is relative to the canvas, so the strip can never be
   taller or wider than the thing it sits on at any viewport.

   z-index 9 is deliberately BELOW .loading-overlay (20): a full-screen build
   overlay covers this, and the compact rebuild chip is top-right, so the two
   never collide. src/export-dock.js owns the folding.
   ============================================================ */
.export-float {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    /* The head is a pill, not a bar: right-aligned above the strip, and the
       only thing left when the strip is folded away. */
    align-items: flex-end;
    gap: var(--space-field);
    max-height: calc(100% - 28px);
}
/* Folded, it is only as wide as its own pill — so it releases the left edge
   it claims above. */
.export-float[data-collapsed="true"] {
    left: auto;
    max-width: calc(100% - 28px);
}
.export-float-head {
    flex: none;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.export-float-tab {
    flex: none;
    min-width: 0;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-chip);
    background: var(--c-white);
    color: var(--accent-text);
    font-family: var(--font-ui);
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--shadow-soft);
    transition: border-color var(--dur-200) ease, box-shadow var(--dur-200) ease, transform var(--dur-200) ease;
}
.export-float-tab:hover {
    border-color: var(--icon-accent);
    transform: translateY(-1px);
}
/* Inline-block, or the rotation below is silently a no-op. */
.export-float-chevron {
    display: inline-block;
    font-size: 0.72rem;
    transition: transform var(--dur-200) ease;
}
.export-float[data-collapsed="true"] .export-float-chevron { transform: rotate(180deg); }

/* The folded verdict. Shown ONLY while the panel is folded, so that exactly
   one of this and #printCheck is ever a live region a screen reader can
   announce — a display:none live region is silent, which is what makes the
   pair safe. Empty until the first build says something. */
/* Under the revamp chrome the floating dock's verdict strip painted itself
   across the whole top, over the brand and the mode dock (owner: "error
   message card is overlapping everything"). The beacon, the panel card and
   the print sheet all carry the same verdict, and the sheet carries every
   export the float offered — the float retires from the revamp surface. */
body[data-mode] .export-float {
    display: none !important;
}
.export-float-verdict {
    flex: 0 1 auto;
    min-width: 0;
    padding: 0.36rem 0.65rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-chip);
    background: #fff;
    font-family: var(--font-ui);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 6px 20px var(--shadow-soft);
}
.export-float-verdict:empty { display: none; }
.export-float-verdict.ok { color: var(--ok-text); }
.export-float-verdict.warn { color: var(--warn-text); }
/* The folded dock's third state, for the same reason as .print-check.checking
   above: summariseVerdict() derives this from #printCheck's class, so without
   it a build that is still being checked was summarised — in the ONE place a
   folded dock shows — as "⚠️ Check the design". */
.export-float-verdict.checking { color: var(--teal-text); }
.export-float[data-collapsed="false"] .export-float-verdict { display: none; }

/* The strip itself. `flex-wrap` and the two flex-basis values below are the
   whole responsive story: while the canvas is wide enough for both columns
   they sit side by side, and when it is not they wrap to one column each —
   no breakpoint, so it behaves the same in a narrow window, at 400 % zoom
   and on a phone. */
.export-dock {
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-flow: row wrap;
    align-items: flex-start;
    gap: 0.5rem 0.9rem;
    padding: 0.75rem var(--space-air);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-dialog);
    background: var(--sidebar-bg);
    box-shadow: 0 10px 30px var(--shadow-soft);
}
.export-float[data-collapsed="true"] .export-dock { display: none; }

/* Left: what there is to read. The printability verdict grows without limit —
   it can run to a paragraph — so it is capped, and the buttons beside it never
   move.

   THE CAP IS ON THE VERDICT, NOT ON THE COLUMN, and that is a shipped defect
   rather than a preference. The column also holds .export-notes, which is two
   static lines each carrying an ⓘ launcher, so a 7rem scrollport on the COLUMN
   rationed two buttons to make room for text. Measured at 1280x900 and at
   1280x1050, on the boot design, `elementFromPoint` at the control's own
   centre:

     .export-dock-read   clientHeight 97   scrollHeight 155   maxScroll 58
     #infoNoteBtn-export-secondary  centre -> DIV#canvas-wrapper   NOT the button
     #infoNoteBtn-export-3mf        centre -> SPAN.in-open-glyph   by 3 px

   Both heights, identically: the cap is 7rem and does not vary with the
   viewport, so a taller window moves the whole strip down and changes nothing.
   Lengthening the verdict by one ordinary amber sentence took the SECOND
   button out too, so "shorten the verdict" is not a fix — it makes the defect
   come and go with the printability result.

   With the cap on .print-check instead, nothing in this column is inside a
   scrollport: the verdict keeps exactly the 7rem budget it always had and
   scrolls inside its own banner, and both ⓘ hit-test to themselves at both
   heights and with the long verdict. The strip pays ~37 px of height for it
   (138 -> 175 at 1280x900), and it grows UPWARD, because .export-float is
   anchored `bottom: 14px`. */
.export-dock-read {
    flex: 1 1 260px;
    min-width: 0;
}
.export-dock .print-check {
    margin-top: 0;
    max-height: 7rem;
    overflow-y: auto;
}
/* Right: what there is to press.

   The basis is 300, not the ~380 the three secondary labels want, because
   tests/a11y-reflow.mjs forbids any flex basis over 320 px — a basis wider
   than a 320 px viewport is how a "responsive" column ends up forcing
   horizontal scroll at 400 % zoom, and `flex-shrink` is not something that
   gate is willing to take on trust. It costs nothing here: the two columns
   share the slack equally, so on any canvas over ~700 px this one is wider
   than 380 anyway, and below that the row drops to two buttons a line. */
.export-dock-actions {
    flex: 1 1 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.export-dock .primary-btn { margin-top: 0; }
/* auto-fit, not `repeat(3, …)`: the strip is as wide as the canvas, which is
   not a number this file knows. The row gives up columns by itself rather
   than squeezing three labels onto two lines each.

   The 109 px is measured, not chosen: at the type size below the widest label
   ("Save photo 📸") needs 95 px of content box, plus 9.6 px of padding and the
   2 px border. That is what makes three fit in the narrowest side-by-side
   layout the strip produces (a ~700 px canvas). Falling to two columns is
   untidy, not broken, so nothing here is load-bearing. */
.export-dock-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(109px, 1fr));
    gap: var(--space-field);
}
.export-dock-row .secondary-btn {
    margin-top: 0.55rem;
    padding: 0.55rem 0.3rem;
    font-size: var(--fs-sm);
}
.export-notes {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: var(--lh-tight);
}

/* Colour palette dropdown + live swatch preview */
.palette-pick {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.palette-pick select { flex: 1; }
.palette-pick .swatches {
    display: flex;
    gap: 3px;
    min-width: 52px;
}
.palette-pick .swatches i {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--c-white-a90);
    box-shadow: 0 1px 3px var(--shadow-soft);
}


.control-group {
    background: var(--card-bg);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 8px 22px var(--shadow-soft);
}

.control-group h3 {
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    font-weight: var(--fw-strong);
    color: var(--text-primary);
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 0.7rem;
    margin-bottom: 0.35rem;
}

/* BRIEF-033: the gradient SVGs that replaced the plain-emoji chrome (the
   shape/starting-points headings' 🔷/✨ and the tour button's ✨, all three
   fill="url(#chrome-icon-grad)" from the shared def near the top of <body>).
   1em tracks each icon's own text size the way .wordmark-cube tracks the
   logo's, so a heading and the sidebar-width guide button size their icon
   independently without a second rule; -0.15em nudges the icon from its own
   box-bottom onto the text baseline instead, which is what an emoji glyph
   was already doing for free. */
.chrome-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    flex: none;
}

/* ---- the music mix: mute, and how loud (owner ask, 2026-08-04) ----

   One row under the play/stop button, and the slider takes the room that is
   left so the two never collide at the sidebar's 400 px floor. Both controls
   are hidden with the whole row until src/music.js has a usable track, the
   same rule the button above them follows.

   The label is REAL and visible rather than an aria-label on the input: a
   slider whose purpose is only announced to a screen reader is a slider
   everybody else has to guess at, and there is room for the word. */
/* Round icon controls, 44 px so they clear the tap floor everywhere without
   src/mobile.css having to raise them. The glyph is the whole label on screen
   and the aria-label is the whole label in the accessibility tree — see
   src/music.js's label(), which sets both on every state change. */
.music-icon-btn {
    width: 44px;
    height: 44px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1.5px solid var(--border-color);
    border-radius: 50%;
    background: var(--c-white);
    font-size: var(--fs-base);
    line-height: 1;
    cursor: pointer;
    transition: border-color var(--dur-200) ease, background var(--dur-200) ease;
}

/* BRIEF-033: the gradient SVG that replaced each button's plain emoji
   (🎧/🔈/⏭️), sized at 1.25em against these buttons' own font-size (not the
   1.4em .preset-btn svg uses off fs-mark — a different control, its own
   ratio), so the glyph reads the same weight against these 44 px round
   buttons as the emoji it replaced did. */
.music-icon-btn svg {
    width: 1.25em;
    height: 1.25em;
    flex: none;
}

.music-icon-btn:hover { border-color: var(--icon-accent); background: #f8f3fc; }
.music-icon-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.music-icon-btn[aria-pressed='true'] { border-color: var(--icon-accent); background: #f5eefb; }

/* The play control sits on the same row as the mix rather than above it: the
   whole panel is one line of icons and a slider. #musicToggle is revealed
   separately from #musicMix (a build with no audio shows neither), so the row
   is formed by the panel itself. */
#musicPanel {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.music-mix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 12rem;
    flex-wrap: wrap;
}

.music-vol-label {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-secondary);
}

/* min-width rather than a fixed width: it shrinks with the sidebar and still
   holds a usable travel. 8rem is the smallest that keeps the 5 % step
   distinguishable by dragging at the narrow breakpoint. */
.music-vol {
    flex: 1 1 8rem;
    min-width: 8rem;
}

/* Upload Button */
.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: var(--space-air) 1rem;
    background: var(--c-white);
    border: 2.5px dashed var(--accent-2);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: all var(--dur-200) ease;
    text-align: center;
    font-weight: var(--fw-strong);
    color: var(--accent-text);
}

.upload-btn:hover {
    background: var(--c-white);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px var(--shadow-pink);
}
/* A file input is the real control; the label is its visible surface, so the
   focus ring has to land on the label, not on the hidden input. Only for
   KEYBOARD focus: a pointer click focuses the input too, and must not leave
   a ring behind. src/focus-host.js sets .kb-focus here and on the two rules
   below; :has() is above the browser floor (tests/browser-floor-gate.mjs). */
.upload-btn.kb-focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Hidden from the eye, not from the keyboard. `display: none` took the input
   out of the Tab order, so the label's ring above could never fire and the
   font upload had no keyboard path (M7 inventory, docs/inventory/FIX-LIST.md
   row 2). Out of flow either way, so the row lays out exactly as before. */
.upload-btn input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}


/* Font upload, Features-card edition (owner order 2026-09-01: out of the More
   door, onto the upper card, redesigned with animation). Speaks the
   .revamp-dropzone family language — gradient tile icon, dashed invite
   border, the same hover pop — compressed to ONE 44px row so the g3
   zero-scroll budget holds (funded by the 2x2 accessory grid below).
   .font-loaded is the happy state: solid border, soft gradient wash, the
   loaded font's name in the title (ui.js swaps the text). */
.upload-btn.font-upload-btn {
    /* Double-class on purpose: .revamp-card label {display:block} (0,1,1)
       outranks .upload-btn's flex (0,1,0) — the same specificity trap the
       toggle rows document further down — and this row lives on the card. */
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    background: #fff7fb;
    border: 2px dashed var(--accent-color, #ff7aa8);
    border-radius: var(--radius-card);
    text-align: left;
    font-size: var(--fs-sm);
    color: var(--text-primary);
    margin-top: 0;
    transition: transform var(--dur-150) ease, box-shadow var(--dur-150) ease,
        background var(--dur-150) ease, border-color var(--dur-150) ease;
}
.upload-btn.font-upload-btn:hover {
    background: #ffeef6;
    border-color: var(--accent-color);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px var(--c-violet-a20);
}
.font-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: transform var(--dur-150) ease;
}
.font-upload-btn:hover .font-upload-icon {
    transform: rotate(-6deg) scale(1.08);
}
.font-upload-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: var(--fw-strong);
}
.font-upload-sub {
    flex: 0 0 auto;
    font-weight: var(--fw-normal);
    color: var(--text-secondary);
    white-space: nowrap;
}
.font-upload-btn.font-loaded {
    border-style: solid;
    border-color: var(--c-violet-600);
    background: linear-gradient(135deg, #fff1f7, #f3ecff);
    animation: font-loaded-pop var(--dur-250) ease;
}
@keyframes font-loaded-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.preview-container {
    width: 100%;
    border-radius: var(--radius-card);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--c-white);
    border: 1.5px solid var(--border-soft);
}

.preview-container img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    padding: 0.5rem;
}

/* Sliders */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Block, not flex. Every one of these labels reads its value INLINE and inside
   brackets — `Foot trim (0%)`, `Brush size (6.0 mm)` — which is three flex
   items, not two: the text before the value, the <span>, and the trailing `%)`
   or ` mm)`. `justify-content: space-between` therefore pushed the closing
   bracket to the far right edge of the column and stranded the value in the
   middle, up to 96 px adrift on `Rotate ↻ (0°)`. A sentence is laid out by the
   text engine, not by a flex line.

   `display: block` is stated rather than left off because a <label> is inline
   by default and there is no base label rule here to fall back on. For the
   "name on the left, value on the right" split row the value would have to be
   the LAST child with no text after it, which means moving the brackets and
   the unit into the span — a markup change, not a change to this rule. */
.slider-container label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-strong);
    color: var(--text-primary);
    display: block;
}

.slider-container small {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* The track used to BE the element, so the pointer target for every slider
   in the app was 8 px tall. The track is now painted by ::-*-track and the
   element itself is 26 px, which clears 2.5.8 Target Size without changing
   how the slider looks. */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 26px;
    background: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: var(--radius-control);
    background: linear-gradient(90deg, var(--c-pink-100), var(--c-lilac-100));
}

input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: var(--radius-control);
    background: linear-gradient(90deg, var(--c-pink-100), var(--c-lilac-100));
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 3px solid var(--c-white);
    box-shadow: 0 3px 8px var(--shadow-pink);
    cursor: pointer;
    transition: transform var(--dur-150) ease, background var(--dur-200) ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.18);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 3px solid var(--c-white);
    box-shadow: 0 3px 8px var(--shadow-pink);
    cursor: pointer;
}

input[type="range"]:disabled { cursor: not-allowed; }
input[type="range"]:disabled::-webkit-slider-thumb { background: #b6a7c4; }
input[type="range"]:disabled::-moz-range-thumb { background: #b6a7c4; }

/* A checkbox and its label are one control: the whole row is the target, and
   the row is 44 px so it clears the AA size bar with room to spare. */
.check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
}
.check-row input[type="checkbox"] {
    flex: none;
    width: 24px;
    height: 24px;
}
.check-row label {
    margin-bottom: 0;
    flex: 1;
    align-self: stretch;
    display: flex;
    align-items: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-strong);
    color: var(--text-primary);
    cursor: pointer;
}

/* Preset chips */
.preset-row {
    display: flex;
    gap: 0.5rem;
}
.preset-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 44px;
    padding: 0.7rem 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    background: var(--c-white);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: all var(--dur-180) ease;
}
.preset-btn span { display: block; }
.preset-btn [aria-hidden="true"] { font-size: var(--fs-mark); line-height: 1; }
.preset-btn svg { width: 1.4em; height: 1.4em; display: block; margin: 0 auto; }
.preset-btn:first-letter { font-size: var(--fs-mark); }
.preset-btn:hover {
    border-color: var(--icon-accent);
    background: var(--c-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--icon-shadow);
}

/* v2.0 mode tabs (Flat / Organic) */
.mode-btn.active {
    border-color: var(--icon-accent);
    background: rgba(164, 102, 218, 0.14);
    box-shadow: 0 4px 12px var(--icon-shadow);
}

/* Shape picker */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}
.shape-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 44px;
    padding: 0.5rem var(--space-hug);
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    color: var(--text-primary);
    background: var(--c-white);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-control);
    cursor: pointer;
    transition: all var(--dur-180) ease;
}
.shape-chip .shape-emoji { font-size: var(--fs-mark); line-height: 1; }
.shape-chip .shape-emoji svg { width: 1.4em; height: 1.4em; display: block; }
.shape-chip:hover {
    border-color: var(--icon-accent);
    background: var(--c-white);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 14px var(--icon-shadow);
}
.shape-chip.active {
    border-color: var(--icon-accent);
    background: rgba(164, 102, 218, 0.14);
    box-shadow: 0 4px 12px var(--icon-shadow);
}

/* Printability check banner */
.print-check {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: var(--fw-strong);
    line-height: var(--lh-tight);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-card);
    margin-top: 0.25rem;
}
.print-check.ok {
    color: var(--ok-text);
    background: #e8f7ef;
    border: 1.5px solid rgba(80, 200, 140, 0.55);
}
.print-check.warn {
    color: var(--warn-text);
    background: #fff2dd;
    border: 1.5px solid rgba(220, 145, 35, 0.55);
}
/* STILL WORKING IT OUT — the third state, and the reason it exists.
   Until now a validation that was still RUNNING was painted `.warn`, the
   identical amber a REFUSAL gets. A customer watching a slow build could not
   tell "we are still checking" from "this will not print", and neither could a
   verifier: it cost them a false red, read straight off this class.
   Teal, because --teal-text is the token this app already uses for "here is
   some information" (the ⓘ notes) and amber is spoken for. It is calm on
   purpose: an in-progress state must not read as an error.
   COLOUR IS NOT THE SIGNAL. It cannot be — this project gates a11y and a
   colour-only state is a WCAG 1.4.1 failure. The three states are told apart
   by their opening words, which src/ui.js writes and
   tests/print-state-gate.mjs holds: "⏳ Checking…", "✓ Printable", "⚠️".
   The dotted underline below is the second non-colour cue, and it is the one
   that survives a greyscale screenshot: neither of the settled states has one.
   src/ui.js also sets aria-busy while this class is on, so the same three-way
   distinction reaches a screen reader. */
.print-check.checking {
    color: var(--teal-text);
    background: #e6f4f7;
    border: 1.5px dashed rgba(10, 107, 120, 0.55);
}
.print-check a {
    color: var(--accent-text);
    font: inherit;
    font-weight: var(--fw-display);
    background: none;
    border: 0;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}

/* Drag-and-drop highlight */
.drag-over {
    border-color: var(--accent-color) !important;
    background: rgba(255, 122, 168, 0.12) !important;
}

/* Text input */
.text-input {
    width: 100%;
    min-height: 40px;
    padding: 0.7rem 0.9rem;
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    font-weight: var(--fw-strong);
    color: var(--text-primary);
    background: var(--c-white);
    border: 2px solid var(--border-control);
    border-radius: var(--radius-card);
    transition: border-color var(--dur-200) ease, box-shadow var(--dur-200) ease;
}
.text-input::placeholder { color: var(--text-secondary); font-weight: 500; }
.text-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(255, 122, 168, 0.18);
}
/* #textInput (F7, multi-line lettering): a <textarea> sharing this same
   class needs a couple of things an <input> gets for free — a real
   line-height so a second row doesn't crowd the first, and the resize
   handle off (dragging it taller doesn't add printable rows, so it would
   just be a control that lies). */
textarea.text-input {
    line-height: var(--lh-tight);
    resize: none;
    font-family: inherit;
}

/* Colour pickers */
.color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.color-row label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-strong);
    color: var(--text-primary);
    flex: none;
}
/* The per-control `style="flex:1"` these selects used to carry is now here,
   so the layout survives anyone editing the markup. */
.color-row .text-input { flex: 1; min-width: 0; }

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 56px;
    height: 36px;
    min-height: 36px;
    border: 2px solid var(--c-white);
    border-radius: var(--radius-control);
    box-shadow: 0 3px 8px var(--shadow-soft);
    cursor: pointer;
    padding: 0;
    background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: var(--radius-control); }
input[type="color"]::-moz-color-swatch { border: none; border-radius: var(--radius-control); }

/* Checkboxes get the candy-pink tint */
input[type="checkbox"] {
    accent-color: var(--c-rose-600);
    cursor: pointer;
}

/* Primary Button — bouncy candy gradient.
   The stops are deeper than --accent-color / --accent-2 because this is the
   one place white sits ON the gradient: at #ff7aa8 that was 2.4:1, and this
   is the button the whole product funnels into. 5.1:1 at the pink end. */
.primary-btn {
    min-height: 48px;
    padding: 1rem;
    background: linear-gradient(115deg, var(--c-rose-600), var(--c-indigo-600));
    color: var(--c-white);
    border: none;
    border-radius: var(--radius-dialog);
    font-size: var(--fs-lg);
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all var(--dur-200) ease;
    margin-top: 0.5rem;
    box-shadow: 0 8px 20px var(--shadow-pink);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 26px var(--shadow-pink);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.primary-btn:disabled {
    background: #e6dfee;
    color: var(--text-primary);
    cursor: not-allowed;
    box-shadow: none;
}

/* Quieter sibling of .primary-btn for secondary actions (STL / share). */
.secondary-btn {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 1rem;
    background: var(--c-white);
    color: var(--text-primary);
    border: 2px solid rgba(164, 102, 218, 0.45);
    border-radius: var(--radius-dialog);
    font-size: var(--fs-base);
    font-weight: var(--fw-strong);
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all var(--dur-200) ease;
    margin-top: 0.7rem;
}

.secondary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #f8f3fc;
    box-shadow: 0 8px 18px var(--icon-shadow);
}

.secondary-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

/* `opacity` on a disabled control drags its text under the contrast floor
   and is unreadable rather than merely quiet. The border and the cursor
   carry the "not yet" signal instead. */
.secondary-btn:disabled {
    background: #f1eef4;
    border-color: rgba(160, 130, 220, 0.3);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Canvas Area */
.canvas-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* The viewport interprets touch itself — one finger draws in the sketch
       editor, two navigate. Without this the browser treats a drag as a page
       scroll and fires pointercancel partway through every gesture. */
    touch-action: none;
}

/* ALI-98 Section view (?section=1): the cut angle, on the 3D view while the
   cross-section is on, the same in Flat and 3D Model Cut. Centred above the
   bottom dock (#revamp-dock), under the export dock's 9 and the loading
   overlay's 20; opaque, like every overlay below. The range is a 44 px target. */
.section-angle-dock {
    position: absolute;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    z-index: 8;
    display: flex;
    align-items: center;
    gap: var(--space-field, 0.6rem);
    max-width: calc(100% - 32px);
    padding: 0 1rem;
    border-radius: var(--radius-chip);
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(40, 20, 60, 0.15);
    white-space: nowrap;
}
.section-angle-dock[hidden] { display: none; }
.section-angle-dock input[type='range'] {
    width: 180px;
    min-height: 44px;
    margin: 0;
}

/* Overlays sit on the 3D canvas, whose colour is whatever the user just
   designed. Their backgrounds are opaque so the text on them has a contrast
   ratio at all — a translucent panel over an arbitrary render does not. */
.instructions {
    position: relative;
    z-index: 5;
    text-align: center;
    pointer-events: none;
    background: var(--card-bg);
    padding: 2.25rem 3rem;
    border-radius: 26px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 36px var(--shadow-soft);
}

.instructions h2 {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: var(--fw-strong);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.instructions p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-1);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    color: var(--text-primary);
    font-weight: var(--fw-strong);
}

/* Once a model is already visible, rebuilds stay non-blocking: the previous
   geometry remains inspectable while this compact status chip is shown. */
.loading-overlay.compact {
    top: 3.25rem;
    right: 1rem;
    left: auto;
    width: min(340px, calc(100% - 2rem));
    height: auto;
    padding: 0.78rem 0.9rem;
    border: 1px solid var(--shadow-pink);
    border-radius: var(--radius-card);
    background: var(--c-white);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px var(--shadow-soft);
    align-items: stretch;
    flex-direction: column;
    gap: var(--space-field);
    pointer-events: none;
}
.loading-overlay.compact .spinner { display: none; }
.loading-overlay.compact p {
    margin: 0;
    text-align: left;
    font-size: var(--fs-sm);
}
.loading-overlay.compact .viewer-progress,
.loading-overlay.compact .viewer-progress-meta { width: 100%; }

.spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 143, 184, 0.25);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 1rem;
}

/* Uploaded-artwork configuration mirrors the viewport right-click menu. */
.artwork-perimeter-card {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.7rem;
    padding: 0.75rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    background: var(--c-white);
}
#imagePerimeterPresetControls { display: grid; gap: 0.6rem; }
.image-tuning { display: flex; flex-direction: column; gap: 0.7rem; }

.artwork-config {
    margin-top: var(--space-air);
    padding: 0.8rem;
    border: 1px solid rgba(179, 155, 255, 0.35);
    border-radius: var(--radius-card);
    background: #fbf9ff;
}
.artwork-config-head,
.artwork-piece-head,
.artwork-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}
.artwork-config-summary {
    margin: var(--space-field) 0 0.65rem;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-tight);
}
.trace-status {
    padding: var(--space-hug) 0.5rem;
    border-radius: var(--radius-chip);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.trace-status.ok { color: var(--ok-text); background: #dff5ea; }
.trace-status.warn { color: var(--warn-text); background: #fdeed6; }
.trace-status.neutral { color: var(--text-secondary); background: var(--bg-2); }
.artwork-actions { margin-bottom: 0.7rem; }
.mini-action {
    flex: 1;
    min-height: 36px;
    padding: 0.38rem 0.52rem;
    border: 1px solid rgba(255, 122, 168, 0.3);
    border-radius: var(--radius-control);
    background: var(--c-white);
    color: var(--text-primary);
    font: var(--fw-strong) 0.72rem var(--font-ui);
    cursor: pointer;
}
.mini-action:disabled {
    background: #f1eef4;
    color: var(--text-secondary);
    cursor: default;
}
.artwork-palette-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-field);
    margin-bottom: 0.7rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    background: var(--c-white);
}
.artwork-palette-strip:empty { display: none; }
.artwork-palette-title {
    width: 100%;
    font-size: var(--fs-sm);
    font-weight: var(--fw-strong);
    color: var(--text-secondary);
}
.artwork-palette-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}
.artwork-palette-swatch .artwork-swatch {
    width: 20px;
    height: 20px;
}
/* ALI-191 (Lane Q3 #11): on Flat's card the label is a block (studio.css:263,
   `.revamp-card label`), so this span went inline: its 20 px width was ignored
   and only its two 1 px borders drew, a thin bar at each swatch's lower left.
   The colour input is the swatch there, and its title says the traced colour. */
.revamp-card .artwork-palette-swatch > .artwork-swatch {
    display: none;
}
.artwork-palette-swatch input[type="color"] {
    width: 36px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-inset);
    background: none;
    cursor: pointer;
    flex: none;
}
.artwork-piece-list { display: grid; gap: 0.6rem; }
/* Same grid the ungrouped list above uses — this is the >12-piece path's
   equivalent container, sitting directly inside a .stack-section <details>
   rather than .section-body, so it carries its own bottom/side padding to
   match that class's own spacing instead of inheriting none. */
.artwork-group-cards { display: grid; gap: 0.6rem; padding: 0 0.6rem 0.6rem; }
.artwork-piece-card {
    padding: 0.65rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    background: var(--c-white);
    transition: border-color var(--dur-150) ease, box-shadow var(--dur-150) ease;
}
.artwork-piece-card.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 168, 0.12);
}
/* Per-piece "Switch position" — the flat-mode mirror of the Organic anchor
   row, restyled to sit inside an artwork card. Typography is INHERITED from
   .artwork-piece-controls (its label size is an existing micro-tier
   exception in tests/type-ladder-gate.mjs) — this block adds layout only. */
.artwork-switch-pos {
    display: grid;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px dashed rgba(179, 155, 255, 0.5);
    border-radius: var(--radius-inset);
    background: rgba(179, 155, 255, 0.06);
}
.artwork-switch-pos .artwork-anchor-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.artwork-switch-pos .artwork-anchor-inputs label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.artwork-switch-pos .artwork-anchor-inputs input[type="number"] {
    width: 3.9rem;
    min-height: 32px;
    border-radius: var(--radius-inset);
    border: 1px solid rgba(179, 155, 255, 0.4);
    background: var(--c-white);
    color: var(--text-primary);
}
.artwork-switch-pos .anchor-nudge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.artwork-switch-pos .anchor-nudge .anchor-nudge-label {
    color: var(--text-secondary);
}
.artwork-switch-pos small {
    color: var(--text-secondary);
}
.artwork-piece-title {
    display: flex;
    align-items: center;
    gap: var(--space-field);
    font-size: var(--fs-sm);
    font-weight: 700;
}
.artwork-swatch {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    flex: none;
}
.artwork-piece-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.artwork-badge {
    padding: 0.15rem 0.38rem;
    border-radius: var(--radius-chip);
    background: #f0ecfa;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
}
.artwork-badge.switch { color: var(--ok-text); background: #dff5ea; }
.artwork-piece-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.55rem;
}
.artwork-piece-controls .wide { grid-column: 1 / -1; }
.artwork-piece-controls label {
    display: grid;
    gap: var(--space-hug);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
}
.artwork-piece-controls select,
.artwork-piece-controls input[type="number"] {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 0.42rem 0.48rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-inset);
    background: var(--c-white);
    color: var(--text-primary);
    font: var(--fw-strong) 0.72rem var(--font-ui);
}
.artwork-piece-controls .artwork-color-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.artwork-piece-controls .artwork-color-row input[type="color"] {
    width: 36px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-inset);
    background: none;
    cursor: pointer;
    flex: none;
}
.artwork-piece-controls .artwork-color-row .mini-action {
    min-height: 32px;
    padding: var(--space-hug) 0.4rem;
}
.artwork-switch-toggle {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem !important;
    color: var(--text-primary) !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
