/* Brix: the manual's paper on a drafting table (see the design language near the end). Big, plain, high-contrast type for people who find paper manuals hard.

   Type: Atkinson Hyperlegible Next, drawn by the Braille Institute for low-vision readers (letters that are easy to
   tell apart: I l 1, O 0, b d). One family in three weights, used with real contrast: 400 to read, 700 to press,
   800 for the few headings. Hosted with the app (SIL Open Font License) so it works offline. Scripts it doesn't
   cover (Chinese, Korean, Japanese, Hindi, Arabic, and Vietnamese tone marks) use the system fonts.

   Colour: cutting-mat green means "do this" (buttons, the current step, the part being placed). Everything else is
   cool greys and a dark slate top bar, so the green is never decoration. Yellow is only the keyboard focus ring and
   the current tab. */
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/vendor/fonts/atkinson-hyperlegible-next-latin-ext-400.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/vendor/fonts/atkinson-hyperlegible-next-latin-ext-700.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/vendor/fonts/atkinson-hyperlegible-next-latin-ext-800.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/vendor/fonts/atkinson-hyperlegible-next-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/vendor/fonts/atkinson-hyperlegible-next-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/vendor/fonts/atkinson-hyperlegible-next-latin-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #e8edf0;
  --surface: #ffffff;
  --surface-2: #f0f4f6;
  --surface-3: #dce3e7;
  --text: #0f171b;
  --muted: #47565e;
  --border: #c5d0d6;
  --line: #0f171b;            /* the 2px outline on buttons you can press */
  --brand: #1b2a32;           /* the top bar: dark slate, so green only ever means "do this" */
  --brand-ink: #ffffff;
  --accent: #0e5a42;          /* "do this": primary buttons, the current step */
  --accent-strong: #08452f;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe5;
  --accent-text: #0a4a35;
  --glow: #17b26a;            /* the part being placed, in 3D and in the lists */
  --glow-soft: #d3f4e2;
  --glow-ink: #0a5332;
  --mark: #ffd21f;            /* focus ring and current tab only */
  --warn: #8a4500;
  --warn-soft: #fff1dc;
  --warn-border: #eec58b;
  --tip: #1d5878;
  --tip-soft: #e2eff7;
  --tip-border: #a7cde2;
  --danger: #b3261e;
  --ok: #187a45;
  /* the 3D diagram is always on a light stage */
  --viewer-top: #f1f4f6;
  --viewer-bottom: #f1f4f6;
  --shadow-sm: none;
  /* only things that float over something else get a shadow */
  --shadow: 0 1px 0 rgba(15, 23, 27, 0.06), 0 14px 32px -14px rgba(15, 23, 27, 0.4);
  --radius: 14px;             /* panels */
  --radius-sm: 10px;          /* buttons, inputs */
  --radius-tag: 8px;          /* chips and small tags */
  --mono: var(--font);
  --topbar-h: 64px;
  --font: 'Atkinson Hyperlegible Next', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', system-ui, 'Segoe UI', Roboto,
    'PingFang SC', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans Devanagari', 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  color-scheme: light;
}
/* Vietnamese tone marks aren't in the font; one system font for the whole text reads better than two mixed */
:root:lang(vi) { --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, sans-serif; }

:root[data-theme='dark'] {
  --bg: #0d1316;
  --surface: #162024;
  --surface-2: #1d292e;
  --surface-3: #283539;
  --text: #eef3f5;
  --muted: #a7b5bc;
  --border: #2f3d43;
  --line: #c9d4d9;
  --brand: #1c2930;
  --brand-ink: #eef3f5;
  --accent: #34c785;
  --accent-strong: #5ad89f;
  --accent-ink: #04150d;
  --accent-soft: #143528;
  --accent-text: #7fe3b4;
  --glow: #2fd481;
  --glow-soft: #12382a;
  --glow-ink: #8ff0c0;
  --warn: #f3b46a;
  --warn-soft: #36291a;
  --warn-border: #6b4f2c;
  --tip: #9bcbe6;
  --tip-soft: #1a2c37;
  --tip-border: #36566a;
  --danger: #ff9c8f;
  --ok: #79d6a0;
  --viewer-top: #f1f4f6;
  --viewer-bottom: #f1f4f6;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 34px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
svg { flex-shrink: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 3px;
}
.skip-link:focus { top: 10px; }
.muted { color: var(--muted); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  border-radius: 3px; border: 1px solid transparent;
  font-weight: 500; font-size: 1rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, opacity 0.15s;
  text-decoration: none;
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:not(:disabled):hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-lg { min-height: 58px; font-size: 1.1rem; padding: 0 28px; }
.btn-block { width: 100%; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 8px 10px; margin: -8px -10px;
  color: var(--muted); font-weight: 500; cursor: pointer; text-decoration: none; border-radius: 3px;
}
.link-btn svg { width: 20px; height: 20px; }
.link-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 1.2rem; }
.lang-picker {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--muted);
  padding: 4px 6px 4px 10px; transition: background 0.15s, color 0.15s;
}
.lang-picker svg { width: 20px; height: 20px; fill: var(--muted); }
.lang-picker select {
  border: 0; background: transparent; font-weight: 500; padding: 6px 4px; cursor: pointer; max-width: 9.5em;
}
.lang-picker select:focus-visible { outline: none; }
.lang-picker:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- home */
.screen-home { max-width: 1160px; margin: 0 auto; padding: 40px 16px 64px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -0.015em; }
.lede { margin-top: 18px; font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.feature-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.feature-icon {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
}
.upload-card { padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.95rem;
}
.dropzone {
  border: 2.5px dashed var(--border); border-radius: var(--radius);
  padding: 30px 18px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dz-icon { width: 52px; height: 52px; color: var(--accent); }
.dz-title { font-size: 1.3rem; font-weight: 500; margin-top: 6px; }
.dz-hint { color: var(--muted); margin-top: 2px; }
.dz-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.file-list:empty { display: none; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.file-thumb {
  width: 44px; height: 44px; border-radius: 3px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-3); display: grid; place-items: center; font-size: 0.75rem; font-weight: 500; color: var(--muted);
}
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 0.85rem; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.library { margin-top: 56px; }
.library h2 { font-size: 1.4rem; }
.guide-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.guide-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.guide-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.guide-card h3 { font-size: 1.15rem; padding-right: 36px; }
.guide-card p { color: var(--muted); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.guide-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-tag);
  background: var(--surface-2); font-size: 0.85rem; font-weight: 500; color: var(--muted);
}
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
.pill-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.guide-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.guide-progress > div { height: 100%; background: var(--accent); border-radius: 3px; }
.card-menu { position: absolute; top: 10px; right: 10px; }
[dir='rtl'] .card-menu { right: auto; left: 10px; }
[dir='rtl'] .guide-card h3 { padding-right: 0; padding-left: 36px; }
.menu {
  position: absolute; top: 44px; right: 0; z-index: 5; min-width: 170px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: grid;
}
[dir='rtl'] .menu { right: auto; left: 0; }
.menu button {
  text-align: start; background: none; border: 0; padding: 10px 12px; border-radius: 3px; cursor: pointer; font-weight: 500;
}
.menu button:hover { background: var(--surface-2); }
.menu .danger { color: var(--danger); }
.empty-note { color: var(--muted); }

/* ---------------------------------------------------------------- processing */
.screen-processing { display: grid; place-items: center; padding: 40px 16px; min-height: calc(100dvh - var(--topbar-h)); }
.processing { width: min(560px, 100%); padding: 34px 28px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.processing h1 { font-size: 1.7rem; }
.build-anim { position: relative; width: 84px; height: 84px; margin-bottom: 6px; }
.build-anim span {
  position: absolute; width: 36px; height: 36px; border-radius: 3px; background: var(--accent);
  animation: stack 2.4s ease-in-out infinite;
}
.build-anim span:nth-child(1) { left: 4px; top: 44px; }
.build-anim span:nth-child(2) { left: 44px; top: 44px; background: var(--accent-strong); animation-delay: 0.3s; }
.build-anim span:nth-child(3) { left: 4px; top: 4px; background: var(--glow); animation-delay: 0.6s; }
.build-anim span:nth-child(4) { left: 44px; top: 4px; background: var(--tip); animation-delay: 0.9s; }
@keyframes stack {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  40% { transform: translateY(-10px) scale(0.92); opacity: 0.55; }
}
.stages { list-style: none; padding: 0; margin: 10px 0 0; width: 100%; display: grid; gap: 4px; text-align: start; }
.stages li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; transition: background 0.2s, color 0.2s;
}
.stage-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border); flex-shrink: 0;
  display: grid; place-items: center;
}
.stages li.is-active { background: var(--accent-soft); color: var(--text); }
.stages li.is-active .stage-dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.stages li.is-done { color: var(--text); }
.stages li.is-done .stage-dot { background: var(--ok); border-color: var(--ok); }
.stages li.is-done .stage-dot::after { content: ''; width: 9px; height: 5px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.stage-count { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--accent-text); }
@keyframes spin { to { transform: rotate(360deg); } }
.thought {
  min-height: 3em; font-style: italic; color: var(--muted); font-size: 0.92rem; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.elapsed { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.proc-error { width: 100%; background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-radius: var(--radius-sm); padding: 18px; display: grid; gap: 10px; justify-items: center; }
.proc-error h2 { font-size: 1.2rem; color: var(--danger); }

/* ---------------------------------------------------------------- guide
   The 3D view fills the screen; the instructions float in a text box inside it; the steps are a row of
   rectangles right below it; one slim bar at the bottom. */
.screen-guide {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: 'stage' 'strip' 'bar';
  height: calc(100dvh - var(--topbar-h));
}
.stage-area { grid-area: stage; position: relative; min-height: 0; overflow: hidden; background: var(--viewer-top); }
.step-card {
  grid-area: stage; z-index: 3; align-self: start; justify-self: start;
  margin: 16px; width: min(400px, 40%); max-height: calc(100% - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.step-card .panel-body { padding: 18px 20px 20px; }
.step-strip { grid-area: strip; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 0; min-width: 0; }
.guide-bar {
  grid-area: bar; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-width: 0;
  padding: 8px 16px max(8px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
}
.guide-bar .link-btn { margin: 0; padding: 8px 6px; white-space: nowrap; }
.bar-spacer { flex: 1; }
.viewer { position: absolute; inset: 0; touch-action: none; }
.viewer-canvas { display: block; width: 100%; height: 100%; }
.viewer-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.callout-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.callout-lines path { fill: none; stroke: #46545c; stroke-width: 1.5; stroke-linejoin: round; opacity: 0.85; }
.callout-lines circle { fill: #ffffff; stroke: #46545c; stroke-width: 2; }
.callout-lines .is-current { stroke: var(--glow); opacity: 1; }
.callout-lines path.is-current { stroke-width: 2; }
.callout-lines circle.is-current { fill: var(--glow); stroke: #ffffff; }
/* the 3D stage is always white, so labels use fixed light colours in both themes */
.part-label {
  position: absolute; left: 0; top: 0; visibility: hidden; will-change: transform;
  display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; max-width: 42%;
  background: #ffffff; color: #0f171b; border: 2px solid #c5d0d6;
  border-radius: var(--radius-tag); font-size: 0.85rem; font-weight: 500; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.pl-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-count { display: none; color: #0a5332; font-weight: 500; }
.part-label.has-count .pl-count { display: inline; }
.part-label.is-current { border-color: var(--glow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 30%, transparent); }
.pl-id {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0;
  background: #0f171b; color: #ffffff; font-size: 0.78rem; font-weight: 700;
}
@media (max-width: 560px) { .part-label { font-size: 0.78rem; padding-inline-end: 8px; } .pl-id { min-width: 22px; height: 22px; } }
.part-label.is-current .pl-id { background: #0e5a42; color: #ffffff; }

.viewer-top {
  position: absolute; z-index: 3; top: 16px; inset-inline-end: 16px; max-width: calc(60% - 40px);
  display: flex; justify-content: flex-end; align-items: flex-start; gap: 8px; flex-wrap: wrap; pointer-events: none;
}
.viewer-top > * { pointer-events: auto; }
.legend, .chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 3px; font-size: 0.88rem; font-weight: 500;
}
.glow-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 30%, transparent); }
.view-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip-btn { cursor: pointer; color: var(--text); }
.chip-btn svg { width: 18px; height: 18px; fill: currentColor; }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip-btn.icon-only { width: 40px; padding: 0; justify-content: center; }
.explode-ctl input[type='range'] { width: 90px; accent-color: var(--accent); }
.viewer-hint {
  position: absolute; left: 60%; transform: translateX(-50%); bottom: 72px;
  font-size: 0.85rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent);
  padding: 4px 12px; border-radius: var(--radius-tag); white-space: nowrap; pointer-events: none;
  transition: opacity 0.6s;
}
.viewer-hint.is-faded { opacity: 0; }

#btn-play .icon-play { display: none; }
#btn-play.is-paused .icon-play { display: block; }
#btn-play.is-paused .icon-pause { display: none; }
[dir='rtl'] .link-btn svg { transform: scaleX(-1); }
[dir='rtl'] #btn-play svg, [dir='rtl'] #btn-replay svg { transform: none; }

.part-card {
  position: absolute; z-index: 4; width: 270px; padding: 16px; display: grid; gap: 10px;
}
.part-card header { display: flex; align-items: center; gap: 10px; }
.part-card h2 { font-size: 1.1rem; flex: 1; margin: 0; }
.part-card .swatch { width: 30px; height: 30px; }
.part-card .icon-btn { margin: -6px -6px -6px 0; }
.part-card .facts { display: grid; gap: 2px; color: var(--muted); font-size: 0.95rem; }
.part-card .ask-part-btn { justify-self: start; margin-inline-start: -10px; color: var(--accent); }
.part-card .ask-part-btn svg { width: 20px; height: 20px; }

.toggles { display: flex; gap: 8px; }
.toggle-icon { width: 44px; padding: 0; }
.toggle-icon svg { width: 20px; height: 20px; }
.toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px;
  border-radius: 4px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; font-size: 0.85rem;
}
.toggle svg { width: 18px; height: 18px; }
.toggle:hover { border-color: var(--accent); }
.toggle[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.mic-status, .translate-status {
  margin: 10px 22px 0; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.92rem;
  background: var(--surface-2); display: flex; align-items: center; gap: 10px;
}
.mic-status .live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse-red 1.2s infinite; flex-shrink: 0; }
@keyframes pulse-red { 50% { opacity: 0.35; } }
.mic-status .heard { color: var(--muted); margin-inline-start: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.mic-status.is-hit { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); }
.spinner { width: 16px; height: 16px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

.panel-body { display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-weight: 500; color: var(--muted); font-size: 0.9rem; }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-badge {
  width: 46px; height: 46px; border-radius: 4px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 500; font-size: 1.35rem;
}
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s; }
.step-title { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.instruction { font-size: 1.15rem; line-height: 1.5; }
.facts-line { color: var(--muted); font-size: 0.95rem; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1.5px solid; }
.callout svg { width: 24px; height: 24px; margin-top: 2px; }
.callout b { display: block; margin-bottom: 2px; }
.callout.warn { background: var(--warn-soft); border-color: var(--warn-border); }
.callout.warn svg, .callout.warn b { color: var(--warn); }
.callout.tip { background: var(--tip-soft); border-color: var(--tip-border); }
.callout.tip svg, .callout.tip b { color: var(--tip); }
.section-title { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 3px;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.is-current { border-color: var(--glow); background: var(--glow-soft); }
.chip-qty { font-variant-numeric: tabular-nums; }
.chip-id { color: var(--muted); font-weight: 400; }
.chip.tool { padding: 6px 14px; cursor: default; }
.chip.tool:hover { border-color: var(--border); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); flex-shrink: 0; }
.page-ref { color: var(--muted); font-size: 0.95rem; }

.parts-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.parts-check label {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer; border: 1.5px solid transparent;
}
.parts-check label:hover { border-color: var(--border); }
.parts-check input { width: 22px; height: 22px; accent-color: var(--ok); flex-shrink: 0; }
.parts-check .p-id { font-weight: 500; min-width: 2.2em; }
.parts-check .p-name { flex: 1; }
.parts-check .p-qty { font-weight: 500; font-variant-numeric: tabular-nums; }
.parts-check input:checked ~ .p-name { text-decoration: line-through; color: var(--muted); }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.overview-actions { display: grid; gap: 10px; }

.done { text-align: center; display: grid; gap: 14px; justify-items: center; padding-top: 24px; }
.done-icon {
  width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text);
}
.done-icon svg { width: 44px; height: 44px; stroke-width: 2.4; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.done h2 { font-size: 2rem; }

.step-dots {
  display: flex; align-items: center; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; overscroll-behavior-x: contain; margin: 0;
  /* the first and last boxes can sit in the middle too */
  padding: 16px calc(50% - 80px) 20px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%, #000 76%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 24%, #000 76%, transparent 100%);
}
.step-dots::-webkit-scrollbar { display: none; }
.step-dot {
  position: relative; flex: 0 0 auto; width: 160px; height: 200px; padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  scroll-snap-align: center; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transform: scale(calc(1 - var(--d, 0) * 0.08)); transition: transform 0.35s ease, background 0.2s, border-color 0.2s;
}
.step-dot:hover { border-color: var(--accent); }
.step-dot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sd-num { min-width: 1.5em; text-align: center; font-size: 3.4rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; display: grid; place-items: center; }
.sd-num svg { width: 40px; height: 40px; }
.sd-label { font-size: 0.95rem; font-weight: 500; opacity: 0.8; }
.sd-title {
  font-size: 0.95rem; font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.step-dot.is-icon { width: 160px; }
.step-dot.is-done { background: var(--accent-soft); border-color: transparent; }
.step-dot.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: scale(1.04); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }

/* settings dialog */
.settings-dialog { width: min(460px, calc(100% - 32px)); }
.share-inner.settings-inner { justify-items: stretch; text-align: start; gap: 20px; }
.share-inner.settings-inner h2 { text-align: center; }
.settings-group { display: grid; }
.settings-group h3 { margin: 0 0 2px; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--border); font-weight: 500; font-size: 1.02rem; cursor: pointer;
}
.setting-row select {
  min-height: 46px; min-width: 150px; max-width: 60%; padding: 0 12px; border-radius: 4px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
}
.setting-check input { width: 26px; height: 26px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.kbd-help { margin: 6px 0 0; font-size: 0.95rem; color: var(--muted); }
@media (pointer: coarse) { .kbd-group { display: none; } }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--surface); padding: 12px 20px; border-radius: var(--radius-tag);
  font-weight: 500; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
  animation: toast-in 0.25s ease-out;
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }
.toast.has-action { display: flex; align-items: center; gap: 14px; padding-inline-end: 8px; }
.toast-action {
  border: 0; border-radius: var(--radius-tag); padding: 8px 14px; min-height: 40px; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 18%, transparent); color: inherit; font: inherit; font-weight: 500;
}
.toast-action:hover { background: color-mix(in srgb, var(--surface) 28%, transparent); }
.noscript { padding: 40px; text-align: center; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .screen-home { padding-top: 28px; }
}

@media (max-width: 860px) {
  body { font-size: 1.0625rem; }
  /* 3D view, then the steps, then the instructions, then the bar */
  .screen-guide {
    height: auto; grid-template-rows: min(54vh, 520px) auto auto auto;
    grid-template-areas: 'stage' 'strip' 'card' 'bar';
  }
  .stage-area { min-height: 320px; scroll-margin-top: var(--topbar-h); }
  .step-card { grid-area: card; margin: 0; width: auto; max-height: none; overflow: visible; justify-self: stretch; border: 0; border-radius: 0; box-shadow: none; }
  .step-card .panel-body { padding: 18px 16px 24px; }
  .viewer-top { max-width: calc(100% - 32px); top: 10px; inset-inline-end: 10px; }
  .step-dots { padding-inline: calc(50% - 62px); gap: 10px; }
  .step-dot, .step-dot.is-icon { width: 124px; height: 156px; }
  .sd-num { font-size: 2.6rem; }
  .viewer-hint { display: none; }
  .legend { display: none; }
  .viewer-top { left: 10px; right: 10px; top: 10px; }
  .step-title { font-size: 1.45rem; }
  .instruction { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .explode-ctl span { display: none; }
  .chip-btn span { display: none; }
  .chip-btn { padding: 0 10px; }
  .toggle { font-size: 0.88rem; padding: 0 8px; gap: 6px; }
  .toggle svg { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.guide-card-wrap { position: relative; display: flex; }
.guide-card-wrap.is-filtered { display: none; }
.library-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.library-head h2 { margin: 0; }
.guide-search {
  flex: 0 1 300px; min-width: 0; min-height: 44px; padding: 0 16px; border-radius: var(--radius-tag);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.guide-search:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.guide-card-wrap > .guide-card { flex: 1; }


/* close-up inset (rendered into the canvas by the viewer; this is just its frame) */
.detail-frame {
  position: absolute; pointer-events: none; border-radius: 3px;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border), var(--shadow);
}
.detail-chip {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: var(--radius-tag); background: var(--surface); color: var(--text);
  font-size: 0.8rem; font-weight: 500; box-shadow: var(--shadow-sm); border: 0; cursor: default; pointer-events: none;
}
/* window controls: minimise / enlarge in the top corner, a drag grip in the bottom one */
.detail-controls { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; pointer-events: auto; }
.detail-btn, .detail-resize {
  width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: background 0.15s;
}
.detail-btn:hover, .detail-resize:hover { background: var(--surface-2); }
.detail-btn svg, .detail-resize svg { width: 16px; height: 16px; }
.detail-resize { position: absolute; right: 4px; bottom: 4px; pointer-events: auto; cursor: nwse-resize; touch-action: none; }
.detail-frame.is-resizing { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--glow), var(--shadow); }
/* minimised: only the "Close-up" tab is left, and tapping it brings the window back */
.detail-frame.is-min { width: auto; height: auto; box-shadow: none; }
.detail-frame.is-min .detail-controls, .detail-frame.is-min .detail-resize { display: none; }
.detail-frame.is-min .detail-chip { position: static; pointer-events: auto; cursor: pointer; box-shadow: 0 0 0 1px var(--border), var(--shadow-sm); padding: 6px 12px 6px 10px; }
.detail-chip svg { width: 15px; height: 15px; }

/* helper: questions + photo check */
.help-card { display: grid; gap: 10px; padding: 4px 16px; border-radius: var(--radius); background: var(--surface-2); margin-top: 4px; }
.help-card[open] { padding-bottom: 16px; }
.help-card:not([open]) { display: block; }
.help-summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer;
  font-weight: 500; font-size: 1.02rem; border-radius: 4px;
}
.help-summary::-webkit-details-marker { display: none; }
.help-summary svg { width: 22px; height: 22px; flex-shrink: 0; }
.help-summary::after {
  content: ''; margin-inline-start: auto; width: 9px; height: 9px; margin-top: -4px;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); transition: transform 0.2s;
}
.help-card[open] > .help-summary::after { transform: rotate(-135deg); margin-top: 4px; }
.help-summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.help-card .section-title { margin-bottom: 0; }
.ask-form { display: flex; gap: 6px; align-items: center; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-tag); padding: 4px 4px 4px 14px; }
.ask-form:focus-within { border-color: var(--accent); }
.ask-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; font-size: 1rem; }
.ask-form input:focus { outline: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.95rem; }
.mic-btn.is-recording { background: var(--danger); color: #fff; animation: pulse-red 1.2s infinite; }
.qa-log { display: grid; gap: 10px; }
.qa { display: grid; gap: 4px; }
.qa p { font-size: 1.02rem; }
.qa b { display: inline-block; margin-inline-end: 6px; color: var(--muted); font-size: 0.85rem; }
.qa .a { background: var(--surface); border-radius: 4px; padding: 10px 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.qa .a.is-error { color: var(--danger); }
.help-card .btn svg { width: 22px; height: 22px; }
.small { font-size: 0.88rem; }
.check-result { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); }
.check-result img { width: 64px; height: 64px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.check-result b { display: flex; align-items: center; gap: 6px; }
.check-result b svg { width: 22px; height: 22px; }
.check-result.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.check-result.ok b { color: var(--ok); }
.check-result.warn { border-color: var(--warn-border); background: var(--warn-soft); }
.check-result.warn b { color: var(--warn); }
.check-result.tip { border-color: var(--tip-border); background: var(--tip-soft); }
.check-result.is-pending { align-items: center; color: var(--muted); }

/* larger text (topbar toggle) */
.topbar-actions { display: flex; align-items: center; }

/* how it works + footer */
.how { margin-top: 64px; }
.how h2 { font-size: 1.4rem; margin-bottom: 16px; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: grid; gap: 8px; align-content: start; }
.how-num { width: 36px; height: 36px; border-radius: 3px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.how-steps h3 { font-size: 1.1rem; }
.how-steps p { color: var(--muted); }
.site-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) { .how-steps { grid-template-columns: 1fr; } }


.share-export { display: grid; justify-items: center; gap: 2px; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--border); text-align: center; }
.share-export .btn svg { width: 20px; height: 20px; }
.link-btn:disabled { opacity: 0.5; cursor: wait; }

/* home: live demo band */
.demo { margin-top: 48px; display: grid; grid-template-columns: 1.25fr 1fr; overflow: hidden; }
.demo-stage { position: relative; height: 380px; background: linear-gradient(var(--viewer-top), var(--viewer-bottom)); }
.demo-stage .detail-frame { display: none; }
.demo-copy { padding: 28px; display: flex; flex-direction: column; gap: 12px; justify-content: center; align-items: flex-start; }
.demo-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-step-btn {
  min-width: 40px; height: 40px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 3px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer;
}
.demo-step-btn svg { width: 18px; height: 18px; }
.demo-step-btn:hover { border-color: var(--accent); }
.demo-step-btn.is-current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.demo-title { font-size: 1.5rem; }
.demo-step { font-weight: 500; color: var(--muted); min-height: 1.5em; }
.demo-text { font-size: 1.15rem; min-height: 4.5em; }
@media (max-width: 860px) {
  .demo { grid-template-columns: 1fr; }
  .demo-stage { height: 300px; }
  .demo-copy { padding: 20px; }
}
.guide-card.is-building { border-style: dashed; border-color: var(--accent); }
.guide-card.is-building .spinner { width: 13px; height: 13px; border-width: 2px; }

.quick-qs { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-q { border: 1px solid var(--border); background: var(--surface); border-radius: 3px; padding: 8px 12px; font-weight: 500; font-size: 0.92rem; cursor: pointer; }
.quick-q:hover { border-color: var(--accent); color: var(--accent-text); }
.step-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.step-foot > * { white-space: nowrap; }
.link-btn.small { font-size: 0.92rem; }
.edit-form { display: grid; gap: 14px; }
.edit-form label { display: grid; gap: 6px; font-weight: 500; color: var(--muted); font-size: 0.92rem; }
.edit-form input, .edit-form textarea {
  font: inherit; font-size: 1.05rem; color: var(--text); background: var(--surface); padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); resize: vertical;
}
.edit-form input:focus, .edit-form textarea:focus { outline: none; border-color: var(--accent); }
.edit-actions { display: flex; gap: 10px; }
.edit-order { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--border); }
.edit-order legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-weight: 500; color: var(--muted); font-size: 0.9rem; }
.edit-order .btn svg { width: 18px; height: 18px; }
body[data-screen='guide'] .toast { top: calc(var(--topbar-h) + 14px); bottom: auto; }
.edit-form input, .edit-form textarea { font-weight: 400; }



/* share dialog */
.share-dialog { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(420px, calc(100% - 32px)); }
.share-dialog::backdrop { background: rgba(8, 16, 20, 0.55); }
.share-inner { position: relative; padding: 26px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.share-close { position: absolute; top: 10px; inset-inline-end: 10px; }
.share-inner h2 { font-size: 1.4rem; }
.qr { width: 220px; height: 220px; display: grid; place-items: center; background: #fff; border-radius: 4px; padding: 8px; }
.qr svg { width: 100%; height: 100%; }
.share-url { width: 100%; font: inherit; font-size: 0.9rem; padding: 10px 12px; border-radius: 3px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: center; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* overview: all steps */
.step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.step-list button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; padding: 8px 10px;
  background: none; border: 0; border-radius: 3px; cursor: pointer; font-size: 1rem;
}
.step-list button:hover { background: var(--surface-2); }
.sl-num { min-width: 30px; height: 30px; border-radius: 3px; display: grid; place-items: center; background: var(--surface-2); font-weight: 500; font-size: 0.85rem; flex-shrink: 0; }
.step-list .is-done .sl-num { background: var(--accent-soft); color: var(--accent-text); }

.print-frame { position: fixed; width: 0; height: 0; border: 0; inset-inline-start: -9999px; }

.file-order { min-width: 24px; height: 24px; border-radius: 3px; display: grid; place-items: center; background: var(--surface-3); font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.file-item .icon-btn:disabled { opacity: 0.3; cursor: default; }


.feedback { margin-top: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); display: grid; gap: 12px; }
.rate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate-btn { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; }
.rate-btn { min-height: 52px; font-size: 1rem; }
.rate-btn:hover { border-color: var(--accent); }
.rate-btn.is-picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.fb-form { display: grid; gap: 10px; }
.fb-form textarea { font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; }
.fb-thanks { font-weight: 500; }

.pose-badge { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 5px 10px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.pose-badge svg { width: 18px; height: 18px; flex-shrink: 0; }

/* first-run tips */
.coach { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 32px)); padding: 22px; display: grid; gap: 14px; }
.coach h2 { font-size: 1.3rem; }
.coach ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.coach li { display: flex; gap: 12px; align-items: flex-start; }
.coach li > span:first-child { flex-shrink: 0; width: 24px; display: grid; place-items: center; margin-top: 3px; }
.time-left { text-transform: none; letter-spacing: 0; font-weight: 400; }
.parts-check li { display: flex; align-items: center; gap: 6px; }
.parts-check li > label { flex: 1; }
.find-btn { font-weight: 500; font-size: 1.05rem; color: var(--muted); border: 1.5px solid var(--border); width: 38px; height: 38px; }

/* people who ask their OS for more contrast */
@media (prefers-contrast: more) {
  :root { --border: #5b6a72; --muted: #2b363c; }
  .chip, .toggle, .btn-secondary, .step-dot, .quick-q, .rate-btn { border-width: 2px; border-color: var(--text); }
  .viewer-hint, .legend, .chip-btn { background: var(--surface); }
}
.coach li > .glow-dot { width: 14px; height: 14px; margin: 6px 5px 0; }

/* library thumbnails */
.guide-card { padding-top: 12px; }
.guide-thumb { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: linear-gradient(var(--viewer-top), var(--viewer-bottom)); display: block; }
.guide-thumb.is-empty { display: grid; place-items: center; color: var(--muted); }
.guide-thumb.is-empty svg { width: 44px; height: 44px; opacity: 0.6; }
.guide-card h3 { padding-right: 0; }
.card-menu { top: 18px; right: 18px; }
.card-menu .icon-btn { background: color-mix(in srgb, var(--surface) 88%, transparent); }
[dir='rtl'] .card-menu { left: 18px; right: auto; }

.found-title { font-size: 1.2rem; font-weight: 500; color: var(--accent-text); }
.stages li.stage-extra { padding: 0 12px 6px 46px; flex-wrap: wrap; gap: 6px; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.found-chip { display: inline-block; padding: 2px 10px; border-radius: var(--radius-tag); background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; animation: toast-in 0.3s ease-out; }

/* phones in landscape: 3D view and instructions side by side, steps and bar below */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --topbar-h: 48px; }
  .screen-guide {
    height: calc(100dvh - var(--topbar-h)); grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
    grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: 'stage card' 'strip bar';
  }
  .stage-area { min-height: 0; }
  .step-card { grid-area: card; margin: 0; width: auto; max-height: 100%; height: 100%; min-height: 0; overflow-y: auto; justify-self: stretch; border-radius: 0; border-width: 0 0 0 1px; box-shadow: none; }
  .step-card .panel-body { padding: 12px 16px; gap: 10px; }
  .step-strip { padding: 6px 8px; }
  .step-dots { padding: 6px calc(50% - 42px); gap: 8px; }
  .step-dot, .step-dot.is-icon { width: 84px; height: 104px; padding: 6px; gap: 2px; }
  .sd-num { font-size: 1.8rem; }
  .sd-label { font-size: 0.78rem; }
  .guide-bar { padding: 4px 8px; gap: 4px 10px; }
  .guide-bar .link-btn span, .guide-bar .toggle span:not(.ico) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .guide-bar .toggle { min-width: 40px; padding: 0 8px; }
  .step-title { font-size: 1.2rem; }
  .instruction { font-size: 1.05rem; }
  .coach { max-height: calc(100% - 16px); overflow: auto; padding: 14px; gap: 8px; }
  .detail-frame { display: none; }
  .viewer-top { top: 6px; }
}
.coach { z-index: 20; }
@media (max-height: 520px) and (orientation: landscape) {
  .coach { top: 8px; transform: translateX(-50%); max-height: calc(100% - 70px); }
}

.spot-btn { width: 38px; height: 38px; border: 1.5px solid var(--border); color: var(--muted); }
.spot-btn svg { width: 20px; height: 20px; }
.spot-btn[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.parts-check li.is-spot label { border-color: var(--accent); }

.identify-btn { margin-bottom: 10px; }
.identify-btn svg { width: 22px; height: 22px; }
#identify-slot:not(:empty) { margin-bottom: 10px; }

a.page-ref { text-decoration: none; color: var(--accent-text); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
a.page-ref:hover { text-decoration: underline; }

.site-foot { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-foot .link-btn { margin: 0; }
.link-code { font-size: 1.8rem; font-weight: 500; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; min-height: 1.3em; }
.link-enter { width: 100%; display: grid; gap: 8px; text-align: start; border-top: 1px solid var(--border); padding-top: 14px; }
.link-enter label { font-weight: 500; color: var(--muted); font-size: 0.92rem; }
.link-enter input { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }

.share-inner h2 { padding: 0 30px; }

.viewer-canvas.is-practice { cursor: grab; }
.viewer-canvas.is-practice:active { cursor: grabbing; }

.install-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; margin-inline-end: 8px; border-radius: var(--radius-tag);
  border: 0; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; transition: background 0.15s, color 0.15s; }
.install-btn svg { width: 18px; height: 18px; }
@media (max-width: 480px) { .install-btn span { display: none; } .install-btn { padding: 0 10px; } }

.privacy-inner { text-align: start; justify-items: stretch; }
.privacy-inner h2 { text-align: center; }
.privacy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.privacy-list li > .ico { color: var(--accent-text); margin-top: 1px; }
.privacy-list li > .ico svg { width: 22px; height: 22px; }
.site-foot .link-btn + .link-btn { margin-inline-start: 0; }

.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }

.pose-badge.is-turn { background: var(--glow-soft); color: var(--glow-ink); border: 1.5px solid var(--glow); animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1); }

.report-form { display: grid; gap: 8px; }
.report-form textarea { font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; }

.tools-summary { display: grid; gap: 8px; font-weight: 500; }
.tools-summary .chips { font-weight: 500; }

.find-manual { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); }
.find-manual[open] { display: grid; gap: 10px; }
.find-manual summary { cursor: pointer; font-weight: 500; color: var(--accent-text); list-style-position: inside; }
.find-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.find-results:empty { display: none; }
.find-result { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px; border-radius: 3px; background: var(--surface-2); }
.find-result div { display: grid; gap: 2px; min-width: 0; }
.find-result b { overflow-wrap: anywhere; }
.find-results .muted { display: flex; align-items: center; gap: 8px; }

.room-status { margin: 10px 22px 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text);
  font-weight: 500; font-size: 0.92rem; display: flex; align-items: center; gap: 10px; }
