/* design-dna chrome. Deliberately neutral (system font, grayscale + one teal
   utility accent) so it never biases the design choices being previewed. */

:root {
  --ink: #14161a;
  --paper: #fafaf9;
  --panel: #ffffff;
  --line: #e7e6e3;
  --muted: #6b7280;
  --accent: #0d9488;      /* tool UI only, not a suggested brand color */
  --accent-ink: #ffffff;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- shell ---- */
.app { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.brand b { font-size: 16px; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: 13px; }

#progress { display: flex; align-items: center; gap: 12px; }
.prail { display: flex; align-items: center; gap: 6px; }
.pdot {
  position: relative;
  width: 18px; height: 8px; border-radius: 999px; border: none; padding: 0;
  background: var(--line); cursor: pointer; transition: background .2s var(--ease), transform .12s var(--ease);
}
.pdot::after { content: ""; position: absolute; inset: -16px -4px; } /* 40px hit area, no neighbor overlap */
.pdot:hover { transform: scaleY(1.35); }
.pdot.done { background: var(--accent); }
.pdot.seeded { background: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.pdot.active { background: var(--ink); }
.pdot.current { outline: 2px solid var(--ink); outline-offset: 2px; }
.pflag { width: 22px; height: 22px; border-radius: 999px; font-size: 11px; line-height: 22px; color: var(--muted); background: var(--line); }
.pflag.done { background: var(--accent); color: #fff; }
.pflag.active { background: var(--ink); color: #fff; }
.pcount { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 46px; text-align: right; }

/* ---- main two-column ---- */
.main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0; flex: 1; }
.pane-left { padding: 32px clamp(20px, 4vw, 56px); overflow: auto; }
.pane-right { border-left: 1px solid var(--line); background: #f2f1ee; padding: 24px; position: sticky; top: 57px; height: calc(100vh - 57px); display: flex; flex-direction: column; gap: 12px; }
.pane-right .pv-caption { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
#preview { flex: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.pv-stage { height: 100%; display: flex; align-items: center; }
.pv-card { width: 100%; }

/* ---- step + options ---- */
.step-head { max-width: 640px; margin-bottom: 24px; }
.step-dim { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.step-title { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 8px; text-wrap: balance; }
.step-help { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0; text-wrap: pretty; }

.opts { display: grid; gap: 12px; }
.opts-font { grid-template-columns: 1fr; }
.opts-palette, .opts-scale, .opts-radius, .opts-spacing, .opts-shadow, .opts-motion,
.opts-layout, .opts-imagery, .opts-icons, .opts-button, .opts-focus, .opts-breakpoints {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.opts-direction { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- direction starter tiles ---- */
.dir-card { padding: 16px; overflow: hidden; }
.dir-h { font-size: 30px; line-height: 1; }
.dir-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.dir-line { height: 8px; flex: 1; opacity: .4; border-radius: 3px; }
.dir-btn { font-size: 11px; font-weight: 600; padding: 5px 12px; white-space: nowrap; }

.opt {
  position: relative; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .08s var(--ease);
}
.opt:hover { border-color: #cfceca; box-shadow: var(--shadow-card); }
.opt:active { transform: scale(.995); }
.opt.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.opt.is-cursor { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt-meta { display: flex; flex-direction: column; gap: 2px; }
.opt-name { font-weight: 650; font-size: 14px; }
.opt-note { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.opt-check {
  position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
  opacity: 0; transform: scale(.6); transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.opt.is-selected .opt-check { opacity: 1; transform: scale(1); }

.badge { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f0efec; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; vertical-align: middle; }

/* ---- text steps (reference anchor, signature move) ---- */
.text-input {
  width: 100%; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; resize: vertical; transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-size: 13px; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: border-color .14s var(--ease), background .14s var(--ease), transform .08s var(--ease);
}
.chip:hover { border-color: #cfceca; background: #f5f4f1; }
.chip:active { transform: scale(.96); }

/* ---- custom color editor (palette step) ---- */
.palette-editor { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.pe-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.pe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pe-row { display: flex; align-items: center; gap: 8px; }
.pe-row label { font-size: 12px; color: var(--muted); width: 72px; flex-shrink: 0; }
.pe-swatch { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0; cursor: pointer; background: none; flex-shrink: 0; }
.pe-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.pe-swatch::-webkit-color-swatch { border: none; border-radius: 6px; }
.pe-hex { width: 82px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; text-transform: uppercase; color: var(--ink); }
.pe-hex:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---- specimens ---- */
.spec-font.byo { color: #b8b5ad; font-style: italic; font-family: var(--font); }
.spec { border-radius: 8px; }
.spec-font { font-size: 22px; line-height: 1.25; color: var(--ink); }
.spec-scale { display: flex; align-items: baseline; gap: 12px; color: var(--ink); }
.spec-palette { display: flex; gap: 8px; }
.spec-palette .sw { width: 100%; height: 40px; border-radius: 6px; }
.spec-radius { display: flex; }
.spec-radius .rbox { width: 100%; height: 56px; background: linear-gradient(135deg, #e9e8e4, #d6d5d0); }
.spec-spacing { display: flex; align-items: flex-end; height: 56px; }
.spec-spacing .sbar { width: 22px; height: 100%; background: linear-gradient(180deg, #d6d5d0, #e9e8e4); border-radius: 4px; }
.spec-shadow { padding: 10px 4px; display: flex; justify-content: center; }
.spec-shadow .shbox { width: 100%; height: 44px; background: #fff; border-radius: 8px; }
.spec-motion .track { position: relative; height: 44px; display: flex; align-items: center; overflow: hidden; }
.spec-motion .knob { width: 22px; height: 22px; border-radius: 999px; background: var(--accent); will-change: transform; }

/* layout wireframe */
.spec-layout { height: 56px; background: #f0efec; border-radius: 8px; display: flex; gap: 6px; padding: 8px; justify-content: center; }
.spec-layout .lay-col { background: #cfceca; border-radius: 3px; }
.spec-layout .lay-side { width: 26%; background: #cfceca; border-radius: 3px; }
.spec-layout .lay-main { flex: 1; background: #dedcd7; border-radius: 3px; }
/* imagery tiles */
.spec-imagery { height: 56px; }
.spec-imagery .im { width: 100%; height: 100%; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
svg.im { display: block; }
.im-abs { background: #f0efec; gap: 8px; }
.im-abs .ab { width: 20px; height: 20px; background: #b9b6b0; }
.im-abs .ab-c { border-radius: 50%; }
.im-abs .ab-s { border-radius: 3px; }
.im-abs .ab-t { width: 0; height: 0; background: none; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 20px solid #b9b6b0; }
.im-duo { background: linear-gradient(135deg, #3a3a3a 0 50%, #c96a4a 50% 100%); }
.im-type { font-family: var(--font); font-weight: 800; font-size: 26px; color: #a8a5a0; background: #f0efec; }
/* icons */
.spec-icons { display: flex; gap: 14px; align-items: center; justify-content: center; height: 44px; color: var(--ink); }
/* button + focus demos */
.spec-button, .spec-focus { display: flex; align-items: center; justify-content: center; height: 44px; }
.btn-demo { font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 8px; }
.btn-demo.btn-solid { background: var(--ink); color: #fff; }
.btn-demo.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-demo.btn-soft { background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink); }
.btn-demo.btn-link { background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.focus-demo { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 8px; background: #f0efec; color: var(--ink); }
.focus-demo.focus-ring-accent { outline: 2px solid var(--accent); outline-offset: 2px; }
.focus-demo.focus-ring-dark { outline: 2px solid var(--ink); outline-offset: 2px; }
.focus-demo.focus-underline { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
/* breakpoints chips */
.spec-bp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; height: 44px; }
.bp-chip { font-family: ui-monospace, monospace; font-size: 11px; background: #f0efec; border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; color: var(--muted); }
/* palette contrast readout */
.pe-contrast { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cbadge-label { font-size: 12px; color: var(--muted); }
.cbadge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.cbadge.ok { background: #e6f4ea; color: #137333; }
.cbadge.bad { background: #fce8e6; color: #c5221f; }
.pe-hint { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.pe-sub { margin-top: 18px; margin-bottom: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pe-warn { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink); background: #f3f2ef; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: none; max-width: 62ch; }
.pe-warn.show { display: block; }

/* start "surprise me" */
.start-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.random-btn { font-size: 15px; font-weight: 650; padding: 12px 20px; border-radius: 12px; background: var(--ink); color: #fff; border: none; cursor: pointer; transition: transform .08s var(--ease), filter .16s var(--ease); }
.random-btn:hover { filter: brightness(1.12); }
.random-btn:active { transform: scale(.96); }
.start-hint { font-size: 13px; color: var(--muted); }

/* font "type your own words" */
.sample-input { width: 100%; max-width: 520px; font-size: 15px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; font-family: var(--font); color: var(--ink); }
.sample-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* radius / spacing slider */
.slider-box { margin-top: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slider-box label { font-size: 13px; color: var(--muted); }
.slider-box input[type="range"] { flex: 1; max-width: 320px; accent-color: var(--accent); }
.slider-val { font-family: ui-monospace, monospace; font-size: 13px; color: var(--ink); min-width: 44px; }

/* ---- review / generate ---- */
.summary { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 14px; }
.summary td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.summary td:first-child { color: var(--muted); width: 55%; }
.summary td:last-child { font-weight: 600; }
.gen-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-accent, .btn-ghost {
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .08s var(--ease), filter .16s var(--ease), background .16s var(--ease);
}
.btn-accent { background: var(--accent); color: var(--accent-ink); border: none; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #cfceca; }
.btn-accent:active, .btn-ghost:active { transform: scale(.96); }
.md-out {
  background: #14161a; color: #e8e6e1; border-radius: var(--radius); padding: 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.55;
  overflow: auto; max-height: 44vh; white-space: pre; margin: 0;
}
.roadmap { margin-top: 20px; color: var(--muted); font-size: 13px; }
.roadmap span { font-weight: 600; }
.roadmap ul { margin: 8px 0 0; padding-left: 18px; columns: 2; }

/* ---- footer nav ---- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--paper); position: sticky; bottom: 0; }
.nav .spacer { flex: 1; }
#nav-label { color: var(--muted); font-size: 13px; }
#nav-back, #nav-next {
  border-radius: 10px; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--panel);
  transition: transform .08s var(--ease), background .16s var(--ease), opacity .16s var(--ease);
}
#nav-next { background: var(--ink); color: #fff; border-color: var(--ink); }
#nav-back:hover, #nav-next:hover { filter: brightness(1.04); }
#nav-back:active, #nav-next:active { transform: scale(.96); }
#nav-back:disabled, #nav-next:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; }
  .pane-right { position: static; height: 420px; border-left: none; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Lift the ui-review toolbar clear of our bottom nav so both are usable. */
.uir-bar { bottom: 84px !important; }
