/* ==========================================================================
   SiteForge Custom Studio
   Light mode is the permanent default: this stylesheet never reads the OS
   color-scheme preference. Motion runs through the --motion tokens, which the
   reduced-motion query below sets to zero in one place.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Warm premium neutrals */
  --bg: #F5F1EA;
  --bg-deep: #EDE7DC;
  --surface: #FFFDF9;
  --surface-2: #FAF6EF;
  --surface-3: #F3EEE5;
  --ink: #23201C;
  --ink-2: #45403A;
  --muted: #69625A;
  --faint: #6F675D;
  --line: #E4DDD2;
  --line-2: #D5CCBE;

  /* One restrained accent: deep clay */
  --accent: #8E3F26;
  --accent-hover: #7A3520;
  --accent-ink: #FFFFFF;
  --accent-soft: #F7ECE5;
  --accent-soft-2: #F1DED3;
  --accent-line: #D8B4A2;
  --focus: rgba(142, 63, 38, 0.24);

  /* Attention (a preference tone, not an alarm) */
  --warn: #7D5200;
  --warn-soft: #FBF2DE;
  --warn-line: #E7C981;
  --warn-dot: #C98A10;
  --ok: #3E6A50;
  --ok-soft: #E9F1EB;
  --danger: #9B2C2C;
  --danger-soft: #FBEAE8;

  /* Priority shelves */
  --c-must-preserve: #2B2824;
  --c-do-not-change: #3E4A56;
  --c-must-include: #8E3F26;
  --c-should-avoid: #75606F;
  --c-should-emphasize: #7E5616;
  --c-optional: #6B645B;

  /* Type: two stacks in the chrome */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* 8px spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --r-xs: 4px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(35, 32, 28, 0.04), 0 2px 10px rgba(35, 32, 28, 0.035);
  --shadow-2: 0 2px 6px rgba(35, 32, 28, 0.045), 0 14px 36px rgba(35, 32, 28, 0.07);
  --shadow-3: 0 30px 80px rgba(35, 32, 28, 0.18);

  --motion-fast: 150ms;
  --motion: 200ms;
  --motion-mid: 250ms;
  --motion-slow: 300ms;
  --motion-pulse: 400ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-io: cubic-bezier(0.45, 0, 0.35, 1);

  --topbar-h: 64px;
  --rail-left: 248px;
  --rail-right: 364px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-fast: 0ms; --motion: 0ms; --motion-mid: 0ms; --motion-slow: 0ms; --motion-pulse: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); }
body {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; color: var(--ink); }
p { margin: 0; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.icon, .icon svg, .wordmark__mark svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

.visually-hidden {
  position: absolute !important; 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: var(--s4); top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--r-sm); text-decoration: none;
}
.skip-link:focus { top: var(--s3); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus); }
.stage:focus-visible, .stage:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }

.noscript { padding: var(--s7); text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 42px; padding: 0 var(--s5);
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px; letter-spacing: 0.005em; text-decoration: none; white-space: nowrap;
  transition: background-color var(--motion) var(--ease-io), border-color var(--motion) var(--ease-io), color var(--motion) var(--ease-io), box-shadow var(--motion) var(--ease-io), transform var(--motion-fast) var(--ease-out);
}
.btn:hover { border-color: var(--ink-2); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 16px rgba(142, 63, 38, 0.18); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); padding: 0 var(--s3); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn--quiet { background: transparent; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #842424; border-color: #842424; }
.btn--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.btn--warn:hover { background: #F7E8C6; border-color: var(--warn-dot); }
.btn--sm { min-height: 36px; padding: 0 var(--s4); font-size: 13.5px; }
.btn--xs { min-height: 30px; padding: 0 var(--s3); font-size: 12.5px; }
.btn .icon { width: 16px; height: 16px; }
.btn.is-done { background: var(--ok-soft); border-color: #B9D2C1; color: var(--ok); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted);
  transition: background-color var(--motion) var(--ease-io), color var(--motion) var(--ease-io), border-color var(--motion) var(--ease-io);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.icon-btn .icon { width: 17px; height: 17px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { color: var(--accent-hover); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s5);
  padding: 0 var(--s5);
  background: rgba(250, 247, 241, 0.92);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: var(--s3); color: var(--ink); text-decoration: none; flex: none; border-radius: var(--r-sm); }
.wordmark__mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(142,63,38,.22); }
.wordmark__mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.wordmark__text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark__family { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wordmark__name { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }

.topbar__project { display: flex; align-items: center; gap: var(--s2); min-width: 0; flex: 0 1 280px; padding-left: var(--s4); border-left: 1px solid var(--line); }
.topbar__project input {
  width: 100%; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm);
  padding: 6px 10px; font-weight: 600; font-size: 14.5px; color: var(--ink);
  text-overflow: ellipsis; transition: border-color var(--motion), background-color var(--motion);
}
.topbar__project input:hover { border-color: var(--line); background: var(--surface); }
.topbar__project input:focus-visible { background: var(--surface); }
.topbar__project .icon { color: var(--faint); }

.progress { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 5px; align-items: center; }
.progress li { width: 30px; height: 5px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.progress li::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--motion-mid) var(--ease-out); }
.progress li.is-done::after { transform: scaleX(1); opacity: 0.55; }
.progress li.is-current::after { transform: scaleX(1); opacity: 1; }
.progress li.is-attention::after { transform: scaleX(1); background: var(--warn-dot); opacity: 1; }

.topbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--s4); flex: none; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); min-width: 118px; justify-content: flex-end; transition: opacity var(--motion-fast); }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state[data-state="saving"]::before { background: var(--faint); }
.save-state[data-state="error"] { color: var(--danger); }
.save-state[data-state="error"]::before { background: var(--danger); }
.save-state:empty::before { display: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-left) minmax(0, 1fr) var(--rail-right); min-height: calc(100vh - var(--topbar-h)); }
body.is-home .shell { grid-template-columns: minmax(0, 1fr); }
.rail { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.rail--left { border-right: 1px solid var(--line); padding: var(--s5) var(--s3) var(--s5) var(--s4); background: var(--bg); display: flex; flex-direction: column; }
.rail--right { border-left: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 220px); padding: var(--s5) var(--s5) var(--s7); }

.stage { min-width: 0; padding: var(--s6) var(--s7) var(--s8); }
.stage__inner { max-width: 900px; margin: 0 auto; }
body.is-home .stage { padding: 0; }

/* ---------- left rail: workflow ---------- */
.flow-nav { display: flex; flex-direction: column; gap: var(--s2); }
.flow-phase { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: var(--s3) var(--s3) var(--s1); }
.flow-studio { position: relative; margin: var(--s2) 0; padding: var(--s2) 0 var(--s2); border-radius: var(--r); background: linear-gradient(180deg, rgba(142,63,38,0.045), rgba(142,63,38,0.015)); border: 1px solid rgba(142,63,38,0.10); }
.flow-studio__label { display: flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; padding: var(--s1) var(--s3) var(--s1); }
.flow-studio__label .icon { width: 13px; height: 13px; }
.flow-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.flow-item a {
  display: flex; align-items: center; gap: var(--s3);
  padding: 9px var(--s3); border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2);
  transition: background-color var(--motion) var(--ease-io), color var(--motion) var(--ease-io);
}
.flow-item a:hover { background: var(--surface); color: var(--ink); }
.flow-item a[aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.flow-item.is-ahead a { color: var(--faint); }
.flow-num { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--faint); width: 20px; flex: none; font-weight: 600; }
.flow-item a[aria-current="step"] .flow-num { color: var(--accent); }
.flow-label { flex: 1; min-width: 0; font-size: 14.5px; }

