/*
 * Custom Sticker Store editor styles.
 *
 * The Fabric editor page runs as a full-window app (#css-editor.css-app,
 * stage 13): a slim top bar, the nav, the tool panel and the workspace
 * (toolbar + canvas stage). The theme's own header and footer are hidden
 * there. The classic editor page keeps its old inline styles.
 */

/* ------------------------------------------------------------------ */
/* Classic editor page                                                 */
/* ------------------------------------------------------------------ */

/*
 * Always reserve the scrollbar's space on the classic page. Otherwise the
 * page scrollbar appearing/disappearing changes the canvas column's width,
 * which resizes the canvas, which changes the page height... and the page
 * can shake as it flips between the two sizes.
 */
html:has(#css-editor:not(.css-app)) {
    scrollbar-gutter: stable;
}

/* ------------------------------------------------------------------ */
/* App page: hide the theme around the editor                          */
/* ------------------------------------------------------------------ */

html:has(#css-editor.css-app),
body:has(#css-editor.css-app) {
    overflow: hidden;
}

body:has(#css-editor.css-app) {
    background: #ebe5da !important;
}

/* Block themes (template parts) and common classic-theme ids/classes. */
body:has(#css-editor.css-app) header.wp-block-template-part,
body:has(#css-editor.css-app) footer.wp-block-template-part,
body:has(#css-editor.css-app) .site-header,
body:has(#css-editor.css-app) .site-footer,
body:has(#css-editor.css-app) #masthead,
body:has(#css-editor.css-app) #colophon {
    display: none !important;
}

/* Brand display face (docs/brand.md): top bar wordmark and dialog headings. */
@font-face { font-family: "CSS Playfair"; src: url("../fonts/playfair-display/playfair-display-variable.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "CSS Playfair"; src: url("../fonts/playfair-display/playfair-display-italic-variable.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

/* ------------------------------------------------------------------ */
/* Design tokens                                                       */
/* ------------------------------------------------------------------ */

#css-editor.css-app,
.css-tooltip {
    --css-accent: #2d5a43;          /* forest (brand accent, docs/brand.md) */
    --css-accent-strong: #1f4231;   /* deep forest */
    --css-accent-soft: #e6eee6;     /* sage mist */
    --css-accent-ring: rgba(45, 90, 67, 0.28);

    --css-ink: #2a1d16;
    --css-ink-2: #5a473b;
    --css-ink-3: #786452;
    --css-line: #ebe4d9;
    --css-line-strong: #d8ccbb;
    --css-surface: #fffdf9;
    --css-surface-2: #f7f3ec;
    --css-surface-3: #efe8dd;
    --css-workspace: #ebe5da;
    --css-danger: #a3331f;

    --css-radius-s: 8px;
    --css-radius: 12px;
    --css-space-1: 4px;
    --css-space-2: 8px;
    --css-space-3: 12px;
    --css-space-4: 16px;

    --css-shadow: 0 1px 2px rgba(42, 29, 22, 0.06), 0 4px 14px rgba(42, 29, 22, 0.07);
    --css-shadow-lift: 0 2px 6px rgba(42, 29, 22, 0.08), 0 10px 30px rgba(42, 29, 22, 0.12);

    --css-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --css-topbar-h: 48px;
    --css-toolbar-h: 52px;
    /* Nav icons: 56px where there's room, smaller on short windows so all
       seven tiles always fit (7 tiles, ~35px label + padding + gap each). */
    --css-nav-img: clamp(36px, calc((100vh - var(--css-topbar-h) - 28px) / 7 - 35px), 56px);
    --css-nav-w: calc(var(--css-nav-img) + 36px);
    /* Wider tool panel on larger screens: more tiles per row, fewer tabs. */
    --css-panel-w: clamp(300px, 24vw, 380px);
}

/* ------------------------------------------------------------------ */
/* App shell                                                           */
/* ------------------------------------------------------------------ */

#css-editor.css-app {
    position: fixed;
    /* Below the WordPress admin bar when it's shown. */
    inset: var(--wp-admin--admin-bar--height, 0px) 0 0 0;
    /* Block themes cap and centre page content (e.g. Twenty Twenty-Five's
       "constrained" layout: max-width 645px, auto margins, !important);
       the editor must ignore that and fill the window. */
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    background: var(--css-workspace);
    color: var(--css-ink);
    font: 14px/1.4 var(--css-font);
    -webkit-font-smoothing: antialiased;
}

#css-editor.css-app *,
#css-editor.css-app *::before,
#css-editor.css-app *::after {
    box-sizing: border-box;
}

#css-editor.css-app button {
    font-family: inherit;
}

#css-editor.css-app :focus-visible {
    outline: 2px solid var(--css-accent);
    outline-offset: 2px;
}

/* Top bar: logo and "Back to store" instead of the theme's header. */
.css-app .css-topbar {
    flex: 0 0 var(--css-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--css-space-4);
    padding: 0 var(--css-space-4);
    background: var(--css-surface);
    border-bottom: 1px solid var(--css-line);
}

.css-app .css-topbar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 100%;
    color: var(--css-ink);
    text-decoration: none;
}

.css-app .css-topbar-logo {
    display: block;
    width: auto;
    max-height: 30px;
}

.css-app .css-topbar-name {
    font-weight: 650;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.css-app .css-topbar-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: var(--css-radius-s);
    color: var(--css-ink-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.css-app .css-topbar-back:hover {
    background: var(--css-surface-2);
    color: var(--css-ink);
}

/* Nav | tool panel | workspace */
.css-app .css-studio {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--css-nav-w) var(--css-panel-w) minmax(0, 1fr);
}

/* ------------------------------------------------------------------ */
/* Left nav                                                            */
/* ------------------------------------------------------------------ */

.css-app .css-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--css-space-2) 0;
    background: var(--css-surface);
    border-right: 1px solid var(--css-line);
    overflow-y: auto;
    scrollbar-width: none;
}

.css-app .css-nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: calc(var(--css-nav-img) + 24px);
    padding: 7px 4px 6px;
    border: 0;
    border-radius: var(--css-radius);
    background: transparent;
    color: var(--css-ink-2);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.css-app .css-nav-tile:hover {
    background: var(--css-surface-2);
    color: var(--css-ink);
}

.css-app .css-nav-img {
    display: block;
    width: var(--css-nav-img);
    height: var(--css-nav-img);
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.12s ease;
}

.css-app .css-nav-label {
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
}

.css-app .css-nav-tile.is-active {
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
}

.css-app .css-nav-tile.is-active .css-nav-img {
    box-shadow: 0 0 0 2px var(--css-accent);
}

/* ------------------------------------------------------------------ */
/* Tool panel                                                          */
/* ------------------------------------------------------------------ */

.css-app .css-tool-panel {
    min-width: 0;
    min-height: 0;
    padding: var(--css-space-4);
    background: var(--css-surface);
    border-right: 1px solid var(--css-line);
    /* Parts 2–4 of stage 13 make every panel fit; until then it can scroll. */
    overflow-y: auto;
}

/* Owner, 2026-11-26: one photo behind the nav buttons and the panel (a palm's shadow on
   concrete, Unsplash photo-1605217074754-7163c10f5804; credits in assets/img/editor/README.md).
   Fixed to the window (as tall as the window, from its left edge, so the palm sits behind the
   panel) so the two columns show one continuous picture, and it stays put while a
   panel scrolls; a light ivory veil keeps the panel text easy to read. */
.css-app .css-nav,
.css-app .css-tool-panel {
    background:
        linear-gradient(rgba(253, 251, 247, 0.42), rgba(253, 251, 247, 0.42)) fixed,
        #f1efea url("../img/editor/panel-bg-1400.webp") left center / auto max(100vh, 620px) no-repeat fixed;
}

.css-app .css-tool-panel h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.css-app .css-tool-panel h4 {
    font-size: 13px;
    font-weight: 600;
}

/* Small section heading inside a panel. */
.css-app .css-subhead {
    margin: var(--css-space-4) 0 var(--css-space-2);
    color: var(--css-ink-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Form controls (shared look; panels are restyled in parts 2–4). */
.css-app .css-tool-panel input[type="text"],
.css-app .css-tool-panel input[type="number"],
.css-app .css-tool-panel select {
    border: 1px solid var(--css-line-strong);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    font: inherit;
    font-size: 13px;
}

.css-app .css-tool-panel input[type="text"]:focus,
.css-app .css-tool-panel input[type="number"]:focus,
.css-app .css-tool-panel select:focus {
    border-color: var(--css-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--css-accent-ring);
}

/* Sliders: slim track, round thumb. */
.css-app input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.css-app input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: var(--css-line-strong);
}

.css-app input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--css-line-strong);
}

.css-app input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--css-accent);
}

.css-app input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border: 2px solid var(--css-accent);
    border-radius: 50%;
    background: var(--css-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.css-app input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid var(--css-accent);
    border-radius: 50%;
    background: var(--css-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.css-app input[type="range"]:focus-visible {
    outline: none;
}

.css-app input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px var(--css-accent-ring);
}

.css-app input[type="range"]:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* Colour pickers: a round swatch. */
.css-app input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    border: 1px solid var(--css-line-strong);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    overflow: hidden;
}

.css-app input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.css-app input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

.css-app input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}

/* Square action tile with an image slot and a label (used from part 2). */
.css-app .css-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: var(--css-space-2);
}

.css-app .css-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 8px 4px 7px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius);
    background: var(--css-surface);
    color: var(--css-ink-2);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.css-app .css-tile:hover:not(:disabled) {
    border-color: var(--css-accent);
    color: var(--css-ink);
}

.css-app .css-tile.is-active {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
}

.css-app .css-tile:disabled,
.css-app .css-tile[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
}

.css-app .css-tile-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--css-surface-2);
    color: var(--css-ink-2);
    overflow: hidden;
}

.css-app .css-tile-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.css-app .css-tile-img svg {
    width: 22px;
    height: 22px;
}

