* {
  box-sizing: border-box;
}

:root {
  --paper: #f1f0e9;
  --ink: #26382f;
  --muted: #56645c;
  --line: #cbd0c5;
  --glass: #203334a6;
  --crimson: #a8324c;
  --space: clamp(16px, 3vw, 48px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #141c22;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

[hidden] {
  display: none !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
canvas:focus-visible {
  outline: 2px solid #cfad74;
  outline-offset: 3px;
}

svg:not(.symbols) {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.symbols {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ============================================================================
   ABOVE THE FOLD: Full-Viewport Interactive 3D Stage
   ============================================================================ */
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  color: #f4f2e8;
  background: radial-gradient(
    ellipse at 38% 74%,
    #789198 0%,
    #536f78 32%,
    #344d58 62%,
    #1d303a 100%
  );
  transition: background 0.55s ease;
  user-select: none;
  -webkit-user-select: none;
}

.stage[data-mood="amber"] {
  background: radial-gradient(
    ellipse at 36% 72%,
    #967c68 0%,
    #6c5546 34%,
    #45352c 64%,
    #211814 100%
  );
}

.stage[data-mood="noir"] {
  background: radial-gradient(
    ellipse at 40% 72%,
    #495b6e 0%,
    #2e3c4c 34%,
    #1a2430 66%,
    #0c1219 100%
  );
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, #0c1b201b, transparent 20%, transparent 81%, #0e222830),
    radial-gradient(ellipse at 50% 50%, transparent 56%, rgba(10, 18, 22, 0.24) 100%);
}

.stage.expand-fallback,
.stage:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 20;
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline-offset: -4px;
}

#scene.orbit-hover { cursor: ew-resize; }
#scene.grabbing { cursor: grabbing; }
#scene.pointer-focus { outline: 0; }

.topbar,
.dock {
  position: absolute;
  left: max(var(--space), env(safe-area-inset-left));
  right: max(var(--space), env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.topbar {
  top: max(20px, env(safe-area-inset-top));
  z-index: 6;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  pointer-events: auto;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(20, 6, 12, 0.52));
}

.brand-wordmark {
  display: block;
  height: 19px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(14, 24, 29, 0.58));
}

.studio-nav,
.tools {
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
}

.studio-nav,
.tools > *,
.dock > button {
  pointer-events: auto;
}

#exploreToggle .close-mark,
#exploreToggle[aria-expanded="true"] .more-mark {
  display: none;
}

#exploreToggle[aria-expanded="true"] .close-mark {
  display: inline;
}

#exploreToggle[aria-expanded="true"] {
  color: #24191e;
  background: #f4efe9;
  border-color: #ffffffcc;
}

/* Top-Right Obsidian Glass Studio Menu */
.studio-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(264px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 15px;
  background: rgba(20, 26, 32, 0.92);
  border: 1px solid rgba(242, 232, 224, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(6, 10, 14, 0.48);
  color: #f3eee8;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-block + .menu-block {
  border-top: 1px solid rgba(255, 245, 238, 0.1);
  padding-top: 9px;
}

.menu-heading {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(235, 224, 216, 0.58);
  padding: 0 4px 3px;
}

.menu-lang-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.menu-lang-pills button {
  height: 28px;
  border-radius: 7px;
  font-size: 12px;
  color: rgba(242, 235, 228, 0.78);
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.15s, color 0.15s;
}

.menu-lang-pills button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.menu-lang-pills button[aria-pressed="true"] {
  background: #f3ede6;
  color: #1c191f;
  font-weight: 600;
}

.menu-item,
.menu-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 12.5px;
  color: #f0ebe4;
  text-decoration: none;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.menu-item svg,
.menu-chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.86;
}

.menu-item:hover,
.menu-chip:hover {
  background: rgba(255, 255, 255, 0.11);
}