.room-status .link-btn { margin-inline-start: auto; }
@media (max-width: 860px) { .room-status { order: 2; } }

.no-3d { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 32px;
  text-align: center; font-size: 1.15rem; color: var(--muted); max-width: 520px; margin: auto; }
.no-3d-icon { display: grid; place-items: center; color: var(--muted); }
.no-3d-icon svg { width: 52px; height: 52px; }

/* live 3D preview while the manual is being read */
.proc-preview {
  position: relative; width: 100%; height: 260px; border-radius: 4px; overflow: hidden;
  background: linear-gradient(var(--viewer-top), var(--viewer-bottom)); animation: toast-in 0.4s ease-out;
}
.proc-preview .detail-frame { display: none; }
.proc-preview .viewer-labels { display: none; }

/* read-along: the sentence being spoken is highlighted (helps people follow the words) */
#panel-body .is-speaking { background: var(--glow-soft); box-shadow: 0 0 0 8px var(--glow-soft); border-radius: 3px; transition: background 0.25s, box-shadow 0.25s; }
#panel-body .callout.is-speaking { box-shadow: 0 0 0 3px var(--glow); }
#panel-body .step-title, #panel-body .instruction, #panel-body .step-head { transition: background 0.25s, box-shadow 0.25s; }
#panel-body .is-speaking:not(.callout) { outline: 2px solid color-mix(in srgb, var(--glow) 55%, transparent); outline-offset: 6px; }

/* fixing a misplaced part */
.fix-btn { justify-self: start; margin: 0; }
.fix-pad { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.nudge-grid { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; justify-content: center; }
/* the arrows are directions on screen, so the pad never mirrors in right-to-left languages */
.nudge-grid { direction: ltr; }
.step-size button { unicode-bidi: isolate; direction: ltr; }
.nudge { width: 44px; height: 44px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--surface-2); font-size: 1.25rem; font-weight: 500; cursor: pointer; }
.nudge:hover { border-color: var(--accent); }
.step-size { display: flex; justify-content: center; gap: 4px; }
.fix-step { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 500; font-size: 0.95rem; }
.fix-step .nudge:disabled { opacity: 0.35; cursor: default; }
.step-size button { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-tag); padding: 4px 10px; font-weight: 500; font-size: 0.85rem; cursor: pointer; }
.step-size button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fix-actions { display: flex; gap: 8px; justify-content: center; }
.fix-side { display: grid; gap: 10px; }

/* phones: the part card is a sheet along the bottom of the 3D view, and fixing a part keeps it compact
   so Save stays reachable and the part stays in sight */