.state-badge { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative; transition: background-color var(--motion-mid) var(--ease-io), border-color var(--motion-mid) var(--ease-io); }
.state-badge .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.state-badge[data-state="not-started"] { border: 1.5px solid var(--line-2); }
.state-badge[data-state="in-progress"] { border: 1.5px solid var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.state-badge[data-state="completed"] { background: var(--accent); color: #fff; }
.state-badge[data-state="attention"] { background: var(--warn-dot); color: #fff; }
.state-badge[data-state="skipped"] { border: 1.5px solid var(--line-2); color: var(--faint); }
.state-badge[data-state="skipped"] .icon { stroke-width: 2.4; }

.rail-foot { margin-top: auto; padding-top: var(--s5); display: flex; flex-direction: column; gap: var(--s1); border-top: 1px solid var(--line); }
.rail-foot .btn--ghost { justify-content: flex-start; font-weight: 500; font-size: 13.5px; color: var(--muted); padding: 0 var(--s3); min-height: 36px; }
.rail-foot .btn--ghost:hover { color: var(--ink); }

/* ---------- stage header & footer ---------- */
.studio-tag { display: inline-flex; align-items: center; gap: var(--s2); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: var(--s3); }
.studio-tag::before { content: ""; width: 22px; height: 1.5px; background: var(--accent); }
.stage-head { margin-bottom: var(--s6); }
.stage-eyebrow { display: flex; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; margin-bottom: var(--s2); }
.stage-eyebrow .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.stage-title { font-family: var(--serif); font-size: clamp(28px, 3.2vw, 38px); font-weight: 600; letter-spacing: -0.012em; line-height: 1.12; }
.stage-lead { margin-top: var(--s3); font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.stage-affects { margin-top: var(--s4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--muted); }
.stage-affects__chip { padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }

.stage-foot { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.stage-foot__hint { font-size: 13px; color: var(--muted); flex: 1 1 220px; }
.stage-foot__actions { display: flex; gap: var(--s3); margin-left: auto; }

/* ---------- cards & groups ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s6); }
.card + .card, .group + .group { margin-top: var(--s5); }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s6); }
.group--secondary { background: var(--surface-2); box-shadow: none; padding: var(--s5) var(--s6); }
.group__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.group__title { font-size: 17px; font-weight: 650; letter-spacing: -0.005em; }
.group--secondary .group__title { font-size: 15.5px; }
.group__help { margin-top: 4px; font-size: 13.5px; color: var(--muted); max-width: 60ch; }
.group__meta { display: flex; align-items: center; gap: var(--s2); flex: none; font-size: 12.5px; color: var(--muted); }
.count-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-pill--accent { background: var(--accent-soft); color: var(--accent); }

.section-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: var(--s7) 0 var(--s4); display: flex; align-items: center; gap: var(--s3); }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: var(--s5); }
.field__label { font-weight: 600; font-size: 14px; color: var(--ink); display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.field__req { font-size: 11.5px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
.field__opt { font-size: 12px; font-weight: 500; color: var(--faint); }
.field__hint { font-size: 13px; color: var(--muted); }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: start; }
.field__row .field__label { min-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field__row > .field + .field { margin-top: 0; }
.input, .textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff;
  padding: 11px 14px; font-size: 15px; line-height: 1.5; color: var(--ink);
  transition: border-color var(--motion) var(--ease-io), box-shadow var(--motion) var(--ease-io), background-color var(--motion);
}
.input::placeholder, .textarea::placeholder { color: #9C9489; }
.input:hover, .textarea:hover { border-color: #BFB4A4; }
.input:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.textarea { resize: vertical; min-height: 104px; }
.textarea--lg { min-height: 200px; }
.field.has-error .input, .field.has-error .textarea { border-color: var(--danger); background: #FFFBFA; }
.field__error { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--danger); font-weight: 600; }
.field__error .icon { width: 15px; height: 15px; border-radius: 50%; background: var(--danger); color: #fff; stroke-width: 3; padding: 1px; }
.field__counter { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.field__counter.is-near { color: var(--warn); font-weight: 600; }
.field__note { display: flex; gap: var(--s2); align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--surface-3); border-radius: var(--r-sm); padding: var(--s3) var(--s4); }
.field__note + .field { margin-top: var(--s5); }
.field__note .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }

.error-summary { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid #E8B8B2; background: var(--danger-soft); color: #6F1F1F; border-radius: var(--r); padding: var(--s4) var(--s5); margin-bottom: var(--s5); font-size: 14px; }
.error-summary .icon { color: var(--danger); margin-top: 2px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 var(--s4);
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background-color var(--motion) var(--ease-io), border-color var(--motion) var(--ease-io), color var(--motion) var(--ease-io), transform var(--motion-fast) var(--ease-out);
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip .chip__check { width: 0; opacity: 0; overflow: hidden; transition: width var(--motion) var(--ease-out), opacity var(--motion); }
.chip .chip__check .icon { width: 14px; height: 14px; stroke-width: 2.8; }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip[aria-checked="true"] .chip__check, .chip[aria-pressed="true"] .chip__check { width: 14px; opacity: 1; }
.chip[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.chip--type { min-height: 0; padding: var(--s3) var(--s4); border-radius: var(--r); flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; flex: 1 1 200px; max-width: 100%; }
.chip--type .chip__title { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.chip--type[aria-checked="true"] .chip__title { color: var(--accent); }
.chip--type .chip__desc { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* ---------- selectable tiles (visual cards) ---------- */
.tiles { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tiles--wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tiles--words { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); padding: var(--s3);
  transition: border-color var(--motion) var(--ease-io), background-color var(--motion) var(--ease-io), box-shadow var(--motion) var(--ease-io), transform var(--motion-fast) var(--ease-out);
}
.tile:hover { border-color: #B8AC9B; box-shadow: var(--shadow-1); }
.tile[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow-1); }
.tile[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.tile[aria-disabled="true"]:hover { box-shadow: none; border-color: var(--line-2); }
.tile.is-popped { animation: tile-pop var(--motion-fast) var(--ease-out); }
@keyframes tile-pop { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
.tile__check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  opacity: 0; transform: scale(0.6); transition: opacity var(--motion) var(--ease-out), transform var(--motion) var(--ease-out); z-index: 2;
}
.tile__check .icon { width: 13px; height: 13px; stroke-width: 3; }
.tile[aria-checked="true"] .tile__check { opacity: 1; transform: scale(1); }
.tile__label { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink); margin-top: var(--s3); }
.tile[aria-checked="true"] .tile__label { color: var(--accent); }
.tile__desc { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.tile--word { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px var(--s3) 10px var(--s4); min-height: 44px; font-size: 14px; font-weight: 500; }
.tile--word .tile__check { position: static; width: 18px; height: 18px; }
.tile--word .tile__check .icon { width: 11px; height: 11px; }
.tile--word[aria-checked="true"] { font-weight: 600; color: var(--accent); }

.tile-art { height: 104px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid rgba(35,32,28,0.06); }

/* Visual personality previews (CSS-generated, data-driven via custom properties) */
.vp-art { background: #F4F1EC; padding: 14px; display: flex; flex-direction: column; gap: calc(7px * var(--g, 1)); }
.vp-art__hero { height: 34px; border-radius: var(--rad, 6px); background: #fff; border: calc(1px * var(--b, 1)) solid #D8D1C6; box-shadow: var(--sh, none); display: flex; align-items: center; padding: 0 10px; }
.vp-art__line { height: calc(6px * var(--sc, 1)); width: 62%; border-radius: 3px; background: #2A2724; opacity: calc(var(--w, 500) / 900); }
.vp-art__row { display: flex; gap: 8px; align-items: center; }
.vp-art__btn { height: 18px; width: 52px; border-radius: var(--rad, 6px); background: #8E3F26; }
.vp-art__sub { flex: 1; height: 5px; border-radius: 3px; background: #CFC6B8; }
.vp-art__serif { font-family: var(--serif); font-size: 11px; color: #6E655A; font-style: italic; }
.vp-art--technical .vp-art__hero { background-image: linear-gradient(#EDE8E0 1px, transparent 1px), linear-gradient(90deg, #EDE8E0 1px, transparent 1px); background-size: 8px 8px; }
.vp-art--editorial .vp-art__hero { border-width: 0 0 1px 0; background: transparent; border-radius: 0; }
.vp-art--bold { background: #2A2724; }
.vp-art--bold .vp-art__hero { background: #8E3F26; border: 0; }
.vp-art--bold .vp-art__line { background: #fff; opacity: 1; }
.vp-art--bold .vp-art__btn { background: #F4F1EC; }
.vp-art--bold .vp-art__sub { background: #6E655A; }
.vp-art--calm { background: #EEF1EE; }
.vp-art--calm .vp-art__btn { background: #7C8F84; }
.vp-art--friendly .vp-art__btn { background: #C0643B; }

/* Color direction cards */
.swatches { display: flex; height: 36px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(35,32,28,0.08); }
.swatches span { flex: 1; }
.palette-ui { margin-top: 8px; height: 60px; border-radius: 8px; border: 1px solid rgba(35,32,28,0.08); padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; }
.palette-ui__nav { display: flex; align-items: center; gap: 6px; }
.palette-ui__logo { width: 16px; height: 6px; border-radius: 2px; }
.palette-ui__link { width: 14px; height: 4px; border-radius: 2px; opacity: 0.55; }
.palette-ui__row { display: flex; align-items: center; justify-content: space-between; }
.palette-ui__text { height: 6px; width: 46%; border-radius: 3px; }
.palette-ui__btn { height: 14px; width: 40px; border-radius: 4px; }

/* Typography cards */
.type-art { background: #F7F4EF; padding: 14px 14px 12px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.type-art__head { font-size: 25px; line-height: 1.05; color: #23201C; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-art__body { font-size: 12px; line-height: 1.4; color: #5E574F; }

/* ---------- tone scales ---------- */
.scale { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s3); }
.scale + .scale { margin-top: var(--s4); }
.scale__end { font-size: 13px; color: var(--muted); font-weight: 600; min-width: 56px; }
.scale__end:last-child { text-align: right; }
.scale__points { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale__point {
  min-height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); padding: 4px 6px; line-height: 1.2;
  transition: background-color var(--motion), border-color var(--motion), color var(--motion);
}
.scale__point:hover { border-color: var(--ink-2); }
.scale__point[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.scale__caption { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }

/* ---------- tag input ---------- */
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; padding: 7px; min-height: 50px; transition: border-color var(--motion), box-shadow var(--motion); }
.tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--ink); max-width: 100%; }
.tag--avoid { background: #F3EEF2; border-color: #E0D5DE; }
.tag__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.tag button:hover { background: rgba(35,32,28,0.08); color: var(--ink); }
.tag button .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.tags input { flex: 1 1 160px; min-width: 120px; border: 0; background: transparent; padding: 6px 8px; font-size: 14.5px; }
.tags input:focus-visible { outline: none; box-shadow: none; }

/* ---------- content canvas ---------- */
.canvas-legend { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: var(--s4); }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; padding: 3px 9px 3px 7px; border-radius: var(--r-pill); border: 1px solid; }
.kind::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.kind--source { color: #4D5A66; border-color: #CCD4DB; background: #F1F4F6; }
.kind--fact { color: #3E6A50; border-color: #BFD5C6; background: #EEF5F0; }
.kind--requirement { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.kind--direction { color: #6B5A1F; border-color: #E0D2A6; background: #FAF5E4; }
.kind--preference { color: #5E4F66; border-color: #D8CEDD; background: #F5F1F7; }

.canvas-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); margin: 0 0 var(--s6); padding: 0; list-style: none; }
.canvas-map li { display: flex; min-width: 0; }
.canvas-map__cell { width: 100%; }
.canvas-map__cell {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: var(--s3) var(--s4);
  display: flex; flex-direction: column; gap: 4px; transition: border-color var(--motion), box-shadow var(--motion), background-color var(--motion);
}
.canvas-map__cell:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.canvas-map__cell.is-supplied { background: #fff; border-color: #CFE0D4; }
.canvas-map__name { font-weight: 600; font-size: 13.5px; }
.canvas-map__state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.canvas-map__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--faint); }
.canvas-map__cell.is-supplied .canvas-map__state { color: var(--ok); font-weight: 600; }
.canvas-map__cell.is-supplied .canvas-map__state::before { background: var(--ok); border-color: var(--ok); }

.zone { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow var(--motion), border-color var(--motion); }
.zone + .zone { margin-top: var(--s4); }
.zone--primary { border-color: var(--line-2); }
.zone--protected { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft) 0, var(--surface) 90px); }
.zone__head { width: 100%; display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); background: transparent; border: 0; text-align: left; }
.zone__head:hover .zone__title { color: var(--accent); }
.zone__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.zone--protected .zone__icon { background: #fff; color: var(--accent); }
.zone__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.zone__titlerow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.zone__title { font-size: 16px; font-weight: 650; transition: color var(--motion); min-width: 0; overflow-wrap: anywhere; }
.zone__summary { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone__status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex: none; }
.zone__status.is-supplied { color: var(--ok); font-weight: 600; }
.zone__chev { color: var(--muted); transition: transform var(--motion-mid) var(--ease-out); flex: none; }
.zone__head[aria-expanded="true"] .zone__chev { transform: rotate(180deg); }
.zone__body { padding: 0 var(--s5) var(--s5); display: grid; grid-template-rows: 1fr; }
.zone__body.is-opening { animation: reveal var(--motion-slow) var(--ease-out); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.zone__reminder { display: flex; gap: var(--s2); align-items: center; font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: var(--s3); }

.repeat-list { display: flex; flex-direction: column; gap: var(--s3); }
.repeat-card { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); animation: reveal var(--motion-mid) var(--ease-out); }
.repeat-card__fields { display: grid; gap: var(--s2); min-width: 0; }
.repeat-card__fields--two { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.repeat-card .input, .repeat-card .textarea { background: #fff; }
.repeat-card .textarea { min-height: 72px; }
.repeat-empty { font-size: 13.5px; color: var(--muted); padding: var(--s3) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r); }
.repeat-add { margin-top: var(--s3); }
.sub-head { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: var(--s5) 0 var(--s3); display: flex; align-items: center; justify-content: space-between; }
.sub-head:first-child { margin-top: 0; }

/* ---------- experience ---------- */
.mini-nav { height: 64px; background: #F6F3EE; border-radius: 8px; border: 1px solid rgba(35,32,28,0.06); padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.mini-nav__bar { height: 20px; background: #fff; border-radius: 5px; display: flex; align-items: center; gap: 6px; padding: 0 7px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.mini-nav__logo { width: 18px; height: 6px; border-radius: 2px; background: #2A2724; }
.mini-nav__links { display: flex; gap: 5px; margin-left: auto; align-items: center; }
.mini-nav__link { width: 13px; height: 4px; border-radius: 2px; background: #BDB3A5; }
.mini-nav__cta { width: 24px; height: 10px; border-radius: 3px; background: #8E3F26; }
.mini-nav__burger { width: 12px; height: 8px; border-top: 2px solid #2A2724; border-bottom: 2px solid #2A2724; position: relative; }
.mini-nav__burger::after { content: ""; position: absolute; left: 0; right: 0; top: 1px; border-top: 2px solid #2A2724; }
.mini-nav__sub { display: flex; gap: 5px; padding: 0 7px; }
.mini-nav__sub span { flex: 1; height: 12px; border-radius: 3px; background: #EAE4DA; }
.mini-nav__page { flex: 1; border-radius: 4px; background: repeating-linear-gradient(180deg, #ECE6DC 0 4px, transparent 4px 9px); opacity: 0.8; }
.mini-nav__caret { width: 5px; height: 5px; border-right: 1.5px solid #8C847A; border-bottom: 1.5px solid #8C847A; transform: rotate(45deg); margin-top: -3px; }

.mini-page { height: 96px; background: #F6F3EE; border-radius: 8px; border: 1px solid rgba(35,32,28,0.06); padding: 10px; display: flex; flex-direction: column; }
.mini-page__block { background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); display: flex; gap: 4px; padding: 4px; }
.mini-page__block span { flex: 1; background: #E5DED3; border-radius: 2px; }

.flowviz { display: flex; flex-direction: column; }
.flowviz__status { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.flowviz__status.is-confirmed { background: var(--ok-soft); border-color: #C6DACB; color: var(--ok); font-weight: 600; }
.flowviz__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flowviz__item { position: relative; padding-bottom: 22px; }
.flowviz__item:last-child { padding-bottom: 0; }
.flowviz__item::after { content: ""; position: absolute; left: 30px; bottom: 3px; width: 1.5px; height: 16px; background: var(--line-2); }
.flowviz__item::before { content: ""; position: absolute; left: 26.5px; bottom: 1px; width: 7px; height: 7px; border-right: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); transform: rotate(45deg); }
.flowviz__item:last-child::after, .flowviz__item:last-child::before { display: none; }
.flowviz__block { display: flex; align-items: center; gap: var(--s3); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px var(--s3) 10px var(--s3); box-shadow: var(--shadow-1); transition: transform var(--motion-mid) var(--ease-out), box-shadow var(--motion), border-color var(--motion); }
.flowviz__block.is-moved { animation: moved var(--motion-slow) var(--ease-out); }
@keyframes moved { from { box-shadow: 0 0 0 3px var(--focus), var(--shadow-2); border-color: var(--accent); } to { box-shadow: var(--shadow-1); } }
.flowviz__idx { width: 38px; height: 38px; flex: none; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flowviz__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.flowviz__name { font-weight: 650; font-size: 14.5px; }
.flowviz__desc { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flowviz__ctrls { display: flex; gap: 2px; flex: none; }
.flowviz__add { margin-top: var(--s4); position: relative; }
.popover { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-2); padding: var(--s2); display: flex; flex-direction: column; gap: 2px; animation: reveal var(--motion) var(--ease-out); }
.popover button { text-align: left; border: 0; background: transparent; border-radius: var(--r-sm); padding: 9px var(--s3); display: flex; flex-direction: column; }
.popover button:hover, .popover button:focus-visible { background: var(--surface-3); }
.popover__name { font-weight: 600; font-size: 14px; }
.popover__desc { font-size: 12.5px; color: var(--muted); }
.popover__empty { padding: var(--s3); font-size: 13px; color: var(--muted); }

/* ---------- rules ---------- */
.hierarchy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: var(--s5); }
.hierarchy__item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.hierarchy__sep { color: var(--faint); }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.boards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.board { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-width: 0; border-top: 3px solid var(--cat); }
.board__head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s4) var(--s2); border: 0; background: transparent; width: 100%; text-align: left; }
.board__head[disabled] { cursor: default; }
.board__title { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.board__chev { display: none; color: var(--muted); transition: transform var(--motion-mid) var(--ease-out); }
.board__meaning { padding: 0 var(--s4) var(--s3); font-size: 12.5px; color: var(--muted); }
.board__body { padding: 0 var(--s3) var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.board__tag { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--faint); }

.rule-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s3) var(--s3) var(--s4); box-shadow: var(--shadow-1); position: relative; animation: reveal var(--motion-mid) var(--ease-out); transition: border-color var(--motion), box-shadow var(--motion); }
.rule-card:hover { border-color: var(--line-2); }
.rule-card.has-conflict { border-color: var(--warn-line); }
.rule-card.is-pulse { animation: pulse var(--motion-pulse) var(--ease-io) 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,138,16,0.45); } 100% { box-shadow: 0 0 0 10px rgba(201,138,16,0); } }
.rule-card.is-target { box-shadow: 0 0 0 3px var(--focus), var(--shadow-2); border-color: var(--accent); }
.rule-card__text { font-size: 14.5px; line-height: 1.45; color: var(--ink); padding-right: 64px; overflow-wrap: anywhere; }
.rule-card__note { margin-top: 6px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.rule-card__tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 0; }
.rule-card__tools .icon-btn { width: 30px; height: 30px; }
.rule-card__conflict { margin-top: var(--s2); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-pill); padding: 2px 9px 2px 6px; text-decoration: none; }
.rule-card__conflict .icon { width: 13px; height: 13px; }
.rule-ghost { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: var(--s3) var(--s4); font-size: 13px; color: var(--muted); }
.rule-ghost__eg { font-style: italic; color: var(--ink-2); }
.rule-editor { background: #fff; border: 1px solid var(--accent); border-radius: var(--r); padding: var(--s3); box-shadow: 0 0 0 4px var(--focus); display: flex; flex-direction: column; gap: var(--s2); animation: reveal var(--motion) var(--ease-out); }
.rule-editor .input, .rule-editor .textarea { font-size: 14px; padding: 8px 10px; }
.rule-editor .textarea { min-height: 64px; }
.rule-editor__row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rule-editor__row .btn { flex: none; }
.rule-editor__msg { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.rule-editor__hint { font-size: 12.5px; color: var(--ink-2); background: var(--surface-3); border-radius: var(--r-sm); padding: 6px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rule-editor__count { font-size: 11.5px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.rule-editor select.input { padding: 6px 8px; width: auto; font-size: 13px; }
.board__add { justify-content: flex-start; border-style: dashed; background: transparent; color: var(--ink-2); font-weight: 600; }
.board__add:hover { background: var(--surface); }

.derived-note { display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s5); font-size: 13.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); }
.derived-note .icon { color: var(--muted); margin-top: 2px; }

/* ---------- priorities map ---------- */
.pmap { display: flex; flex-direction: column; gap: var(--s3); }
.pmap__group { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: var(--s4) 0 var(--s1); display: flex; align-items: center; gap: var(--s3); }
.pmap__group:first-child { margin-top: 0; }
.pmap__group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.shelf { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: var(--s4); align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.shelf::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat); }
.shelf--empty { padding: 10px var(--s4); box-shadow: none; background: transparent; border-style: dashed; }
.shelf__label { display: flex; flex-direction: column; gap: 2px; padding-left: 6px; }
.shelf__name { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; color: var(--cat); }
.shelf__kind { font-size: 12px; color: var(--muted); }
.shelf__items { display: flex; flex-wrap: wrap; gap: var(--s2); min-width: 0; }
.shelf__empty { font-size: 13px; color: var(--muted); align-self: center; }
.pitem { display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px var(--s3); max-width: 100%; min-width: 0; flex: 0 1 auto; animation: reveal var(--motion-mid) var(--ease-out); }
.pitem__text { font-size: 14px; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pitem__meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.pitem__src { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.pitem.has-conflict { border-color: var(--warn-line); background: #FFFBF1; }
.conflict-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-pill); padding: 1px 8px 1px 5px; text-decoration: none; }
.conflict-badge .icon { width: 12px; height: 12px; }

.conflict-panel { margin-top: var(--s7); }
.conflict-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); flex-wrap: wrap; }
.conflict-panel__title { font-size: 20px; font-family: var(--serif); font-weight: 600; }
.conflict-none { display: flex; gap: var(--s3); align-items: center; padding: var(--s5); border-radius: var(--r-lg); background: var(--ok-soft); border: 1px solid #C6DACB; color: var(--ok); font-weight: 600; }
.conflict-card { border: 1px solid var(--warn-line); background: #FFFCF4; border-radius: var(--r-lg); padding: var(--s5); animation: reveal var(--motion-slow) var(--ease-out); }
.conflict-card + .conflict-card { margin-top: var(--s4); }
.conflict-card.is-ack { border-color: var(--line-2); background: var(--surface); }
.conflict-card:target, .conflict-card.is-target { box-shadow: 0 0 0 3px rgba(201,138,16,0.25); }
.conflict-card__top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.conflict-card__subject { font-weight: 700; font-size: 14.5px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 10px 2px 7px; border-radius: var(--r-pill); }
.status-pill .icon { width: 12px; height: 12px; }
.status-pill--open { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); }
.status-pill--ack { color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line-2); }
.conflict-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s3); align-items: stretch; }
.conflict-side { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s4); min-width: 0; }
.conflict-side__cat { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; color: var(--cat, var(--muted)); display: flex; align-items: center; gap: 6px; }
.conflict-side__text { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.conflict-vs { display: grid; place-items: center; color: var(--warn); }
.conflict-vs .icon { width: 20px; height: 20px; }
.conflict-card__why { margin-top: var(--s3); font-size: 13.5px; color: var(--ink-2); }
.conflict-card__actions { margin-top: var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- blueprint ---------- */
.bp-top { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s5); align-items: stretch; margin-bottom: var(--s5); }
.bp-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: var(--s3); }
.bp-summary__row { display: flex; gap: var(--s3); font-size: 13.5px; }
.bp-summary__k { width: 110px; color: var(--muted); flex: none; }
.bp-summary__v { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--r-pill); width: fit-content; max-width: 100%; }
.tab { border: 0; background: transparent; border-radius: var(--r-pill); padding: 9px 18px; font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: background-color var(--motion), color var(--motion), box-shadow var(--motion); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tab:hover { color: var(--ink); }
.doc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin: var(--s4) 0 var(--s3); }
.doc-toolbar__left, .doc-toolbar__right { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.export-warn { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--warn-soft); border: 1px solid var(--warn-line); color: #5E3E00; margin-bottom: var(--s4); animation: reveal var(--motion-slow) var(--ease-out); }
.export-warn .icon { color: var(--warn); margin-top: 2px; flex: none; }
.export-warn__body { flex: 1; min-width: 0; }
.export-warn__title { font-weight: 700; color: var(--warn); }
.export-warn__text { font-size: 13.5px; margin-top: 2px; }
.export-warn__actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }

.doc {
  background: #FFFEFB; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: var(--s7) clamp(20px, 5vw, 64px);
  font-size: 15px; line-height: 1.65; color: var(--ink);
  transition: opacity var(--motion-slow) var(--ease-io);
}
.doc.is-fading { opacity: 0; }
.doc .d-h3.is-doc-title { font-family: var(--serif); font-size: 19px; }
.doc h1, .doc .d-h1 { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.01em; line-height: 1.15; margin-bottom: var(--s3); }
.doc .d-h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: var(--s7) 0 var(--s3); padding-top: var(--s5); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.doc .d-h2 > span { min-width: 0; overflow-wrap: anywhere; }
.doc .d-h2.is-warn { color: var(--warn); border-top-color: var(--warn-line); }
.doc > .d-h2:first-of-type { margin-top: var(--s6); }
.doc .d-h3 { font-size: 15px; font-weight: 700; margin: var(--s5) 0 var(--s2); color: var(--ink); }
.doc .d-h5 { font-size: 14px; font-weight: 700; margin: var(--s4) 0 var(--s2); color: var(--ink-2); }
.doc .d-h4 { font-size: 13px; font-weight: 700; margin: var(--s4) 0 var(--s2); color: var(--ink-2); letter-spacing: 0.04em; text-transform: uppercase; }
.doc p { margin: var(--s2) 0; overflow-wrap: anywhere; }
.doc .d-meta { color: var(--muted); font-size: 14px; }
.doc .d-missing { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: #6E5A2E; background: #F8F1E1; border: 1px dashed #DCC89B; padding: 2px 10px; border-radius: var(--r-xs); }
.doc .d-warn { color: var(--warn); font-weight: 600; }
.doc blockquote { margin: var(--s2) 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--line-2); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.doc ul, .doc ol { margin: var(--s2) 0; padding-left: 1.4em; }
.doc li { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc li::marker { color: var(--faint); }
.doc .d-kv { list-style: none; padding: 0; }
.doc .d-kv li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s4); padding: 8px 0; border-bottom: 1px solid var(--surface-3); margin: 0; }
.doc .d-kv__k { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.doc .d-conflicts li { color: #5E3E00; }
.doc .section-copy { opacity: 0.8; }
.doc .section-copy:hover, .doc .section-copy:focus-visible { opacity: 1; }

.fallback { margin-top: var(--s4); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); padding: var(--s5); animation: reveal var(--motion) var(--ease-out); }
.fallback__title { font-weight: 700; margin-bottom: 4px; }
.fallback__text { font-size: 13.5px; color: var(--muted); margin-bottom: var(--s3); }
.fallback textarea { width: 100%; min-height: 220px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }


.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--s5); }
.notice .icon { margin-top: 2px; color: var(--muted); }
.notice--warn { background: var(--warn-soft); border-color: var(--warn-line); color: #5E3E00; }
.notice--warn .icon { color: var(--warn); }

/* Inline preview copy: only shown where the rail preview lives in a drawer */
.inline-preview { display: none; }
@media (max-width: 1023px) { .inline-preview { display: block; } }
.inline-preview .preview { max-width: 460px; }

/* ---------- Live Direction Preview ---------- */
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.rail-card + .rail-card { margin-top: var(--s4); }
.rail-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.rail-card__title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.rail-card__title .icon { width: 15px; height: 15px; color: var(--accent); }
.rail-card__body { padding: var(--s4); }

.preview { margin: 0; }
.preview__frame { border-radius: 10px; border: 1px solid #DDD5C9; background: #fff; overflow: hidden; box-shadow: 0 8px 24px rgba(35,32,28,0.08); }
.preview__chrome { height: 20px; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: #F1EDE6; border-bottom: 1px solid #E4DDD2; }
.preview__chrome i { width: 6px; height: 6px; border-radius: 50%; background: #D6CDBF; }
.preview__chrome b { margin-left: 8px; height: 8px; flex: 1; max-width: 120px; border-radius: 4px; background: #E5DFD5; }
.preview__stage { display: flex; gap: 10px; align-items: flex-start; justify-content: center; padding: 10px; background: #EEE9E1; }
.preview__stage--single { padding: 0; background: transparent; }
.preview__device { flex: 1 1 auto; min-width: 0; border-radius: 6px; overflow: hidden; }
.preview__stage--single .preview__device { border-radius: 0; }
.preview__device--phone { flex: 0 0 34%; border-radius: 10px; border: 3px solid #2A2724; }
.preview__stage--phone .preview__device--phone { flex: 0 0 52%; }
.preview__caption { margin-top: var(--s3); display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.preview__caption .icon { width: 13px; height: 13px; }
.preview__markers { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.preview__markers li { font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); border-radius: var(--r-xs); padding: 2px 7px; display: inline-flex; gap: 4px; }
.preview__markers li b { color: var(--accent); font-variant-numeric: tabular-nums; }
.preview__markers.is-draft li { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.preview__board { margin-top: var(--s3); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.preview__chip { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; background: var(--surface-2); min-width: 0; }
.preview__chip-k { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.preview__chip-v { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__chip-v.is-empty { color: var(--faint); font-weight: 500; }
.preview__sw { display: flex; height: 10px; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.preview__sw span { flex: 1; }
.preview--compact .preview__board { display: none; }

/* The mini composition. Everything is driven by custom properties set from the direction. */
.pv {
  --pv-bg: #F3F2EF; --pv-surface: #FFFFFF; --pv-text: #2A2A2A; --pv-accent: #6E6A64; --pv-support: #D9D6D0;
  --pv-radius: 6px; --pv-border: 1; --pv-shadow: 0; --pv-weight: 600; --pv-scale: 1; --pv-gap: 1;
  --pv-head: var(--sans); --pv-body: var(--sans);
  background: var(--pv-bg); color: var(--pv-text); font-family: var(--pv-body);
  padding: calc(8px * var(--pv-gap)) calc(9px * var(--pv-gap)) calc(10px * var(--pv-gap));
  display: flex; flex-direction: column; gap: calc(7px * var(--pv-gap));
  transition: background-color var(--motion-mid) var(--ease-io);
}
.pv [data-region] { transition: background-color var(--motion-mid) var(--ease-io), border-radius var(--motion-mid), padding var(--motion-mid), box-shadow var(--motion-mid); }
.pv [data-region].is-flash { animation: pvflash var(--motion-mid) var(--ease-out); }
@keyframes pvflash { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 0 rgba(142,63,38,0); } }
.pv-card { background: var(--pv-surface); border-radius: var(--pv-radius); border: calc(1px * var(--pv-border)) solid color-mix(in srgb, var(--pv-text) 12%, transparent); }
.pv--shadow-1 .pv-card { box-shadow: 0 2px 6px color-mix(in srgb, var(--pv-text) 10%, transparent); }
.pv--shadow-2 .pv-card { box-shadow: 0 4px 14px color-mix(in srgb, var(--pv-text) 13%, transparent); }
.pv-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--pv-text) 22%, transparent); }
.pv-nav { display: flex; align-items: center; gap: 5px; padding: 5px 7px; }
.pv-nav__logo { font-family: var(--pv-head); font-weight: var(--pv-weight); font-size: 8.5px; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-nav__links { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pv-nav__links .pv-bar { width: 12px; height: 3px; }
.pv-nav__cta { height: 9px; width: 22px; border-radius: min(var(--pv-radius), 5px); background: var(--pv-accent); }
.pv-nav__burger { width: 10px; height: 7px; border-top: 1.5px solid var(--pv-text); border-bottom: 1.5px solid var(--pv-text); position: relative; }
.pv-nav__burger::after { content: ""; position: absolute; left: 0; right: 0; top: 1.25px; border-top: 1.5px solid var(--pv-text); }
.pv-nav__caret { width: 3px; height: 3px; border-right: 1px solid var(--pv-text); border-bottom: 1px solid var(--pv-text); transform: rotate(45deg); opacity: 0.6; }
.pv-nav__sub { display: flex; gap: 4px; padding: 0 7px 5px; }
.pv-nav__sub .pv-bar { flex: 1; height: 5px; opacity: 0.6; }
.pv-navwrap { display: flex; flex-direction: column; }
.pv-pin { font-size: 6.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pv-accent); margin-left: 3px; }
.pv-hero { padding: calc(9px * var(--pv-gap)) 9px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; align-items: center; }
.pv-hero--center { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.pv-hero__text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pv-hero--center .pv-hero__text { align-items: center; }
.pv-head { font-family: var(--pv-head); font-weight: var(--pv-weight); font-size: calc(11px * var(--pv-scale)); line-height: 1.12; letter-spacing: -0.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pv-head.is-placeholder { opacity: 0.55; font-style: italic; font-weight: 500; }
.pv-sub { font-size: 6.5px; opacity: 0.7; line-height: 1.3; }
.pv-action { display: inline-flex; align-items: center; justify-content: center; height: 13px; padding: 0 8px; border-radius: min(var(--pv-radius), 7px); background: var(--pv-accent); color: var(--pv-bg); font-size: 6.5px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; width: fit-content; }
.pv-img { height: 44px; border-radius: var(--pv-radius); background: var(--pv-support); position: relative; overflow: hidden; }
.pv-img--photo::before { content: ""; position: absolute; left: 12%; bottom: -30%; width: 70%; height: 80%; background: color-mix(in srgb, var(--pv-text) 25%, var(--pv-support)); transform: rotate(45deg); }
.pv-img--photo::after { content: ""; position: absolute; right: 16%; top: 18%; width: 9px; height: 9px; border-radius: 50%; background: var(--pv-surface); opacity: 0.8; }
.pv-img--illustration { background: var(--pv-surface); }
.pv-img--illustration::before { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; background: var(--pv-accent); opacity: 0.55; left: 10%; top: 6px; }
.pv-img--illustration::after { content: ""; position: absolute; width: 30px; height: 22px; border-radius: 40% 60% 50% 50%; background: var(--pv-support); right: 10%; bottom: 5px; }
.pv-img--icons { background: transparent; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pv-img--icons span { border-radius: var(--pv-radius); background: var(--pv-surface); border: 1px solid color-mix(in srgb, var(--pv-text) 14%, transparent); display: grid; place-items: center; }
.pv-img--icons span::after { content: ""; width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid var(--pv-accent); }
.pv-img--neutral { background: repeating-linear-gradient(135deg, var(--pv-support) 0 4px, color-mix(in srgb, var(--pv-support) 60%, var(--pv-surface)) 4px 8px); }
.pv-sec { padding: calc(6px * var(--pv-gap)) 8px; display: flex; flex-direction: column; gap: 4px; }
.pv-sec__label { font-size: 6px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.55; }
.pv-row { display: grid; gap: 4px; }
.pv-cell { padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pv-cell .pv-bar:first-child { width: 70%; height: 4px; background: color-mix(in srgb, var(--pv-text) 45%, transparent); }
.pv-cell__name { font-size: 6.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pv-accent); opacity: 0.7; }
.pv-trust { display: flex; gap: 6px; align-items: center; padding: 6px 8px; }
.pv-trust__quote { font-family: Georgia, serif; font-size: 16px; line-height: 0.6; color: var(--pv-accent); height: 10px; }
.pv-trust__lines { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pv-badges { display: flex; gap: 3px; }
.pv-badges span { width: 12px; height: 8px; border-radius: 2px; background: var(--pv-support); }
.pv-faq { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; }
.pv-faq__plus { font-size: 8px; font-weight: 700; color: var(--pv-accent); line-height: 1; }
.pv-band { background: var(--pv-accent); color: var(--pv-bg); border-radius: var(--pv-radius); padding: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pv-band .pv-bar { background: color-mix(in srgb, var(--pv-bg) 55%, transparent); width: 45%; }
.pv-band .pv-action { background: var(--pv-bg); color: var(--pv-accent); }
.pv-form { display: flex; flex-direction: column; gap: 3px; padding: 5px; }
.pv-form span { height: 6px; border-radius: 2px; border: 1px solid color-mix(in srgb, var(--pv-text) 20%, transparent); background: var(--pv-surface); }
.pv-phone .pv-hero { grid-template-columns: 1fr; }
.pv-phone .pv-row { grid-template-columns: 1fr !important; }
.pv-phone .pv-nav__links .pv-bar { display: none; }

/* ---------- Live Project DNA ---------- */
.dna__header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px var(--s3); margin-bottom: var(--s3); }
.dna__title { white-space: nowrap; }
.dna__title { display: flex; align-items: center; gap: var(--s2); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 800; }
.dna__title .icon { color: var(--accent); width: 18px; height: 18px; }
.dna__live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 600; }
.dna__live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(142,63,38,0.15); }
.dna__identity { padding: var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--s4); }
.dna__project { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.dna__biz { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.dna__type { display: inline-flex; margin-top: var(--s2); font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: var(--r-pill); padding: 2px 9px; }
.dna__empty { color: var(--faint); font-style: italic; }
.dna-groups { display: flex; flex-direction: column; gap: 6px; }
.dna-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: box-shadow var(--motion), border-color var(--motion); }
.dna-group.is-flash { animation: dnaflash var(--motion) var(--ease-out); }
@keyframes dnaflash { 0% { background: var(--accent-soft); border-color: var(--accent-line); } 100% { background: var(--surface); } }
.dna-group.is-attention { border-color: var(--warn-line); }
.dna-group__h { margin: 0; font-size: inherit; font-weight: inherit; }
.dna-group__head { width: 100%; display: flex; align-items: center; gap: var(--s2); padding: 10px var(--s3) 10px var(--s4); border: 0; background: transparent; text-align: left; }
.dna-group__name { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; flex: 1; }
.dna-group__count { font-size: 11.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.dna-group.is-attention .dna-group__count { color: var(--warn); }
.dna-group__chev { color: var(--faint); width: 16px; height: 16px; transition: transform var(--motion-mid) var(--ease-out); }
.dna-group__head[aria-expanded="true"] .dna-group__chev { transform: rotate(180deg); }
.dna-group__body { padding: 0 var(--s4) var(--s3); font-size: 13px; animation: reveal var(--motion-slow) var(--ease-out); }
.dna-rows { display: flex; flex-direction: column; gap: 6px; }
.dna-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: var(--s2); align-items: baseline; }
.dna-row__k { font-size: 11.5px; color: var(--muted); }
.dna-row__v { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dna-row__v.is-empty { color: var(--faint); font-weight: 500; font-style: italic; }
.dna-sw { display: inline-flex; vertical-align: middle; margin-right: 6px; border-radius: 3px; overflow: hidden; }
.dna-sw span { width: 9px; height: 12px; }
.dna-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dna-list li { position: relative; padding-left: 14px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.4; }
.dna-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 1.5px; background: var(--cat, var(--line-2)); }
.dna-list__src { color: var(--faint); font-size: 11px; }
.dna-more { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dna-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.dna-zone { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); min-width: 0; }
.dna-zone span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dna-zone::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.dna-zone.is-supplied { color: var(--ink); font-weight: 600; }
.dna-zone.is-supplied::before { background: var(--ok); border-color: var(--ok); }
.dna-flow { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.dna-flow span { font-size: 11.5px; font-weight: 600; background: var(--surface-3); border-radius: var(--r-xs); padding: 1px 6px; }
.dna-flow i { font-style: normal; color: var(--faint); font-size: 11px; }
.dna-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.dna-count { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.dna-count b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dna-attn { margin-top: var(--s3); display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; }
.dna-attn--warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.dna-attn--ok { background: var(--ok-soft); color: var(--ok); }
.dna-attn .link-btn { margin-left: auto; font-size: 12.5px; color: inherit; }
.dna-go { margin-top: var(--s2); font-size: 12px; }
.dna-context { margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.dna-context strong { color: var(--ink); }

.dna-toggle {
  position: fixed; z-index: 45; right: var(--s5); bottom: var(--s5);
  display: none; align-items: center; gap: var(--s2); min-height: 46px; padding: 0 var(--s5) 0 var(--s4);
  border-radius: var(--r-pill); border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-2);
}
.dna-toggle .icon { width: 18px; height: 18px; }
.dna-toggle__meta { font-weight: 500; opacity: 0.8; font-size: 12.5px; }
.dna-toggle__attn { width: 8px; height: 8px; border-radius: 50%; background: var(--warn-dot); }
.scrim { position: fixed; inset: 0; z-index: 46; background: rgba(35, 32, 28, 0.32); animation: fadein var(--motion) var(--ease-out); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.drawer-close { display: none; }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: var(--s5); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s2); align-items: center; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s3); background: var(--ink); color: #fff; border-radius: var(--r); padding: 10px 10px 10px var(--s4); box-shadow: var(--shadow-2); font-size: 14px; animation: toast-in var(--motion-mid) var(--ease-out); max-width: 100%; }
.toast__text { flex: 1; min-width: 0; }
.toast .btn { min-height: 32px; background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.25); }
.toast .btn:hover { background: rgba(255,255,255,0.2); }
.toast .icon-btn { color: rgba(255,255,255,0.75); width: 30px; height: 30px; }
.toast .icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(35, 32, 28, 0.42); display: grid; place-items: center; padding: var(--s4); animation: fadein var(--motion) var(--ease-out); }
.modal { width: min(480px, 100%); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: var(--s6); animation: toast-in var(--motion-mid) var(--ease-out); }
.modal__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; margin-bottom: var(--s4); }
.modal__title { font-family: var(--serif); font-size: 23px; margin-bottom: var(--s2); }
.modal__text { color: var(--ink-2); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--s3); margin-top: var(--s6); flex-wrap: wrap; }

.tip { display: flex; gap: var(--s3); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s3) var(--s3) var(--s4); margin-bottom: var(--s5); font-size: 13.5px; color: var(--ink-2); box-shadow: var(--shadow-1); animation: reveal var(--motion-slow) var(--ease-out); }
.tip .icon { color: var(--accent); }
.tip__text { flex: 1; }

/* ---------- context panel ---------- */
.context-panel { margin-top: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.context-panel__head { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border: 0; background: transparent; text-align: left; }
.context-panel__title { font-weight: 650; flex: 1; }
.context-panel__sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.context-panel__body { padding: 0 var(--s5) var(--s5); animation: reveal var(--motion-slow) var(--ease-out); }

/* ---------- screen transition ---------- */
.screen-enter { animation: screen-in var(--motion-slow) var(--ease-out); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- home ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: var(--s8) var(--s6) var(--s8); }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s7); align-items: center; }
.home-eyebrow { font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: var(--s4); display: flex; align-items: center; gap: var(--s3); }
.home-eyebrow::before { content: ""; width: 26px; height: 1.5px; background: var(--accent); }
.home-title { font-family: var(--serif); font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.02em; font-weight: 600; }
.home-lead { font-size: 18px; color: var(--ink-2); margin-top: var(--s5); max-width: 54ch; }
.home-actions { margin-top: var(--s6); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.home-actions .btn { min-height: 50px; padding: 0 var(--s6); font-size: 15.5px; }
.home-note { margin-top: var(--s4); font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: var(--s2); }
.home-note .icon { width: 15px; height: 15px; }
.home-visual { position: relative; }
.home-visual .preview__frame { transform: rotate(-1.2deg); }
.home-visual__dna { position: absolute; right: -8px; bottom: -28px; width: 58%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: var(--s3) var(--s4); transform: rotate(1.5deg); }
.home-visual__dna .dna__title { font-size: 10px; margin-bottom: 8px; }
.home-visual__line { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; }
.home-visual__line b { display: block; height: 100%; border-radius: 3px; background: var(--accent-line); }
.mech { margin-top: var(--s8); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); counter-reset: mech; }
.mech__step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s4); position: relative; }
.mech__word { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 800; color: var(--accent); }
.mech__stages { font-size: 12px; color: var(--faint); font-weight: 600; margin-top: 2px; }
.mech__text { font-size: 13.5px; color: var(--ink-2); margin-top: var(--s2); }
.mech__step:not(:last-child)::after { content: ""; position: absolute; right: -10px; top: 50%; width: 8px; height: 8px; border-top: 1.5px solid var(--line-2); border-right: 1.5px solid var(--line-2); transform: translateY(-50%) rotate(45deg); }
.home-grid { margin-top: var(--s7); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.artifact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--shadow-1); }
.artifact__icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: var(--s4); }
.artifact__title { font-family: var(--serif); font-size: 21px; }
.artifact__text { color: var(--ink-2); margin-top: var(--s2); font-size: 14.5px; }
.home-bounds { margin-top: var(--s4); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.bound { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.bound .icon { color: var(--accent); margin-top: 2px; }
.bound strong { display: block; color: var(--ink); font-size: 14px; }
.resume { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s6); box-shadow: var(--shadow-2); }
.resume__k { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.resume__name { font-family: var(--serif); font-size: 28px; margin-top: var(--s2); overflow-wrap: anywhere; }
.resume__meta { color: var(--ink-2); margin-top: var(--s1); overflow-wrap: anywhere; }
.resume__actions { display: flex; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.home-footer { margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* 1024-1279: compact left rail (numbers + state), full DNA rail */
@media (max-width: 1279px) {
  :root { --rail-left: 84px; --rail-right: 330px; }
  .rail--left { padding: var(--s4) var(--s2); align-items: stretch; }
  .flow-phase, .flow-studio__label span, .rail-foot__text { display: none; }
  .flow-studio__label { justify-content: center; padding: 2px 0 4px; }
  .flow-item a { flex-direction: column; gap: 4px; padding: 8px 4px; position: relative; }
  .flow-num { width: auto; text-align: center; }
  .flow-label { font-size: 10.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
  .rail-foot .btn--ghost { justify-content: center; padding: 0; }
  .stage { padding: var(--s6) var(--s6) var(--s8); }
  .topbar__project { flex-basis: 220px; }
  .shelf { grid-template-columns: 150px minmax(0, 1fr); }
  .bp-top { grid-template-columns: minmax(0, 1fr); }
}

/* 768-1023: DNA becomes a drawer */
@media (max-width: 1023px) {
  :root { --rail-right: 0px; }
  .shell { grid-template-columns: var(--rail-left) minmax(0, 1fr); }
  .rail--right {
    position: fixed; z-index: 47; top: 0; right: 0; bottom: 0; height: 100vh; width: min(420px, 92vw);
    border-left: 1px solid var(--line); box-shadow: var(--shadow-3); background: var(--bg);
    transform: translateX(102%); visibility: hidden;
    transition: transform var(--motion-slow) var(--ease-out), visibility 0s linear var(--motion-slow);
  }
  body.dna-open .rail--right { transform: none; visibility: visible; transition: transform var(--motion-slow) var(--ease-out), visibility 0s; }
  .dna-toggle { display: inline-flex; }
  .drawer-close { display: inline-flex; }
  .topbar__project { display: none !important; }
  .progress li { width: 20px; }
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .home-visual { max-width: 520px; }
  .mech { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mech__step::after { display: none; }
  .home-bounds { grid-template-columns: minmax(0, 1fr); }
  .stage { padding-bottom: 110px; }
}

/* <=767: horizontal stepper, bottom-sheet DNA */
@media (max-width: 767px) {
  :root { --topbar-h: 56px; }
  body { font-size: 15px; }
  .topbar { gap: var(--s3); padding: 0 var(--s4); }
  .wordmark__mark { width: 30px; height: 30px; }
  .wordmark__family { font-size: 9.5px; }
  .wordmark__name { font-size: 16px; }
  .topbar__project, .progress, .topbar__action { display: none !important; }
  .save-state { min-width: 0; font-size: 12px; }
  .shell { display: block; }
  .rail--left {
    position: sticky; top: var(--topbar-h); z-index: 30; height: auto; overflow-x: auto; overflow-y: hidden;
    padding: 0 var(--s3); border-right: 0; border-bottom: 1px solid var(--line);
    background: rgba(245, 241, 234, 0.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    flex-direction: row; scrollbar-width: none;
  }
  .rail--left::-webkit-scrollbar { display: none; }
  .flow-nav { flex-direction: row; gap: 0; align-items: stretch; }
  .flow-studio { display: flex; flex-direction: row; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .flow-studio__label, .flow-phase, .rail-foot { display: none; }
  .flow-list { flex-direction: row; gap: 0; }
  .flow-item a { flex-direction: row; gap: 6px; padding: 12px 10px; border-radius: 0; box-shadow: none !important; background: transparent !important; border-bottom: 2px solid transparent; min-height: 48px; }
  .flow-item a[aria-current="step"] { border-bottom-color: var(--accent); }
  .flow-label { font-size: 13px; width: auto; overflow: visible; }
  .flow-num { font-size: 11px; }
  .state-badge { width: 16px; height: 16px; }
  .state-badge .icon { width: 10px; height: 10px; }
  .stage { padding: var(--s5) var(--s4) 120px; }
  .stage-head { margin-bottom: var(--s5); }
  .stage-lead { font-size: 15.5px; }
  .card, .group { padding: var(--s5) var(--s4); border-radius: var(--r); }
  .group--secondary { padding: var(--s4); }
  .group__head { flex-direction: column; gap: var(--s2); }
  .field__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .field__row > .field + .field { margin-top: var(--s5); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
  .tiles--wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .tiles--words { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .tile-art { height: 88px; }
  .scale { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scale__points { grid-column: 1 / -1; grid-row: 2; }
  .scale__end:last-child { text-align: right; }
  .scale__point { font-size: 11px; padding: 4px 2px; }
  .zone__head { padding: var(--s4); gap: var(--s3); }
  .zone__icon { width: 34px; height: 34px; }
  .zone__body { padding: 0 var(--s4) var(--s4); }
  .zone__status { display: none; }
  .repeat-card__fields--two { grid-template-columns: minmax(0, 1fr); }
  .boards { grid-template-columns: minmax(0, 1fr); }
  .board__head { cursor: pointer; }
  .board__chev { display: block; }
  .board__head[aria-expanded="true"] .board__chev { transform: rotate(180deg); }
  .shelf { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .conflict-pair { grid-template-columns: minmax(0, 1fr); }
  .conflict-vs { transform: rotate(90deg); height: 20px; }
  .doc { padding: var(--s5) var(--s4); }
  .doc .d-kv li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 9px 10px; font-size: 13px; }
  .stage-foot { position: static; }
  .stage-foot__actions { width: 100%; }
  .stage-foot__actions .btn { flex: 1; }
  .stage-foot__hint { order: 2; }
  .dna-toggle { left: 0; right: 0; bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; justify-content: flex-start; min-height: 56px; padding: 0 var(--s5); border: 0; border-top: 1px solid rgba(255,255,255,0.1); }
  .dna-toggle__chev { margin-left: auto; transform: rotate(180deg); }
  .rail--right { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: min(82vh, 720px); border-radius: var(--r-xl) var(--r-xl) 0 0; border-left: 0; transform: translateY(102%); padding: var(--s4) var(--s4) var(--s6); }
  body.dna-open .rail--right { transform: none; }
  .home { padding: var(--s6) var(--s4) var(--s7); }
  .home-lead { font-size: 16px; }
  .home-visual { display: none; }
  .home-visual--resume { display: block; }
  .mech { grid-template-columns: minmax(0, 1fr); margin-top: var(--s6); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-actions .btn { width: 100%; }
  .modal { padding: var(--s5); }
  .modal__actions .btn { flex: 1; }
  .toasts { bottom: 72px; }
  .bp-summary__k { width: 90px; }
  .canvas-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flowviz__desc { display: none; }
  .flowviz__idx { width: 32px; height: 32px; }
  .flowviz__item::after { left: 27px; }
  .flowviz__item::before { left: 23.5px; }
}

@media (max-width: 420px) {
  .stage-foot__actions { flex-direction: column-reverse; }
  .stage-foot__actions .btn { width: 100%; white-space: normal; }
}

@media (max-width: 360px) {
  .wordmark__family { display: none; }
  .save-state { font-size: 11px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tiles--words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canvas-map { grid-template-columns: minmax(0, 1fr); }
  .scale__point { font-size: 10px; }
  .flowviz__ctrls .icon-btn { width: 30px; }
}

@media print {
  .topbar, .rail, .dna-toggle, .doc-toolbar, .tabs, .stage-foot, .bp-top, .stage-head, .export-warn { display: none !important; }
  .shell { display: block; }
  .doc { box-shadow: none; border: 0; padding: 0; }
}

/* ---------- review polish ---------- */
.bp-top { align-items: start; }
.preview--compact .preview__stage { max-height: 230px; overflow: hidden; position: relative; }
.preview--compact .preview__stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(transparent, rgba(238, 233, 225, 0.95)); pointer-events: none; }
.preview--compact .preview__stage--single::after { background: linear-gradient(transparent, rgba(255, 255, 255, 0.9)); }
.export-warn > .icon, .notice--warn > .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--warn-dot); color: #fff; stroke-width: 2.8; }

/* ---------- beginner guidance (native to the existing visual system) ---------- */
.stage-helper { margin-top: var(--s2); font-size: 14px; color: var(--muted); max-width: 64ch; }
.help { margin-top: var(--s3); }
.help__toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s3) 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; transition: border-color var(--motion), background-color var(--motion), color var(--motion); }
.help__toggle:hover { border-color: var(--line-2); color: var(--ink); }
.help__toggle .icon { color: var(--accent); }
.help__chev { transition: transform var(--motion-mid) var(--ease-out); color: var(--muted) !important; }
.help__toggle[aria-expanded="true"] .help__chev { transform: rotate(180deg); }
.help__panel { margin-top: var(--s3); padding: var(--s4) var(--s5); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); max-width: 64ch; font-size: 14px; color: var(--ink-2); }
.help__panel.is-opening { animation: reveal var(--motion-slow) var(--ease-out); }
.help__examples { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--line-2); }
.help__tag { display: inline-block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: var(--s2); }
.help__list { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px var(--s4); }
.help__list dt { font-weight: 600; color: var(--ink); font-size: 13px; }
.help__list dd { margin: 0; font-style: italic; color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.rail-card__note { margin: 0; padding: var(--s3) var(--s4) 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.dna__about { margin: calc(-1 * var(--s1)) 0 var(--s3); font-size: 12px; color: var(--muted); line-height: 1.45; }
.shelf__meaning { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.conflict-guide { margin-bottom: var(--s4); padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn-dot); font-size: 13.5px; color: var(--ink-2); }
.conflict-guide p + p { margin-top: 4px; }
.conflict-guide__title { font-weight: 700; color: var(--warn); font-size: 14px; }
.doc-purpose { margin-top: var(--s3); font-size: 14px; color: var(--ink-2); max-width: 70ch; }
.welcome__title { font-size: clamp(32px, 4.4vw, 52px); }
.welcome__note { margin-top: var(--s3); font-size: 15px; color: var(--muted); max-width: 56ch; }
.welcome__steps { list-style: none; margin: var(--s5) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); max-width: 520px; }
.welcome__steps li { display: flex; gap: var(--s4); align-items: flex-start; }
.welcome__num { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.welcome__steps strong { display: block; font-size: 14.5px; letter-spacing: 0.02em; }
.welcome__desc { display: block; font-size: 14px; color: var(--ink-2); }
.welcome .help { margin-top: var(--s4); }
@media (max-width: 767px) {
  .stage-helper { font-size: 13.5px; }
  .help__panel { padding: var(--s3) var(--s4); }
  .help__list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .help__list dd { margin-bottom: var(--s2); }
  .welcome .home-actions .btn--ghost { width: 100%; }
}
