/* ── Lamina visualizer — styles ─────────────────────────────────────────
   Tokens first (light palette on :root, dark via prefers-color-scheme and
   an explicit data-theme stamp), then layout, then components.            */

:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --panel-2: #ecebe5;
  --panel-3: #e3e1da;
  --ink: #1d1c1a;
  --ink-2: #615d56;
  --ink-3: #8f8a81;
  --line: #e0ddd5;
  --line-2: #cfcbc1;
  --accent: #0e7c7b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 124, 123, 0.11);
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.06), 0 8px 24px rgba(30, 25, 15, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 25, 15, 0.18);
  --stage-bg: #d8dee4;
  --coach: rgba(20, 18, 14, 0.58);
  --font-display: 'Archivo', 'Archivo Narrow', 'Helvetica Neue', Arial, sans-serif;
  --font-ui: 'IBM Plex Sans', 'Segoe UI', Roboto, system-ui, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --topbar-h: 56px;
  --surfacebar-h: 48px;
  --catalog-w: 336px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161614;
    --panel: #1f1f1c;
    --panel-2: #292926;
    --panel-3: #33332f;
    --ink: #efece6;
    --ink-2: #a7a39a;
    --ink-3: #7d7971;
    --line: #34332f;
    --line-2: #45433e;
    --accent: #45b8b3;
    --accent-ink: #0a1817;
    --accent-soft: rgba(69, 184, 179, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
    --stage-bg: #0f1115;
    --coach: rgba(0, 0, 0, 0.66);
  }
}
:root[data-theme="dark"] {
  --bg: #161614;
  --panel: #1f1f1c;
  --panel-2: #292926;
  --panel-3: #33332f;
  --ink: #efece6;
  --ink-2: #a7a39a;
  --ink-3: #7d7971;
  --line: #34332f;
  --line-2: #45433e;
  --accent: #45b8b3;
  --accent-ink: #0a1817;
  --accent-soft: rgba(69, 184, 179, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --stage-bg: #0f1115;
  --coach: rgba(0, 0, 0, 0.66);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
img, canvas { display: block; max-width: 100%; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--panel-2); padding: 0.1em 0.4em; border-radius: 4px; }
kbd { background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 0.05em 0.45em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }
.ic { display: inline-flex; line-height: 0; }

/* ── Boot splash ─────────────────────────────────────────────────────── */
.boot { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 18px; background: var(--bg); }
.boot-mark { font-family: var(--font-display); font-stretch: 118%; font-weight: 700; letter-spacing: 0.28em; font-size: 22px; color: var(--ink); text-align: center; }
.boot-bar { width: 160px; height: 3px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 2px; animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }
.boot-error { color: #b42318; max-width: 360px; text-align: center; }

/* ── Brand ───────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-family: var(--font-display); font-stretch: 118%; font-weight: 700; letter-spacing: 0.26em; font-size: 15px; text-transform: uppercase; }
.brand-sub { font-family: var(--font-display); font-weight: 500; color: var(--ink-2); letter-spacing: 0.04em; font-size: 13px; }

/* ── Buttons & chips ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--panel-2); filter: none; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn.small { width: 30px; height: 30px; }
.chips { display: flex; gap: 6px; align-items: center; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroll-x { overflow-x: auto; scrollbar-width: none; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); gap: 2px; }
.seg-btn { border: 0; background: transparent; color: var(--ink-2); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.seg-btn.dim:not(.on) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-muted { color: var(--ink-3); font-weight: 500; font-size: 0.85em; margin-left: 4px; font-variant-numeric: tabular-nums; }
.tag { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.empty { color: var(--ink-2); padding: 18px 4px; }
.empty[data-reason="availability"] { display: grid; gap: 4px; padding: 16px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); font-size: 13px; }
.empty[data-reason="availability"] b { color: var(--ink); font-weight: 600; }
.empty[data-reason="availability"] .ic { color: var(--ink-3); margin-bottom: 2px; }
/* A search that matched nothing here but found designs in other rooms/areas:
   each hit is a shortcut that opens the room and applies the design. */
.empty[data-reason="filter"]:has(.empty-hits) { display: grid; gap: 4px; padding: 16px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 13px; }
.empty[data-reason="filter"] b { color: var(--ink); font-weight: 600; }
.empty[data-reason="filter"] .ic { color: var(--ink-3); margin-bottom: 2px; }
.empty-hits { display: grid; gap: 6px; margin-top: 8px; }
.empty-hit { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.empty-hit:hover:not(:disabled) { border-color: var(--accent); }
.empty-hit:disabled { opacity: 0.55; cursor: default; }
.empty-hit .hit-name { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-hit .hit-where { margin-left: auto; font-size: 11px; color: var(--accent); white-space: nowrap; }

/* ── Landing ─────────────────────────────────────────────────────────── */
.landing { max-width: 1180px; margin: 0 auto; padding: 22px 28px 40px; min-height: 100%; display: flex; flex-direction: column; gap: 48px; }
.landing-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.landing-nav { display: flex; align-items: center; gap: 22px; }
.nav-link { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 13.5px; }
.nav-link:hover { color: var(--ink); }
.hero { max-width: 66ch; display: grid; gap: 12px; padding-top: 30px; }
.eyebrow { margin: 0; font-family: var(--font-display); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.06; letter-spacing: -0.018em; text-wrap: balance; }
.lede { margin: 4px 0 0; font-size: 16px; color: var(--ink-2); max-width: 60ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.section-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 64ch; }
.tabs { display: inline-flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.room-card {
  display: grid; gap: 0; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.room-thumb { aspect-ratio: 16 / 10; background: var(--panel-2); position: relative; display: grid; place-items: center; overflow: hidden; }
.room-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.6s ease-in-out infinite; }
.room-thumb.ready::after, .room-thumb:has(img.ready)::after { display: none; }
@keyframes shimmer { to { transform: translateX(100%); } }
.room-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.room-thumb img.ready { opacity: 1; }
.room-meta { padding: 14px 16px 16px; display: grid; gap: 4px; }
.room-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.room-meta h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.room-meta p { margin: 0; color: var(--ink-2); font-size: 13px; }
.room-count { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.room-count svg { width: 16px; height: 16px; }

.featured-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.featured-card {
  display: grid; gap: 6px; padding: 8px 8px 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.featured-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.featured-swatch { width: 100%; aspect-ratio: 1; height: auto; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.featured-name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.featured-id { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Where a searched design can be applied (shown only in search results). */
.featured-where { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Landing-page catalogue search */
.find-search { min-width: 260px; flex: 0 1 340px; }
.find-status { margin: -8px 0 14px; font-size: 13px; color: var(--ink-2); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: grid; gap: 6px; align-content: start; }
.step-n { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.step h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.step p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.stat { padding: 18px 22px; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-n { font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-l { color: var(--ink-2); font-size: 13px; }

.landing-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-right { display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.admin-link { color: var(--ink-3); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.admin-link:hover { color: var(--ink); border-bottom-color: var(--ink-3); }

/* ── App frame ───────────────────────────────────────────────────────── */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: var(--topbar-h) var(--surfacebar-h) 1fr; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 8px 6px 4px; border-radius: 8px; cursor: pointer; }
.brand-btn:hover { background: var(--panel-2); }
.brand-btn .ic { color: var(--ink-2); }
.room-switch { position: relative; }
.room-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); padding: 7px 10px 7px 14px; border-radius: 999px; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.room-btn:hover { background: var(--panel-2); }
.menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 20; display: grid; }
.menu-item { display: grid; text-align: left; gap: 1px; padding: 9px 12px; border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer; }
.menu-item:hover { background: var(--panel-2); }
.menu-item.on { background: var(--accent-soft); }
.menu-item.back { border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: var(--ink-2); }
.menu-item.back .menu-name { display: inline-flex; align-items: center; gap: 8px; }
.menu-name { font-weight: 600; }
.menu-sub { font-size: 12px; color: var(--ink-3); text-transform: capitalize; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.surfacebar { display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
.surfacebar .label { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.surfacebar .chips { flex: 1; min-width: 0; }
.surface-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.catalog-toggle { display: none; }

.workspace { display: grid; grid-template-columns: var(--catalog-w) 1fr; min-height: 0; }

/* ── Catalogue ───────────────────────────────────────────────────────── */
.catalog { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 8px; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; min-width: 0; }
.catalog > :not(.swatches) { flex: none; }   /* only the swatch grid may shrink/scroll */
.catalog-head { display: grid; gap: 8px; }
.catalog-head h2 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.catalog-sub { margin: -4px 0 0; color: var(--ink-2); font-size: 12.5px; }
.catalog-sub b { color: var(--accent); font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink-3); }
.search input { flex: 1; border: 0; background: transparent; padding: 8px 0; color: var(--ink); outline: none; min-width: 0; }
.search:focus-within { border-color: var(--accent); color: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px 10px; overflow-y: auto; padding: 2px 2px 12px; min-height: 0; align-content: start; scrollbar-width: thin; }
.swatch-card { position: relative; display: grid; gap: 3px; }
.swatch-btn { padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius-sm); position: relative; }
.swatch-img { width: 100%; aspect-ratio: 1; height: auto; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); transition: transform 0.15s ease; object-fit: cover; }
.swatch-btn:hover .swatch-img { transform: scale(1.03); }
.swatch-card.applied .swatch-img { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.applied-badge { position: absolute; left: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: none; place-items: center; }
.applied-badge svg { width: 14px; height: 14px; }
.swatch-card.applied .applied-badge { display: grid; }
.heart-btn { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.9); color: #4b4741; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.heart-btn svg { width: 15px; height: 15px; }
.swatch-card:hover .heart-btn, .heart-btn.on, .heart-btn:focus-visible { opacity: 1; }
.heart-btn.on { color: #c8323b; }
.swatch-name { font-size: 12.5px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-id { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── Stage ───────────────────────────────────────────────────────────── */
.stage { position: relative; min-width: 0; min-height: 0; background: var(--stage-bg); overflow: hidden; }
.canvas-host { position: absolute; inset: 0; }
.canvas-host canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.canvas-host canvas:active { cursor: grabbing; }
.hover-label { position: absolute; left: 0; top: 0; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 3; }
.loading { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-2); background: var(--stage-bg); }
.loading-bar { width: 140px; height: 3px; background: color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 2px; overflow: hidden; }
.loading-bar span { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 2px; animation: boot 1.1s ease-in-out infinite; }
.toolbar { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.tool { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: background 0.15s, color 0.15s; }
.tool:hover { color: var(--ink); background: var(--panel-2); }
.tool.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tool svg { width: 20px; height: 20px; }
.applied-strip { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 3; max-width: min(440px, calc(100% - 90px)); }
.applied-strip:empty { display: none; }
.applied-swatch { width: 44px; height: 44px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); object-fit: cover; }
.applied-text { display: grid; line-height: 1.25; min-width: 0; }
.applied-surface { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.applied-design { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.applied-meta { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); background: color-mix(in srgb, var(--panel) 78%, transparent); padding: 5px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; z-index: 2; backdrop-filter: blur(6px); transition: background 0.2s, color 0.2s; }
.hint.look { color: var(--ink); background: color-mix(in srgb, var(--accent) 16%, color-mix(in srgb, var(--panel) 80%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ── Coach overlay ───────────────────────────────────────────────────── */
.coach { position: fixed; inset: 0; z-index: 40; background: var(--coach); opacity: 0; transition: opacity 0.25s; cursor: pointer; }
.coach.on { opacity: 1; }
.callout { position: absolute; width: 280px; background: var(--panel); color: var(--ink); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: grid; gap: 4px; }
.callout::before { content: ''; position: absolute; left: -8px; top: 18px; border: 8px solid transparent; border-right-color: var(--panel); border-left: 0; }
.callout-step { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.callout p { margin: 0; font-size: 13.5px; }
.coach-dismiss { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); color: #fff; font-size: 13px; opacity: 0.8; margin: 0; }

/* ── Modals & toasts ─────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 10, 8, 0.5); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity 0.2s; }
.modal-backdrop.on { opacity: 1; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; transform: translateY(6px); transition: transform 0.2s; }
.modal-backdrop.on .modal { transform: none; }
.modal.wide { width: min(840px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.shortlist-grid { display: grid; gap: 10px; }
.sl-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.sl-swatch { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.sl-text { display: grid; gap: 2px; }
.sl-text span { color: var(--ink-3); font-size: 12px; }
.sl-actions { display: flex; align-items: center; gap: 6px; }
.snap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.snap-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.snap-side h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 15px; }
.snap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.snap-list li { display: grid; gap: 2px; }
.snap-surface { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.snap-design { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.help-tips { margin: 16px 0 0; color: var(--ink-2); font-size: 12.5px; }
.quality { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.quality-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quality-head b { font-weight: 600; }
.quality-note { margin: 0; color: var(--ink-3); font-size: 12px; }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; white-space: nowrap; }
.toast.on { opacity: 1; transform: none; }
.toast-ic { display: inline-flex; color: var(--accent); }
.toast-ic svg { width: 16px; height: 16px; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .landing { padding: 16px 16px 32px; gap: 36px; }
  .landing-nav .nav-link { display: none; }
  .hero { padding-top: 14px; }
  .section-head { margin-bottom: 14px; }
  .featured-list { display: flex; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; }
  .featured-card { flex: 0 0 132px; scroll-snap-align: start; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(-n + 2) { border-top: 0; }
  .stat:nth-child(2n) { border-left: 1px solid var(--line); }
  .stat-n { font-size: 24px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .catalog { order: 2; border-right: 0; border-top: 1px solid var(--line); max-height: 48vh; transition: max-height 0.3s ease; gap: 10px; padding-top: 10px; }
  .catalog-sub { display: none; }
  .chips.wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips.wrap::-webkit-scrollbar { display: none; }
  .app.catalog-collapsed .catalog { max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-top: 0; }
  .stage { order: 1; }
  .catalog-toggle { display: inline-flex; }
  .surfacebar .label { display: none; }
  .hint { display: none; }
  .applied-strip { max-width: calc(100% - 80px); }
  .snap { grid-template-columns: 1fr; }
  .topbar-right .btn span:not(.ic) { display: none; }
  .topbar-right .btn { padding: 6px 10px; }
  .brand-btn .brand-mark { display: none; }
  .sl-item { grid-template-columns: 56px 1fr; }
  .sl-swatch { width: 56px; height: 56px; }
  .sl-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .quality-head { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