.menu-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.menu-chip {
  justify-content: center;
  padding: 7px 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.menu-accent {
  background: rgba(168, 50, 76, 0.22);
  border: 1px solid rgba(210, 92, 118, 0.34);
}

.menu-accent:hover {
  background: rgba(168, 50, 76, 0.36);
}

.menu-adult {
  justify-content: flex-start;
}

.badge-18 {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(212, 82, 108, 0.28);
  border: 1px solid rgba(226, 118, 140, 0.52);
  color: #ffdce3;
}

.badge-18.lg {
  display: inline-block;
  margin: 0;
  font-size: 12px;
  padding: 4px 11px;
  background: #361722;
  color: #f9dfe5;
  border-color: #7d2e45;
}

.round,
.action,
#materials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid #d1e1db4a;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f2f3e9;
  transition: background 0.18s, transform 0.18s, color 0.18s, border-color 0.18s;
}

.round {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.round:hover,
.action:hover,
#materials:hover {
  background: #293e40ed;
}

button:active {
  transform: translateY(1px);
}

.dock {
  bottom: max(24px, env(safe-area-inset-bottom));
  align-items: flex-end;
}

#materials {
  padding: 10px 13px 10px 10px;
  border-radius: 12px;
  gap: 12px;
  text-align: left;
}

#materials small,
#materials b { display: block; }

#materials small {
  font-size: 12px;
  line-height: 1.3;
  color: #d2ddd6;
  letter-spacing: 0.14em;
}

#materials b {
  font-size: 13px;
  font-weight: 540;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

#materials svg { width: 16px; }

.chip {
  width: 32px;
  height: 34px;
  display: block;
  border-radius: 6px;
  border: 1px solid #c6cabe55;
  background:
    repeating-linear-gradient(118deg, transparent 0 1px, #ffffff0a 1px 2px),
    linear-gradient(135deg, #17191e, #515258 45%, #23252b 70%, #3a3d40);
}

.action {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 24px;
  font-size: 13px;
}

#repair {
  color: #2c4039;
  background: #edefdf;
  border-color: #f7f8e8;
}

#repair:hover { background: #f6f7ec; }

.grab-hint {
  position: absolute;
  display: flex;
  align-items: center;
  pointer-events: none;
  transform: translate(-9px, -50%);
  transition: opacity 0.35s;
}

.grab-hint.gone { opacity: 0; }

.grab-hint span {
  width: 18px;
  height: 18px;
  border: 1px solid #ffffffe0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px #28363c52;
  background: #f8f5e6;
}

.grab-hint i {
  width: 22px;
  border-top: 1px solid #eef3dfaa;
}

.grab-hint b {
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
  border-radius: 16px;
  padding: 6px 10px;
  background: #253736c9;
  color: white;
}

.stage-toast,
#error {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: #253936e6;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 15;
}

.stage-toast {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.stage-toast.show { opacity: 1; }

/* ============================================================================
   DIALOGS (Wardrobe, Guide, Share, 18+ Notice, Collab & Coffee)
   ============================================================================ */
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #ffffff88;
  border-radius: 15px;
  padding: 26px;
  width: min(392px, calc(100% - 28px));
  max-height: 86dvh;
  overflow: auto;
  box-shadow: 0 12px 50px #17292138;
}

dialog.wide-dialog {
  width: min(460px, calc(100% - 28px));
}

dialog::backdrop { background: #152c324a; }
#materialPanel::backdrop { background: #14283116; }

#materialPanel {
  position: fixed;
  inset: auto auto max(96px, env(safe-area-inset-bottom)) var(--space);
  margin: 0;
  width: min(334px, calc(100% - 32px));
  max-height: calc(100dvh - 125px);
}