/* `hidden` must win over component display rules (e.g. crop-only tiles). */
.css-app [hidden] {
    display: none !important;
}

.css-app .css-tile-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Four small tiles in a row (layer order). */
.css-app .css-tile-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.css-app .css-tile--compact {
    gap: 3px;
    padding: 6px 2px 5px;
    font-size: 11px;
}

.css-app .css-tile--compact .css-tile-img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.css-app .css-tile--compact .css-tile-img svg {
    width: 18px;
    height: 18px;
}

.css-app .css-tile--danger:hover:not(:disabled) {
    border-color: var(--css-danger);
    color: var(--css-danger);
}

.css-app .css-tile--danger:hover:not(:disabled) .css-tile-img {
    color: var(--css-danger);
}

/* One-line setting rows (stage 13c): label | control (| value). */
.css-app .css-slider-row,
.css-app .css-color-row,
.css-app .css-choice-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 46px;
    align-items: center;
    gap: var(--css-space-2);
    min-height: 28px;
    font-size: 13px;
}

.css-app .css-color-row,
.css-app .css-choice-row {
    grid-template-columns: 88px minmax(0, 1fr);
}

.css-app .css-slider-row > label,
.css-app .css-color-row > label,
.css-app .css-row-label {
    overflow: hidden;
    color: var(--css-ink-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.css-app .css-choice-row select {
    width: 100%;
    height: 28px;
    padding: 0 6px;
}

/* Colour: round swatch + hex code. */
.css-app .css-color-pair {
    display: flex;
    align-items: center;
    gap: var(--css-space-2);
    min-width: 0;
}

.css-app .css-color-pair input[type="color"] {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
}

.css-app .css-hex-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 0 8px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace !important;
    font-size: 12.5px !important;
    text-transform: uppercase;
}

/* Label above a control (text field, font, weight, alignment). */
.css-app .css-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
}

.css-app .css-field > label,
.css-app .css-field > span:first-child {
    color: var(--css-ink-2);
    font-size: 12px;
    font-weight: 500;
}

.css-app .css-field input[type="text"],
.css-app .css-field select {
    width: 100%;
    height: 32px;
    padding: 0 10px;
}

/* "Add a text box": wide button with an image slot. */
.css-app .css-btn-add {
    display: flex;
    align-items: center;
    gap: var(--css-space-2);
    width: 100%;
    margin-bottom: 10px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--css-accent);
    border-radius: var(--css-radius);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.css-app .css-btn-add:hover {
    background: #d9e5d9;
}

.css-app .css-btn-add .css-tile-img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--css-surface);
    color: var(--css-accent);
}

.css-app .css-btn-add .css-tile-img svg {
    width: 18px;
    height: 18px;
}

/* Curve: name and value on one line, slider below. */
.css-app .css-curve-field {
    margin-top: 2px;
}

.css-app .css-curve-head {
    display: flex;
    justify-content: space-between;
    gap: var(--css-space-2);
    color: var(--css-ink-2);
    font-size: 13px;
}

.css-app .css-curve-field input[type="range"] {
    width: 100%;
}

/* Small choice buttons (font weights). */
.css-app .css-chip-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.css-app .css-chip {
    min-width: 0;
    padding: 6px 2px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink-2);
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.css-app .css-chip:hover:not(:disabled) {
    border-color: var(--css-accent);
    color: var(--css-ink);
}

.css-app .css-chip[aria-pressed="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
    font-weight: 600;
}

.css-app .css-chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* A row of icon-only toggle buttons (text alignment). */
.css-app .css-icon-row {
    display: flex;
    gap: 4px;
}

.css-app .css-icon-btn {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink-2);
    cursor: pointer;
}

.css-app .css-icon-btn--gap {
    margin-left: 8px;
}

.css-app .css-icon-btn:hover:not(:disabled) {
    border-color: var(--css-accent);
    color: var(--css-ink);
}

.css-app .css-icon-btn[aria-pressed="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
}

.css-app .css-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.css-app .css-icon-btn svg {
    width: 16px;
    height: 16px;
}

/* Effects tab: style tiles, then one header per extra effect. */
.css-app .css-effect-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.css-app .css-effect-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
    padding: 5px 2px 4px;
    border: 1.5px solid var(--css-line);
    border-radius: 10px;
    background: var(--css-surface);
    color: var(--css-ink-2);
    font-size: 11px;
    cursor: pointer;
}

.css-app .css-effect-tile:hover:not(:disabled) {
    border-color: var(--css-accent);
}

.css-app .css-effect-tile[aria-checked="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
}

.css-app .css-effect-tile:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.css-app .css-effect-body:not(:empty) {
    padding: 2px 0;
}

.css-app .css-effect-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    border-top: 1px solid var(--css-line);
}

.css-app .css-effect-grid + .css-effect-body:empty + .css-effect-head {
    margin-top: 10px;
}

.css-app .css-switch-label {
    display: flex;
    align-items: center;
    gap: var(--css-space-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* On/off switch (styled checkbox). */
.css-app .css-switch {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 18px;
    margin: 0;
    border-radius: 9px;
    background: var(--css-line-strong);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.css-app .css-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.css-app .css-switch:checked {
    background: var(--css-accent);
}

.css-app .css-switch:checked::after {
    transform: translateX(12px);
}

.css-app .css-switch:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.css-app .css-effect-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--css-radius-s);
    background: transparent;
    color: var(--css-ink-3);
    cursor: pointer;
}

.css-app .css-effect-expand:hover {
    background: var(--css-surface-2);
    color: var(--css-ink);
}

.css-app .css-effect-expand svg {
    transition: transform 0.15s ease;
}

.css-app .css-effect-expand.is-open svg {
    transform: rotate(90deg);
}

.css-app .css-effect-note {
    margin: 0 0 6px;
    color: var(--css-ink-3);
    font-size: 12px;
}

/* A text-style button ("Adjust shadow settings"). */
.css-app .css-link-btn {
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--css-accent-strong);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.css-app .css-link-btn:hover {
    text-decoration: underline;
}

.css-app .css-tabpanel > .css-slider-row + .css-slider-row {
    margin-top: 4px;
}

/* ------------------------------------------------------------------ */
/* Stage 13d: Shapes and Background                                    */
/* ------------------------------------------------------------------ */

/* Segmented switch (None | Solid | Gradient, Linear | Radial…). */
.css-app .css-segmented {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 10px;
    background: var(--css-surface-3);
}

.css-app .css-seg-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--css-ink-2);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.css-app .css-seg-btn:hover {
    color: var(--css-ink);
}

.css-app .css-seg-btn[aria-checked="true"] {
    background: var(--css-surface);
    color: var(--css-accent-strong);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Shape tiles: drawn thumbnails in a tight grid. */
.css-app .css-shape-section + .css-shape-section .css-subhead {
    margin-top: 10px;
}

.css-app .css-shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
}

.css-app .css-shape-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-width: 0;
    padding: 2px;
    border: 1px solid var(--css-line);
    border-radius: 8px;
    background: var(--css-surface);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.css-app .css-shape-tile:hover {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
}

/* Short helper text inside a panel. */
.css-app .css-panel-note {
    margin: 0 0 8px;
    color: var(--css-ink-3);
    font-size: 12px;
    line-height: 1.4;
}

.css-app .css-tabpanel > .css-panel-note:first-child,
.css-app #css-shape-notice + .css-panel-note {
    margin-top: 0;
}

/* Plain buttons built by the script. */
.css-app .css-btn {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--css-line-strong);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.css-app .css-btn:hover {
    border-color: var(--css-accent);
}

.css-app .css-btn--primary {
    border-color: var(--css-accent);
    background: var(--css-accent);
    color: #fff;
}

.css-app .css-btn--primary:hover {
    background: var(--css-accent-strong);
}

/* Option card (Sticker format placeholder). */
.css-app .css-format-card {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius);
    background: var(--css-surface);
}

.css-app .css-format-card strong {
    font-size: 13px;
    font-weight: 600;
}

.css-app .css-format-card .css-panel-note {
    margin: 2px 0 0;
}

/* A highlighted message (e.g. "Choose a shape for your image"). */
.css-app .css-banner {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--css-accent);
    border-radius: var(--css-radius);
    background: var(--css-accent-soft);
}

.css-app .css-banner-title {
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
}

.css-app .css-link-btn--danger {
    color: var(--css-danger);
}

.css-app .css-link-btn:disabled {
    color: var(--css-ink-3);
    text-decoration: none;
    cursor: not-allowed;
}

/* Compact gradient editor (page background and shape fills). */
.css-app .css-grad-top {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.css-app .css-grad-top .css-segmented {
    flex: 1 1 auto;
}

.css-app .css-grad-quick {
    flex: 0 0 auto;
    gap: 2px;
}

.css-app .css-grad-quick .css-icon-btn {
    flex: 0 0 26px;
    width: 26px;
    height: 32px;
    font-size: 14px;
}

.css-app .css-grad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--css-ink-2);
    font-size: 12px;
    font-weight: 500;
}

.css-app .css-grad-barwrap {
    position: relative;
    margin: 4px 8px 0;
}

.css-app .css-grad-bar {
    height: 22px;
    overflow: hidden;
    border: 1px solid var(--css-line-strong);
    border-radius: 6px;
}

.css-app .css-grad-markers {
    position: relative;
    height: 24px;
}

/* The selected stop's colour / transparency / position, grouped. */
.css-app .css-grad-stop {
    margin: 0 0 6px;
    padding: 3px 8px;
    border-radius: var(--css-radius-s);
    background: var(--css-surface-2);
}

.css-app .css-grad-stop:empty {
    display: none;
}

.css-app .css-slider-row input[type="range"] {
    width: 100%;
}