@media (max-width: 860px) {
  .part-card {
    left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto;
    max-height: calc(100% - 70px); overflow-y: auto; padding: 12px 14px; gap: 8px;
  }
  .part-card.is-fixing .facts, .part-card.is-fixing .ask-part-btn, .part-card.is-fixing [data-action="goto-step"] { display: none; }
  .part-card .fix-pad { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .part-card .nudge-grid { grid-template-columns: repeat(3, 42px); }
  .part-card .nudge { width: 42px; height: 42px; }
  .part-card .fix-step { gap: 4px; }
  .part-card .fix-step span { font-size: 0.88rem; text-align: center; }
}

/* little 3D pictures of each part (parts checklist, "you need" chips) */
.part-pic { flex-shrink: 0; object-fit: contain; border-radius: 3px; background: #ffffff; border: 1px solid var(--border); }
.part-pic-sm { width: 34px; height: 34px; border-radius: 50%; }
.part-pic-lg { width: 54px; height: 54px; }
.chip .part-pic-sm { margin: -2px 0; }

/* line icons used in place of emoji */
.ico { display: inline-grid; place-items: center; flex-shrink: 0; }
.ico svg { width: 20px; height: 20px; }
.feature-icon { color: var(--accent-text); }
.feature-icon svg { width: 22px; height: 22px; }
.pill svg { width: 15px; height: 15px; flex-shrink: 0; }
.page-ref svg { width: 18px; height: 18px; flex-shrink: 0; }
.page-ref .ext { display: inline-grid; }
.page-ref .ext svg { width: 14px; height: 14px; }
p.page-ref { display: inline-flex; align-items: center; gap: 6px; }
.link-btn.small svg { width: 17px; height: 17px; }
.btn-ghost svg { width: 20px; height: 20px; }
.tools-summary > span { display: inline-flex; align-items: center; gap: 8px; }
p.tools-summary { display: flex; align-items: center; gap: 8px; }
.fb-thanks { display: inline-flex; align-items: center; gap: 8px; }
.fb-thanks svg { width: 22px; height: 22px; color: var(--accent-text); }
.room-status svg { width: 20px; height: 20px; flex-shrink: 0; }
.banner .ico { color: var(--accent-text); margin-top: 1px; }
.find-manual summary .ico { vertical-align: -4px; margin-inline-end: 6px; }
.foot-links .ico svg { width: 18px; height: 18px; }
.foot-note { display: flex; align-items: flex-start; gap: 8px; }
.foot-note .ico { margin-top: 2px; }
.coach li > .ico { width: 24px; color: var(--accent-text); }
.coach li > .ico svg { width: 22px; height: 22px; }
.nudge { display: grid; place-items: center; color: var(--text); }
.nudge svg { width: 22px; height: 22px; }
.fix-btn svg { width: 18px; height: 18px; }

/* things drawn straight on the white 3D stage keep light-theme colours, whatever the page theme */
.viewer-hint { color: #34424a; background: rgba(255, 255, 255, 0.92); }

@media (min-width: 861px) and (max-width: 1180px) {
  .view-tools .chip-btn > span { display: none; }
  .view-tools .chip-btn { padding: 0 10px; }
}
/* on the white 3D stage the floating controls keep light colours in every theme */
.stage-area .chip-btn { background: #ffffff; color: #0f171b; border-color: #c5d0d6; }
.stage-area .chip-btn[aria-pressed='true'] { background: #0e5a42; color: #ffffff; border-color: #0e5a42; }
.stage-area .chip-btn:hover { background: #eef2f4; border-color: #0f171b; }


@media (min-width: 861px) {
  .step-card {
    align-self: end; justify-self: end; margin: 0 16px 16px; width: min(320px, 28%); height: auto;
    max-height: calc(100% - 96px); overflow-y: auto;
    border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  }
  .step-card .panel-body { padding: 14px 16px 16px; gap: 10px; }
  .step-card .step-title { font-size: 1.15rem; }
  .step-card .instruction { font-size: 1rem; line-height: 1.45; }
  .step-card .eyebrow { font-size: 0.82rem; }
  .step-card .section-title { font-size: 0.85rem; margin-bottom: 6px; }
  .step-card .chip { font-size: 0.9rem; }
  .step-card .pose-badge { font-size: 0.9rem; }
  .step-card .help-summary { min-height: 44px; font-size: 0.95rem; }
}

/* toolbar icons drawn as outlines */
#btn-fullscreen svg { fill: none; }

/* full screen: just the 3D view (with its instructions) and the steps */
body.is-fullscreen { overflow: hidden; }
body.is-fullscreen .topbar, body.is-fullscreen .guide-bar { display: none; }
body.is-fullscreen .screen-guide {
  position: fixed; inset: 0; z-index: 40; height: 100dvh; background: var(--bg);
  grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: 'stage' 'strip';
}
@media (max-width: 860px), (max-height: 520px) and (orientation: landscape) {
  body.is-fullscreen .screen-guide { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: 'stage' 'strip'; }
  body.is-fullscreen .step-card { display: none; }
  body.is-fullscreen .stage-area { min-height: 0; }
}
@media (max-width: 480px) {
  .view-tools { gap: 4px; }
  .view-tools .chip-btn.icon-only { width: 36px; }
  .explode-ctl input[type='range'] { width: 56px; }
}

/* ---- the helper: a panel at the bottom left of the 3D view (a sheet on phones) */
.helper-panel {
  grid-area: stage; z-index: 5; align-self: end; justify-self: start; margin: 0 16px 16px;
  width: min(380px, 34%); max-height: calc(100% - 96px); display: flex; flex-direction: column; gap: 10px;
  padding: 14px 14px 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.helper-panel[hidden] { display: none; }
.helper-head { display: flex; align-items: flex-start; gap: 10px; }
.helper-badge { width: 34px; height: 34px; border-radius: 3px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex-shrink: 0; }
.helper-badge svg { width: 18px; height: 18px; }
.helper-heading { flex: 1; min-width: 0; }
.helper-heading h2 { font-size: 1.05rem; margin: 0; }
.helper-context { font-size: 0.85rem; color: var(--muted); margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.helper-head .icon-btn { margin: -4px -4px 0 0; }
.helper-log { flex: 1; min-height: 60px; overflow-y: auto; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; }
.helper-intro { color: var(--muted); font-size: 0.95rem; line-height: 1.45; margin: 0; }
.helper-log .qa { display: grid; gap: 6px; }
.helper-log .q { justify-self: end; max-width: 88%; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 4px 4px 0 4px; margin: 0; }
.helper-log .q b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.helper-log .a { justify-self: start; max-width: 92%; background: var(--surface-2); padding: 8px 12px; border-radius: 4px 4px 4px 0; margin: 0; line-height: 1.45; }
.helper-log .a > b { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-bottom: 2px; text-transform: none; letter-spacing: 0; }
.helper-log .a.is-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.helper-log .say-btn { width: 30px; height: 30px; vertical-align: middle; margin: -4px 0 -4px 2px; }
.helper-log .say-btn svg { width: 16px; height: 16px; }
.helper-log .check-result img { width: 52px; height: 52px; }
.helper-panel .quick-qs { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; padding-bottom: 2px; }
.helper-panel .quick-qs::-webkit-scrollbar { display: none; }
.helper-panel .quick-q { font-size: 0.85rem; padding: 6px 10px; white-space: nowrap; flex-shrink: 0; }
.helper-form .mic-btn { width: 40px; height: 40px; flex-shrink: 0; }
.helper-form .mic-btn svg { width: 20px; height: 20px; }
.mic-btn.is-recording { background: var(--danger); color: #fff; animation: pulse-red 1.2s infinite; }
.helper-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.helper-speak { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.helper-speak input { width: 18px; height: 18px; accent-color: var(--accent); }
.helper-foot .link-btn { margin: 0; }
.helper-foot .ico svg { width: 18px; height: 18px; }
.toggle-ask { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toggle-ask:hover { background: var(--accent-strong); }
.toggle-ask svg { width: 18px; height: 18px; }
.card-ask { justify-self: start; align-self: flex-start; }
.card-ask svg { width: 18px; height: 18px; }
@media (max-width: 860px), (max-height: 520px) and (orientation: landscape) {
  .helper-panel {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; margin: 0; width: auto; max-height: min(72vh, 560px);
    justify-self: stretch; align-self: end;
    border-radius: 4px 4px 0 0; padding: 14px 16px max(14px, env(safe-area-inset-bottom));
  }
}

/* camera scanner: always dark like a camera app, with sand accents */
.scan-dialog {
  --scan-sand: #3fd18f; --scan-ink: #04150d;
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0b0f11; color: #f2f5f7; overflow: hidden;
}
.scan-dialog[open] { display: grid; grid-template-rows: auto 1fr auto; }
.scan-dialog::backdrop { background: #000; }
.scan-top {
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
}
.scan-top h2 { margin: 0; font-size: 1.05rem; font-weight: 500; text-align: center; }
.scan-round {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: inherit;
}
.scan-round:hover { background: rgba(255, 255, 255, 0.2); }
.scan-round svg { width: 22px; height: 22px; }
.scan-round[aria-pressed='true'] { background: var(--scan-sand); color: var(--scan-ink); }
#scan-torch { grid-column: 3; }

.scan-stage { position: relative; min-height: 0; background: #000; overflow: hidden; }
.scan-stage video, .scan-outline { position: absolute; inset: 0; width: 100%; height: 100%; }
.scan-stage video { object-fit: contain; }
.scan-outline { pointer-events: none; }
.scan-outline polygon {
  fill: rgba(63, 209, 143, 0.16); stroke: var(--scan-sand); stroke-linejoin: round;
  opacity: 0; transition: opacity 0.2s;
}
.scan-outline.is-found polygon { opacity: 1; }
.scan-stage::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scan-stage.is-flash::after { animation: scan-flash 0.35s ease-out; }
@keyframes scan-flash { from { opacity: 0.75; } to { opacity: 0; } }
.scan-stage.is-reviewing video, .scan-stage.is-reviewing .scan-outline, .scan-stage.is-reviewing .scan-hint { visibility: hidden; }

.scan-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px);
  padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 0.98rem; text-align: center;
}

.scan-error, .scan-review {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px 16px; text-align: center;
}
.scan-error[hidden], .scan-review[hidden] { display: none; }
.scan-error p { max-width: 34ch; margin: 0; font-size: 1.05rem; line-height: 1.45; }
.scan-error-icon svg { width: 44px; height: 44px; opacity: 0.8; }
.scan-error-actions, .scan-review-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.scan-review { background: #0b0f11; justify-content: space-between; }
.scan-review-title { margin: 0; font-weight: 500; }
.scan-review-frame { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; overflow: hidden; }
.scan-review-frame img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; transition: transform 0.2s; }
.scan-review-actions .btn { gap: 6px; }
.scan-review-actions .btn svg { width: 18px; height: 18px; }

.btn-sand { background: var(--scan-sand); color: var(--scan-ink); border-color: transparent; }
.btn-sand:not(:disabled):hover { background: #6be0ab; }
.btn-outline-light { background: transparent; color: #f2f5f7; border-color: rgba(255, 255, 255, 0.35); }
.btn-outline-light:hover { border-color: #f2f5f7; }

.scan-bottom { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.scan-pages {
  list-style: none; margin: 0; padding: 2px 0; display: flex; gap: 8px; overflow-x: auto; min-height: 64px;
  scrollbar-width: none;
}
.scan-pages::-webkit-scrollbar { display: none; }
.scan-thumb {
  position: relative; width: 48px; height: 62px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 3px;
  overflow: hidden; background: #222; cursor: pointer; display: block;
}
.scan-thumb:hover, .scan-thumb:focus-visible { border-color: var(--scan-sand); }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scan-thumb span {
  position: absolute; left: 3px; bottom: 3px; min-width: 18px; padding: 0 4px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.72rem; line-height: 18px; text-align: center;
}
.scan-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.scan-count { font-size: 0.95rem; color: #b8c4ca; }
.scan-shutter {
  width: 74px; height: 74px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 4px solid #ffffff; background: #ffffff; box-shadow: inset 0 0 0 4px #0b0f11;
}
.scan-shutter:active:not(:disabled) { transform: scale(0.94); }
.scan-shutter:disabled { opacity: 0.4; cursor: not-allowed; }
.scan-shutter:focus-visible { outline: 3px solid var(--scan-sand); outline-offset: 4px; }
#scan-build { justify-self: end; min-height: 48px; padding: 0 18px; white-space: nowrap; }
@media (max-width: 420px) {
  #scan-build { padding: 0 12px; font-size: 0.92rem; white-space: normal; text-align: center; line-height: 1.2; }
  .scan-shutter { width: 66px; height: 66px; }
}
@media (prefers-reduced-motion: reduce) { .scan-stage.is-flash::after { animation: none; } }

/* ---------------------------------------------------------------- main nav: Projects · Discover · Profile */
.topbar { gap: 24px; }
.main-nav { display: flex; align-self: stretch; gap: 4px; margin-inline-end: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--muted); font-weight: 500; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link svg, .tab-link svg { width: 20px; height: 20px; }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current='page'] { color: var(--text); border-bottom-color: var(--glow); }
.nav-link:focus-visible { outline-offset: -3px; }
.tab-bar { display: none; }

/* Discover / Profile pages */
.screen-tab { max-width: 1160px; margin: 0 auto; padding: 40px 16px 64px; }
.tab-head { display: grid; gap: 10px; margin-bottom: 32px; }
.tab-head h1 { font-size: clamp(2rem, 4vw, 2.7rem); letter-spacing: -0.015em; }
.tab-head .guide-search { max-width: 420px; margin-top: 8px; }
.tab-section { font-size: 1.4rem; margin: 40px 0 16px; }
.tab-head + .tab-section { margin-top: 0; }

.profile-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px;
}
.avatar {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 2rem; font-weight: 500;
}
.avatar.is-empty { background: var(--surface-2); }
.avatar.is-empty::before {
  content: ''; width: 44px; height: 44px; background: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="8" r="4.5"/><path d="M3.5 21a8.5 8.5 0 0 1 17 0z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="8" r="4.5"/><path d="M3.5 21a8.5 8.5 0 0 1 17 0z"/></svg>') center / contain no-repeat;
}
.profile-id { display: grid; gap: 6px; min-width: 0; }
.profile-id h1 { font-size: 1.9rem; overflow-wrap: anywhere; }
.profile-name { display: grid; gap: 4px; margin-top: 8px; font-size: 0.9rem; font-weight: 500; color: var(--muted); max-width: 320px; }
.profile-name input {
  min-height: 44px; padding: 0 12px; border-radius: 3px; border: 1px solid var(--border);
  background: var(--bg); font-weight: 400; color: var(--text);
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(84px, auto)); margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.stats > div { padding: 12px 16px; border-inline-start: 1px solid var(--border); }
.stats > div:first-child { border-inline-start: 0; }
.stats dt { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.stats dd { margin: 2px 0 0; font-size: 1.6rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.screen-tab .guide-card-wrap.is-filtered { display: none; }

@media (max-width: 880px) {
  .topbar { gap: 12px; }
  .nav-link { padding: 0 8px; font-size: 0.95rem; }
  .profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .stats { grid-column: 1 / -1; }
}

/* Phones: the tabs move to a bar at the bottom, like a native app. Hidden while building or following a guide. */
@media (max-width: 640px) {
  .main-nav { display: none; }
  .tab-bar {
    position: fixed; z-index: 20; inset-inline: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 4px 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .tab-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 54px; color: var(--muted); font-size: 0.8rem; font-weight: 500; text-decoration: none;
  }
  .tab-link[aria-current='page'] { color: var(--text); }
  .tab-link[aria-current='page'] svg { color: var(--glow); }
  body[data-screen='guide'] .tab-bar, body[data-screen='processing'] .tab-bar { display: none; }
  body:is([data-screen='home'], [data-screen='discover'], [data-screen='profile']) main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body:is([data-screen='home'], [data-screen='discover'], [data-screen='profile']) .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .screen-tab { padding-top: 28px; }
  .profile-head { grid-template-columns: 1fr; justify-items: start; padding: 20px; }
  .avatar { width: 72px; height: 72px; font-size: 1.6rem; }
  .stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .stats > div { padding: 10px 12px; }
}
body.is-fullscreen .tab-bar { display: none; }

/* ---------------------------------------------------------------- agent check badge (HarnessRouter) */
.guide-bar .agent-badge { gap: 6px; border-radius: var(--radius-tag); padding: 6px 12px; background: var(--surface-2); color: var(--muted); font-weight: 500; }
.guide-bar .agent-badge svg { width: 18px; height: 18px; }
.guide-bar .agent-badge .spinner { width: 14px; height: 14px; }
.guide-bar .agent-badge.is-running { color: var(--glow-ink); background: var(--glow-soft); }
.guide-bar .agent-badge.is-checked { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.agent-inner { display: grid; gap: 14px; text-align: start; }
.agent-changes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.agent-changes li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.4; }
.agent-changes b { margin-inline-end: 6px; }
.agent-by { font-size: 0.85rem; }

/* the close-up's magnifier link: a ring on the spot in the main view and a line to the close-up */
.detail-link { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.detail-link path { stroke: #26333a; stroke-width: 1.5; stroke-dasharray: 4 3; fill: none; }
.detail-link circle { fill: none; stroke: #26333a; stroke-width: 2; }

/* parts-list check on the overview */
.verify-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px; font-size: 0.95rem; color: var(--ok); font-weight: 500; }
.verify-note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.verify-note.is-gap { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--radius-sm); padding: 8px 10px; }

/* processing: the parts list arrives first, so people can sort while the guide is made */
.proc-parts { margin-top: 18px; text-align: start; border-top: 1px solid var(--border); padding-top: 14px; }
.proc-parts h2 { font-size: 1.1rem; }
.proc-parts .muted { font-size: 0.92rem; margin: 4px 0 10px; }
.proc-parts-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 260px; overflow: auto; }
.proc-parts-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.92rem; animation: toast-in 0.3s ease-out; }
.pp-qty { font-weight: 500; min-width: 2.6em; font-variant-numeric: tabular-nums; }
.pp-name { flex: 1; min-width: 0; }
.pp-id { color: var(--muted); font-size: 0.8rem; font-weight: 500; }

/* scan with your phone */
.handoff-status { min-height: 1.5em; color: var(--muted); font-size: 0.95rem; }
#phone-scan-dialog .btn-block { width: 100%; }

/* not enough in the scan to build from */
.proc-needs { display: grid; gap: 12px; text-align: start; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.proc-needs h2 { font-size: 1.3rem; }
.needs-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.needs-list.is-soft { color: var(--muted); font-size: 0.95rem; }
.needs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.intake-list { margin: 4px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; font-weight: 400; }

/* live photo checks in the scanner: the outline turns amber while the shot would be poor, and a page that came
   out blurry, dark or cut off is marked in the strip */
.scan-outline.is-found.is-warn polygon { stroke: #f0b429; }
.scan-thumb[data-problem] { outline: 3px solid #f0b429; outline-offset: -3px; }
.scan-thumb[data-problem] span { background: #f0b429; color: #1b1208; }
.file-item.has-problem { box-shadow: inset 3px 0 0 var(--warn); }
.file-problem { display: block; font-size: 0.85rem; color: var(--warn); }

/* ---------------------------------------------------------------- my room */
.room-card { display: flex; align-items: center; gap: 16px; margin: 40px 0 0; padding: 16px 20px; text-decoration: none; color: inherit; transition: border-color 0.15s; }
.room-card:hover { border-color: var(--glow); }
.room-card-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius); background: var(--surface-2); color: var(--glow); flex: none; }
.room-card-icon svg { width: 26px; height: 26px; }
.room-card-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.room-card-text b { font-weight: 500; font-size: 1.1rem; }
.room-card-text .muted { font-size: 0.95rem; }
.screen-room { display: grid; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - var(--topbar-h)); }
.room-head { display: flex; align-items: baseline; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.room-head .link-btn { margin: 0; }
.room-head h1 { font-size: 1.4rem; }
.room-size { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.room-stage { position: relative; min-height: 0; overflow: hidden; background: var(--viewer-top); touch-action: none; }
.room-canvas { display: block; width: 100%; height: 100%; }
.room-setup { position: absolute; inset: 16px; margin: auto; max-width: 760px; height: fit-content; max-height: calc(100% - 32px); overflow: auto;
  padding: 24px; display: grid; gap: 12px; z-index: 2; touch-action: auto; }
.room-setup h2 { font-size: 1.3rem; }
.room-setup h3 { font-size: 1.05rem; margin-bottom: 4px; }
.room-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.room-setup-grid > * { display: grid; gap: 8px; align-content: start; }
.room-setup label:not(.room-file) { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.room-setup input[type='number'], .room-scale input { min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.room-file { cursor: pointer; justify-self: start; }
.room-warn { position: absolute; left: 12px; bottom: 12px; right: 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; width: fit-content; max-width: calc(100% - 24px);
  padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--ok) 16%, #ffffff); color: #24513a; font-size: 0.9rem; pointer-events: none; }
.room-warn.is-bad { background: #fbe9e5; color: #8f2a1e; }
.room-side { border-inline-start: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.room-panel { padding: 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--border); }
.room-panel h2 { font-size: 1.1rem; }
.room-panel h3 { font-size: 1rem; }
.room-mono { font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.room-gaps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; color: var(--muted); }
.room-gaps .is-bad, .room-problems { color: var(--danger); }
.room-problems { margin: 0; padding-inline-start: 18px; font-size: 0.9rem; }
.room-problems:empty { display: none; }
.room-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.room-furniture { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.room-piece { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); background: var(--surface-2); }
.room-piece img, .room-piece-thumb { width: 52px; height: 36px; object-fit: cover; border-radius: var(--radius-tag); background: var(--viewer-top); flex: none; }
.room-piece-name { flex: 1; min-width: 0; font-size: 0.95rem; line-height: 1.25; }
.room-piece-name small { display: block; color: var(--muted); font-size: 0.8rem; }
.room-note { font-size: 0.85rem; }
.room-check { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
#room-scan-tools { display: grid; gap: 10px; }
#room-scan-tools[hidden] { display: none; }
@media (max-width: 880px) {
  .screen-room { height: auto; }
  .room-layout { grid-template-columns: 1fr; }
  .room-stage { height: 58vh; min-height: 320px; }
  .room-side { border-inline-start: 0; border-top: 1px solid var(--border); }
  .room-setup-grid { grid-template-columns: 1fr; }
}

.room-panel .muted, .room-panel p { font-size: 0.9rem; }
.room-gaps { grid-template-columns: 1fr; }
.room-source { font-size: 0.85rem; color: var(--ok); }
.room-source.is-model { color: var(--warn); }
.room-size-form { display: grid; gap: 6px; }
.room-size-fields { display: flex; gap: 6px; align-items: end; flex-wrap: wrap; }
.room-size-fields label { display: grid; gap: 2px; font-size: 0.8rem; color: var(--muted); }
.room-size-fields input { width: 64px; min-height: 34px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }

/* 3D | Manual: the stage shows the animated step or the original manual page */
.mode-toggle { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); margin-inline-end: 6px; }
.mode-toggle button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 2px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; transition: background 0.15s, color 0.15s; }
.mode-toggle button[aria-pressed='true'] { background: var(--text); color: var(--bg); }
.viewer-top { display: flex; align-items: flex-start; }
.stage-area.is-manual .view-tools { display: none; }
.stage-area.is-manual .viewer, .stage-area.is-manual .detail-link, .stage-area.is-manual .viewer-hint { visibility: hidden; }
.manual-view { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #dfe5e9; box-sizing: border-box; }
.manual-scroll { position: relative; overflow: auto; padding: 64px 16px 8px; min-height: 0; touch-action: pan-x pan-y pinch-zoom; }
/* the whole page fits by default; Zoom in shows it at double width to read small print */
.manual-scroll img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.manual-view.is-zoomed .manual-scroll img { width: 200%; height: auto; max-width: none; object-fit: fill; background: #fff; }
.manual-spin { position: absolute; top: 50%; left: 50%; margin: -8px; }
.manual-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.manual-label { font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #34424a; min-width: 9em; text-align: center; }
.manual-bar .chip-btn:disabled { opacity: 0.35; cursor: default; }

/* Quick tips: centred in the window (not the 3D area, which can be shorter than the card), never taller than the
   screen; on a very short screen it scrolls inside instead of being cut off */
.coach, .coach[style] {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 40;
  width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
}
@media (max-height: 520px) { .coach { padding: 14px; gap: 8px; } .coach ol { gap: 8px; } }

/* my room: measure from photos */
.room-photo { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.room-photo[hidden] { display: none; }
.room-photo-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.room-photo-count { font-size: 0.9rem; }
.room-known { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.room-known select, .room-known input { min-height: 40px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.room-known input { width: 90px; }
.room-photo-status { display: grid; gap: 4px; margin: 0; font-size: 0.9rem; }
.room-photo-status:empty { display: none; }
.room-photo-status.is-busy { color: var(--muted); }
.room-photo-status.is-high, .room-photo-status.is-medium { color: var(--text); }
.room-photo-status.is-low { color: var(--warn); }
.room-photo-status > span:first-child { font-weight: 500; }

/* ================================================================ drafting table design language
   Written last so it wins over the component rules above. Brix should feel like the paper the manual was printed
   on, laid on a drafting table:
   - Warm paper with a faint grid; ink for text and the hairline rules that divide things. No soft drop shadows on
     the page: things are separated by rules and space. Only things that float (the step box, menus, dialogs) lift.
   - Square corners. The main action is soft pink with an aubergine edge and small square handles at its corners, like
     a part selected in a CAD drawing.
   - Type: Archivo, wide, for headings; Instrument Serif italic as the rare accent; IBM Plex Mono in small capitals
     for labels and numbers; Atkinson Hyperlegible stays for everything people read while building.
   - Soft pink means "do this"; green only marks the part being placed in 3D. */

@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url('/vendor/fonts/archivo-latin-ext-standard.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url('/vendor/fonts/archivo-latin-standard.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/vendor/fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/vendor/fonts/ibm-plex-mono-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/vendor/fonts/ibm-plex-mono-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Two themes, picked with the sun/moon button (data-theme on <html>, dark unless chosen otherwise).
     Light (the default): everything white, obsidian ink, soft pink for "do this", violet for links and progress.
     Dark: obsidian with pink. Each puts every 3D view on a grey one step off the page (lighter grey on white,
     a dark grey on obsidian), and both use the logo's orange as the
     marker: corner handles, the current tab, focus, a few labels. */
  --bg: #faf9f7;              /* not quite white: a warm off-white with a little grain, like paper */
  --surface: #ffffff;
  --surface-2: #f5f4f6;
  --surface-3: #e9e7ec;
  --text: #14141c;            /* obsidian */
  --muted: #5d5c66;
  --border: #e4e2e8;          /* hairline rules */
  --line: #31263b;            /* aubergine: the edge of anything you press */
  --grid: transparent;        /* plain white: no drafting grid */
  --brand: #ffffff;
  --brand-ink: #14141c;
  --accent: #5f509d;          /* violet: links, icons, progress */
  --accent-strong: #473982;
  --accent-ink: #ffffff;
  --accent-fill: #fbe1e1;     /* the main action: soft pink under an aubergine edge */
  --accent-fill-hover: #f7cfcf;
  --accent-soft: #eeebf5;
  --accent-text: #473982;
  --pink: #f5c0c0;
  --orange: #e8590c;          /* the logo's orange: the marker */
  --orange-text: #c2410c;
  --viewer-top: #e9eaee;      /* every 3D view, in both themes: a soft neutral grey */
  --viewer-bottom: #e9eaee;
  --shadow: 0 1px 0 rgba(20, 20, 28, 0.08), 0 18px 36px -18px rgba(49, 38, 59, 0.35);
  --radius: 2px;
  --radius-sm: 2px;
  --radius-tag: 2px;
  --display: 'Archivo', var(--font);
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
:root[data-theme='dark'] {
  --bg: #14141c;            /* obsidian, with the pink as the light */
  --surface: #1f1f29;
  --surface-2: #262632;
  --surface-3: #30303e;
  --text: #e4e6ec;
  --muted: #b1b6c4;
  --border: #2f2f3e;
  --line: #e4e6ec;
  --grid: rgba(245, 192, 192, 0.045);
  --brand: #14141c;
  --brand-ink: #e4e6ec;
  --accent: #f5c0c0;
  --accent-strong: #f9d6d6;
  --accent-ink: #14141c;
  --accent-fill: #3b2a33;
  --accent-fill-hover: #4a3440;
  --accent-soft: #262033;
  --accent-text: #f5c0c0;
  --pink: #f5c0c0;
  --orange: #ff7a2e;
  --orange-text: #ff9a5c;
  --viewer-top: #2b2b34;      /* a dark grey a step lighter than the page, as the light theme's is a step darker */
  --viewer-bottom: #2b2b34;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 18px 36px -18px rgba(0, 0, 0, 0.8);}

body {
  font-size: 1.125rem; line-height: 1.55;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}
h1, h2 { font-family: var(--display); font-weight: 700; font-stretch: 112%; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
h3 { font-weight: 700; }
b, strong { font-weight: 700; }
a { color: var(--accent-text); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 0; box-shadow: 0 0 0 6px var(--text); border-radius: 0; }
.lang-picker:focus-within { outline: 3px solid var(--orange); outline-offset: 0; box-shadow: 0 0 0 6px var(--text); }
.skip-link { background: var(--orange); color: #ffffff; font-weight: 700; border-radius: 0; }
.card { border: 1px solid var(--border); box-shadow: none; border-radius: var(--radius); }

/* labels: small mono capitals, like the callouts on a technical drawing */
.eyebrow, .section-title, .tab-section, .stats dt, .demo .eyebrow, .settings-group h3, .library-head .muted {
  font-family: var(--mono); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
}
.demo .eyebrow { color: var(--orange-text); }
.p-id, .chip-id, .sl-num, .stage-count, .elapsed, .pp-qty, .chip-qty, .parts-check .p-qty, .file-order, .link-code {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

/* ---- buttons */
.btn { border-radius: 0; border-width: 1px; font-weight: 700; min-height: 50px; position: relative; }
.btn-primary {
  background: var(--accent-fill); color: var(--text); border-color: var(--line); box-shadow: none;
}
/* the four square handles, as on a selected part */
.btn-primary::after, #choose-files::after, .toggle-ask::after {
  content: ''; position: absolute; inset: -4px; pointer-events: none;
  background:
    linear-gradient(var(--orange), var(--orange)) top left / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top right / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom left / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom right / 6px 6px no-repeat;
}
.btn-primary:not(:disabled):hover { background: var(--accent-fill-hover); border-color: var(--line); }
.btn-primary:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--line); }
.btn-ghost { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled, .btn-primary:disabled { opacity: 1; background: var(--surface-3); color: var(--muted); border-color: transparent; box-shadow: none; }
.btn-primary:disabled::after { display: none; }
.btn-lg { min-height: 60px; font-size: 1.2rem; }
.btn-sm { min-height: 42px; }
.link-btn { color: var(--text); font-weight: 700; border-radius: 0; }
.link-btn:hover { background: var(--surface-2); }
.icon-btn { border-radius: 0; }
.icon-btn:hover { background: var(--surface-2); }

/* ---- top bar: part of the paper, ruled off underneath */
.topbar {
  background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--brand-ink);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(8px);
}
.brand { color: var(--brand-ink); font-weight: 800; font-size: 1.3rem; }
.nav-link {
  color: var(--muted); font-weight: 700; font-size: 1.02rem;
  border-bottom: 2px solid transparent; margin-bottom: 0; padding: 4px 14px 0;
}
.nav-link:hover { color: var(--text); }
.nav-link[aria-current='page'] { color: var(--text); border-bottom-color: var(--orange); }
.nav-link:focus-visible { outline-offset: -4px; box-shadow: none; }
.install-btn, .lang-picker { color: var(--text); font-weight: 700; border-radius: 0; }
.lang-picker svg { fill: currentColor; }
.lang-picker select { color: inherit; font-weight: 700; }
.lang-picker select option { color: #14141c; background: #ffffff; }
.install-btn:hover, .lang-picker:hover { background: var(--surface-2); color: var(--text); }

/* phones: tabs along the bottom */
@media (max-width: 640px) {
  .tab-bar { background: var(--surface); backdrop-filter: none; border-top: 1px solid var(--border); }
  .tab-link { font-size: 0.85rem; font-weight: 700; position: relative; }
  .tab-link[aria-current='page'] { color: var(--text); }
  .tab-link[aria-current='page'] svg { color: var(--accent); }
  .tab-link[aria-current='page']::before {
    content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; background: var(--orange);
  }
}

/* ---- home: the upload on the left, the live demo on the right */
.screen-home {
  max-width: 1200px; padding: 44px 20px 72px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 28px; align-items: start;
}
.screen-home > .room-card { grid-column: 1 / -1; grid-row: 1; }
.screen-home > .hero-band { grid-column: 1 / -1; grid-row: 2; }
.hero-band > .home-grid { grid-column: 1; }
.hero-band > .demo-wrap { grid-column: 2; margin-top: 0; }
.screen-home > .library, .screen-home > .site-foot { grid-column: 1 / -1; }
.home-grid { max-width: none; margin: 0; gap: 0; }
.upload-card { background: transparent; border: 0; padding: 0; gap: 14px; }
.banner { background: var(--warn-soft); color: var(--text); border-radius: 0; border: 1px solid var(--warn-border); padding: 14px 16px; font-size: 1rem; }
.banner .ico { color: var(--warn); }
.dropzone { background: var(--surface); border: 1.5px dashed var(--line); border-radius: 0; padding: 40px 24px 36px; }
.dropzone:hover, .dropzone.is-over { background: var(--accent-soft); border-color: var(--accent); border-style: solid; }
.dz-icon { width: 54px; height: 54px; color: var(--orange); }
.dz-title { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; font-stretch: 112%; letter-spacing: -0.025em; margin-top: 8px; }
.dz-hint { font-size: 1.1rem; margin-top: 4px; color: var(--muted); }
.dz-buttons { gap: 14px; margin-top: 24px; }
#choose-files { background: var(--accent-fill); color: var(--text); border-color: var(--line); box-shadow: none; }
#choose-files:hover { background: var(--accent-fill-hover); border-color: var(--line); }
/* nothing to build yet: no greyed-out button, it appears once there are pages */
#build-btn:disabled { display: none; }
.file-item { background: var(--surface); border: 1px solid var(--border); border-radius: 0; }
.file-order { border-radius: 0; font-weight: 500; }

.demo { background: var(--surface); border: 1px solid var(--border); grid-template-columns: minmax(0, 1fr); }
.demo-stage { height: 300px; border-inline-end: 0; border-bottom: 1px solid var(--border); }
.demo-copy { padding: 22px 24px 26px; gap: 10px; }
.demo-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal; font-size: 2.3rem; letter-spacing: -0.01em; line-height: 1.05; }
.demo-step { color: var(--text); font-weight: 700; }
.demo-text { font-size: 1.1rem; }
.demo-steps { gap: 6px; margin: 4px 0 6px; }
.demo-step-btn { border: 1px solid var(--border); border-radius: 0; font-family: var(--mono); font-weight: 500; min-width: 42px; height: 42px; background: var(--surface); }
.demo-step-btn:hover { border-color: var(--line); }
.demo-step-btn.is-current { background: var(--accent-fill); color: var(--text); border-color: var(--line); }

.room-card { margin: 0 0 28px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--border); transition: border-color 0.15s; }
.room-card:hover { box-shadow: none; border-color: var(--line); }
.room-card-icon { width: 52px; height: 52px; border-radius: 0; background: var(--accent-soft); color: var(--accent); }
.room-card-text b { font-family: var(--display); font-weight: 700; font-stretch: 112%; font-size: 1.2rem; }

.library { margin-top: 48px; }
.library h2 { font-size: 1.9rem; }
.guide-list { gap: 18px; }
.guide-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 0 0 16px; box-shadow: none; transition: border-color 0.15s; overflow: hidden; }
.guide-card:hover { transform: none; border-color: var(--line); box-shadow: none; }
.guide-card h3 { font-family: var(--display); font-size: 1.15rem; font-weight: 700; font-stretch: 108%; padding-inline: 14px; }
.guide-card p { padding-inline: 14px; }
.guide-thumb { border-radius: 0; border-bottom: 1px solid var(--border); }
.guide-meta { gap: 4px 14px; padding-inline: 14px; }
.guide-meta .pill { padding: 0; background: none; color: var(--muted); font-family: var(--mono); font-weight: 400; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.guide-meta .pill-accent { color: var(--accent-text); font-weight: 500; }
.guide-meta .pill-ok { color: var(--ok); font-weight: 500; }
.guide-card.is-building { border-color: var(--accent); box-shadow: none; }
.guide-progress { height: 4px; border-radius: 0; background: var(--surface-3); margin-inline: 14px; }
.guide-progress > div { background: var(--accent); border-radius: 0; }
.card-menu .icon-btn { background: var(--surface); border: 1px solid var(--border); }
.menu { border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); }
.menu button { border-radius: 0; font-weight: 700; }
.guide-search { min-height: 52px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); font-size: 1.05rem; }
.guide-search:focus { border-color: var(--line); }
.site-foot { border-top: 1px solid var(--border); }
.empty-note { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--muted); }

/* side by side, the upload box grows to the demo's height instead of leaving a gap under it */
@media (min-width: 981px) {
  .hero-band > .home-grid { align-self: stretch; }
  .home-grid > .upload-card { display: flex; flex-direction: column; height: 100%; }
  .upload-card > .dropzone { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
}
@media (max-width: 980px) {
  .screen-home { grid-template-columns: minmax(0, 1fr); }
  .screen-home > .room-card, .screen-home > .hero-band { grid-row: auto; }
  .hero-band { grid-template-columns: minmax(0, 1fr); }
  .hero-band > .demo-wrap { grid-column: 1; margin-top: 0; }
  .demo { grid-template-columns: 1.2fr 1fr; }
  .demo-stage { height: 340px; border-bottom: 0; border-inline-end: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .demo { grid-template-columns: 1fr; }
  .demo-stage { height: 280px; border-inline-end: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .screen-home { padding-top: 28px; }
  .dropzone { padding: 30px 16px 28px; }
}

/* ---- Discover and Profile */
.screen-tab { max-width: 1200px; padding: 44px 20px 72px; }
.tab-head h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -0.03em; }
.tab-head .lede { font-size: 1.2rem; color: var(--muted); }
.tab-section { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin: 40px 0 16px; }
.tab-head + .tab-section { margin-top: 8px; }
.profile-head { background: var(--surface); border: 1px solid var(--border); }
.avatar { background: var(--accent-fill); color: var(--text); font-family: var(--display); font-weight: 700; border-radius: 0; border: 1px solid var(--line); }
.avatar.is-empty { background: var(--accent-soft); }
.avatar.is-empty::before { background: var(--accent); }
.profile-id h1 { font-size: 2.2rem; }
.profile-name { font-weight: 700; color: var(--text); font-size: 1rem; }
.profile-name input { border: 1px solid var(--line); border-radius: 0; background: var(--surface); min-height: 50px; }
.profile-name input:focus { border-color: var(--line); outline: none; }
.stats { border: 1px solid var(--border); gap: 0; overflow: visible; background: var(--surface); }
.stats > div, .stats > div:first-child { border: 0; border-inline-start: 1px solid var(--border); background: transparent; border-radius: 0; padding: 14px 18px 16px; }
.stats > div:first-child { border-inline-start: 0; }
.stats dd { font-family: var(--display); font-size: 2.4rem; font-weight: 700; font-stretch: 112%; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---- processing */
.processing { background: var(--surface); border: 1px solid var(--border); }
.processing h1 { font-size: 2.1rem; }
.build-anim span { border-radius: 0; }
.stages li { border-radius: 0; font-weight: 700; }
.stages li.is-active { background: var(--accent-soft); }
.stage-count, .elapsed, .pp-qty { font-weight: 500; }
.found-title { font-family: var(--display); font-weight: 700; }
.found-chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 0; }
.proc-parts-list li { border-radius: 0; }
.proc-preview { border-radius: 0; border: 1px solid var(--border); }

/* ---- guide */
.step-card { border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); }
.time-left { display: block; font-family: var(--font); font-size: 0.95rem; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--muted); }
.time-left::first-letter { text-transform: uppercase; }
.step-title { font-family: var(--display); font-weight: 700; font-stretch: 108%; letter-spacing: -0.015em; }
.section-title { margin-bottom: 8px; }
ul.facts-line { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.facts-line li { padding: 3px 9px; border-radius: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: var(--mono); font-weight: 500; font-size: 0.82rem; }
ul.facts-line li::first-letter { text-transform: uppercase; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 0; font-weight: 700; }
.chip:hover { border-color: var(--line); }
.chip.is-current { border-color: var(--glow); background: var(--glow-soft); }
.chip-qty { font-weight: 500; }
.chip-id { color: var(--muted); font-weight: 400; }
.chip.tool:hover { border-color: var(--border); }
.pose-badge { background: var(--tip-soft); color: var(--tip); border-radius: 0; font-weight: 700; }
.pose-badge.is-turn { background: var(--glow-soft); color: var(--glow-ink); border: 1px solid var(--glow); }
.callout { border-radius: 0; border-width: 1px; }
.parts-check label { border-radius: 0; border-width: 1px; }
.parts-check .p-id { font-weight: 500; }
.parts-check .p-qty { font-weight: 500; }
.spot-btn, .find-btn { border-width: 1px; border-radius: 0; }
.step-list button { border-radius: 0; }
.sl-num { border-radius: 0; font-weight: 500; }
.step-list .is-done .sl-num { background: var(--accent-soft); color: var(--accent-text); }
.verify-note.is-gap { border-radius: 0; }
.help-card { border-radius: 0; }
.help-summary { font-weight: 700; }
.ask-form { border: 1px solid var(--line); border-radius: 0; }
.ask-form:focus-within { border-color: var(--line); }
.quick-q { border: 1px solid var(--border); border-radius: 0; font-weight: 700; }
.quick-q:hover { border-color: var(--line); color: var(--text); }
.feedback { border-radius: 0; }
.rate-btn { border: 1px solid var(--border); border-radius: 0; font-weight: 700; }
.rate-btn:hover { border-color: var(--line); }
.rate-btn.is-picked { border-color: var(--line); background: var(--accent-fill); color: var(--text); }
.done h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 3rem; letter-spacing: -0.01em; }
.done-icon { background: var(--accent-fill); color: var(--text); border: 1px solid var(--line); border-radius: 0; }

/* floating controls on the 3D stage (always on paper, whatever the theme) */
.chip-btn { border: 1px solid #31263b; border-radius: 0; font-weight: 700; min-height: 42px; background: #fdfbfa; color: #14141c; }
.chip-btn.icon-only { width: 44px; }
.chip-btn:hover { background: #f3eeec; }
.mode-toggle { border: 1px solid #31263b; border-radius: 0; background: #fdfbfa; padding: 3px; }
.mode-toggle button { border-radius: 0; font-weight: 700; color: #5d5c66; }
.mode-toggle button[aria-pressed='true'] { background: #fbe1e1; color: #14141c; box-shadow: inset 0 0 0 1px #31263b; }
.part-label { border-radius: 0; padding-inline-end: 12px; font-weight: 700; }
.part-label.is-current { border-color: #17b26a; box-shadow: 0 0 0 3px rgba(23, 178, 106, 0.28); }
.detail-frame { border-radius: 0; }
.detail-chip { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); border-radius: 0; }
.part-card, .coach, .room-setup { box-shadow: var(--shadow); border-radius: 0; border: 1px solid var(--line); }
.glow-dot { background: var(--glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 28%, transparent); }

/* the step boxes */
.step-strip { border-top: 1px solid var(--border); }
.step-dot { border: 1px solid var(--border); border-radius: 0; background: var(--surface); }
.step-dot:hover { border-color: var(--line); }
.sd-num { font-family: var(--display); font-weight: 700; font-stretch: 112%; }
.sd-label { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.step-dot.is-done { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.step-dot.is-current { background: var(--accent-fill); border-color: var(--line); color: var(--text); box-shadow: none; }

/* the bar along the bottom */
.guide-bar { border-top: 1px solid var(--border); background: var(--bg); }
.toggle { border: 1px solid var(--border); border-radius: 0; font-weight: 700; min-height: 44px; font-size: 0.95rem; }
.toggle:hover { border-color: var(--line); }
.toggle[aria-pressed='true'] { background: var(--accent-fill); border-color: var(--line); color: var(--text); }
.toggle-ask { background: var(--accent-fill); color: var(--text); border-color: var(--line); box-shadow: none; position: relative; }
.toggle-ask:hover { background: var(--accent-fill-hover); border-color: var(--line); }
.guide-bar .agent-badge { border-radius: 0; font-weight: 700; }

/* the helper */
.helper-panel { border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); }
.helper-badge { border-radius: 0; }
.helper-heading h2 { font-weight: 700; }
.helper-log .q { border-radius: 0; }
.helper-log .a { border-radius: 0; }
.helper-log .a > b { font-weight: 700; }
.helper-speak { font-weight: 700; }
@media (max-width: 860px), (max-height: 520px) and (orientation: landscape) {
  .helper-panel { border-radius: 0; }
}

/* read-along: the words being spoken get a green wash */
#panel-body .is-speaking { background: var(--glow-soft); box-shadow: 0 0 0 8px var(--glow-soft); border-radius: 0; }
#panel-body .is-speaking:not(.callout) { outline: 0; }

@media (min-width: 861px) {
  .step-card { border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); }
  .step-card .step-title { font-size: 1.35rem; }
}
@media (max-width: 860px) {
  .step-card { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
}

/* ---- dialogs, toasts, settings */
dialog, .share-dialog { border-radius: 0; }
.share-inner h2 { font-weight: 700; }
.share-url { border: 1px solid var(--line); border-radius: 0; }
.qr { border-radius: 0; }
.toast { border-radius: 0; font-weight: 700; }
.toast-action { border-radius: 0; font-weight: 700; }
.setting-row { font-weight: 700; border-bottom: 1px solid var(--border); }
.setting-row select { border: 1px solid var(--line); border-radius: 0; font-weight: 700; }
.edit-form input, .edit-form textarea, .fb-form textarea, .report-form textarea { border: 1px solid var(--line); border-radius: 0; }
.edit-form label { color: var(--text); font-weight: 700; }
.link-code { font-weight: 500; letter-spacing: 0.12em; }

/* ---- my room */
.room-head h1 { font-weight: 700; }
.room-panel h2 { font-weight: 700; }
.room-setup input[type='number'], .room-scale input, .room-known select, .room-known input, .room-size-fields input {
  border: 1px solid var(--line); border-radius: 0; background: var(--surface);
}
.room-piece { border-radius: 0; }

/* the reader's notes on the overview: one quiet line, opened on a click */
.notes-fold { margin: 2px 0 10px; }
.notes-fold > summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.notes-fold > summary::-webkit-details-marker { display: none; }
.notes-fold > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.notes-fold[open] > summary::before { transform: rotate(45deg); }
.notes-fold[open] > summary { margin-bottom: 6px; }

/* the Brix logo: letter tiles, the X tipped over in orange */
.brand-logo { height: 38px; width: auto; display: block; }
/* on paper the cream tiles need a hairline edge to stand out; on obsidian they stand out by themselves */
.brand-logo { filter: drop-shadow(0 0 0.6px rgba(49, 38, 59, 0.6)) drop-shadow(0 1px 0 rgba(49, 38, 59, 0.18)); }
:root[data-theme='dark'] .brand-logo { filter: none; }
@media (max-width: 640px) { .brand-logo { height: 32px; } }

/* ---- theme switch: a sun in the dark theme (go light), a moon in the light one (go dark) */
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; background: none; color: var(--text); cursor: pointer; }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 22px; height: 22px; }
:root[data-theme='dark'] .theme-btn .ic-moon, :root:not([data-theme='dark']) .theme-btn .ic-sun { display: none; }

/* ---- the top bar: a framed bar that floats at the top of the page and stays there as you scroll, the tabs in
   the middle, the logo on the left and the settings on the right; orange handles at its corners */
:root { --topbar-h: 76px; }   /* the bar (60px) and the gap around it */
.topbar {
  position: sticky; top: 8px; z-index: 30;
  height: 60px; width: min(1200px, calc(100% - 24px)); margin: 8px auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 16px;
  padding: 0 14px; border: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px -22px rgba(20, 20, 28, 0.45);
}
.topbar::after {
  content: ''; position: absolute; inset: -4px; pointer-events: none;
  background:
    linear-gradient(var(--orange), var(--orange)) top left / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top right / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom left / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom right / 6px 6px no-repeat;
}
.topbar > .brand { justify-self: start; align-self: center; }
.topbar > .main-nav { justify-self: center; margin: 0; }
.topbar > .topbar-actions { justify-self: end; align-self: center; }
@media (max-width: 640px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); width: calc(100% - 16px); padding: 0 10px; }
}
/* short landscape phones: a plain strip, every pixel goes to the 3D view */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --topbar-h: 48px; }
  .topbar { top: 0; height: 48px; width: 100%; margin: 0; border-width: 0 0 1px; box-shadow: none; }
  .topbar::after { display: none; }
}
/* keep the bar's top margin inside the body (else it collapses through, and a full-height body ends 8px too low) */
body { display: flow-root; }
/* phones: My room as a compact row, its button full width underneath */
@media (max-width: 640px) {
  .room-card { flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px; margin-bottom: 20px; }
  .room-card-text { flex: 1 1 0; min-width: 0; }
  .room-card > .btn { flex: 1 0 100%; }
  .room-card-icon { width: 44px; height: 44px; }
}

/* ---- grain: the page is a warm off-white with a fine noise over it, so it reads as paper, not a screen */
:root {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.19  0 0 0 0 0.15  0 0 0 0 0.23  0 0 0 .17 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme='dark'] {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body {
  background-image: var(--grain), linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 180px 180px, 28px 28px, 28px 28px;
}

/* ---- the band behind the upload box and your latest guide: squared paper with grain, so the two read as the
   place to start. The squares are centred (the same on both sides) and fade into the grainy paper near the band's
   edges and around the two boxes, so the boxes sit in a clear margin.
   Layers, back to front: the band's paper and grain; the squares (::before); a paper-and-grain halo behind each
   box that fades out over 44px (.hero-item::before); the boxes; the orange handles (::after). */
:root { --band-bg: #fbfaf8; --squares: rgba(49, 38, 59, 0.10); --squares-major: rgba(49, 38, 59, 0.19); --halo: 26px; }
:root[data-theme='dark'] { --band-bg: #191921; --squares: rgba(228, 230, 236, 0.08); --squares-major: rgba(228, 230, 236, 0.15); }
.hero-band {
  position: relative; isolation: isolate; margin-bottom: 8px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 28px; row-gap: 28px; align-items: start;
  padding: 64px; column-gap: 64px; border: 1px solid var(--border);
  background-color: var(--band-bg); background-image: var(--grain); background-size: 180px 180px;
}
.hero-band::before {
  content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--squares-major) 1px, transparent 1px), linear-gradient(90deg, var(--squares-major) 1px, transparent 1px),
    linear-gradient(var(--squares) 1px, transparent 1px), linear-gradient(90deg, var(--squares) 1px, transparent 1px);
  background-size: 128px 128px, 128px 128px, 32px 32px, 32px 32px;
  background-position: center;
  /* fade out toward the band's own edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent),
                      linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent),
              linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-composite: intersect;
}
.hero-band::after {
  content: ''; position: absolute; inset: -4px; pointer-events: none;
  background:
    linear-gradient(var(--orange), var(--orange)) top left / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) top right / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom left / 6px 6px no-repeat,
    linear-gradient(var(--orange), var(--orange)) bottom right / 6px 6px no-repeat;
}
.hero-item { position: relative; }
.hero-item::before {
  content: ''; position: absolute; inset: calc(-1 * var(--halo)); z-index: -1; pointer-events: none;
  background-color: var(--band-bg); background-image: var(--grain); background-size: 180px 180px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--halo), #000 calc(100% - var(--halo)), transparent),
                      linear-gradient(to bottom, transparent, #000 var(--halo), #000 calc(100% - var(--halo)), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 var(--halo), #000 calc(100% - var(--halo)), transparent),
              linear-gradient(to bottom, transparent, #000 var(--halo), #000 calc(100% - var(--halo)), transparent);
  mask-composite: intersect;
}
.hero-band .dropzone { background: var(--surface); }
@media (max-width: 1100px) { .hero-band { padding: 44px; column-gap: 44px; } }
@media (max-width: 980px) { .hero-band { padding: 40px; row-gap: 48px; } }
@media (max-width: 640px) { .hero-band { padding: 22px; row-gap: 32px; margin-inline: -4px; } :root { --halo: 14px; } }

/* ---- a build's name in a flowing italic: the latest guide next to the upload, the
   guide's overview, the build-in-progress screen and My room. The project cards keep the bold heading face, so
   the latest guide stands apart from the past ones. */
.demo-title, .build-name, .found-title, .room-piece-name, #room-sel-name {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal; letter-spacing: -0.005em;
}
.step-card .step-title.build-name, .step-title.build-name { font-size: 2rem; line-height: 1.05; }
.found-title { font-size: 1.5rem; }
.room-piece-name { font-size: 1.2rem; line-height: 1.15; }
.room-piece-name small { font-family: var(--font); font-style: normal; }
#room-sel-name { font-size: 1.7rem; }
.demo-wrap > .demo { margin-top: 0; }
@media (max-width: 980px) {
  .hero-band { grid-template-columns: minmax(0, 1fr); }
  .hero-band > .home-grid, .hero-band > .demo-wrap { grid-column: 1; }
}

/* ---- the squared band reaches almost to the window's edges (a 24px margin), its contents stay in the page's
   column: the band grows outward and its padding grows with it */
@media (min-width: 981px) {
  .screen-home > .hero-band {
    --wide: min(calc(100vw - 48px), 1480px);
    margin-inline: calc((100% - var(--wide)) / 2);
    padding-inline: calc(64px + (var(--wide) - 100%) / 2);
    /* the same left padding, from the page column's width (a % would mean something else on the trail) */
    --pad-l: calc(64px + (var(--wide) - (min(100vw, 1200px) - 40px)) / 2);
  }
}
body { overflow-x: clip; }

/* ---- the guides: a centred heading, then tiles like a feature grid — a soft grainy panel, the 3D picture
   floating at the top with its edges faded into the panel, the name in heavy type, the details in mono */
.library { margin-top: 72px; }
.library-head { flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 16px; margin-bottom: 36px; }
.library-head h2, .library h2 {
  font-family: var(--display); font-weight: 800; font-stretch: 118%; letter-spacing: -0.035em;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1;
}
.library-head .guide-search { width: min(420px, 100%); }
:root { --tile: #f1efed; --tile-hover: #ebe8e5; }
:root[data-theme='dark'] { --tile: #1c1c25; --tile-hover: #22222c; }
.guide-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.guide-card {
  background-color: var(--tile); background-image: var(--grain); background-size: 180px 180px;
  border: 0; border-radius: 0; box-shadow: none; padding: 26px 30px 30px; gap: 10px; overflow: visible;
  transition: background-color 0.15s;
}
.guide-card:hover { background-color: var(--tile-hover); border: 0; box-shadow: none; transform: none; }
.guide-card .guide-thumb {
  width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 0; border-radius: 0; background: none;
  margin-bottom: 14px; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 58%, transparent 100%);
          mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 58%, transparent 100%);
}
:root[data-theme='dark'] .guide-card .guide-thumb { mix-blend-mode: normal; }
.guide-card .guide-thumb.is-empty { display: grid; place-items: center; color: var(--muted); -webkit-mask-image: none; mask-image: none; }
.guide-card .guide-thumb.is-empty svg { width: 56px; height: 56px; }
.guide-card h3 {
  font-family: var(--display); font-style: normal; font-weight: 800; font-stretch: 112%; letter-spacing: -0.03em;
  font-size: 1.6rem; line-height: 1.12; padding: 0;
}
.guide-meta { padding: 0; margin-top: 2px; }
.guide-progress { margin: 8px 0 0; height: 3px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.guide-card.is-building { background-color: var(--tile); outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.card-menu { top: 14px; right: 14px; }
.card-menu .icon-btn { background: color-mix(in srgb, var(--surface) 80%, transparent); border: 0; }
@media (max-width: 640px) {
  .guide-list { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .guide-card { padding: 20px 22px 24px; }
  .guide-card h3 { font-size: 1.4rem; }
}

/* softer fade on the card pictures, so no rectangle shows */
.guide-card .guide-thumb {
  -webkit-mask-image: radial-gradient(ellipse 62% 64% at 50% 50%, #000 38%, transparent 92%);
          mask-image: radial-gradient(ellipse 62% 64% at 50% 50%, #000 38%, transparent 92%);
}

/* ---- drafting lines, as on a technical drawing: two rails down the page lined up with the squared band's edges,
   and a ruled line with end ticks between the sections */
:root { --rail: max(24px, calc((100vw - 1480px) / 2)); --rule: color-mix(in srgb, var(--line) 22%, transparent); }
body::after {
  content: ''; position: fixed; top: 0; bottom: 0; left: var(--rail); right: var(--rail); z-index: -1; pointer-events: none;
  border-left: 1px solid var(--rule); border-right: 1px solid var(--rule);
}
.screen-home > .library, .screen-home > .site-foot { position: relative; }
.screen-home > .library::before, .screen-home > .site-foot::before {
  content: ''; position: absolute; height: 9px; pointer-events: none;
  left: calc(50% - 50vw + var(--rail)); right: calc(50% - 50vw + var(--rail));
  background:
    linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) left center / 1px 9px no-repeat,
    linear-gradient(var(--line), var(--line)) right center / 1px 9px no-repeat;
}
.screen-home > .library::before { top: -40px; }
.screen-home > .library { margin-top: 96px; }
.screen-home > .site-foot { border-top: 0; margin-top: 72px; }
.screen-home > .site-foot::before { top: -4px; }
@media (max-width: 640px) {
  body::after { display: none; }
  .screen-home > .library::before, .screen-home > .site-foot::before { left: 0; right: 0; }
}

/* ---- no corner handles on the squared band */
.hero-band::after { display: none; }

/* ---- "Your Guides": a flowing italic heading set into a ruled line. The line runs from the left rail to the
   heading, breaks for it, and picks up again after it to the right rail, with a tick at each rail. */
.screen-home > .library::before { display: none; }
.library-head { align-items: stretch; }
.library-head h2, .library h2#library-title {
  display: flex; align-items: center; gap: 32px;
  margin-inline: calc(50% - 50vw + var(--rail));
  font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal; letter-spacing: -0.01em;
  font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; white-space: nowrap;
}
.library-head h2::before, .library-head h2::after {
  content: ''; flex: 1; height: 9px; min-width: 24px;
  background: linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat;
}
.library-head h2::before { background: linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) left center / 1px 9px no-repeat; }
.library-head h2::after { background: linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) right center / 1px 9px no-repeat; }
.library-head .guide-search { align-self: center; }
@media (max-width: 640px) {
  .library-head h2, .library h2#library-title { margin-inline: 0; gap: 16px; }
}
/* a slight, very light drop shadow under the heading's letters */
.library-head h2, .library h2#library-title { text-shadow: 0 2px 3px rgba(49, 38, 59, 0.12), 0 6px 14px rgba(49, 38, 59, 0.08); }
:root[data-theme='dark'] .library-head h2 { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); }

/* ---- My room's mark: the Brix logo's tipped orange tile, with a house on it */
.room-card-icon { width: 56px; height: 56px; background: none; border-radius: 0; }
.room-card-icon .room-mark { width: 56px; height: 56px; filter: drop-shadow(0 2px 3px rgba(49, 38, 59, 0.18)); }
.room-head { align-items: center; }
.room-head .room-mark { width: 34px; height: 34px; flex: none; margin-inline-end: -6px; filter: drop-shadow(0 1px 2px rgba(49, 38, 59, 0.18)); }
@media (max-width: 640px) { .room-card-icon, .room-card-icon .room-mark { width: 46px; height: 46px; } }

/* ---- very light drop shadows, only on things that sit on the paper: cards and panels, the guide tiles, the step
   boxes, buttons and the controls floating on the 3D view. Barely there, so the page still reads as flat paper. */
:root {
  --lift: 0 1px 2px rgba(20, 20, 28, 0.045), 0 6px 16px -8px rgba(20, 20, 28, 0.10);
  --lift-sm: 0 1px 2px rgba(20, 20, 28, 0.06);
  --lift-hover: 0 2px 4px rgba(20, 20, 28, 0.05), 0 12px 24px -12px rgba(20, 20, 28, 0.16);
}
:root[data-theme='dark'] {
  --lift: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 16px -8px rgba(0, 0, 0, 0.5);
  --lift-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --lift-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
}
.room-card, .hero-band .demo, .hero-band .dropzone, .guide-card, .file-item, .profile-head, .stats, .processing,
.screen-tab .guide-card, .help-card, .feedback { box-shadow: var(--lift); }
.room-card:hover, .guide-card:hover { box-shadow: var(--lift-hover); }
.step-dot, .demo-step-btn, .chip-btn, .mode-toggle, .toggle, .btn-primary, .btn-secondary, .chip, .quick-q, .rate-btn { box-shadow: var(--lift-sm); }
.step-dot.is-current { box-shadow: var(--lift); }
.btn:disabled { box-shadow: none; }

/* ---- X marks the spot: a dotted trail from the squared band's corner, across the margin and into the upload box,
   to the logo's X sitting where you drop a manual (it stands in for the upload arrow). Drawn by home.js to
   wherever the drop spot is; only where there's a band margin for it to cross (wide screens). */
.x-trail { display: none; }
.hero-band.has-trail > .x-trail {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible;
  color: color-mix(in srgb, var(--text) 42%, transparent);
}
.hero-band.has-trail > .hero-item { z-index: 1; }
.hero-band.has-trail .dz-icon { visibility: hidden; }
.x-trail .x-tile { filter: drop-shadow(0 2px 3px rgba(20, 20, 28, 0.18)); }

/* ---- Your Guides on dotted paper: a grid of faint dots behind the section, from rail to rail, strongest around the
   heading and fading out toward the sides and the bottom; the tiles sit on top of it */
:root { --dots: rgba(49, 38, 59, 0.26); }
:root[data-theme='dark'] { --dots: rgba(228, 230, 236, 0.16); }
.screen-home > .library::before {
  display: block; content: ''; position: absolute; z-index: -1; pointer-events: none; height: auto;
  top: -56px; bottom: -48px; left: calc(50% - 50vw + var(--rail)); right: calc(50% - 50vw + var(--rail));
  background: radial-gradient(circle, var(--dots) 1px, transparent 1.5px) center top / 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 22%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 62% 70% at 50% 22%, #000 25%, transparent 78%);
}
@media (max-width: 640px) {
  .screen-home > .library::before { left: -16px; right: -16px; background-size: 16px 16px; }
}
/* dark theme: the controls floating on the 3D view take the theme's colours, not paper */
:root[data-theme='dark'] .chip-btn, :root[data-theme='dark'] .mode-toggle { background: var(--surface); color: var(--text); border-color: var(--border); }
:root[data-theme='dark'] .chip-btn:hover { background: var(--surface-2); }
:root[data-theme='dark'] .mode-toggle button { color: var(--muted); }
:root[data-theme='dark'] .mode-toggle button[aria-pressed='true'] { background: var(--accent-fill); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* ---- the labels in the 3D guide are Brix orange: the label for the part being added (its box, letter badge,
   leader line and dot) and its "You need" chip. The part itself still glows green in 3D. */
:root { --label: #e8590c; --label-soft: #fdeee5; --label-ink: #9a3412; }
:root[data-theme='dark'] { --label: #ff7a2e; --label-soft: #3a2418; --label-ink: #ffb380; }
.part-label.is-current { border-color: var(--label); box-shadow: 0 0 0 3px color-mix(in srgb, var(--label) 28%, transparent); }
.part-label.is-current .pl-id { background: var(--label); color: #ffffff; }
.callout-lines .is-current { stroke: var(--label); }
.callout-lines circle.is-current { fill: var(--label); stroke: #ffffff; }
.chip.is-current { border-color: var(--label); background: var(--label-soft); color: var(--text); }
.chip.is-current .chip-id { color: var(--label-ink); }

/* the guide pictures now have a clear background: no blending needed */
.guide-card .guide-thumb { mix-blend-mode: normal; }

/* ================================================================ Plan my room */
.room-head { align-items: center; }
.room-head-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.room-view button { min-height: 34px; padding: 0 14px; }
.room-badge {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
  color: var(--orange-text); border: 1px solid color-mix(in srgb, var(--orange) 45%, transparent); padding: 3px 8px;
}
.room-hint {
  position: absolute; top: 12px; left: 12px; margin: 0; max-width: min(460px, calc(100% - 24px)); pointer-events: none;
  font-size: 0.85rem; padding: 6px 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted);
  border: 1px solid var(--border); box-shadow: var(--lift-sm);
}
#screen-room[data-mode='view'] .room-warn { display: none; }

/* the list: drag a piece out of it onto the floor */
.room-piece[data-drag] { cursor: grab; transition: background 0.15s, box-shadow 0.15s; }
.room-piece[data-drag]:hover { background: var(--surface-3); box-shadow: var(--lift-sm); }
.room-piece-drag { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.room-piece-drag::before {
  content: ''; flex: none; width: 8px; height: 18px; opacity: 0.45;
  background: radial-gradient(circle, currentColor 1.2px, transparent 1.6px) 0 0 / 4px 6px;
}
.room-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-weight: 700; font-size: 0.95rem; max-width: 280px; transition: opacity 0.12s;
}
.room-ghost img, .room-ghost .room-piece-thumb { width: 52px; height: 36px; object-fit: contain; }
.room-ghost small { display: none; }
.room-ghost.is-over { opacity: 0; }
body:has(.room-ghost) { cursor: grabbing; }

/* the selected piece: a way to its instructions */
.room-open-guide { justify-self: start; color: var(--accent-text); }

/* someone else's room: the stage takes the width; a tap on a piece opens this card */
#screen-room[data-mode='view'] .room-layout { grid-template-columns: minmax(0, 1fr); }
#screen-room[data-mode='view'] .room-side { display: none; }
#screen-room[data-mode='collab'] #room-settings { display: none; }
.room-pop {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(380px, calc(100% - 32px));
  padding: 18px 20px 20px; display: grid; gap: 8px; z-index: 3; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.room-pop h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.8rem; line-height: 1.05; }
.room-pop .btn { justify-self: start; margin-top: 6px; }

/* the share dialog */
.room-share-dialog { width: min(520px, calc(100vw - 32px)); }
.room-share-dialog .share-inner { display: grid; gap: 16px; }
.room-share-name { display: grid; gap: 6px; font-weight: 700; }
.room-share-name input { min-height: 46px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); }
.room-vis { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.room-vis-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); cursor: pointer; }
.room-vis-opt:has(input:checked) { border-color: var(--line); background: var(--accent-fill); }
.room-vis-opt input { margin-top: 4px; accent-color: var(--orange); }
.room-vis-opt > span { display: grid; gap: 2px; }
.room-vis-opt .muted { font-size: 0.92rem; }
.room-together { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.room-together h3 { font-size: 1.05rem; }
.room-together .ask-form input { font-family: var(--mono); font-size: 0.85rem; }
.room-share-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Discover: room design cards */
.room-design-card .design-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--viewer-top); margin-bottom: 14px; box-shadow: inset 0 0 0 1px var(--border); }
.room-design-card .design-thumb.is-empty {
  background: var(--viewer-top) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'><rect x='120' y='252' width='785' height='758' rx='152' fill='%231e1d1b'/><path d='M430 840H273V420h477v420H597' fill='none' stroke='%23f3f0ea' stroke-width='42' stroke-linecap='round' stroke-linejoin='round'/><g transform='rotate(8.6 730 210)'><rect x='595' y='98' width='270' height='224' rx='44' fill='%23e8590c'/></g><path d='M467 111l45 44M590 28l7 57' fill='none' stroke='%23e8590c' stroke-width='22' stroke-linecap='round'/></svg>") center / 56px no-repeat;
}
@media (max-width: 860px) {
  .room-head-actions { margin-inline-start: 0; width: 100%; }
  .room-hint { font-size: 0.8rem; }
}

/* Discover: featured guides or room designs */
.discover-switch { justify-self: start; margin-top: 6px; }
.discover-switch button { min-height: 40px; padding: 0 18px; }
.room-share-dialog .share-inner { text-align: start; }
.room-share-dialog h2 { text-align: start; }

/* a piece's size, looked up online (or the most likely size) */
.room-lookup:empty { display: none; }
.room-lookup-busy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.92rem; margin: 0; }
.room-lookup-busy .spinner { width: 14px; height: 14px; border-width: 2px; }
.room-lookup-result { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 6px; }
.room-lookup-result.is-found { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.room-lookup-result.is-estimate { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.room-lookup-result p { margin: 0; font-size: 0.92rem; }
.room-lookup-result .btn { justify-self: start; margin-top: 2px; }

/* the new Plan my room mark has room around it: show it a little larger */
.room-head .room-mark { width: 42px; height: 42px; margin-inline-end: -4px; }
.room-card-icon, .room-card-icon .room-mark { width: 60px; height: 60px; }

/* sharing with people: a link that can edit, and one that can only look */
.room-link { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); }
.room-link-head { display: grid; gap: 2px; }
.room-link-head .muted { font-size: 0.9rem; }
.room-link .ask-form input { font-family: var(--mono); font-size: 0.82rem; }
.room-link-on { display: grid; gap: 4px; }
.room-link-on[hidden], .room-link-off[hidden] { display: none; }
.room-link-on > .btn-ghost { justify-self: start; }
/* the pop-up on a shared room's furniture */
.room-pop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }
.room-pop-actions .btn { margin-top: 0; }

/* ---- Discover's heading, search and switch on the same dotted paper as Your Guides: faint dots on a grid,
   strongest behind the heading and fading out toward the sides and below */
#screen-discover .tab-head { position: relative; padding: 28px 0 32px; }
#screen-discover .tab-head::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: -24px; bottom: -40px; left: calc(50% - 50vw + var(--rail)); right: calc(50% - 50vw + var(--rail));
  background: radial-gradient(circle, var(--dots) 1px, transparent 1.5px) center top / 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 58% 75% at 35% 40%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 58% 75% at 35% 40%, #000 25%, transparent 78%);
}
#screen-discover { position: relative; }
@media (max-width: 640px) {
  #screen-discover .tab-head::before { left: -16px; right: -16px; background-size: 16px 16px; }
}
/* pictures drawn fresh with a transparent background need no fade at their edges */
.guide-card .guide-thumb.is-rendered { -webkit-mask-image: none; mask-image: none; }
.room-piece img.is-rendered { object-fit: contain; background: none; }

/* room pictures in Discover have a clear background: the card's own colour shows behind the room */
.room-design-card .design-thumb { background: color-mix(in srgb, var(--viewer-top) 70%, transparent); object-fit: contain; }

/* Discover: For you */
.for-you { margin-bottom: 8px; }
.for-you-lede { margin: -6px 0 16px; }
.for-you-why {
  margin: 0 0 4px; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--orange-text);
}
.guide-card .for-you-why { padding: 0; }

/* Plan my room is a workspace: no top bar or tabs, the room takes the whole screen ("‹ Projects" goes back) */
body[data-screen='room'] .topbar, body[data-screen='room'] .tab-bar { display: none; }
body[data-screen='room'] { --topbar-h: 0px; }
body[data-screen='room'] .screen-room { height: 100dvh; }

/* ================================================================ accounts
   Sign in / Create account, in the same drafting-table language as the rest: square edges, 1px ink lines, the
   pink main button with its orange handles, mono capitals for small labels and the italic serif for the headline. */

/* top bar: Sign in for guests (signed in, Profile is the way to the account) */
.account-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; margin-inline-start: 10px;
  color: var(--text); font-weight: 700; text-decoration: none; border: 1px solid var(--line); background: var(--surface);
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s;
}
.account-btn:hover { background: var(--accent-fill); }
.account-btn svg { width: 18px; height: 18px; }
.account-btn[hidden] { display: none; }
@media (max-width: 480px) { .account-btn span { display: none; } .account-btn { padding: 0 10px; } }

/* the sign-in screen: one sheet in the middle of the page */
.screen-account { display: grid; justify-items: center; padding-top: 56px; }
.auth {
  width: min(480px, 100%); padding: 34px 32px 28px; display: grid; gap: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--lift);
}
.auth h1 {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal;
  font-size: clamp(2.4rem, 6vw, 3.1rem); line-height: 1; letter-spacing: -0.01em; margin-top: -6px;
}
.auth .eyebrow { color: var(--orange-text); }
.auth-lede { color: var(--muted); margin-top: -4px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 4px 0 0; }
.auth-switch button { min-height: 44px; }
.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; font-weight: 700; font-size: 1rem; }
.auth-field > span, .auth-field > label { font-weight: 700; }
.auth-field input {
  min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 400; font-size: 1.1rem; width: 100%;
}
.auth-field input:focus-visible { outline: 3px solid var(--orange); outline-offset: 0; box-shadow: none; }
.auth-field[hidden] { display: none; }
.auth-pw { position: relative; display: flex; }
.auth-pw input { padding-inline-end: 84px; }
.auth-show {
  position: absolute; inset-block: 6px; inset-inline-end: 6px; padding: 0 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
.auth-show:hover { border-color: var(--line); }
.auth-hint { font-weight: 400; font-size: 0.92rem; color: var(--muted); }
.auth-hint[hidden] { display: none; }
.auth-error {
  margin: 0; padding: 10px 12px; border: 1px solid var(--danger); color: var(--danger); font-weight: 700;
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.auth-error[hidden] { display: none; }
.auth .btn-block { margin-top: 4px; }
.auth-alt { text-align: center; color: var(--muted); margin: 2px 0 0; }
.auth-alt .link-btn { margin: 0; padding: 4px 6px; text-decoration: underline; text-underline-offset: 0.2em; color: var(--text); }
.auth-privacy {
  display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 0; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 0.92rem; color: var(--muted);
}
.auth-privacy .ico svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .screen-account { padding-top: 24px; }
  .auth { padding: 26px 18px 22px; }
}

/* Profile, signed out: an invitation to keep the library everywhere */
.account-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  margin-top: 20px; padding: 20px 24px; background: var(--surface); border: 1px dashed var(--line);
}
.account-cta[hidden] { display: none; }
.account-cta h2 { font-size: 1.35rem; }
.account-cta-text { display: grid; gap: 4px; max-width: 46ch; }
.account-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.account-cta-actions .btn { text-decoration: none; padding: 0 22px; }

/* Profile, signed in: who you are, sign out, and the rarely needed bits folded away */
.account-manage[hidden] { display: none; }
.account-manage-body { display: grid; gap: 0; padding: 0; background: var(--surface); }
.account-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 22px;
}
.account-email { margin: 0; display: grid; gap: 2px; font-weight: 700; overflow-wrap: anywhere; }
.account-more { border-top: 1px solid var(--border); }
.account-more > summary {
  list-style: none; cursor: pointer; padding: 16px 22px; font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.account-more > summary::-webkit-details-marker { display: none; }
.account-more > summary::after {
  content: ''; margin-inline-start: auto; width: 9px; height: 9px; margin-top: -4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s;
}
.account-more[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.account-more .auth-form { padding: 0 22px 22px; max-width: 460px; }
.account-more.is-danger > summary { color: var(--danger); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); justify-self: start; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }

/* the sign-in page is its own page: no top bar or tabs, just the logo, a way back, and the sheet */
body[data-screen='account'] .topbar, body[data-screen='account'] .tab-bar { display: none; }
body[data-screen='account'] { --topbar-h: 0px; }
body[data-screen='account'] main { padding-bottom: 0; }
.screen-account { padding-top: 28px; gap: 18px; align-content: start; min-height: 100dvh; }
.auth-top { width: min(480px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-back { margin: 0; padding: 8px 10px 8px 4px; text-decoration: none; }
.auth-back svg { width: 20px; height: 20px; }
.auth-logo { display: block; line-height: 0; }
.auth-logo img { height: 40px; width: auto; }
.welcome-signin { gap: 8px; }
.welcome-signin svg { width: 18px; height: 18px; }
[dir='rtl'] .auth-back svg { transform: scaleX(-1); }

/* home: what Brix does, as the parts list at the front of an assembly manual. Each feature is a lettered part,
   on tiles cut like the letters of the logo. */
.features {
  margin-top: 56px; padding: 30px 32px 34px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--lift); position: relative;
}
.features-head { display: grid; gap: 6px; max-width: 60ch; margin-bottom: 26px; }
.features-head .eyebrow { color: var(--orange-text); }
.features-head h2 {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal;
  font-size: clamp(2.1rem, 4.4vw, 3rem); line-height: 1.02; letter-spacing: -0.01em;
}
.features-lede { color: var(--muted); }
.features-list {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px; border-top: 1px solid var(--line);
}
.feature { display: flex; gap: 16px; align-items: flex-start; padding: 20px 0; border-bottom: 1px dashed var(--border); }
.feat-tile {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: 1.45rem; color: #1e1d1b;
  background: #f3f0ea; border: 1px solid #d9d3c8; border-radius: 6px; box-shadow: 0 2px 0 #d9d3c8;
}
.feature:last-child .feat-tile { background: var(--orange); color: #ffffff; border-color: var(--orange); box-shadow: 0 2px 0 #b8460a; transform: rotate(-5deg); }
.feat-text { display: grid; gap: 4px; min-width: 0; }
.feat-text h3 { font-family: var(--display); font-size: 1.2rem; font-weight: 700; font-stretch: 108%; letter-spacing: -0.01em; }
.feat-text p { color: var(--muted); }
:root[data-theme='dark'] .feat-tile { background: #e9e4da; border-color: #b9b2a6; box-shadow: 0 2px 0 #8e877b; }
@media (max-width: 760px) {
  .features { margin-top: 40px; padding: 24px 18px 26px; }
  .features-list { grid-template-columns: minmax(0, 1fr); }
}

/* the features run the full width of the page, under the upload and the demo */
.screen-home > .features { grid-column: 1 / -1; }

/* top bar with the Sign in button: the right-hand side may grow to fit its buttons instead of spilling over the
   tabs (they shift a little left when space is tight); narrower screens show the button as just its icon, and
   phones leave it out, since the Profile tab at the bottom has sign-in */
@media (min-width: 641px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr); }
}
@media (max-width: 1180px) {
  .account-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .account-btn { padding: 0 10px; }
}
.topbar-actions:has(.account-btn:not([hidden])) .install-btn span { display: none; }
@media (max-width: 640px) {
  .account-btn { display: none; }
}

/* Sign in with Google: Google's own look for its button (white, grey edge, the four-colour G), square like ours */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 18px;
  background: #ffffff; color: #1f1f1f; border: 1px solid #747775; text-decoration: none;
  font-weight: 700; font-size: 1.05rem; transition: background 0.15s;
}
.google-btn:hover { background: #f2f2f2; }
.google-btn svg { width: 20px; height: 20px; }
.google-btn[hidden] { display: none; }
:root[data-theme='dark'] .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
:root[data-theme='dark'] .google-btn:hover { background: #1f1f20; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 0.95rem; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px dashed var(--border); }
.auth-or[hidden] { display: none; }
.account-more[hidden] { display: none; }

/* Merge fixes: the orange "F" tile stays orange in dark mode, and the Profile numbers fit a phone's card. */
:root[data-theme='dark'] .feature:last-child .feat-tile { background: var(--orange); color: #ffffff; border-color: var(--orange); box-shadow: 0 2px 0 #b8460a; }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div, .stats > div:first-child { padding: 12px 10px 14px; min-width: 0; }
  .stats > div:first-child { border-inline-start: 0; }
  .stats dt { font-size: 0.72rem; letter-spacing: 0.04em; overflow-wrap: anywhere; }
  .stats dd { font-size: 2rem; }
}

/* ------------------------------------------------------------------ the welcome page (Sign in / Create account)
   A product page: a centred headline with two buttons, the product beside the form on the drafting grid,
   then proof, what an account adds, who it's for, a closing call and questions. */
.screen-account { display: block; padding-top: 24px; padding-bottom: 72px; }
.screen-account > * { max-width: 1180px; margin-inline: auto; }
.screen-account > .auth-top { max-width: 1180px; }
.welcome-hero { text-align: center; display: grid; justify-items: center; gap: 18px; padding: 56px 16px 52px; }
.welcome-eyebrow { color: var(--orange-text); }
.welcome-title {
  font-family: var(--display); font-weight: 800; font-stretch: 112%; letter-spacing: -0.035em;
  font-size: clamp(2.6rem, 7.4vw, 5.4rem); line-height: 0.98; max-width: 14ch; text-wrap: balance;
}
.welcome-title em {
  display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: normal;
  letter-spacing: -0.01em; color: var(--orange-text);
}
.welcome-lede { max-width: 58ch; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.55; text-wrap: pretty; }
.welcome-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }

/* the product shot and the form, side by side on the grid */
.welcome-band { grid-template-columns: minmax(0, 7fr) minmax(0, 4.4fr); align-items: center; }
.welcome-band .auth { width: 100%; }
.welcome-shot { margin: 0; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--lift); overflow: hidden; }
.welcome-shot-bar {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.welcome-shot-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--border); }
.welcome-shot-bar i:first-child { background: var(--orange); border-color: var(--orange); }
.welcome-shot-bar span { margin-inline-start: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.welcome-shot img { display: block; width: 100%; height: auto; }
.welcome-shot .shot-dark, :root[data-theme='dark'] .welcome-shot .shot-light { display: none; }
:root[data-theme='dark'] .welcome-shot .shot-dark { display: block; }

/* every section after the band: a mono eyebrow, a short headline, one line under it */
.welcome-sec { padding: 96px 0 0; }
.welcome-sec-head { display: grid; gap: 12px; max-width: 720px; margin-bottom: 36px; }
.welcome-sec-head.is-row { max-width: none; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 20px; }
.welcome-sec-head .eyebrow { color: var(--orange-text); }
.welcome-sec h2, .welcome-close h2 {
  font-family: var(--display); font-weight: 800; font-stretch: 110%; letter-spacing: -0.03em;
  font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.04; text-wrap: balance;
}
.welcome-sec-lede { color: var(--muted); font-size: 1.1rem; line-height: 1.55; max-width: 62ch; }

/* proof: four big numbers in ruled cells, then one honest comparison */
.proof-stats {
  margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.proof-stat { padding: 26px 24px 28px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 10px; }
.proof-stat + .proof-stat { border-inline-start: 1px solid var(--border); }
.proof-stat dd {
  margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 112%; letter-spacing: -0.04em;
  font-size: clamp(2.6rem, 5.4vw, 4.2rem); line-height: 1; font-variant-numeric: tabular-nums;
}
.proof-stat dd small { font-size: 0.4em; letter-spacing: 0; color: var(--muted); margin-inline-start: 2px; }
.proof-stat.is-orange dd { color: var(--orange-text); }
.proof-stat dt { color: var(--muted); font-size: 0.98rem; line-height: 1.4; max-width: 22ch; }
.proof-compare { margin-top: 36px; display: grid; gap: 12px; max-width: 760px; }
.proof-compare-title { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.compare-row { display: grid; grid-template-columns: minmax(150px, 14rem) 1fr; align-items: center; gap: 16px; font-weight: 700; }
.compare-bar { position: relative; height: 34px; display: flex; align-items: center; }
.compare-bar::before {
  content: ''; height: 100%; width: max(3px, calc(var(--v) * 100%)); background: var(--squares-major, #ccc);
  background: repeating-linear-gradient(135deg, var(--muted) 0 1px, transparent 1px 7px); opacity: 0.55; border: 1px solid var(--muted);
}
.compare-bar.is-brix::before { background: var(--orange); opacity: 1; border-color: var(--orange); }
.compare-bar b { margin-inline-start: 12px; font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.proof-note { margin-top: 22px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; max-width: 86ch; }

/* what an account adds: a 2x2 feature grid with ruled cells */
.why-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--lift); }
.why-tile { padding: 30px 30px 34px; display: grid; gap: 10px; align-content: start; }
.why-tile:nth-child(even) { border-inline-start: 1px solid var(--border); }
.why-tile:nth-child(n+3) { border-top: 1px solid var(--border); }
.why-tile .feat-tile { margin-bottom: 8px; }
.why-tile:last-child .feat-tile { background: var(--orange); color: #ffffff; border-color: var(--orange); box-shadow: 0 2px 0 #b8460a; transform: rotate(-5deg); }
.why-tile h3, .use-card h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 700; font-stretch: 108%; letter-spacing: -0.01em; }
.why-tile p, .use-card p { color: var(--muted); line-height: 1.55; }

/* who it's for: three cards */
.use-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.use-card { padding: 26px 24px 30px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 10px; align-content: start; box-shadow: var(--lift); }
.use-card::before { content: ''; width: 28px; height: 3px; background: var(--orange); margin-bottom: 8px; }

/* the closing call: the drafting grid again, centred */
.welcome-close {
  margin-top: 104px; padding: 72px 24px; text-align: center; display: grid; justify-items: center; gap: 14px;
  position: relative; isolation: isolate; border: 1px solid var(--border);
  background-color: var(--band-bg); background-image: var(--grain); background-size: 180px 180px;
}
.welcome-close::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--squares) 1px, transparent 1px), linear-gradient(90deg, var(--squares) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 18%, #000 75%);
  mask-image: radial-gradient(ellipse at center, transparent 18%, #000 75%);
}
.welcome-close p { color: var(--muted); font-size: 1.1rem; }

/* questions: an open list of folds */
.welcome-faq h2 { margin-bottom: 24px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 20px 4px; display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--mono); font-weight: 400; color: var(--orange-text); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-item summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.faq-item p { padding: 0 4px 22px; color: var(--muted); max-width: 70ch; line-height: 1.6; }

@media (max-width: 980px) {
  .welcome-band { grid-template-columns: minmax(0, 1fr); }
  .welcome-band .auth { max-width: 520px; justify-self: center; }
  .proof-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-stat:nth-child(3) { border-inline-start: 0; }
  .proof-stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .use-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .welcome-hero { padding: 36px 0 36px; }
  .welcome-ctas .btn { flex: 1 1 100%; }
  .welcome-sec { padding-top: 64px; }
  .welcome-sec-head.is-row { grid-template-columns: minmax(0, 1fr); }
  .why-grid { grid-template-columns: minmax(0, 1fr); }
  .why-tile:nth-child(even) { border-inline-start: 0; }
  .why-tile:nth-child(n+2) { border-top: 1px solid var(--border); }
  .proof-stat { padding: 20px 14px 22px; }
  .compare-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .welcome-close { margin-top: 72px; padding: 52px 18px; }
}
.screen-account > * { width: 100%; justify-self: stretch; box-sizing: border-box; }
.welcome-band { grid-template-columns: minmax(0, 1fr) minmax(380px, 430px); }
@media (max-width: 980px) { .welcome-band { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .welcome-band { padding: 14px; }
  .welcome-band .auth { padding: 26px 18px 22px; }
  .welcome-band .auth-switch button { font-size: 0.95rem; padding-inline: 6px; white-space: nowrap; }
}

/* the welcome page's languages: the list under the hero buttons, and the pick-a-language demo */
.welcome-langs { display: grid; justify-items: center; gap: 10px; margin-top: 18px; max-width: 760px; }
.welcome-langs .eyebrow { color: var(--muted); }
#welcome-langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; }
#welcome-langs span { font-size: 1.02rem; color: var(--text); }
#welcome-langs span + span::before { content: '·'; color: var(--orange-text); margin-inline: 8px 10px; }

.welcome-lang .welcome-sec-head { margin-bottom: 30px; }
.lang-demo {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--lift);
}
.lang-chips {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px;
  padding: 28px; border-inline-end: 1px solid var(--border);
  background-color: var(--band-bg); background-image: var(--grain); background-size: 180px 180px;
}
.lang-chip {
  min-height: 48px; padding: 8px 14px; text-align: start; font-size: 1.05rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.lang-chip:hover { border-color: var(--line); }
.lang-chip[aria-checked='true'] { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); color: var(--orange-text); }
.lang-chip:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.lang-card { padding: 34px 36px 32px; display: grid; gap: 14px; align-content: start; min-height: 300px; }
.lang-card-step { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lang-card h3 { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em; }
.lang-card[lang='zh'] h3, .lang-card[lang='ja'] h3, .lang-card[lang='ko'] h3, .lang-card[lang='hi'] h3, .lang-card[lang='ar'] h3 { font-stretch: normal; letter-spacing: 0; }
.lang-card-text { font-size: 1.2rem; line-height: 1.65; }
.lang-card-text span { transition: background-color 0.2s, color 0.2s; border-radius: 2px; }
.lang-card-text span.is-reading { background: color-mix(in srgb, var(--orange) 22%, transparent); }
.lang-card .btn { justify-self: start; margin-top: 6px; gap: 8px; }
.lang-card .btn[aria-pressed='true'] { border-color: var(--orange); color: var(--orange-text); }
.lang-card .btn[hidden] { display: none; }

.lang-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.lang-point { display: grid; gap: 8px; align-content: start; }
.lang-ico {
  width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--orange-text);
}
.lang-ico svg { width: 20px; height: 20px; }
.lang-point h3 { font-family: var(--display); font-weight: 700; font-stretch: 108%; font-size: 1.12rem; }
.lang-point p { color: var(--muted); line-height: 1.55; }

@media (max-width: 980px) {
  .lang-demo { grid-template-columns: minmax(0, 1fr); }
  .lang-chips { border-inline-end: 0; border-bottom: 1px solid var(--border); grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lang-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lang-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .lang-card { padding: 24px 20px; min-height: 0; }
  .lang-points { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (prefers-reduced-motion: reduce) { .lang-card-text span { transition: none; } }
.proof-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; column-gap: 48px; row-gap: 28px; }
.compare-group { display: grid; gap: 10px; align-content: start; }
.proof-stat dd small#proof-hard-vs { color: var(--muted); }
@media (max-width: 980px) { .proof-compare { grid-template-columns: minmax(0, 1fr); } }
.compare-bar::before { width: max(3px, calc(var(--v) * (100% - 64px))); flex: none; }
.proof-alone { margin-top: 30px; padding: 20px 24px; border-inline-start: 3px solid var(--orange); background: var(--surface); display: grid; gap: 6px; max-width: 860px; }
.proof-alone h3 { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.proof-alone p { color: var(--muted); line-height: 1.55; }
/* the parts list of what Brix does, now on the welcome page (it was on Projects) */
.welcome-features { margin-top: 96px; }
@media (max-width: 640px) { .welcome-features { margin-top: 64px; } }

/* the collage beside the sign-up form: the product shot with what it does floating around it */
.welcome-art { position: relative; padding: 46px 30px 58px 34px; }
.welcome-art .welcome-shot { position: relative; z-index: 1; transform: rotate(-1.2deg); }
.art-card {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--lift), 0 10px 28px rgba(20, 20, 28, 0.10);
  animation: art-float 7s ease-in-out infinite;
}
:root[data-theme='dark'] .art-card { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
.art-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.art-ico {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--orange-text); background: var(--bg);
}
.art-ico svg { width: 18px; height: 18px; }
.art-ico.is-orange { background: var(--orange); border-color: var(--orange); color: #ffffff; }

/* read aloud, top left: the step in Vietnamese, with a moving waveform */
.art-voice { top: 0; left: 0; max-width: 300px; animation-delay: -1s; }
.art-voice-text { display: grid; gap: 4px; min-width: 0; }
.art-voice b { font-family: var(--display); font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-wave { display: flex; align-items: center; gap: 3px; height: 16px; }
.art-wave i { width: 3px; height: 100%; background: var(--orange); border-radius: 2px; transform-origin: center; animation: art-wave 1.1s ease-in-out infinite; }
.art-wave i:nth-child(3n) { animation-delay: -0.3s; }
.art-wave i:nth-child(3n + 1) { animation-delay: -0.6s; }
.art-wave i:nth-child(4n) { animation-delay: -0.85s; opacity: 0.7; }

/* a voice command, bottom left, in three languages */
.art-say { bottom: 6px; left: 10px; animation-delay: -3s; }
.art-quotes { display: flex; gap: 10px; font-family: var(--serif); font-style: italic; font-size: 1.25rem; }
.art-quotes q { quotes: '“' '”'; }
.art-quotes q + q { color: var(--muted); }

/* the parts this step needs, right */
.art-need { right: 0; bottom: 70px; flex-direction: column; align-items: flex-start; gap: 8px; animation-delay: -5s; }
.art-part { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.art-part b { font-variant-numeric: tabular-nums; }
.art-tile {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px;
  font-family: var(--display); font-weight: 800; font-size: 0.85rem; color: #ffffff; background: var(--orange); border-radius: 4px;
}

/* where you are, top right */
.art-progress { top: 14px; right: 6px; flex-direction: column; align-items: stretch; gap: 8px; min-width: 150px; animation-delay: -2s; }
.art-bar { display: block; height: 6px; background: var(--border); }
.art-bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--orange); }

/* the X from the logo, stuck on the corner like a sticker */
.art-x {
  position: absolute; z-index: 3; right: 38%; bottom: 18px; width: 44px; height: 44px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: #ffffff; background: var(--orange);
  border-radius: 7px; box-shadow: 0 3px 0 #b8460a; transform: rotate(8deg);
}

@keyframes art-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes art-wave { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .art-card, .art-wave i { animation: none; } .art-wave i { transform: scaleY(0.6); } }

@media (max-width: 980px) { .welcome-art { padding: 40px 18px 56px; max-width: 760px; justify-self: center; width: 100%; } }
@media (max-width: 640px) {
  .welcome-art { padding: 34px 0 46px; }
  .art-need, .art-progress { display: none; }
  .art-voice { max-width: 78%; padding: 10px 12px; }
  .art-say { padding: 9px 12px; }
  .art-quotes { font-size: 1.05rem; gap: 8px; }
  .art-x { width: 36px; height: 36px; font-size: 1.3rem; right: 10px; bottom: 10px; }
}

/* the collage, second pass: the paper page behind, the 3D step in front, the features floating around */
.welcome-art { padding: 0; min-height: 600px; display: block; }
.art-page {
  position: absolute; z-index: 0; top: 18px; left: 4px; width: 42%; background: #ffffff;
  border: 1px solid var(--line); box-shadow: var(--lift), 0 10px 26px rgba(20, 20, 28, 0.10); transform: rotate(-5deg);
}
.art-page img { display: block; width: 100%; height: auto; }
.art-page-label { position: absolute; left: 10px; bottom: 8px; color: #5b5b66; background: #ffffff; padding: 2px 6px; }
.art-arrow { position: absolute; z-index: 1; top: 64px; left: 41%; width: 110px; color: var(--orange); }
.welcome-art .welcome-shot { position: absolute; top: 200px; right: 0; width: 80%; transform: rotate(1deg); }
.art-voice { top: 4px; left: auto; right: 0; }
.art-progress { top: 110px; right: 18px; }
.art-need { right: auto; left: 0; bottom: 30px; }
.art-say { left: auto; right: 24px; bottom: 0; }
.art-x { right: auto; left: 36%; bottom: auto; top: 178px; }
@media (max-width: 980px) { .welcome-art { min-height: 620px; max-width: 700px; } }
@media (max-width: 640px) {
  .welcome-art { min-height: 0; display: grid; gap: 0; padding: 18px 0 40px; }
  .art-page, .art-arrow, .art-x { display: none; }
  .welcome-art .welcome-shot { position: relative; top: auto; width: 100%; transform: none; margin-top: 54px; }
  .art-voice { top: 0; right: auto; left: 0; }
  .art-say { bottom: 0; right: 0; }
}
.art-x { left: 35%; top: 4px; }
.art-page-label { bottom: auto; top: 12px; left: auto; right: 10px; }

/* the collage, calmer: two pictures and two cards, on a clear grid, nothing drifting */
.welcome-art { min-height: 560px; }
.art-card { animation: none; box-shadow: var(--lift); }
:root[data-theme='dark'] .art-card { box-shadow: var(--lift); }
.art-page { top: 0; left: 0; width: 40%; transform: rotate(-3deg); box-shadow: var(--lift); }
.art-arrow { top: 46px; left: 42%; width: 92px; opacity: 0.85; }
.welcome-art .welcome-shot { top: 150px; right: 0; width: 78%; transform: none; }
.art-voice { top: 22px; right: 0; left: auto; }
.art-need { left: 0; right: auto; bottom: 0; top: auto; }
@media (max-width: 640px) {
  .welcome-art { min-height: 0; }
  .art-need { display: none; }
  .welcome-art .welcome-shot { margin-top: 62px; }
}
.art-arrow { top: 96px; left: 40%; width: 80px; }
.art-need { top: 452px; bottom: auto; }
.art-need { top: 390px; }
@media (max-width: 640px) {
  .welcome-art { display: grid; padding: 8px 0 28px; min-height: 0; }
  .welcome-art .welcome-shot { position: relative; top: auto; right: auto; width: 100%; margin-top: -12px; transform: none; }
  .art-voice { position: relative; top: auto; right: auto; left: auto; justify-self: start; z-index: 2; max-width: 92%; }
}

/* your own designs, and sharing guides to Discover */
.own-design { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 4px; cursor: pointer; text-align: start; }
.own-design input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange); flex: none; }
.own-design b { display: block; font-size: 0.98rem; }
.own-design small { display: block; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.pill-orange { background: var(--orange); border-color: var(--orange); color: #ffffff; }
.guide-by { margin: -2px 0 0; color: var(--muted); font-size: 0.9rem; font-style: italic; }
.share-discover { width: 100%; display: grid; gap: 12px; padding: 14px 0 4px; border-top: 1px solid var(--border); text-align: start; }
.share-discover[hidden], .share-discover-more[hidden] { display: none; }
.share-discover-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.share-discover-row b { display: block; }
.share-discover-row small { display: block; font-size: 0.88rem; line-height: 1.4; }
.share-discover-more { display: grid; gap: 10px; }
.share-discover-name { display: grid; gap: 6px; font-weight: 700; font-size: 0.92rem; }
.share-discover-name input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.share-discover-own { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.share-discover-own input { width: 18px; height: 18px; accent-color: var(--orange); }
input.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 13px; margin: 0;
  background: var(--border); position: relative; cursor: pointer; transition: background-color 0.15s;
}
input.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
input.switch:checked { background: var(--orange); }
input.switch:checked::after { transform: translateX(20px); }
[dir='rtl'] input.switch:checked::after { transform: translateX(-20px); }
input.switch:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }
.guide-meta .pill.pill-orange { color: var(--orange-text); border-color: var(--orange); background: transparent; }
/* the manual page is a photo now (the page on a table, with an Allen key and dowels) */
.art-page { background: none; border: 0; box-shadow: 0 2px 4px rgba(20, 20, 28, 0.18), 0 14px 30px rgba(20, 20, 28, 0.16); border: 6px solid #ffffff; }
:root[data-theme='dark'] .art-page { border-color: #f2efe9; }
.art-page-label { top: 10px; right: 10px; }
.art-page { width: 44%; }
.art-tile { font-size: 0.72rem; letter-spacing: 0.02em; }
/* the manual page itself, pinned to the board (no photo, no frame) */
.art-page { background: #ffffff; border: 0; transform: rotate(-2.5deg); width: 38%; top: 14px; overflow: visible;
  box-shadow: 0 1px 2px rgba(20, 20, 28, 0.12), 0 12px 28px rgba(20, 20, 28, 0.14); }
:root[data-theme='dark'] .art-page { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5); }
.art-page::after { /* the paper sags a touch below the pin */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.035), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.03));
}
.art-pin { position: absolute; z-index: 2; top: -22px; left: 50%; width: 30px; height: 39px; transform: translateX(-50%) rotate(8deg); }
.art-page-label { top: auto; bottom: 8px; right: 8px; }
.art-arrow { left: 39%; }
.art-page-label { top: 12px; bottom: auto; right: 10px; }
.art-tile { font-size: 0.85rem; }
/* the voice command card is back: bottom right of the 3D step, opposite "You need" */
.art-say { display: flex; top: 452px; bottom: auto; right: 0; left: auto; }
@media (max-width: 640px) {
  .art-say { position: relative; top: auto; right: auto; justify-self: end; margin-top: -14px; z-index: 2; }
}
@media (min-width: 641px) { .art-say { top: 404px; } }
/* accounts on Supabase: a note after signing up ("check your email"), and the reset link */
.auth-info { margin: 0; padding: 10px 12px; border-inline-start: 3px solid var(--orange); background: var(--accent-fill); color: var(--text); font-size: 0.95rem; line-height: 1.45; }
.auth-info[hidden], .auth-forgot[hidden] { display: none; }
.auth-forgot { justify-self: center; font-size: 0.95rem; }

/* paid plans: pricing cards (welcome page and the Upgrade dialog), "Your plan" on Profile, the earnings screen */
.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.price-card { display: grid; gap: 10px; align-content: start; padding: 22px 20px 24px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--lift); }
.price-card h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.price-card .price { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 2rem; letter-spacing: -0.02em; line-height: 1.1; }
.price-card .price small { font-size: 0.9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-desc { color: var(--muted); line-height: 1.5; }
.price-card .btn { margin-top: 6px; }
.price-card.is-featured { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange), var(--lift); }
.price-card.is-current { background: var(--accent-fill); }
.price-current { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-text); }
.price-note { margin-top: 16px; padding: 10px 12px; border-inline-start: 3px solid var(--orange); background: var(--surface); color: var(--muted); font-size: 0.92rem; }
.price-note[hidden] { display: none; }
.upgrade-dialog { width: min(980px, calc(100vw - 32px)); }
.upgrade-inner { display: grid; gap: 14px; text-align: start; }
.upgrade-inner .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 20px 0 8px; padding: 20px 22px; }
.plan-card[hidden] { display: none; }
.plan-info { display: grid; gap: 6px; min-width: 0; flex: 1; }
.plan-info .eyebrow { color: var(--orange-text); }
.plan-info h2 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.plan-meter { height: 6px; background: var(--border); max-width: 360px; }
.plan-meter i { display: block; height: 100%; width: 0; background: var(--orange); }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-actions .btn[hidden] { display: none; }
#proc-upgrade[hidden], #proc-retry[hidden] { display: none; }
.screen-earnings { max-width: 1080px; margin-inline: auto; padding: 32px 16px 64px; display: grid; gap: 24px; }
.earnings-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); }
.earnings-head .eyebrow { color: var(--orange-text); }
.earnings-key { display: grid; gap: 12px; max-width: 460px; padding: 22px; }
.earnings-key[hidden], #earnings-body[hidden] { display: none; }
.earnings-table { width: 100%; border-collapse: collapse; }
.earnings-table th, .earnings-table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.earnings-table th { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 980px) { .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .price-grid, .upgrade-inner .price-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-card { flex-direction: column; align-items: stretch; }
}

/* after a camera scan: the official manual, found online */
.online-manual { display: grid; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--line); }
.online-manual[hidden] { display: none; }
.om-row { display: flex; align-items: center; gap: 12px; }
.om-text { flex: 1; margin: 0; font-weight: 700; }
.om-row .btn { min-height: 40px; }
.om-found { display: flex; gap: 14px; align-items: center; }
.om-pdf {
  flex: none; width: 46px; height: 56px; display: grid; place-items: end center; padding-bottom: 7px;
  background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.om-meta { display: grid; gap: 2px; min-width: 0; }
.om-meta b { font-family: var(--display); font-size: 1.1rem; }
.om-meta .muted, .om-site { overflow-wrap: anywhere; font-size: 0.92rem; }
.om-site { font-family: var(--mono); font-size: 0.8rem; color: var(--orange-text); }
.om-why { margin: 0; font-size: 0.95rem; }
.om-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* no manual at hand: find it from the box or a label */

/* Talk to Brix: a hands-free conversation with the helper, in any language */
.talk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.talk-btn { --level: 0; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--surface); color: var(--text, inherit); font-weight: 700; }
.talk-btn:hover { border-color: var(--accent); }
.talk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 calc(var(--level) * 8px) color-mix(in srgb, var(--accent) 30%, transparent); transition: box-shadow 80ms linear; }
.talk-btn.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.talk-btn.is-on .talk-dot { background: var(--accent-ink); box-shadow: 0 0 0 calc(var(--level) * 8px) color-mix(in srgb, var(--accent-ink) 35%, transparent); }
.talk-btn[data-phase="thinking"] .talk-dot, .talk-btn[data-phase="speaking"] .talk-dot { animation: talk-pulse 1.1s ease-in-out infinite; }
@keyframes talk-pulse { 50% { transform: scale(0.6); opacity: 0.6; } }
.talk-status { font-size: 0.9rem; color: var(--muted); }
.heard-lang { display: inline-block; margin-inline-start: 6px; padding: 1px 6px; border-radius: 3px; font-size: 0.78rem; background: var(--accent-soft); color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { .talk-btn .talk-dot { animation: none !important; transition: none; } }
/* the bottom bar's Talk button (it replaced Read aloud and Hands-free) */
.toggle-talk { --level: 0; }
.toggle-talk.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 0 calc(var(--level) * 6px) color-mix(in srgb, var(--accent) 28%, transparent); }
.toggle-talk.is-on[data-phase="thinking"] svg, .toggle-talk.is-on[data-phase="speaking"] svg { animation: talk-pulse 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .toggle-talk svg { animation: none !important; } }

/* ---- helper panel, Nov 2026: resizable, the Brix X as its mark, a quiet type box, and Talk as a live waveform */
.helper-panel { --helper-size: 0.35; width: min(calc(300px + var(--helper-size) * 420px), calc(100% - 32px)); max-height: calc(100% - 96px); }
.helper-panel .helper-log { min-height: calc(80px + var(--helper-size) * 260px); }
.helper-logo { background: none; width: 36px; height: 36px; }
.helper-logo svg { width: 36px; height: 36px; }
.helper-size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 2px; }
.helper-size svg { width: 18px; height: 18px; flex-shrink: 0; }
.helper-size input[type="range"] { width: 84px; accent-color: var(--orange, #e8590c); cursor: pointer; }
/* the type box: no heavy ring when it's tapped, just a thin orange edge */
.helper-form.ask-form:focus-within { border-color: var(--orange, #e8590c); box-shadow: none; }
.helper-form input:focus, .helper-form input:focus-visible { outline: none; box-shadow: none; border-radius: 0; }

/* Talk to Brix: a dark glass pill with the waveform inside */
:root { --talk-bg: #14141c; --talk-ink: #f4f1ea; --talk-wave-1: #ff7a2e; --talk-wave-2: #8f7ff0; --talk-wave-3: #e9f3ff; }
.talk-bar { display: flex; align-items: center; gap: 8px; }
.talk-orb {
  position: relative; flex: 1; min-width: 0; height: 56px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--talk-ink);
  background: radial-gradient(120% 140% at 50% 120%, #2a2340 0%, var(--talk-bg) 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(20, 20, 28, 0.25);
  transition: box-shadow 0.3s ease, transform 0.15s ease;
}
.talk-orb:hover { transform: translateY(-1px); }
.talk-orb:active { transform: translateY(0) scale(0.99); }
.talk-orb:focus-visible { outline: 2px solid var(--talk-wave-1); outline-offset: 2px; box-shadow: none; }
.talk-orb .talk-wave { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.4s ease; }
.talk-orb.is-on .talk-wave { opacity: 1; }
.talk-text { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.15; pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.talk-label { font-weight: 700; letter-spacing: 0.01em; }
.talk-hint { font-size: 0.72rem; opacity: 0.7; font-family: var(--font-mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: 0.08em; }
.talk-hint:empty { display: none; }
.talk-orb:not(.is-on) .talk-label::before {   /* idle: a small live dot before the words */
  content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; border-radius: 50%; vertical-align: 1px;
  background: var(--talk-wave-1); box-shadow: 0 0 10px var(--talk-wave-1);
}
.talk-orb.is-on { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 3px rgba(255, 122, 46, 0.22), 0 8px 26px rgba(95, 80, 157, 0.35); }
.talk-orb.is-on[data-phase="thinking"] { animation: talk-glow 2.2s ease-in-out infinite; }
@keyframes talk-glow { 50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 5px rgba(143, 127, 240, 0.25), 0 8px 30px rgba(255, 122, 46, 0.3); } }
.talk-end { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .talk-orb, .talk-orb.is-on[data-phase="thinking"] { animation: none; transition: none; } }

/* the helper's microphone: while it listens, five small orange bars in the type box follow the voice */
.helper-form { position: relative; --level: 0; }
.helper-form .mic-level { display: none; align-items: center; gap: 3px; height: 20px; flex-shrink: 0; }
.helper-form.is-listening .mic-level { display: inline-flex; }
.mic-level i { width: 3px; border-radius: 2px; background: var(--orange, #e8590c); height: calc(4px + var(--level) * 16px * var(--k, 1)); transition: height 80ms linear; }
.mic-level i:nth-child(1), .mic-level i:nth-child(5) { --k: 0.45; }
.mic-level i:nth-child(2), .mic-level i:nth-child(4) { --k: 0.8; }
.helper-form.is-thinking .mic-level i { height: 4px; animation: mic-think 1s ease-in-out infinite; }
.helper-form.is-thinking .mic-level i:nth-child(2) { animation-delay: 0.1s; }
.helper-form.is-thinking .mic-level i:nth-child(3) { animation-delay: 0.2s; }
.helper-form.is-thinking .mic-level i:nth-child(4) { animation-delay: 0.3s; }
.helper-form.is-thinking .mic-level i:nth-child(5) { animation-delay: 0.4s; }
@keyframes mic-think { 50% { height: 12px; } }
.helper-form .mic-btn { border-radius: 50%; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.helper-form .mic-btn.is-recording { background: var(--orange, #e8590c); color: #ffffff; box-shadow: 0 0 0 4px rgba(232, 89, 12, 0.2); animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 7px rgba(232, 89, 12, 0.1); } }
@media (prefers-reduced-motion: reduce) { .helper-form .mic-btn.is-recording, .helper-form.is-thinking .mic-level i { animation: none; } }
/* Settings: the helper's voice names are long ("Matilda · friendly American woman") */
/* the voice names are long, so the voice choice sits on its own line, full width, inside the dialog */
#ai-voice-wrap { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0 12px; }
.setting-row #ai-voice { width: 100%; max-width: 100%; min-width: 0; }
/* the dialog never runs off a short window: it scrolls instead */
.settings-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; }

/* sign-up, step 2: the code from the email */
.auth-code[hidden] { display: none; }
.auth-code-sent { margin: 0 0 4px; line-height: 1.45; }
.auth-code #auth-code-input { font-family: var(--mono, ui-monospace, monospace); font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; }
.auth-code-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }

/* "Your builds go wherever you do": one build, followed across the week and three screens */
.why-trip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; position: relative; counter-reset: stop; }
.why-trip::before {   /* the route the build takes, through every stop */
  content: ""; position: absolute; inset-inline: 28px; top: 74px; border-top: 2px dashed var(--orange, #e8590c); opacity: 0.55;
}
.trip-stop { position: relative; display: grid; gap: 8px; align-content: start; }
.trip-when { margin: 0; min-height: 2.6em; font-family: var(--mono, ui-monospace, monospace); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.trip-node {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface); color: var(--text); border: 2px solid var(--line); box-shadow: 0 0 0 6px var(--bg, #faf9f7);
}
.trip-node svg { width: 26px; height: 26px; }
.trip-stop:last-child .trip-node { background: var(--orange, #e8590c); color: #ffffff; border-color: var(--orange, #e8590c); }
.trip-tag {   /* the same build, further along at every stop */
  justify-self: start; margin-top: 6px; padding: 3px 9px; font-family: var(--mono, ui-monospace, monospace); font-size: 0.75rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 2px 2px 0 var(--line);
}
.trip-stop h3 { margin: 4px 0 0; font-family: var(--display); font-size: 1.2rem; font-weight: 700; font-stretch: 108%; letter-spacing: -0.01em; }
.trip-stop > p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
@media (max-width: 900px) {
  .why-trip { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-inline-start: 74px; }
  .why-trip::before { inset-inline: auto; inset-inline-start: 27px; top: 8px; bottom: 8px; border-top: 0; border-inline-start: 2px dashed var(--orange, #e8590c); }
  .trip-node { position: absolute; inset-inline-start: -74px; top: 0; }
  .trip-when { min-height: 0; }
}
/* the route: icons in one straight row on top, the dashes only between one stop and the next */
.why-trip::before { content: none; }
.trip-stop .trip-node { order: -1; }
.trip-when { min-height: 0; }
.trip-stop:not(:last-child)::after {
  content: ""; position: absolute; top: 27px; inset-inline-start: 66px; inset-inline-end: -18px;
  border-top: 2px dashed var(--orange, #e8590c); opacity: 0.6;
}
@media (max-width: 900px) {
  .trip-stop .trip-node { order: 0; }
  .trip-stop:not(:last-child)::after {
    top: 64px; bottom: -22px; inset-inline-start: -47px; inset-inline-end: auto; border-top: 0;
    border-inline-start: 2px dashed var(--orange, #e8590c);
  }
}

/* pricing, as a ladder that only goes up: Free, Brix Plus (most popular, monthly or yearly), the Move-in Pass */
.price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upgrade-inner .price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.price-card { position: relative; }
.price-badge { justify-self: start; margin: 0; padding: 3px 9px; font-family: var(--mono, ui-monospace, monospace); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--orange, #e8590c); color: #ffffff; }
.price-badge.is-soft { background: transparent; color: var(--orange-text, #b8460a); border: 1px solid currentColor; }
.price-cycle { display: inline-flex; justify-self: start; border: 1px solid var(--line); }
.price-cycle button { border: 0; background: transparent; color: var(--text); padding: 6px 12px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.price-cycle button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.price-save { font-size: 0.75rem; font-weight: 700; color: var(--orange-text, #b8460a); }
.price-cycle button[aria-pressed="true"] .price-save { color: #ffb38a; }
@media (max-width: 980px) { .price-grid, .upgrade-inner .price-grid { grid-template-columns: minmax(0, 1fr); } }
.price-badge.is-plain { background: transparent; color: var(--muted); border: 1px solid var(--border); }
/* the collage beside the sign-in form stays put: switching to "Create account" grows the form, not the art */
.welcome-band { align-items: start; }
.welcome-band .welcome-art { align-self: start; }

/* the camera button's choice: find it online from the cover, or scan every page */
.scan-choice { width: min(520px, calc(100vw - 32px)); }
.scan-choice h2 { margin: 0 40px 16px 0; font-family: var(--display); font-size: 1.35rem; }
.choice-list { display: grid; gap: 12px; }
.choice-card {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; text-align: start; width: 100%;
  padding: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.choice-card:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--line); }
.choice-card.is-online { border-color: var(--orange, #e8590c); box-shadow: inset 0 0 0 1px var(--orange, #e8590c); }
.choice-icon { width: 48px; height: 48px; display: grid; place-items: center; background: var(--surface-2, #f1efeb); border: 1px solid var(--line); }
.choice-card.is-online .choice-icon { background: var(--orange, #e8590c); color: #ffffff; border-color: var(--orange, #e8590c); }
.choice-icon svg { width: 26px; height: 26px; }
.choice-text { display: grid; gap: 4px; }
.choice-text b { font-family: var(--display); font-size: 1.1rem; }
.choice-text small { color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.choice-tag { justify-self: start; margin-top: 4px; font-family: var(--mono, ui-monospace, monospace); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-text, #b8460a); }
@media (prefers-reduced-motion: reduce) { .choice-card { transition: none; } }

/* the loading screen: Brix the mascot hops while the guide is built (squash on landing, stretch in the air) */
.build-mascot { width: 140px; height: 150px; margin: 0 auto 4px; display: grid; justify-items: center; align-content: end; }

.mascot-hop { width: 117px; height: auto; transform-origin: 50% 100%; animation: mascot-hop 1.1s cubic-bezier(0.33, 0, 0.67, 1) infinite; will-change: transform; }
.mascot-shadow { width: 76px; height: 12px; margin-top: 2px; border-radius: 50%; background: rgba(20, 20, 28, 0.18); animation: mascot-shadow 1.1s cubic-bezier(0.33, 0, 0.67, 1) infinite; }
@keyframes mascot-hop {
  0%   { transform: translateY(0) scale(1.08, 0.9); }        /* crouched, about to jump */
  12%  { transform: translateY(-4px) scale(0.94, 1.08); }    /* pushing off */
  45%  { transform: translateY(-40px) rotate(-4deg) scale(1, 1); }   /* top of the hop */
  78%  { transform: translateY(-2px) scale(0.97, 1.04); }    /* coming down */
  88%  { transform: translateY(0) scale(1.1, 0.88); }        /* landing squash */
  100% { transform: translateY(0) scale(1.08, 0.9); }
}
@keyframes mascot-shadow {
  0%, 88%, 100% { transform: scale(1); opacity: 1; }
  45% { transform: scale(0.6); opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-hop { animation: none; }
  .mascot-shadow { animation: none; }
}

/* "All done": compact enough for a short screen; the check beside the words, the two buttons side by side */
.done { text-align: start; justify-items: stretch; padding-top: 4px; gap: 16px; }
.done-head { display: flex; align-items: center; gap: 14px; }
.done .done-icon { width: 52px; height: 52px; flex-shrink: 0; }
.done .done-icon svg { width: 28px; height: 28px; }
.done h2 { font-size: 2.2rem; line-height: 1; margin: 0 0 4px; }
.done .instruction { margin: 0; }
.done-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.done-actions .btn { width: 100%; justify-content: center; }
/* a step card with more than fits: soft shadows at the edge it scrolls on, instead of text sliced off */
.step-card {
  background:
    linear-gradient(var(--surface) 30%, transparent) center top / 100% 28px no-repeat local,
    linear-gradient(transparent, var(--surface) 70%) center bottom / 100% 28px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.14), transparent) center top / 100% 10px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.14), transparent) center bottom / 100% 10px no-repeat scroll,
    var(--surface);
}

/* the building screen's stages, as a progress bar: a track that fills in orange as each stage is done, one stop per
   stage with its name under it, the current stop pulsing. What it finds (parts, steps) shows on a line underneath. */
.stages { display: flex; flex-wrap: wrap; gap: 0; margin: 18px 0 0; padding: 0; counter-reset: none; }
.stages li[data-stage] {
  position: relative; flex: 1 1 0; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 8px;
  padding: 0 4px; background: none !important; border-radius: 0; text-align: center; font-size: 0.82rem; line-height: 1.25;
  font-weight: 600; color: var(--muted);
}
.stages li[hidden] { display: none; }
/* the track: from the stop before to this one */
.stages li[data-stage]::before {
  content: ""; position: absolute; top: 9px; height: 4px; inset-inline-start: -50%; inset-inline-end: 50%;
  background: var(--border); z-index: 0;
}
.stages li[data-stage]:first-child::before { content: none; }
.stages li.is-done::before { background: var(--orange, #e8590c); }
.stages li.is-active::before {   /* the part of the track being filled now */
  background: linear-gradient(90deg, var(--orange, #e8590c) 0 50%, var(--border) 50% 100%);
  background-size: 200% 100%; animation: track-fill 1.6s ease-in-out infinite;
}
[dir="rtl"] .stages li.is-active::before { background: linear-gradient(270deg, var(--orange, #e8590c) 0 50%, var(--border) 50% 100%); background-size: 200% 100%; }
@keyframes track-fill { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.stages .stage-dot {
  position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border);
  background: var(--surface); animation: none; transform: none;
}
.stages li.is-done .stage-dot { background: var(--orange, #e8590c); border-color: var(--orange, #e8590c); }
.stages li.is-done .stage-dot::after { content: none; }
.stages li.is-active .stage-dot {
  border-color: var(--orange, #e8590c); border-top-color: var(--orange, #e8590c); background: var(--surface);
  box-shadow: 0 0 0 0 rgba(232, 89, 12, 0.35); animation: stop-pulse 1.4s ease-out infinite;
}
@keyframes stop-pulse { 0% { box-shadow: 0 0 0 0 rgba(232, 89, 12, 0.4); } 100% { box-shadow: 0 0 0 10px rgba(232, 89, 12, 0); } }
.stages li.is-done, .stages li.is-active { color: var(--text); }
.stages li.is-active { font-weight: 800; }
.stages .stage-count { margin: 0; font-family: var(--mono, ui-monospace, monospace); font-size: 0.78rem; color: var(--orange-text, #b8460a); }
.stages .stage-count:empty { display: none; }
/* what was found so far: full width, under the bar */
.stages li.stage-extra { order: 99; flex: 1 1 100%; margin-top: 14px; padding: 10px 12px; justify-content: center; text-align: center;
  border-top: 1px dashed var(--border); font-size: 0.9rem; }
@media (max-width: 560px) {
  .stages li[data-stage] { font-size: 0.7rem; padding: 0 2px; }
  .stages li[data-stage]:not(.is-active) > span:not(.stage-dot):not(.stage-count) { opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .stages li.is-active::before, .stages li.is-active .stage-dot { animation: none; }
  .stages li.is-active::before { background: linear-gradient(90deg, var(--orange, #e8590c) 0 50%, var(--border) 50% 100%); background-size: 100% 100%; }
}

/* the welcome page's own light/dark switch, beside Sign in (the top bar is hidden there) */
.auth-top-actions { display: flex; align-items: center; gap: 6px; }

/* pieces the 3D guide doesn't show: up front on the overview, never folded away */
.gap-alert { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; padding: 12px 14px; color: var(--text);
  background: var(--warn-soft); border: 1.5px solid var(--warn-border); border-radius: var(--radius-sm); }
.gap-alert > svg { width: 22px; height: 22px; flex: none; color: var(--warn); margin-top: 1px; }
.gap-alert-title { font-weight: 700; margin: 0 0 4px; }
.gap-alert ul { margin: 0 0 6px; padding-left: 18px; }
.gap-alert li { margin: 2px 0; }
.gap-alert .p-id { font-family: var(--font-mono, monospace); font-size: 0.85em; opacity: 0.75; }
.gap-alert-hint { margin: 0; font-size: 0.92rem; color: var(--text-2, var(--text)); }