.x {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.x:hover { background: #dde2d6; }

.panel-title h2 {
  font-size: 20px;
  margin: 0 0 17px;
}

.guide-brand-hero {
  margin: -26px -26px 18px;
  padding: 24px 24px 20px;
  background: radial-gradient(ellipse at 50% 42%, #3c1b27 0%, #1c1820 58%, #12171d 100%);
  border-bottom: 1px solid rgba(255, 240, 232, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-brand-hero.compact {
  padding: 18px 20px 16px;
}

.guide-brand-hero img {
  display: block;
  width: 176px;
  max-width: 68%;
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45));
}

.guide-brand-hero.compact img {
  width: 136px;
}

#guide .x,
#shareDialog .x,
#collabDialog .x {
  color: #f3ece7;
  z-index: 2;
}

#guide .x:hover,
#shareDialog .x:hover,
#collabDialog .x:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dialog-lead {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 6px 0 14px;
}

.dialog-paragraphs p {
  font-size: 13.5px;
  line-height: 1.65;
  color: #314039;
  margin: 10px 0;
}

.adult-badge-row {
  margin-bottom: 10px;
}

.share-spec-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 9px;
  background: #e4e7dd;
  color: #24352d;
  margin-bottom: 12px;
}

.share-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  cursor: pointer;
}

.share-toggle input { accent-color: #344d40; }

.share-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.share-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.btn-solid,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn-solid {
  background: #2f463b;
  color: #fafaf6;
}

.btn-solid:hover { background: #22352c; }

.btn-outline {
  background: #f8f8f2;
  color: #26382f;
  border: 1px solid #c4cabd;
}

.btn-outline:hover { background: #e8ece1; }
.btn-outline.sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }

.email-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e6e9e0;
  margin-bottom: 14px;
}

.email-strip small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.email-strip a {
  font-size: 13.5px;
  font-weight: 600;
  color: #1f332a;
  text-decoration: none;
}

.collab-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collab-form input,
.collab-form select,
.collab-form textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #c6ccc0;
  background: #fbfbf7;
  color: var(--ink);
  font-size: 13px;
}

.collab-form textarea { resize: vertical; }

.coffee-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 14px;
  align-items: center;
}

.coffee-copy h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.coffee-copy p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.coffee-qr {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d4d8cc;
  background: #fff;
}

.coffee-qr img {
  display: block;
  width: 100%;
  height: auto;
}

.group {
  border-top: 1px solid var(--line);
  padding: 15px 0 3px;
}

.group h3 {
  font-size: 13px;
  margin: 0 0 10px;
  font-weight: 600;
}

.garments {
  display: flex;
  gap: 3px;
  background: #e1e4da;
  border-radius: 9px;
  padding: 3px;
  margin: 0 0 16px;
}

.garments button {
  flex: 1;
  min-height: 32px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.garments [aria-selected="true"] {
  color: var(--ink);
  background: #fafaf4;
  box-shadow: 0 1px 3px #26382f20;
  font-weight: 600;
}

.swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 12px;
  margin-bottom: 10px;
}

.swatch {
  position: relative;
  padding: 0;
  text-align: left;
}

.swatch canvas {
  object-fit: cover;
  width: 100%;
  height: 41px;
  display: block;
  border-radius: 5px;
  transition: transform 0.16s ease;
}

.swatch:hover canvas { transform: translateY(-1px); }
.swatch span { display: block; margin-top: 4px; font-size: 12px; }
.swatch i { display: none; }

.swatch[aria-pressed="true"] canvas {
  outline: 1.5px solid #496953;
  outline-offset: 2px;
}

.swatch[aria-pressed="true"] i {
  display: grid;
  place-items: center;
  position: absolute;
  right: 5px;
  top: 19px;
  background: var(--paper);
  border-radius: 50%;
  width: 17px;
  height: 17px;
}

.swatch i svg { width: 13px; }

.settings label,
.tension-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.settings input {
  width: 100%;
  accent-color: #476552;
  margin: 6px 0 13px;
  cursor: pointer;
}

output { font-variant-numeric: tabular-nums; }
.tension-title h3 { margin: 0; }