.css-app .css-slider-value {
    color: var(--css-ink-2);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Short status line inside a panel (e.g. background removal). */
.css-app .css-panel-status {
    min-height: 0;
    margin: var(--css-space-2) 0 0;
    color: var(--css-ink-2);
    font-size: 12px;
}

.css-app .css-panel-status:empty {
    display: none;
}

/* A panel whose last part fills the remaining height (Upload). */
.css-app #css-panel-image {
    height: 100%;
}

.css-app .css-panel-fill {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* Upload: one large button with an image slot. */
.css-app .css-upload-drop {
    display: flex;
    align-items: center;
    gap: var(--css-space-3);
    width: 100%;
    padding: 14px;
    border: 1.5px dashed var(--css-line-strong);
    border-radius: var(--css-radius);
    background: var(--css-surface-2);
    color: var(--css-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.css-app .css-upload-drop:hover {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
}

.css-app .css-upload-drop .css-tile-img {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    background: var(--css-surface);
    color: var(--css-accent);
}

.css-app .css-upload-drop-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--css-ink-3);
}

.css-app .css-upload-drop-text strong {
    color: var(--css-ink);
    font-size: 14px;
    font-weight: 600;
}

/* The uploads library: the only part of a panel that scrolls. */
.css-app .css-library {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 6px;
    margin: 0 -4px;
    padding: 0 4px 4px;
    overflow-y: auto;
}

.css-app .css-library-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--css-ink-3);
    font-size: 13px;
}

.css-app .css-library-item {
    aspect-ratio: 1;
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--css-line);
    border-radius: 10px;
    background: var(--css-surface-2);
    cursor: pointer;
    transition: border-color 0.12s ease;
}

.css-app .css-library-item:hover {
    border-color: var(--css-accent);
}

.css-app .css-library-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* "Fix for Me" on red print-check warnings and the sharpest-print note (owner, 2026-11-25): bottom right, dark red. */
.css-app .css-print-check .css-print-fix,
.css-print-check .css-print-fix {
    display: block;
    margin: 8px 0 0 auto;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: #8c1d18;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: background 0.12s ease;
}

.css-app .css-print-check .css-print-fix:hover,
.css-app .css-print-check .css-print-fix:focus-visible {
    background: #6a1410;
}

/* Deleting uploads (owner, 2026-11-25): an × on each tile, "Clear all" by the heading. */
.css-app .css-library-cell {
    position: relative;
    min-width: 0;
}

.css-app .css-library-cell .css-library-item {
    width: 100%;
}

.css-app .css-library-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.72);
    color: #fff;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.12s ease, background 0.12s ease;
}

.css-app .css-library-remove svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
}

.css-app .css-library-remove:hover,
.css-app .css-library-remove:focus-visible {
    opacity: 1;
    background: #b3261e;
}

.css-app .css-library-clear {
    padding: 2px 8px;
    border: 1px solid var(--css-line);
    border-radius: 999px;
    background: transparent;
    color: var(--css-ink-2, inherit);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.css-app .css-library-clear:hover,
.css-app .css-library-clear.is-confirm {
    border-color: #b3261e;
    background: #b3261e;
    color: #fff;
}

/* Small tabs at the top of a panel (used from part 3). */
.css-app .css-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 10px;
    background: var(--css-surface-3);
}

.css-app .css-tab {
    flex: 1;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--css-ink-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.css-app .css-tab:hover {
    color: var(--css-ink);
}

.css-app .css-tab[aria-selected="true"] {
    background: var(--css-surface);
    color: var(--css-ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------------ */
/* Workspace: toolbar + stage                                          */
/* ------------------------------------------------------------------ */

.css-app .css-workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.css-app .css-toolbar {
    flex: 0 0 var(--css-toolbar-h);
    display: flex;
    align-items: center;
    gap: var(--css-space-1);
    padding: 0 var(--css-space-3);
    background: var(--css-surface);
    border-bottom: 1px solid var(--css-line);
}

.css-app .css-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--css-radius-s);
    background: transparent;
    color: var(--css-ink);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.css-app .css-tool-btn:hover:not(:disabled) {
    background: var(--css-surface-2);
}

.css-app .css-tool-btn:disabled {
    color: var(--css-ink-3);
    cursor: not-allowed;
}

.css-app .css-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.css-app .css-toolbar-status {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 var(--css-space-3);
    overflow: hidden;
    color: var(--css-ink-2);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Room for "Add to cart" later; takes no space while empty. */
.css-app .css-toolbar-cart:empty {
    display: none;
}

.css-app .css-toolbar-cart {
    display: flex;
    align-items: center;
    gap: var(--css-space-2);
}

.css-app .css-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--css-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.css-app .css-btn-primary:hover {
    background: var(--css-accent-strong);
}

.css-app .css-btn-primary .css-icon {
    width: 18px;
    height: 18px;
}

/* The grey stage; the canvas is centred and sized to fit (fitCanvasToHost).
   Zoom and pan (stage 9) will work inside this area. */
.css-app .css-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background: var(--css-workspace);
    /* Owner, 2026-11-26: a photo behind the canvas only (not the nav, panels or toolbar):
       black-and-white palm leaves, Unsplash photo-1590990908482-1634e3eb7288 (credits in
       assets/img/editor/README.md). Sharper copy on high-density screens. */
    background: #1c1c1c url("../img/editor/stage-bg-1200.webp") center / cover no-repeat;
    background-image: image-set(url("../img/editor/stage-bg-1200.webp") 1x, url("../img/editor/stage-bg-2000.webp") 2x);
}

.css-app .css-canvas-frame {
    flex: 0 0 auto;
    line-height: 0;
    border-radius: 2px;
    box-shadow: var(--css-shadow);
    /* The checkerboard shows transparent areas of the design. */
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #ece7df 25%, transparent 25%),
        linear-gradient(-45deg, #ece7df 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ece7df 75%),
        linear-gradient(-45deg, transparent 75%, #ece7df 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.css-app .css-stage-info {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--css-surface);
    color: var(--css-ink-3);
    font: italic 600 13px/1 Georgia, serif;
    box-shadow: var(--css-shadow);
    cursor: help;
    user-select: none;
}

/* Zoom bar (stage 9): bottom-left of the stage; 100% = the page fitted to the stage. */
.css-app .css-zoom {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    box-shadow: var(--css-shadow);
    font: 600 13px/1 var(--css-font);
    user-select: none;
}

.css-app .css-zoom button {
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--css-ink);
    font: inherit;
    cursor: pointer;
}

.css-app .css-zoom-btn[data-zoom="out"],
.css-app .css-zoom-btn[data-zoom="in"] {
    font-size: 17px;
}

.css-app .css-zoom-level {
    min-width: 54px !important;
    font-variant-numeric: tabular-nums;
}

.css-app .css-zoom button:hover:not(:disabled) {
    background: var(--css-accent-soft);
}

.css-app .css-zoom button:focus-visible {
    outline: 2px solid var(--css-accent-ring);
    outline-offset: 1px;
}

.css-app .css-zoom button:disabled {
    color: var(--css-ink-3);
    cursor: default;
}

.css-app .css-zoom-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    display: flex;
    flex-direction: column;
    min-width: 120px;
    padding: 4px;
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    box-shadow: var(--css-shadow-lift);
}

.css-app .css-zoom-menu[hidden] {
    display: none;
}

.css-app .css-zoom-menu button {
    justify-content: flex-start;
    text-align: left;
    font-weight: 500;
}

.css-app .css-zoom-menu button[aria-checked="true"] {
    color: var(--css-accent-strong);
    font-weight: 700;
}

/* Space held or middle button: grab the view (beats Fabric's inline cursor). */
.css-app .css-canvas-frame.css-panning canvas {
    cursor: grab !important;
}

.css-app .css-canvas-frame.css-panning-active canvas {
    cursor: grabbing !important;
}

/* "We restored your design" / "Started a new design" (stage 7c). */
.css-app #css-draft-notice {
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 2;
    max-width: calc(100% - 32px);
    margin: 0 !important;
    transform: translateX(-50%);
    box-shadow: var(--css-shadow);
}

/* ------------------------------------------------------------------ */
/* Tooltip (one element, placed by the script)                         */
/* ------------------------------------------------------------------ */

.css-tooltip {
    position: fixed;
    z-index: 100001;
    max-width: 260px;
    padding: 6px 9px;
    border-radius: 7px;
    background: #2a1d16;
    color: #fff;
    font: 12px/1.35 var(--css-font);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.css-tooltip.is-visible {
    opacity: 1;
}

.css-tooltip-key {
    margin-left: 6px;
    color: #b9b9c6;
}

/* ------------------------------------------------------------------ */
/* Stage 15a: Colour select (Edit panel, Colour tab)                   */
/* ------------------------------------------------------------------ */

.css-app .css-pick-btn.is-active {
    background: var(--css-accent);
    color: #fff;
}

.css-app .css-pick-btn:disabled {
    border-color: var(--css-line-strong);
    background: var(--css-surface-2);
    color: var(--css-ink-3);
    cursor: not-allowed;
}

.css-app .css-colour-settings {
    margin-top: 10px;
}

.css-app .css-colour-settings > .css-slider-row {
    margin-bottom: 10px;
}

.css-app .css-colour-flat {
    margin: 6px 0 4px;
}

.css-app .css-colour-head {
    margin: 14px 0 6px;
}

.css-app .css-colour-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 168px;
    overflow-y: auto;
}

.css-app .css-colour-edit {
    display: flex;
    gap: 4px;
}

.css-app .css-colour-edit .css-icon-btn {
    flex: 0 0 32px;
}

.css-app .css-icon-btn--danger:hover:not(:disabled) {
    border-color: var(--css-danger);
    color: var(--css-danger);
}

.css-app .css-colour-edit-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink-2);
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}

.css-app .css-colour-edit-main:hover {
    border-color: var(--css-accent);
}

.css-app .css-colour-edit-main[aria-pressed="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-ink);
}

.css-app .css-colour-chip {
    flex: 0 0 18px;
    height: 18px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 5px;
}

.css-app .css-colour-arrow {
    color: var(--css-ink-3);
}