.meter {
  display: flex;
  gap: 3px;
  margin: 10px 0;
}

.meter i {
  flex: 1;
  height: 5px;
  background: #d5d9ce;
  transition: background 0.08s;
}

.meter .on { background: #5e7d62; }
.meter .hot { background: #af694c; }

#condition {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

#condition i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5e7d62;
}

#condition.warn i { background: #af694c; }

dialog dt { font-weight: 600; font-size: 14px; margin-top: 13px; }
dialog dd { margin: 4px 0; font-size: 13px; line-height: 1.65; }
dialog h2 { font-size: 19px; margin: 0 0 8px; }

.guide-views { display: flex; gap: 8px; margin-top: 8px; }
.guide-views button { border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; }
.guide-views button:hover { background: #e5e8de; }

.repair {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  background: #344d40;
  color: white;
  font-weight: 600;
  margin-top: 10px;
}

.repair:hover { background: #2b4236; }

.leg-shapes { display: grid; grid-template-columns: 1fr; gap: 8px; }

.leg-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f5f5ee;
  text-align: left;
  transition: border-color 0.16s, background 0.16s, transform 0.14s;
}

.leg-card:hover { border-color: #9bb0a2; background: #edf0e6; }
.leg-card[aria-pressed='true'] { border-color: #3a5646; background: #e6ece4; box-shadow: 0 0 0 1px #3a5646; }
.leg-card svg { width: 34px; height: 46px; flex-shrink: 0; fill: none; stroke: #344a3f; stroke-width: 2.2; stroke-linecap: round; }
.leg-card div { display: flex; flex-direction: column; gap: 2px; }
.leg-card b { font-size: 13px; font-weight: 600; color: #1f2b25; }
.leg-card small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.leg-card i {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #344d40;
  color: #ffffff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}
.leg-card[aria-pressed='true'] i { opacity: 1; transform: scale(1); }
.leg-card i svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; }

.accessory-group, .pose-group { margin-top: 12px; }
.pose-group { margin-top: 2px; margin-bottom: 14px; }
.sub-head { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }

.seg-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg-pills button {
  padding: 7px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f5f5ee;
  font-size: 12px;
  font-weight: 500;
  color: #304139;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.seg-pills button:hover { background: #eaece2; border-color: #9cb0a3; }
.seg-pills button[aria-pressed='true'] { background: #344d40; border-color: #344d40; color: #ffffff; }

#zoomPanel {
  position: absolute;
  right: max(var(--space), env(safe-area-inset-right));
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 58px);
  width: min(236px, calc(100% - 32px));
  max-height: calc(100dvh - 125px);
  overflow-y: auto;
  padding: 15px 17px 11px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 7px 28px #17292138;
  z-index: 9;
}

#zoomPanel > div:first-child { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
#zoomValue { font-variant-numeric: tabular-nums; color: var(--muted); }
#magnification { width: 100%; height: 24px; accent-color: #476552; cursor: pointer; margin: 4px 0; }
.zoom-actions { display: flex; justify-content: flex-end; }
#resetZoom { font-size: 12px; padding: 3px 0 3px 9px; color: #405e4b; }
#zoom[aria-expanded="true"] { background: #eff0e5; color: #304039; }

.panel-section { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 8px; }
.section-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.view-pills, .mood-pills { display: grid; gap: 4px; }
.view-pills { grid-template-columns: repeat(4, 1fr); }
.mood-pills { grid-template-columns: repeat(3, 1fr); }

.view-pills button, .mood-pills button {
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  background: #e3e6dc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.16s, color 0.16s;
}
.view-pills button:hover, .mood-pills button:hover { background: #d9ddd1; }
.view-pills button[aria-pressed="true"], .mood-pills button[aria-pressed="true"] {
  background: #fafaf4;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2.5px #26382f22;
}

.mood-pills i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.16); }
.dot-slate { background: linear-gradient(135deg, #6e8890, #233843); }
.dot-amber { background: linear-gradient(135deg, #a8876d, #3b2a21); }
.dot-noir { background: linear-gradient(135deg, #4b5e72, #0f1620); }

.inspect-options {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 8px 0 0;
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}
.inspect-options legend { font-size: 12px; color: var(--muted); padding-right: 8px; }
.inspect-options label { display: flex; gap: 4px; align-items: center; min-height: 30px; font-size: 12px; cursor: pointer; }
.inspect-options input { accent-color: #476552; }

#zoomPanel .preferences {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 6px;
  display: grid;
  gap: 3px;
}

.preferences button, .preferences #musicToggle {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  backdrop-filter: none;
}
.preferences button:hover, .preferences #musicToggle:hover { background: #e5e8de; }
.preferences #musicToggle::after { content: attr(data-off); margin-left: auto; color: var(--muted); font-size: 12px; }
.preferences #musicToggle[aria-pressed="true"] { background: #e3e7dc; color: var(--ink); }
.preferences #musicToggle[aria-pressed="true"]::after { content: attr(data-on); color: #476552; font-weight: 600; }

.immersive-face { display: inline-flex; align-items: center; justify-content: center; }
.immersive-face span { display: none; }
.stage:not(.immersive) > #immersiveToggle { display: none; }

.immersive .brand,
.immersive .studio-nav,
.immersive .dock,
.immersive .grab-hint,
.immersive .stage-toast {
  display: none;
}

.immersive #immersiveToggle {
  position: absolute;
  top: 50%;
  right: env(safe-area-inset-right, 0px);
  transform: translateY(-50%);
  --edge-hit: 32px;
  width: var(--edge-hit);
  height: 48px;
  overflow: hidden;
  pointer-events: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  transition: width 0.18s ease;
  z-index: 10;
}

.immersive .immersive-face {
  position: absolute;
  left: calc(var(--edge-hit) - 16px);
  top: 3px;
  bottom: 3px;
  width: 116px;
  justify-content: flex-start;
  gap: 9px;
  background: #253c40e8;
  border: 1px solid #d1e1db55;
  border-radius: 18px 0 0 18px;
  color: var(--paper);
}

.immersive .immersive-face::before {
  content: "";
  width: 3px;
  height: 17px;
  margin-left: 6px;
  background: #cad9d2;
  border-radius: 3px;
}

.immersive .immersive-face span { display: inline; font-size: 13px; white-space: nowrap; }
.immersive #immersiveToggle:focus-visible { width: calc(var(--edge-hit) + 100px); outline-offset: -2px; }
@media (hover: hover) { .immersive #immersiveToggle:hover { width: calc(var(--edge-hit) + 100px); } }
@media (pointer: coarse) { .immersive #immersiveToggle { --edge-hit: 44px; } }

/* ============================================================================
   BELOW THE FOLD: SSR SEO & GEO Monograph (Native Lazy Render via content-visibility)
   ============================================================================ */
.snagged-guide {
  background: #f5f3ec;
  color: #1f2a24;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.guide-shell {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(44px, 6vw, 84px) clamp(18px, 4vw, 36px) 56px;
}

.guide-hero {
  padding-bottom: 36px;
  border-bottom: 1px solid #d7d8ce;
}

.guide-kicker,
.band-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #8b2840;
  text-transform: uppercase;
}

.guide-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #151c19;
}

.guide-lead {
  margin: 0 0 26px;
  max-width: 78ch;
  font-size: 15.5px;
  line-height: 1.72;
  color: #3e4a44;
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.spec-card {
  padding: 16px 15px;
  border-radius: 12px;
  background: #fbfaf6;
  border: 1px solid #dcddd4;
}

.spec-card strong {
  display: block;
  font-size: 15px;
  color: #161f1b;
  margin-bottom: 5px;
}

.spec-card span {
  display: block;
  font-size: 12.5px;
  line-height: 1.5;
  color: #55615a;
}

.guide-band {
  content-visibility: auto;
  contain-intrinsic-size: auto 560px;
  padding: 40px 0;
  border-bottom: 1px solid #dcdcd2;
}

.guide-band h2 {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.25;
  color: #161d1a;
}

.guide-band p {
  font-size: 15px;
  line-height: 1.72;
  color: #3a4640;
  margin: 0 0 16px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #d6d8ce;
  background: #fcfbf8;
}

.snagged-guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.snagged-guide th {
  padding: 12px 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #ecece3;
  color: #35413b;
  border-bottom: 1px solid #d6d8ce;
}

.snagged-guide td {
  padding: 12px 14px;
  border-bottom: 1px solid #e7e7de;
  vertical-align: top;
  line-height: 1.55;
  color: #2f3a35;
}

.snagged-guide tr:last-child td { border-bottom: 0; }

.try-preset {
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #23342e;
  color: #f7f6f0;
  transition: background 0.15s;
}

.try-preset:hover { background: #8b2840; }

.mech-list {
  margin: 14px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 11px;
  font-size: 14.5px;
  line-height: 1.7;
  color: #35423c;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.product-card {
  padding: 18px 18px 16px;
  border-radius: 13px;
  background: #fcfbf7;
  border: 1px solid #d9dad0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card.is-live {
  border-color: #9e354d;
  background: linear-gradient(180deg, #fffdf9 0%, #f9f1f2 100%);
}

.p-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8b2840;
}

.product-card h3 { margin: 0; font-size: 16.5px; color: #171f1c; }
.product-card p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #4a5650; }
.product-card a,
.product-card .link-like {
  margin-top: auto;
  align-self: flex-start;
  padding: 0;
  background: none;
  color: #8b2840;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.product-card a:hover,
.product-card .link-like:hover { text-decoration: underline; }

.dual-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-card {
  padding: 20px;
  border-radius: 13px;
  background: #fcfbf7;
  border: 1px solid #d9dad0;
}

.info-card h3 { margin: 0 0 8px; font-size: 16.5px; }
.info-card p { font-size: 13.8px; line-height: 1.65; }
.inline-email a { color: #8b2840; font-weight: 600; }
.inline-btn { display: inline-flex; margin-top: 4px; }

.faq-list {
  display: grid;
  gap: 9px;
}

.faq-list details {
  border-radius: 10px;
  border: 1px solid #d7d8ce;
  background: #fcfbf8;
  padding: 13px 16px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: #19221e;
}

.faq-list details p {
  margin: 10px 0 2px;
  font-size: 13.8px;
  line-height: 1.68;
  color: #46524c;
}

.guide-footer {
  padding-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: #54605a;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.footer-links a,
.footer-btn {
  color: #31413a;
  text-decoration: none;
  font-size: 13px;
  padding: 0;
}

.footer-links a:hover,
.footer-btn:hover { color: #8b2840; text-decoration: underline; }

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 860px) {
  .spec-strip { grid-template-columns: 1fr 1fr; }
  .product-grid, .dual-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { top: max(13px, env(safe-area-inset-top)); }
  .brand { gap: 7px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-wordmark { height: 15px; }
  .dock { bottom: max(16px, env(safe-area-inset-bottom)); }
  .round { width: 40px; height: 40px; }
  .tools { gap: 5px; }
  #materials { gap: 7px; padding: 6px 8px; }
  .chip { width: 24px; height: 30px; }
  .action { font-size: 12px; padding: 0 9px; }
  .action svg { width: 16px; }
  .coffee-box { grid-template-columns: 1fr; }
  .coffee-qr { max-width: 190px; }
  .spec-strip { grid-template-columns: 1fr; }
  #materialPanel {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 23px 24px max(22px, env(safe-area-inset-bottom));
    max-height: min(76dvh, 560px);
  }
  .grab-hint { transform: translate(calc(-100% + 9px), -50%); flex-direction: row-reverse; }
}

@media (max-width: 420px) {
  #unpin, #undoTear { position: absolute; right: 0; bottom: 52px; }
  #unpin:not([hidden]) ~ #undoTear { right: 92px; }
  .stage:has(#unpin:not([hidden])) #zoomPanel { bottom: 118px; }
}

@media (max-height: 480px) {
  .topbar { top: 8px; }
  .dock { bottom: 8px; }
  #materialPanel { inset: auto 12px 12px auto; max-height: calc(100dvh - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


.sub-page{min-height:100dvh;background:#f5f3ec;color:#1e2823;display:flex;flex-direction:column}
.sub-topbar{background:radial-gradient(ellipse at 30% 0%,#3a1925 0%,#191d24 58%,#12171d 100%);color:#f4efe9;padding:calc(16px + env(safe-area-inset-top,0px)) clamp(18px,4vw,44px) 16px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid rgba(255,240,232,.1)}
.sub-brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none}
.sub-brand .brand-mark{width:32px;height:32px}
.sub-brand .brand-wordmark{height:17px}
.sub-nav{display:flex;flex-wrap:wrap;align-items:center;gap:16px}
.sub-nav a{color:rgba(244,239,233,.86);text-decoration:none;font-size:13px;font-weight:500}
.sub-nav a:hover,.sub-nav a[aria-current="page"]{color:#fff;text-decoration:underline}
.sub-shell{width:100%;max-width:920px;margin:0 auto;padding:clamp(32px,5vw,60px) clamp(18px,4vw,32px) 64px;flex:1}
.sub-crumb{font-size:12.5px;color:#606d66;margin-bottom:18px;display:flex;align-items:center;gap:7px}
.sub-crumb a{color:#8b2840;text-decoration:none}
.sub-crumb a:hover{text-decoration:underline}
.sub-shell h1{margin:0 0 14px;font-size:clamp(26px,3.6vw,38px);line-height:1.18;color:#151c18}
.sub-lead{font-size:15.5px;line-height:1.72;color:#414d47;margin:0 0 28px;max-width:72ch}
.collab-layout{display:grid;grid-template-columns:1.25fr .9fr;gap:24px;align-items:start}
.collab-card{background:#fcfbf7;border:1px solid #d7d8ce;border-radius:15px;padding:24px}
.collab-card h2{margin:0 0 10px;font-size:20px;color:#171f1b}
.collab-card p{font-size:14px;line-height:1.66;color:#46534d;margin:0 0 14px}
.tier-list{margin:0 0 18px;padding-left:18px;display:grid;gap:7px;font-size:13.8px;line-height:1.6;color:#313e38}
.coffee-figure{margin:14px auto 8px;max-width:260px;border-radius:12px;overflow:hidden;border:1px solid #d6d9ce;background:#fff;box-shadow:0 10px 30px rgba(24,34,30,.08)}
.coffee-figure img{display:block;width:100%;height:auto}
.coffee-caption{text-align:center;font-size:12px;color:#5e6a64;margin:8px 0 0}
.legal-prose{background:#fcfbf7;border:1px solid #d7d8ce;border-radius:15px;padding:clamp(22px,4vw,36px)}
.legal-prose h2{margin:26px 0 10px;font-size:20px;color:#171f1b}
.legal-prose h2:first-child{margin-top:0}
.legal-prose p,.legal-prose li{font-size:14.5px;line-height:1.74;color:#36433d}
.legal-prose a{color:#8b2840}
.sub-footer{border-top:1px solid #d9dad0;padding:24px clamp(18px,4vw,44px);max-width:920px;width:100%;margin:0 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;font-size:13px;color:#58645e}
@media(max-width:780px){.collab-layout{grid-template-columns:1fr}}