.css-app .css-colour-edit-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Swatch beside the cursor while picking (outside the editor root). */
.css-pick-loupe {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border-radius: 8px;
    background: #2a1d16;
    color: #fff;
    font: 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
}

.css-pick-loupe.is-visible {
    opacity: 1;
}

.css-pick-loupe-swatch {
    width: 22px;
    height: 22px;
    border: 2px solid #fff;
    border-radius: 5px;
}

/* Short windows (e.g. 1366 × 768 with browser bars): the Edit panel's
   Image | Colour tabs take the heading's place so the Image tab still fits. */
@media (max-height: 660px) {
    .css-app #css-panel-edit-image > h3 {
        display: none;
    }

    .css-app #css-edit-tabpanel-image > .css-subhead {
        margin-top: 12px;
    }
}

/* Eraser brush (stage 15b): a circle the size of the brush follows the pointer. */
.css-brush-cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100000;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    display: none;
}

.css-brush-cursor.is-visible {
    display: block;
}

.css-brush-cursor.is-restore {
    border-style: dashed;
}

.css-app.is-erasing .upper-canvas {
    cursor: none !important;
}

.css-app .css-erase-reset {
    margin-top: 8px;
}

/* AI object erase (stage 15d): the AI erase part of the Erase tab, the brush, and a status pill on the canvas. */
.css-brush-cursor.is-ai {
    border-color: #ff2d55;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.css-app .css-ai {
    display: flex;
    flex-direction: column;
    gap: var(--css-space-2);
    margin-top: var(--css-space-2);
}

.css-app .css-ai[hidden],
.css-app .css-ai [hidden] {
    display: none;
}

.css-app .css-ai-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--css-space-2);
}

.css-app .css-ai-progress {
    width: 100%;
    height: 8px;
    accent-color: var(--css-accent);
}

.css-app .css-ai-fallback {
    margin: 0;
    font-size: 12.5px;
    color: var(--css-ink-2);
}

.css-app .css-ai-pill {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: var(--css-space-3);
    max-width: calc(100% - 32px);
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--css-surface);
    color: var(--css-ink);
    box-shadow: var(--css-shadow-lift);
    font-size: 13px;
    line-height: 1.3;
}

.css-app .css-ai-pill[hidden] {
    display: none;
}

/* Curved crop (stage 15c): Rectangle | Custom shape, preset and point buttons, in crop mode. */
.css-app .css-crop-shape {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 10px;
}

.css-app .css-crop-shape[hidden] {
    display: none;
}

.css-app .css-crop-shape-buttons {
    display: flex;
    gap: 8px;
}

.css-app .css-crop-shape-buttons button {
    flex: 1;
}

/* ------------------------------------------------------------------ */
/* Adjust tab (stage 15i): look tiles with live thumbnails             */
/* ------------------------------------------------------------------ */

.css-app .css-look-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--css-space-2);
    margin-bottom: var(--css-space-2);
}

.css-app .css-look-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 4px 4px 6px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    font: inherit;
    cursor: pointer;
}

.css-app .css-look-tile:hover:not(:disabled) {
    border-color: var(--css-line-strong);
}

.css-app .css-look-tile[aria-pressed="true"] {
    border-color: var(--css-accent);
    box-shadow: 0 0 0 2px var(--css-accent-ring);
}

.css-app .css-look-tile:disabled {
    opacity: 0.5;
    cursor: default;
}

.css-app .css-look-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 6px;
    background: repeating-conic-gradient(#ece7df 0% 25%, #ffffff 0% 50%) 50% / 10px 10px;
}

.css-app .css-look-label {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Phase 1a: Sticker panel (cut, size, border, inner cuts, print check) */
/* ------------------------------------------------------------------ */

.css-app .css-length-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
}

.css-app .css-num-pair {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.css-app .css-num-input {
    width: 64px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--css-line-strong);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    font: inherit;
    font-size: 13px;
}

.css-app .css-num-input:focus {
    border-color: var(--css-accent);
    outline: 2px solid var(--css-accent-ring);
    outline-offset: 0;
}

.css-app .css-unit {
    color: var(--css-ink-3);
    font-size: 12px;
}

.css-app .css-cut-row {
    margin-bottom: 6px;
}

.css-app .css-cut-row .css-chip {
    font-size: 11.5px;
}

.css-app .css-size-custom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.css-app #css-sticker-controls [hidden] {
    display: none !important;
}

.css-app .css-units-row {
    max-width: 180px;
}

.css-app .css-size-info {
    color: var(--css-ink-2);
    font-weight: 500;
}

.css-app .css-sticker-switch {
    margin: 6px 0;
}

.css-app .css-hole-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.css-app .css-hole-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 4px 4px 8px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    font-size: 12.5px;
}

.css-app .css-hole-row:hover {
    border-color: var(--css-accent);
}

.css-app .css-hole-row .css-segmented {
    flex: 0 0 170px;
    margin: 0;
}

/* A hole too small for the cutter: always filled, Cut out locked. */
.css-app .css-hole-row.is-too-small {
    background: var(--css-surface-2);
    color: var(--css-ink-2);
}

.css-app .css-hole-row .css-seg-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.css-app .css-hole-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.css-app .css-hole-add {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.css-app .css-hole-add .css-btn[aria-pressed="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
}

.css-app .css-cut-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.css-app .css-key {
    display: inline-block;
    width: 18px;
    height: 0;
    margin-left: 4px;
    border-top: 2px dashed;
    vertical-align: middle;
}

.css-app .css-key--cut { border-color: #e0218a; }
.css-app .css-key--bleed { border-top-style: dotted; border-color: #d93a3a; }
.css-app .css-key--safe { border-top-style: dotted; border-color: #1e78e6; }

.css-app .css-print-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.css-app .css-print-checks-head {
    font-size: 13px;
    font-weight: 600;
    color: #b3261e;   /* red, like the boxes below (owner, 2026-11-25: warnings must catch the eye) */
}

.css-app .css-print-checks-head.is-ok {
    color: #2d5a43;
}

.css-app .css-print-check {
    margin: 0;
    padding: 7px 9px;
    border-radius: var(--css-radius-s);
    font-size: 12px;
    line-height: 1.4;
}

.css-app .css-print-check--warn {
    /* Light red (was light brown): border-width and cut warnings need the customer to notice them. */
    border: 1px solid #f4b4b0;
    background: #fdecea;
    color: #8c1d18;
}

.css-app .css-print-check--info {
    border: 1px solid var(--css-line);
    background: var(--css-surface-2);
    color: var(--css-ink-2);
}

.css-app .css-print-export {
    width: 100%;
    margin-bottom: 6px;
}

/* ------------------------------------------------------------------ */
/* Phase 1b: phone layout. Canvas on top, the tool panel below it, the  */
/* nav as a bottom bar. Desktop is unchanged.                           */
/* ------------------------------------------------------------------ */

@media (max-width: 760px) {
    .css-app {
        --css-nav-img: 30px;
        --css-topbar-h: 44px;
        --css-toolbar-h: 46px;
    }

    .css-app .css-studio {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas: "work" "panel" "nav";
    }

    .css-app .css-workspace {
        grid-area: work;
    }

    .css-app .css-stage {
        flex: 0 0 auto;
        height: min(calc(100vw - 8px), 48vh);
        padding: 8px;
    }

    .css-app .css-tool-panel {
        grid-area: panel;
        border-right: 0;
        border-top: 1px solid var(--css-line);
        padding: var(--css-space-3) var(--css-space-4);
        -webkit-overflow-scrolling: touch;
    }

    .css-app .css-nav {
        grid-area: nav;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0;
        padding: 2px 4px calc(2px + env(safe-area-inset-bottom, 0px));
        border-right: 0;
        border-top: 1px solid var(--css-line);
        overflow-x: auto;
        overflow-y: hidden;
    }

    .css-app .css-nav-tile {
        flex: 1 0 auto;
        width: auto;
        min-width: 52px;
        padding: 4px 2px;
    }

    .css-app .css-nav-label {
        font-size: 10.5px;
    }

    .css-app .css-toolbar {
        gap: 2px;
        padding: 0 var(--css-space-2);
    }

    .css-app .css-tool-btn-label,
    .css-app .css-toolbar-status {
        display: none;
    }

    .css-app .css-toolbar-cart {
        margin-left: auto;
    }

    .css-app .css-btn-primary {
        height: 34px;
        padding: 0 10px;
    }

    .css-app .css-zoom {
        transform: scale(0.85);
        transform-origin: left bottom;
    }

    .css-app .css-stage-info {
        display: none;
    }
}

/* ------------------------------------------------------------------ */
/* Phase 1b: mockup preview dialog                                      */
/* ------------------------------------------------------------------ */

.css-app .css-mock-open {
    margin: 8px 0 4px;
}

.css-mock-dialog {
    width: min(920px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 16px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: #2a1d16;
    box-shadow: 0 20px 60px rgba(42, 29, 22, 0.3);
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.css-mock-dialog::backdrop {
    background: rgba(42, 29, 22, 0.55);
}

.css-mock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.css-mock-head h3 {
    margin: 0;
    font-size: 16px;
}

.css-app .css-mock-dialog .css-mock-close {
    flex: 0 0 32px;
    padding: 0;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #f2f2f6;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.css-mock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.css-mock {
    margin: 0;
}

.css-mock figcaption {
    margin-top: 6px;
    color: #5a473b;
    font-size: 12.5px;
    text-align: center;
}

.css-mock-surface {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
}

.css-mock-sticker {
    position: relative;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.18));
    transform: rotate(-4deg);
}

/* Laptop lid: brushed aluminium in space grey. */
.css-mock--laptop .css-mock-surface {
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.18) 0 6%, transparent 6.5%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
        linear-gradient(160deg, #5b5f68, #3a3d44 60%, #2e3036);
}

/* Bottle: a curved teal powder-coat with a highlight. */
.css-mock--bottle .css-mock-surface {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 22%, rgba(255, 255, 255, 0.22) 38%, transparent 52%, rgba(0, 0, 0, 0.3)),
        linear-gradient(#1f8f8a, #16736f);
}

.css-mock--bottle .css-mock-sticker {
    transform: perspective(500px) rotateY(-8deg);
}

/* Notebook: kraft paper cover. */
.css-mock--notebook .css-mock-surface {
    background:
        radial-gradient(rgba(90, 60, 20, 0.08) 1px, transparent 1.5px) 0 0 / 5px 5px,
        linear-gradient(150deg, #c9a272, #b88d5c);
}

.css-mock--notebook .css-mock-sticker {
    transform: rotate(3deg);
}

/* ------------------------------------------------------------------ */
/* Phase 4: Add to cart in the toolbar + share-to-catalog dialog        */
/* ------------------------------------------------------------------ */

.css-app .css-toolbar-cart { margin-left: auto; }
.css-app .css-cart-finish,
.css-app .css-cart-qty {
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--css-line-strong);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    font: inherit;
    font-size: 13px;
}
.css-app .css-cart-qty { width: 64px; }
.css-app .css-cart-price { min-width: 54px; font-weight: 650; font-size: 13px; text-align: right; }
.css-app .css-cart-add { background: var(--css-accent); }
.css-app .css-cart-add:hover { background: var(--css-accent-strong); }
.css-app .css-cart-add:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 760px) {
    .css-app .css-cart-finish, .css-app .css-cart-price { display: none; }
    .css-app .css-cart-qty { width: 52px; }
}

.css-share-dialog {
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 20px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: #2a1d16;
    box-shadow: 0 20px 60px rgba(42, 29, 22, 0.3);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.css-share-dialog::backdrop { background: rgba(42, 29, 22, 0.5); }
.css-share-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.css-share-head h3 { margin: 0 0 4px; font-size: 17px; }
.css-share-head p { margin: 0; color: #5a473b; }
.css-share-thumb { flex: 0 0 76px; width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: repeating-conic-gradient(#f1e9dd 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.css-share-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.css-app .css-share-actions .css-btn, .css-app .css-share-dialog > .css-btn, .css-app .css-share-form > .css-btn { width: auto; text-decoration: none; display: inline-flex; align-items: center; }
.css-share-form { display: grid; gap: 10px; }
.css-share-field { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.css-share-field input, .css-share-field select { height: 38px; padding: 0 10px; border: 1px solid #d8ccbb; border-radius: 8px; font: inherit; font-weight: 400; }
.css-share-rules { padding: 10px 12px; border-radius: 10px; background: #f7f3ec; font-size: 13px; }
.css-share-rules ul { margin: 6px 0; padding-left: 18px; }
.css-share-rules a { color: var(--css-accent-strong, #1f4231); font-weight: 600; }
.css-share-agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.css-share-agree input { margin-top: 3px; }
.css-share-note { min-height: 1.2em; margin: 0; color: #b42318; font-size: 13px; }
.css-share-done { margin: 0 0 8px; color: #2d5a43; font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Brand (espresso & forest, docs/brand.md)                            */
/* ------------------------------------------------------------------ */

.css-app .css-topbar-brand { gap: 10px; }
.css-app .css-topbar-brand .css-s-logo-mark { flex: 0 0 auto; width: 28px; height: 28px; }
.css-app .css-topbar-name {
    font-family: "CSS Playfair", Georgia, serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.css-app .css-topbar-name em { font-style: italic; font-weight: 500; color: var(--css-accent); }
.css-mock-dialog, .css-share-dialog { border-radius: 8px; background: #fffdf9; }
.css-mock-head h3, .css-share-head h3 {
    font-family: "CSS Playfair", Georgia, serif;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.15;
}
.css-share-note { color: #a3331f; }

/* Add to cart states (Phase 5) */
.css-app .css-cart-add { min-width: 118px; justify-content: center; }
.css-app .css-cart-add.is-busy { cursor: progress; opacity: 0.85; }
.css-app .css-cart-add.is-busy::before {
    content: "";
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: css-spin 0.8s linear infinite;
}
.css-app .css-cart-add.is-done { background: var(--css-accent-strong); }
@keyframes css-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .css-app .css-cart-add.is-busy::before { animation-duration: 2.4s; } }
@media (max-width: 420px) { .css-app .css-topbar-name { font-size: 17px; } }

/* With "Add to cart" in the toolbar, Export PNG is the secondary action. */
.css-app .css-toolbar-cart:not(:empty) + #css-export {
    background: transparent;
    color: var(--css-accent-strong);
    box-shadow: inset 0 0 0 1px var(--css-line-strong);
}
.css-app .css-toolbar-cart:not(:empty) + #css-export:hover {
    background: var(--css-surface-2);
    box-shadow: inset 0 0 0 1px var(--css-accent);
}
@media (max-width: 760px) {
    .css-app .css-toolbar-cart:not(:empty) + #css-export { width: 36px; padding: 0; justify-content: center; }
    .css-app .css-toolbar-cart:not(:empty) + #css-export span {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
}
@media (max-width: 760px) {
    .css-app .css-cart-add[data-price]:not([data-price=""]):not(.is-busy):not(.is-done)::after {
        content: "·\00a0" attr(data-price);
        font-weight: 500;
        opacity: 0.85;
    }
}

/* Empty canvas start card + drop target (Phase 5 UX) */
.css-app .css-stage .css-empty-hint {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 16px;
    pointer-events: none;
}
.css-app .css-stage .css-empty-hint[hidden] { display: none; }
.css-app .css-empty-card {
    pointer-events: auto;
    width: min(340px, 100%);
    padding: 24px 22px 20px;
    border: 1px solid var(--css-line);
    border-radius: 10px;
    background: var(--css-surface);
    box-shadow: var(--css-shadow-lift);
    text-align: center;
}
.css-app .css-empty-title {
    margin: 0 0 4px;
    font-family: "CSS Playfair", Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--css-ink);
}
.css-app .css-empty-text { margin: 0 0 16px; color: var(--css-ink-2); }
.css-app .css-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.css-app .css-empty-actions .css-btn { width: auto; }
.css-app .css-empty-link { display: inline-block; margin-top: 14px; color: var(--css-accent-strong); font-weight: 600; font-size: 13px; }
.css-app .css-empty-drop { margin: 10px 0 0; color: var(--css-ink-3); font-size: 12px; }
@media (max-width: 760px) { .css-app .css-empty-drop { display: none; } }
.css-app .css-stage.is-dropping { box-shadow: inset 0 0 0 3px var(--css-accent); background: var(--css-accent-soft); }

/* Art styles (Styles tab): reuses the look tiles; actions row, busy state. */
.css-app .css-style-sliders { margin-top: 10px; }
.css-app .css-style-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.css-app .css-style-actions .css-btn[hidden] { display: none; }
.css-app .css-style-compare { touch-action: none; user-select: none; -webkit-user-select: none; }
.css-app .css-style-compare[aria-pressed="true"] { background: var(--css-accent-soft, #e6eee6); }
.css-app .css-styles-busy .css-look-grid { opacity: .55; pointer-events: none; }
.css-app .css-styles-busy .css-panel-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: css-style-spin .8s linear infinite; }
@keyframes css-style-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .css-app .css-styles-busy .css-panel-status::before { animation: none; } }
.css-app .css-style-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.css-app .css-style-preset { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border: 1px solid var(--css-border, #ddd); border-radius: 999px; }
.css-app .css-style-preset-del { padding: 0 6px; text-decoration: none; }
@media (pointer: coarse), (max-width: 700px) { .css-app .css-style-actions .css-btn { min-height: 44px; } .css-app .css-style-preset .css-link-btn { min-height: 36px; } }

/* ------------------------------------------------------------------ */
/* Editor UX pass (2026-11-21, docs/editor-ux/PROGRESS.md)             */
/* ------------------------------------------------------------------ */

/* Nav: the photo icons stay (owner's choice); the words under them are easier to read. */
.css-app .css-nav-label { font-size: 12px; font-weight: 600; color: var(--css-ink); letter-spacing: 0.01em; }
.css-app .css-nav-tile.is-active .css-nav-label { color: var(--css-accent-strong); }

/* Status messages: a toast over the bottom of the stage that fades, instead of
   a cut-off line in the toolbar (and now shown on phones too). */
.css-app .css-toolbar-cart:empty + #css-export { margin-left: auto; }
.css-app #css-status.css-toast {
    display: block;
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 64px;
    max-width: min(560px, calc(100% - 32px));
    margin: 0;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(42, 29, 22, 0.92);
    color: #fffdf9;
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    box-shadow: var(--css-shadow-lift);
    transform: translate(-50%, 8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.css-app #css-status.css-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.css-app #css-status.css-toast:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .css-app #css-status.css-toast { transition: none; } }

/* Sticker panel: the basics, then "More cut options". */
.css-app .css-more { margin-top: var(--css-space-3); border-top: 1px solid var(--css-line); padding-top: var(--css-space-2); }
.css-app .css-more-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    color: var(--css-ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.css-app .css-more-summary::-webkit-details-marker { display: none; }
.css-app .css-more-summary::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}
.css-app .css-more[open] > .css-more-summary::before { transform: rotate(45deg); }
.css-app .css-more-summary:hover { color: var(--css-accent-strong); }
.css-app .css-sticker-next { margin-top: var(--css-space-4); padding: 10px; font-weight: 600; }

/* Finish & order panel */
.css-app .css-panel-finish h3 { margin: 0 0 var(--css-space-3); }
.css-app .css-order-summary {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius);
    background: var(--css-surface-2);
}
.css-app .css-order-summary-text { margin: 0; color: var(--css-ink); font-size: 13px; font-weight: 600; }
.css-app .css-order-summary .css-link-btn { justify-self: start; }
.css-app .css-finish-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.css-app .css-finish-row .css-chip,
.css-app .css-chip[aria-checked="true"] { font-size: 12.5px; padding: 8px 4px; }
.css-app .css-chip[aria-checked="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    color: var(--css-accent-strong);
    font-weight: 600;
}
.css-app .css-qty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.css-app .css-qty-chip {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 7px 2px 6px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    cursor: pointer;
    font: inherit;
}
.css-app .css-qty-chip strong { font-size: 15px; }
.css-app .css-qty-each { font-size: 11px; color: var(--css-ink-2); }
.css-app .css-qty-save { min-height: 13px; font-size: 10.5px; font-weight: 600; color: var(--css-accent); }
.css-app .css-qty-chip:hover { border-color: var(--css-accent); }
.css-app .css-qty-chip[aria-checked="true"] { border-color: var(--css-accent); background: var(--css-accent-soft); box-shadow: inset 0 0 0 1px var(--css-accent); }
.css-app .css-qty-other { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--css-ink-2); }
.css-app .css-qty-other .css-num-input { width: 80px; }
.css-app .css-order-total {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    margin: var(--css-space-4) 0 var(--css-space-2);
    padding-top: var(--css-space-3);
    border-top: 1px solid var(--css-line);
}
.css-app .css-order-total-label { font-size: 13px; color: var(--css-ink-2); }
.css-app .css-order-total-value { font-size: 22px; color: var(--css-ink); }
.css-app .css-order-total-each { grid-column: 2; font-size: 12px; color: var(--css-ink-2); text-align: right; }
.css-app .css-order-add { width: 100%; height: 44px; justify-content: center; font-size: 15px; background: var(--css-accent); }
.css-app .css-order-add:hover { background: var(--css-accent-strong); }
.css-app .css-order-add:disabled { opacity: 0.4; cursor: not-allowed; }
.css-app .css-panel-finish .css-mock-open { margin-top: var(--css-space-3); }
.css-app .css-order-downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.css-app .css-order-downloads .css-btn { margin: 0; font-size: 12.5px; }

/* Toolbar: "10 · Glossy" opens the Finish & order panel. */
.css-app .css-cart-summary {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--css-line-strong);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.css-app .css-cart-summary:hover { border-color: var(--css-accent); }

/* Phones: all seven nav tiles fit (the 30px icon size never applied: the base
   size is set on #css-editor.css-app, which outranks .css-app). */
@media (max-width: 760px) {
    #css-editor.css-app { --css-nav-img: 34px; }
    .css-app .css-nav { justify-content: space-between; overflow-x: hidden; }
    .css-app .css-nav-tile { flex: 1 1 0; min-width: 0; padding: 4px 1px; }
    .css-app .css-nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; letter-spacing: -0.01em; }
    .css-app .css-cart-summary { padding: 0 8px; font-size: 12px; }
    .css-app .css-cart-summary { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
    .css-app #css-status.css-toast { bottom: 44px; font-size: 12.5px; }
}
@media (max-width: 380px) { .css-app .css-cart-summary { display: none; } }

/* Context toolbar: floats over the top of the stage, tools for the selection. */
.css-app .css-context-bar {
    position: absolute;
    z-index: 7;
    top: 10px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: calc(100% - 24px);
    padding: 4px 6px;
    border: 1px solid var(--css-line);
    border-radius: 12px;
    background: var(--css-surface);
    box-shadow: var(--css-shadow-lift);
    transform: translateX(-50%);
    overflow-x: auto;
    scrollbar-width: none;
    transition: opacity 0.12s ease;
}
.css-app .css-context-bar[hidden] { display: none; }
.css-app .css-context-bar.is-dragging { opacity: 0; pointer-events: none; }
.css-app .css-ctx-btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--css-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.css-app .css-ctx-btn svg { width: 18px; height: 18px; }
.css-app .css-ctx-btn:hover:not(:disabled) { background: var(--css-surface-3); }
.css-app .css-ctx-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.css-app .css-ctx-btn--text { font-weight: 600; }
.css-app .css-ctx-btn--danger:hover:not(:disabled) { color: var(--css-danger); }
.css-app .css-ctx-divider { flex: 0 0 auto; width: 1px; height: 22px; margin: 0 4px; background: var(--css-line-strong); }
.css-app .css-ctx-note { padding: 0 8px; font-size: 13px; color: var(--css-ink-2); }
.css-app .css-ctx-swatches, .css-app .css-ctx-group { display: flex; align-items: center; gap: 4px; padding: 0 2px; }
.css-app .css-ctx-swatch {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid var(--css-surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--css-line-strong);
    cursor: pointer;
}
.css-app .css-ctx-swatch:hover { box-shadow: 0 0 0 2px var(--css-accent); }
.css-app .css-ctx-swatch.is-changed { box-shadow: 0 0 0 2px var(--css-accent); }
.css-app .css-ctx-swatch--text {
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--css-surface);
    box-shadow: none;
    color: var(--css-ink);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}
.css-app .css-ctx-swatch--text span { padding-bottom: 3px; border-bottom: 4px solid var(--swatch, #000); }
.css-app .css-ctx-swatch--text:hover { background: var(--css-surface-3); box-shadow: none; }

/* Colour chooser under a swatch */
.css-app .css-swatch-pop {
    position: absolute;
    z-index: 8;
    width: 232px;
    padding: 10px;
    border: 1px solid var(--css-line);
    border-radius: 12px;
    background: var(--css-surface);
    box-shadow: var(--css-shadow-lift);
}
.css-app .css-swatch-pop[hidden] { display: none; }
.css-app .css-swatch-pop-head { margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--css-ink); }
.css-app .css-swatch-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.css-app .css-swatch {
    aspect-ratio: 1;
    width: 100%;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 50%;
    cursor: pointer;
}
.css-app .css-swatch:hover, .css-app .css-swatch:focus-visible { outline: 2px solid var(--css-accent); outline-offset: 1px; }
.css-app .css-swatch[aria-pressed="true"] { outline: 2px solid var(--css-accent); outline-offset: 1px; }
.css-app .css-swatch-pop-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.css-app .css-swatch-any { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--css-ink); cursor: pointer; }
.css-app .css-swatch-any input { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }

@media (max-width: 760px) {
    .css-app .css-context-bar { top: 6px; padding: 3px 4px; }
    .css-app .css-ctx-label { display: none; }
    .css-app .css-ctx-btn--text .css-ctx-label { display: inline; }
    .css-app .css-ctx-btn { height: 36px; padding: 0 8px; }
}

/* Remove BG in progress: a shimmer over the picture (editor UX pass). */
.css-app .css-busy-overlay {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255, 253, 249, 0.28);
    pointer-events: none;
}
.css-app .css-busy-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
    background-size: 250% 100%;
    animation: css-busy-sweep 1.6s ease-in-out infinite;
}
.css-app .css-busy-label {
    position: relative;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(42, 29, 22, 0.88);
    color: #fffdf9;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.css-app .css-busy-overlay.is-small .css-busy-label { font-size: 11px; padding: 4px 8px; }
@keyframes css-busy-sweep { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .css-app .css-busy-overlay::before { animation: none; } }

/* Styles tab: one clear Apply, the rest smaller (editor UX pass). */
.css-app .css-style-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.css-app .css-style-actions .css-style-apply { grid-column: 1 / -1; padding: 9px; font-weight: 600; }
.css-app .css-style-actions .css-style-save-preset {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--css-accent-strong);
    font-size: 12.5px;
}
.css-app .css-style-actions .css-style-save-preset:hover { text-decoration: underline; }

/* Context toolbar on narrow phones: smaller swatches; Flip and Lock stay in the Edit panel. */
@media (max-width: 480px) {
    .css-app .css-ctx-swatch { width: 24px; height: 24px; }
    .css-app .css-ctx-btn { padding: 0 6px; }
    .css-app .css-context-bar [data-ctx-action="flip-horizontal"],
    .css-app .css-context-bar [data-ctx-action="lock"] { display: none; }
}

/* Cut line switch beside zoom (2026-11-21) */
.css-app .css-zoom-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--css-line-strong); }
.css-app .css-cutline-toggle { display: inline-flex; align-items: center; gap: 5px; width: auto !important; padding: 0 8px; font-weight: 600; font-size: 12.5px; }
.css-app .css-cutline-toggle[aria-pressed="true"] { color: #c0186f; }
.css-app .css-cutline-toggle[aria-pressed="false"] { color: var(--css-ink-3); }
.css-app .css-cutline-toggle[aria-pressed="false"] svg { opacity: 0.5; }
@media (max-width: 760px) { .css-app .css-cutline-toggle span { display: none; } }

/* Photo tiles (2026-11-21): a button whose picture in assets/icons/ is a photo
   (WebP/JPEG) shows it filling the top of the tile, like the nav photos. */
.css-app .css-tile.has-photo {
    gap: 6px;
    padding: 4px 4px 7px;
    color: var(--css-ink);
    font-weight: 600;
    font-size: 12px;
}
.css-app .css-tile.has-photo .css-tile-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: 9px;
    background: var(--css-surface-3);
}
.css-app .css-tile.has-photo .css-tile-img img { object-fit: cover; transition: transform 0.25s ease; }
.css-app .css-tile.has-photo:hover:not(:disabled) .css-tile-img img { transform: scale(1.06); }
.css-app .css-tile.has-photo:hover:not(:disabled) { box-shadow: var(--css-shadow); }
.css-app .css-tile--danger.has-photo:hover:not(:disabled) .css-tile-img { box-shadow: inset 0 0 0 2px var(--css-danger); }
.css-app .css-btn-add.has-photo .css-tile-img { width: 48px; height: 32px; }
.css-app .css-btn-add.has-photo .css-tile-img img,
.css-app .css-upload-drop.has-photo .css-tile-img img { object-fit: cover; }
.css-app .css-upload-drop.has-photo .css-tile-img { width: 72px; height: 48px; }
@media (prefers-reduced-motion: reduce) { .css-app .css-tile.has-photo .css-tile-img img { transition: none; } }
.css-app .css-colour-quick:empty { display: none; }
.css-app .css-colour-quick { margin-bottom: var(--css-space-3); padding-bottom: var(--css-space-3); border-bottom: 1px solid var(--css-line); }
.css-app .css-colour-quick-row { flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.css-app .css-colour-quick-row .css-ctx-swatch { width: 34px; height: 34px; }
.css-app .css-bg-mode-note { margin: 6px 0 2px; }
.css-app .css-bg-quick { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-bottom: 10px; }
.css-app .css-bg-swatch { border-color: rgba(0, 0, 0, 0.18); }

/* Shapes: bigger, colourful tiles with names (2026-11-21). */
.css-app .css-shape-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.css-app .css-shape-tile {
    flex-direction: column;
    gap: 3px;
    aspect-ratio: auto;
    padding: 8px 2px 6px;
    border-color: transparent;
    border-radius: 10px;
    background: var(--css-surface-2);
}
.css-app .css-shape-tile:hover { border-color: var(--css-accent); background: var(--css-surface); box-shadow: var(--css-shadow); }
.css-app .css-shape-tile canvas { transition: transform 0.15s ease; }
.css-app .css-shape-tile:hover canvas { transform: scale(1.08); }
.css-app .css-shape-name { max-width: 100%; overflow: hidden; color: var(--css-ink-2); font-size: 10.5px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .css-app .css-shape-tile canvas { transition: none; } }

/* ------------------------------------------------------------------ */
/* Photo buttons, v2 (2026-11-21): the photo IS the button. The label  */
/* sits on a dark fade along the bottom, white and semi-bold, so it    */
/* reads on any photo. Replaces the photo-above-label tiles.           */
/* ------------------------------------------------------------------ */
.css-app .css-tile.has-photo {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #2a1d16;
    box-shadow: 0 1px 2px rgba(42, 29, 22, 0.12);
    isolation: isolate;
}
.css-app .css-tile.has-photo .css-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    background: transparent;
}
.css-app .css-tile.has-photo .css-tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease, filter 0.2s ease; }
.css-app .css-tile.has-photo .css-tile-label {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 0;
    display: -webkit-box;
    padding: 22px 8px 7px;
    overflow: hidden;
    background: linear-gradient(to top, rgba(20, 13, 9, 0.88) 0%, rgba(20, 13, 9, 0.6) 45%, rgba(20, 13, 9, 0) 100%);
    color: #fff;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.15;
    text-align: left;
    text-overflow: clip;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.css-app .css-tile.has-photo:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--css-accent), var(--css-shadow); }
.css-app .css-tile.has-photo:hover:not(:disabled) .css-tile-img img { transform: scale(1.07); }
.css-app .css-tile.has-photo:focus-visible { outline: 3px solid var(--css-accent); outline-offset: 2px; }
.css-app .css-tile.has-photo:active:not(:disabled) { transform: scale(0.98); }
.css-app .css-tile.has-photo:disabled .css-tile-img img { filter: grayscale(0.85); }
.css-app .css-tile--danger.has-photo:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--css-danger), var(--css-shadow); }
.css-app .css-tile--danger.has-photo:hover:not(:disabled) .css-tile-label { background: linear-gradient(to top, rgba(130, 30, 18, 0.92) 0%, rgba(130, 30, 18, 0.6) 45%, rgba(130, 30, 18, 0) 100%); }
.css-app .css-tile-grid:has(.has-photo) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* Wide photo buttons (Upload, Add text, Pick a colour): a photo banner with the words on a fade from the left. */
.css-app .css-upload-drop.has-photo,
.css-app .css-btn-add.has-photo {
    position: relative;
    min-height: 68px;
    padding: 12px 14px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #2a1d16;
    color: #fff;
    isolation: isolate;
    box-shadow: 0 1px 2px rgba(42, 29, 22, 0.12);
}
.css-app .css-upload-drop.has-photo .css-tile-img,
.css-app .css-btn-add.has-photo .css-tile-img {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: transparent;
}
.css-app .css-upload-drop.has-photo .css-tile-img::after,
.css-app .css-btn-add.has-photo .css-tile-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(20, 13, 9, 0.9) 0%, rgba(20, 13, 9, 0.7) 45%, rgba(20, 13, 9, 0.15) 100%);
}
.css-app .css-upload-drop.has-photo .css-tile-img img,
.css-app .css-btn-add.has-photo .css-tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.css-app .css-upload-drop.has-photo:hover .css-tile-img img,
.css-app .css-btn-add.has-photo:hover .css-tile-img img { transform: scale(1.05); }
.css-app .css-upload-drop.has-photo:hover,
.css-app .css-btn-add.has-photo:hover { background: #2a1d16; box-shadow: 0 0 0 2px var(--css-accent), var(--css-shadow); }
.css-app .css-upload-drop.has-photo:focus-visible,
.css-app .css-btn-add.has-photo:focus-visible { outline: 3px solid var(--css-accent); outline-offset: 2px; }
.css-app .css-upload-drop.has-photo .css-upload-drop-text,
.css-app .css-btn-add.has-photo > span:not(.css-tile-img) { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.css-app .css-upload-drop.has-photo .css-upload-drop-text strong { color: #fff; font-size: 15px; }
.css-app .css-upload-drop.has-photo .css-upload-drop-text span { color: rgba(255, 255, 255, 0.85); }
.css-app .css-btn-add.has-photo { color: #fff; font-size: 14px; font-weight: 650; }
.css-app .css-btn-add.has-photo[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--css-accent); }
@media (prefers-reduced-motion: reduce) {
    .css-app .css-tile.has-photo .css-tile-img img,
    .css-app .css-upload-drop.has-photo .css-tile-img img,
    .css-app .css-btn-add.has-photo .css-tile-img img { transition: none; }
}

/* Photo buttons: two per row, bigger squares, so the photos can be seen (owner, 2026-11-21). */
.css-app .css-tile-grid:has(.has-photo) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.css-app .css-tile.has-photo { aspect-ratio: 1 / 1; border-radius: 14px; }
.css-app .css-tile.has-photo .css-tile-label { padding: 34px 11px 10px; font-size: 14.5px; }
/* Buttons without a photo in a photo grid (crop mode's Apply / Reset / Cancel): same squares, a big icon. */
.css-app .css-tile-grid:has(.has-photo) .css-tile:not(.has-photo) { aspect-ratio: 1 / 1; justify-content: center; gap: 10px; border-radius: 14px; font-size: 14px; font-weight: 600; color: var(--css-ink); }
.css-app .css-tile-grid:has(.has-photo) .css-tile:not(.has-photo) .css-tile-img { width: 56px; height: 56px; border-radius: 16px; }
.css-app .css-tile-grid:has(.has-photo) .css-tile:not(.has-photo) .css-tile-img svg { width: 30px; height: 30px; }
/* ...on second thought: short wide buttons (icon + word) for those quick actions, not big squares. */
.css-app .css-tile-grid:has(.has-photo) .css-tile:not(.has-photo) { aspect-ratio: auto; flex-direction: row; min-height: 52px; padding: 8px 12px; gap: 8px; }
.css-app .css-tile-grid:has(.has-photo) .css-tile:not(.has-photo) .css-tile-img { width: 34px; height: 34px; border-radius: 10px; }
.css-app .css-tile-grid:has(.has-photo) .css-tile:not(.has-photo) .css-tile-img svg { width: 20px; height: 20px; }

/* AI erase on the faster model: a visible notice with the way back (2026-11-21). */
.css-app .css-ai-fallback:not([hidden]) {
    display: block;
    margin: 8px 0;
    padding: 9px 11px;
    border: 1px solid #e8c77a;
    border-radius: var(--css-radius-s);
    background: #fdf6e3;
    color: var(--css-ink);
    font-size: 12.5px;
    line-height: 1.4;
}
.css-app .css-ai-fallback .css-link-btn { font-weight: 650; text-decoration: underline; }

/* The logo in the editor's top bar (owner's design, 2026-11-21): same as the store. */
@font-face { font-family: "CSS Inter"; src: url("../fonts/inter/inter-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
.css-app .css-topbar-name .css-s-wordmark { display: inline-flex; align-items: baseline; gap: 0.3em; white-space: nowrap; }
.css-app .css-topbar-name em { font-size: 1.08em; font-weight: 600; color: #5b6b4e; }
.css-app .css-topbar-name .css-s-wm-name { color: #3b2716; font-family: "CSS Inter", system-ui, sans-serif; font-size: 16px; font-weight: 750; letter-spacing: -0.025em; }
.css-app .css-topbar-name .css-s-wm-dot { margin: 0 0.06em 0 0.14em; color: #5b6b4e; font-weight: 900; }
.css-app .css-topbar-name .css-s-wordmark { gap: 0.28em; }
.css-app .css-topbar-name em { font-size: 1.16em; letter-spacing: -0.02em; }
.css-app .css-topbar-name .css-s-wm-name { font-weight: 700; letter-spacing: -0.055em; word-spacing: -0.04em; }
.css-app .css-topbar-name .css-s-wm-dot { margin: 0 0.04em 0 0.26em; letter-spacing: 0; }

/* The Remove BG model blocks the page's main thread, which froze the background-position sweep
   (2026-11-22). Sweep with a transform instead: the compositor keeps it moving regardless. */
.css-app .css-busy-overlay::before {
    inset: 0 auto 0 -100%;
    width: 300%;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
    background-size: auto;
    animation: css-busy-sweep-x 1.6s ease-in-out infinite;
    will-change: transform;
}
@keyframes css-busy-sweep-x { from { transform: translateX(-34%); } to { transform: translateX(34%); } }
@media (prefers-reduced-motion: reduce) { .css-app .css-busy-overlay::before { animation: none; } }

/* ---- Sticker panel, simplified (2026-11-22): Shape tiles, size units on the heading,
   border width presets and colour dots ---- */
.css-app .css-subhead-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.css-app .css-units-mini { margin: 0; padding: 2px; border-radius: 8px; max-width: none; }
.css-app .css-units-mini .css-seg-btn { padding: 2px 9px; font-size: 11px; text-transform: none; letter-spacing: 0; }
.css-app .css-shape-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.css-app .css-shape-tile {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 8px 2px 7px;
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink-2);
    font: inherit;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
}
.css-app .css-shape-tile svg { width: 26px; height: 26px; }
.css-app .css-shape-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.css-app .css-shape-tile:hover { border-color: var(--css-accent); color: var(--css-ink); }
.css-app .css-shape-tile[aria-pressed="true"] {
    border-color: var(--css-accent);
    background: var(--css-accent-soft);
    box-shadow: inset 0 0 0 1px var(--css-accent);
    color: var(--css-accent-strong);
    font-weight: 600;
}
.css-app .css-shape-tile:focus-visible { outline: 2px solid var(--css-accent); outline-offset: 2px; }
.css-app .css-border-widths { margin-bottom: 8px; }
.css-app .css-border-colours { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.css-app .css-border-colours .css-row-label { margin-right: 2px; color: var(--css-ink-2); font-size: 12.5px; }
.css-app .css-colour-dot {
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--css-line);
    border-radius: 50%;
    cursor: pointer;
}
.css-app .css-colour-dot.is-white { background: #fff; }
.css-app .css-colour-dot.is-black { background: #111; border-color: #111; }
.css-app .css-colour-dot.is-any { background: conic-gradient(#e0505a, #f2c14e, #5bbf6a, #3f8fd8, #9a5bd6, #e0505a); }
.css-app .css-colour-dot.is-any[aria-checked="true"] { background: var(--dot, #2d5a43); }
.css-app .css-colour-dot[aria-checked="true"] { box-shadow: 0 0 0 2px var(--css-surface), 0 0 0 4px var(--css-accent); }
.css-app .css-colour-dot:focus-visible { outline: 2px solid var(--css-accent); outline-offset: 3px; }
.css-app .css-border-anycolour { margin-bottom: 8px; }
.css-app .css-more .css-length-row { margin-bottom: 4px; }
.css-app .css-qty-stepper { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 6px; margin-bottom: 8px; }
.css-app .css-qty-stepper .css-num-input { width: 100%; text-align: center; font-size: 15px; font-weight: 600; }
.css-app .css-qty-step {
    border: 1px solid var(--css-line);
    border-radius: var(--css-radius-s);
    background: var(--css-surface);
    color: var(--css-ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.css-app .css-qty-step:hover { border-color: var(--css-accent); color: var(--css-accent-strong); }
.css-app .css-qty-grid--flat { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.css-app .css-qty-grid--flat .css-qty-chip { padding: 6px 0; }
.css-app .css-qty-grid--flat .css-qty-chip strong { font-size: 13px; }

/* ------------------------------------------------------------------ */
/* Nav photo buttons (2026-11-25, owner: "make the words and buttons   */
/* one cohesive thing while still making the words legible"). Like the */
/* Edit panel's photo buttons: the photo is the button and its name    */
/* sits on a dark fade along the bottom. Desktop and tablet only:      */
/* the phone bottom bar is too small for words on photos.              */
/* ------------------------------------------------------------------ */
@media (min-width: 761px) {
    .css-app .css-nav-tile {
        position: relative;
        display: block;
        width: calc(var(--css-nav-img) + 20px);
        aspect-ratio: 1;
        margin: 3px auto;
        padding: 0;
        overflow: hidden;
        border-radius: 14px;
        background: #2a1d16;
        box-shadow: 0 1px 2px rgba(42, 29, 22, 0.14);
        isolation: isolate;
        transition: box-shadow 0.15s ease, transform 0.1s ease;
    }
    .css-app .css-nav-tile .css-nav-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        transition: transform 0.3s ease;
    }
    .css-app .css-nav-tile .css-nav-label {
        position: absolute;
        z-index: 1;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 16px 2px 5px;
        background: linear-gradient(to top, rgba(20, 13, 9, 0.9) 0%, rgba(20, 13, 9, 0.62) 50%, rgba(20, 13, 9, 0) 100%);
        color: #fff;
        font-size: 11.5px;
        font-weight: 650;
        letter-spacing: 0;
        line-height: 1.1;
        text-align: center;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
        white-space: nowrap;
    }
    .css-app .css-nav-tile:hover { background: #2a1d16; box-shadow: 0 0 0 2px var(--css-accent), var(--css-shadow); }
    .css-app .css-nav-tile:hover .css-nav-img { transform: scale(1.07); }
    .css-app .css-nav-tile:active { transform: scale(0.97); }
    .css-app .css-nav-tile:focus-visible { outline: 3px solid var(--css-accent); outline-offset: 2px; }
    /* The open panel: a brand-green ring and a green fade under the word. */
    .css-app .css-nav-tile.is-active { background: #2a1d16; box-shadow: 0 0 0 3px var(--css-accent); }
    .css-app .css-nav-tile.is-active .css-nav-img { box-shadow: none; }
    .css-app .css-nav-tile.is-active .css-nav-label {
        color: #fff;
        background: linear-gradient(to top, rgba(31, 66, 49, 0.95) 0%, rgba(31, 66, 49, 0.7) 50%, rgba(31, 66, 49, 0) 100%);
    }
    @media (prefers-reduced-motion: reduce) {
        .css-app .css-nav-tile, .css-app .css-nav-tile .css-nav-img { transition: none; }
    }
}

/* Each corner (owner, 2026-11-29): a small fold under Round corners with one slider per corner. */
.css-app .css-corner-each[hidden] { display: none; }
.css-app .css-corner-each > .css-slider-row + .css-slider-row { margin-top: var(--css-space-1, 4px); }
.css-app .css-corner-each-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 6px;
    color: var(--css-ink-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.css-app .css-corner-each-summary::-webkit-details-marker { display: none; }
.css-app .css-corner-each-summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}
.css-app .css-corner-each[open] > .css-corner-each-summary::before { transform: rotate(45deg); }
.css-app .css-corner-each-summary:hover { color: var(--css-accent-strong); }

/* Automatic tag suggestions under the share form's Tags box (2026-11-29). */
.css-share-hint { min-height: 1.2em; margin: -4px 0 0; color: var(--css-ink-2, #5b524b); font-size: 12px; }

/* Border and cut line outside the page (owner, 2026-11-29): a layer behind the page, drawn by
   drawOutsideLayer() in editor-fabric.js when the sticker reaches past the page (a page background). */
.css-app .css-outside-layer { position: absolute; z-index: 0; pointer-events: none; }
.css-app .css-stage > .css-canvas-frame { position: relative; z-index: 1; }

/* Sticker area (owner, 2026-11-29): "Resize sticker area" + "Whole page" under the Shape tiles. */
.css-app .css-area-row { display: flex; align-items: center; gap: var(--css-space-2, 8px); margin: 4px 0 2px; }
.css-app .css-area-row[hidden], .css-app .css-area-note[hidden] { display: none; }
.css-app .css-area-btn { padding: 7px 12px; font-size: 13px; }
.css-app .css-area-reset { white-space: nowrap; }

/* Art styles: face strength (2026-12-03). The switch, its slider and the "Move the face oval" button sit
   under the style's own sliders, set apart by a hairline. */
.css-style-face { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.css-style-face[hidden], .css-style-face [hidden] { display: none !important; }
.css-style-face-move { justify-self: start; }
.css-style-face-move[aria-pressed="true"] { background: var(--css-accent, #2f6b4f); color: #fff; border-color: transparent; }
.css-style-face-note { margin: 0; }

/* Outline what to keep (2026-12-03): the bar over the canvas while the outline is drawn. */
.css-outline-bar { position: absolute; z-index: 30; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); padding: 8px 10px 8px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); font-size: 14px; }
.css-outline-text { color: #2b2622; width: 100%; text-align: center; }
.css-outline-bar .css-btn { min-height: 36px; width: auto; flex: 0 0 auto; padding-left: 16px; padding-right: 16px; }
@media (max-width: 600px) { .css-outline-bar { top: 8px; font-size: 13px; padding: 8px; } .css-outline-text { width: 100%; text-align: center; } }
/* Outline: Keep / Remove brushes (2026-12-03, round 2). The pressed brush is filled in its colour. */
.css-outline-brush[aria-pressed="true"].css-outline-brush--keep { background: #2f8c5a; border-color: #2f8c5a; color: #fff; }
.css-outline-brush[aria-pressed="true"].css-outline-brush--drop { background: #e0505a; border-color: #e0505a; color: #fff; }

/* Cart in the editor's top bar (2026-12-03, owner: no way to reach the cart from the editor, no count). */
.css-app .css-topbar-actions { display: flex; align-items: center; gap: 6px; }
.css-app .css-topbar-cart { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--css-radius-s); color: var(--css-ink); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; border: 1px solid var(--css-line); }
.css-app .css-topbar-cart:hover { background: var(--css-surface-2); }
.css-app .css-topbar-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #2f6b4f; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.css-app .css-topbar-badge[hidden] { display: none; }
@media (max-width: 480px) { .css-app .css-topbar-cart-label { display: none; } }
/* Face strength round 2 (2026-12-03): find faces + face brush. */
.css-style-face-tools, .css-style-face-brushes { display: flex; flex-wrap: wrap; gap: 6px; }
.css-style-face-tools .css-btn, .css-style-face-brushes .css-btn { width: auto; flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
.css-style-face-brushes[hidden] { display: none !important; }
.css-style-face-brushes .css-panel-note { width: 100%; margin: 0; }
.css-style-face-paint[aria-pressed="true"], .css-style-face-add[aria-pressed="true"] { background: #e0505a; border-color: #e0505a; color: #fff; }
.css-style-face-remove[aria-pressed="true"] { background: #2b2622; border-color: #2b2622; color: #fff; }
