/* dreamy mockups - design system
   Palette: paper + ink + one stamp accent (boarding-pass motif).
   Type: Fraunces for display (printed-letter warmth), Karla for text.
   Radius: 14 cards, 10 fields, pill only for primary buttons and chips.
*/

:root {
  --paper: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f3eee4;
  --desk: #e9e3d7;
  --ink: #1c1a17;
  --text: #4a443c;
  --muted: #675f52;
  --line: #e3dcd0;
  --line-strong: #c9bfae;

  --accent: #b23e0f;
  --accent-ink: #ffffff;
  --accent-soft: #f7e7dd;
  --accent-quiet: #8f320b;

  --ok: #2c6a4e;
  --ok-soft: #e4efe7;
  --warn: #7d5306;
  --warn-soft: #f7edd6;
  --danger: #a3241c;
  --danger-soft: #f8e4e1;

  --radius-card: 14px;
  --radius-field: 10px;
  --radius-pill: 999px;

  --shadow-lift: 0 1px 0 rgba(28, 26, 23, 0.04), 0 10px 28px -22px rgba(28, 26, 23, 0.45);
  --shell: 520px;
  --pad: 18px;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step-1: 12px;
  --step-2: 14px;
  --step-3: 16px;
  --step-4: 18px;
  --step-5: clamp(22px, 5.4vw, 26px);
  --step-6: clamp(28px, 7vw, 34px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17140f;
    --surface: #201c16;
    --surface-2: #2a251d;
    --desk: #0f0d0a;
    --ink: #f4eee2;
    --text: #d9d0c0;
    --muted: #b4a894;
    --line: #3a3329;
    --line-strong: #554c3d;
    --accent: #f0904f;
    --accent-ink: #241405;
    --accent-soft: #3a2314;
    --accent-quiet: #f6a873;
    --ok: #7cc39c;
    --ok-soft: #1d3227;
    --warn: #e0b25e;
    --warn-soft: #33280f;
    --danger: #f09186;
    --danger-soft: #3a1f1b;
    --shadow-lift: 0 1px 0 rgba(0, 0, 0, 0.4), 0 10px 28px -22px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  --paper: #17140f;
  --surface: #201c16;
  --surface-2: #2a251d;
  --desk: #0f0d0a;
  --ink: #f4eee2;
  --text: #d9d0c0;
  --muted: #b4a894;
  --line: #3a3329;
  --line-strong: #554c3d;
  --accent: #f0904f;
  --accent-ink: #241405;
  --accent-soft: #3a2314;
  --accent-quiet: #f6a873;
  --ok: #7cc39c;
  --ok-soft: #1d3227;
  --warn: #e0b25e;
  --warn-soft: #33280f;
  --danger: #f09186;
  --danger-soft: #3a1f1b;
  --shadow-lift: 0 1px 0 rgba(0, 0, 0, 0.4), 0 10px 28px -22px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--step-3);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; }

h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--accent-quiet); text-underline-offset: 3px; }

/* Affordance layer: every enabled native control shows a pointer. */
a[href],
button,
summary,
select,
label[for],
input[type="checkbox"],
input[type="radio"],
[role="button"] { cursor: pointer; }
button:disabled,
[aria-disabled="true"] { cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- review chrome (not part of the product UI) ---------- */

.review-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 9px 16px;
  background: var(--surface-2);
  border-bottom: 1px dashed var(--line-strong);
  font-size: var(--step-1);
  color: var(--muted);
}
.review-bar a { color: var(--muted); text-decoration: none; }
.review-bar a:hover { color: var(--ink); text-decoration: underline; }
.review-bar__home {
  font-family: var(--font-display);
  font-size: var(--step-3);
  color: var(--ink) !important;
  letter-spacing: 0.01em;
}
.review-bar__meta { flex: 1 1 260px; }
.review-bar__meta b { color: var(--ink); font-weight: 700; }
.review-bar__nav { display: flex; align-items: center; gap: 12px; }
.review-bar__nav a { min-height: 28px; display: inline-flex; align-items: center; }

.theme-toggle {
  font: inherit;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  min-height: 28px;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- app shell ---------- */

.app {
  max-width: var(--shell);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
}
.app--wide { --shell: 1080px; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.appbar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-left: -10px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
}
.appbar__back:hover { background: var(--surface-2); }
.appbar__title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.appbar__meta { margin-left: auto; font-size: var(--step-1); color: var(--muted); }

.screen {
  flex: 1;
  min-width: 0;
  padding: var(--pad);
  padding-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.screen--tight { gap: 12px; }
fieldset { min-width: 0; }
.grid-2 > *, .grid-4 > * { min-width: 0; }

/* ---------- type ---------- */

.h1 {
  font-family: var(--font-display);
  font-size: var(--step-6);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variation-settings: "SOFT" 40, "WONK" 0;
}
.h2 {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.15;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.h3 { font-size: var(--step-4); font-weight: 700; color: var(--ink); line-height: 1.3; }
.lead { font-size: var(--step-4); color: var(--text); line-height: 1.45; }
.small { font-size: var(--step-2); color: var(--muted); line-height: 1.45; }
.caption { font-size: var(--step-1); color: var(--muted); }
.label {
  display: block;
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.num { font-variant-numeric: tabular-nums; }
.ink { color: var(--ink); }
.accent { color: var(--accent-quiet); }

/* ---------- layout helpers ---------- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack--sm { gap: 8px; }
.stack--lg { gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.split { display: grid; gap: 18px; }
@media (min-width: 880px) {
  .split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); align-items: start; gap: 24px; }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .screen { padding: 24px 28px 36px; }
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
}
.card--flat { background: transparent; border-style: dashed; }
.card--quiet { background: var(--surface-2); border-color: transparent; }
.card--accent { border-color: var(--accent); }
.card--pad-lg { padding: 20px; }

.card__head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.card__title { font-weight: 700; color: var(--ink); font-size: var(--step-3); line-height: 1.3; }
.card__meta { font-size: var(--step-1); color: var(--muted); }

/* Boarding-pass stub: the product's own motif (PRD 7.12.6). */
.ticket {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
}
.ticket__body { padding: 16px; }
.ticket__tear {
  border-top: 1px dashed var(--line-strong);
  margin: 0 14px;
}
.ticket__foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: var(--step-1);
  color: var(--muted);
}
.ticket__foot::before,
.ticket__foot::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  top: -8px;
  z-index: 1;
}
.ticket__foot::before { left: -9px; }
.ticket__foot::after { right: -9px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: var(--step-3);
  text-decoration: none;
  text-align: center;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.btn:hover { border-color: var(--ink); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-quiet); border-color: var(--accent-quiet); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent-quiet); }
.btn--ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 7px 14px; font-size: var(--step-2); }
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
  transform: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 150px; }

/* ---------- chips, tags, meters ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--step-2);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"],
.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }
.tag--neutral { background: var(--surface-2); color: var(--text); }
.tag--accent { background: var(--accent-soft); color: var(--accent-quiet); }

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter__fill {
  display: block;
  height: 100%;
  width: calc(var(--val, 0) * 1%);
  background: var(--accent);
  border-radius: 999px;
}
.meter__fill--ok { background: var(--ok); }
.meter__fill--warn { background: var(--warn); }
.meter__fill--danger { background: var(--danger); }

.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 34px; gap: 10px; align-items: center; }
.bar-row__name { font-size: var(--step-2); color: var(--text); }
.bar-row__val { font-size: var(--step-2); font-weight: 700; color: var(--ink); text-align: right; }

.ring {
  --val: 67;
  --size: 132px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--val) * 1%), var(--surface-2) 0);
  display: grid;
  place-items: center;
  flex: none;
}
.ring__inner {
  width: calc(var(--size) - 22px);
  height: calc(var(--size) - 22px);
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-align: center;
}
.ring__num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.ring__band { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- lists ---------- */

.list { display: flex; flex-direction: column; }
.list__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.list__item:last-child { border-bottom: 0; padding-bottom: 0; }
.list__item:first-child { padding-top: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 700; color: var(--ink); font-size: var(--step-3); line-height: 1.35; }
.list__sub { font-size: var(--step-2); color: var(--muted); margin-top: 2px; }
.list__side { flex: none; text-align: right; font-size: var(--step-2); color: var(--muted); }

.icon-box {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--step-2);
  color: var(--ink);
}
.icon-box--ok { background: var(--ok-soft); color: var(--ok); }
.icon-box--warn { background: var(--warn-soft); color: var(--warn); }
.icon-box--danger { background: var(--danger-soft); color: var(--danger); }
.icon-box--accent { background: var(--accent-soft); color: var(--accent-quiet); }

/* ---------- forms ---------- */

.field { display: block; }
.field + .field { margin-top: 14px; }
.field__hint { font-size: var(--step-1); color: var(--muted); margin-top: 6px; }

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-3);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--muted); }
.input:focus, .textarea:focus, .select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.textarea { min-height: 128px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: var(--surface);
}
.choice + .choice { margin-top: 8px; }
.choice input { margin: 4px 0 0; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.choice__body { min-width: 0; }
.choice__title { font-weight: 700; color: var(--ink); font-size: var(--step-3); }
.choice__sub { font-size: var(--step-2); color: var(--muted); margin-top: 2px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.segmented button,
.segmented a {
  flex: 1 0 auto;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--step-2);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
.segmented button[aria-selected="true"],
.segmented button[aria-pressed="true"],
.segmented a[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(28, 26, 23, 0.12);
}

/* ---------- notices ---------- */

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  background: var(--surface-2);
  font-size: var(--step-2);
  color: var(--text);
}
.notice--accent { background: var(--accent-soft); }
.notice--ok { background: var(--ok-soft); }
.notice--warn { background: var(--warn-soft); }
.notice--danger { background: var(--danger-soft); }
.notice b { color: var(--ink); }

/* ---------- progress and steps ---------- */

.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.progress-head__label { font-size: var(--step-2); color: var(--muted); }
.progress-head__val { font-size: var(--step-2); font-weight: 700; color: var(--ink); }

.steps { display: flex; gap: 6px; }
.steps__dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--line);
}
.steps__dot.is-done { background: var(--accent); }
.steps__dot.is-now { background: var(--accent); opacity: 0.55; }

/* ---------- tab bar ---------- */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 4px 2px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-current="page"] { color: var(--accent-quiet); background: var(--accent-soft); }
.tab__icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- avatars (stylised, clearly artificial) ---------- */

.avatar {
  --size: 52px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  flex: none;
  overflow: hidden;
  position: relative;
}
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar--a { background: #e7d6c4; }
.avatar--b { background: #d6dfd8; }
.avatar--c { background: #dfd7e4; }
:root[data-theme="dark"] .avatar--a { background: #4a3826; }
:root[data-theme="dark"] .avatar--b { background: #2c3d33; }
:root[data-theme="dark"] .avatar--c { background: #372f40; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar--a { background: #4a3826; }
  :root:not([data-theme="light"]) .avatar--b { background: #2c3d33; }
  :root:not([data-theme="light"]) .avatar--c { background: #372f40; }
}

/* ---------- moodboard posters ---------- */

.poster {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #d9c7b2;
  color: #201a13;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px;
}
.poster__sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster__text { position: relative; z-index: 2; }
.poster__city {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.poster__meta { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; opacity: 0.85; }
.poster__words { font-size: 10px; margin-top: 6px; line-height: 1.35; max-width: 16ch; }
.poster--mini .poster__meta { font-size: 8px; }
.poster--mini .poster__city { font-size: 16px; }
.poster--mini .poster__words { font-size: 9px; margin-top: 4px; }

.poster--dusk { background: #c9a68c; }
.poster--night { background: #23202a; color: #f3e8d8; }
.poster--paper { background: #efe6d6; color: #2a241c; }
.poster-option { display: flex; flex-direction: column; gap: 6px; }
.poster-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.poster-option__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: var(--step-1);
  color: var(--muted);
  min-height: 28px;
}
.poster-option input:checked + .poster { outline: 2px solid var(--accent); outline-offset: 2px; }
.poster-option input:focus-visible + .poster { outline: 2px solid var(--accent); outline-offset: 2px; }
.poster-option:has(input:checked) .poster-option__label { color: var(--ink); font-weight: 700; }

/* ---------- misc product pieces ---------- */

.countdown {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.countdown__unit { font-family: var(--font-text); font-size: var(--step-2); font-weight: 700; color: var(--muted); margin-left: 6px; letter-spacing: 0; }

.big-time {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pacing { display: flex; align-items: center; gap: 10px; }
.pacing__track { position: relative; flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--line); }
.pacing__now { position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--accent); left: calc(var(--val, 0) * 1%); }
.pacing__target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); left: calc(var(--target, 50) * 1%); }

.question-text { font-size: var(--step-4); line-height: 1.55; color: var(--ink); }
.quote { font-family: var(--font-display); font-size: var(--step-5); line-height: 1.35; color: var(--ink); }

.criteria { display: flex; flex-direction: column; gap: 10px; }
.criteria__row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.criteria__name { font-size: var(--step-2); color: var(--text); }
.criteria__score { font-size: var(--step-2); font-weight: 700; color: var(--ink); text-align: right; }

.comment {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 12px;
  font-size: var(--step-2);
  color: var(--text);
}
.comment__where { font-size: var(--step-1); color: var(--muted); margin-top: 4px; }

.wallpaper-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }

.table { width: 100%; border-collapse: collapse; font-size: var(--step-2); }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: var(--step-1); color: var(--muted); font-weight: 700; }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; text-align: right; }

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }

/* ---------- index gallery ---------- */

.gallery { max-width: 1080px; margin: 0 auto; padding: 24px 18px 64px; }
.gallery__head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.gallery__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 18px; }
.gallery__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--text);
  transition: border-color 140ms ease, transform 140ms ease;
}
.gallery__card:hover { border-color: var(--accent); transform: translateY(-2px); }
.gallery__id { font-size: var(--step-1); color: var(--muted); font-weight: 700; letter-spacing: 0.04em; }
.gallery__name { font-family: var(--font-display); font-size: var(--step-4); font-weight: 600; color: var(--ink); line-height: 1.2; }
.gallery__purpose { font-size: var(--step-2); color: var(--muted); line-height: 1.4; }
.gallery__phase { margin-top: 26px; font-family: var(--font-display); font-size: var(--step-5); color: var(--ink); }

.token-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 12px; }
.swatch {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.swatch__chip { display: block; height: 52px; flex: none; }
.swatch__body { display: block; padding: 8px 10px; font-size: var(--step-1); color: var(--muted); }
.swatch__body b { display: block; color: var(--ink); font-size: var(--step-2); }

/* ---------- utilities used across screens ---------- */

.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.hero { padding: 8px 0 2px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

.kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 9px;
  column-gap: 16px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--step-2);
}
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 700; text-align: right; }

.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.poster__sky { position: absolute; inset: auto 0 0 0; width: 100%; height: 42%; color: rgba(32, 26, 19, 0.5); }
.poster--night .poster__sky { color: rgba(243, 232, 216, 0.4); }
.poster__meta, .poster__city, .poster__words { display: block; }
.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.board-grid > * { min-width: 0; }

.sticky-cta {
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 72%, transparent);
}

/* ---------- screen-specific pieces ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-3 > * { min-width: 0; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

.plan-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-col__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan-col__title { font-family: var(--font-display); font-size: var(--step-4); color: var(--ink); }
.mini-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.mini-card__title { font-weight: 700; color: var(--ink); font-size: var(--step-2); line-height: 1.3; }
.mini-card__meta { font-size: var(--step-1); color: var(--muted); margin-top: 2px; }

.timeline { display: flex; flex-direction: column; }
.tl-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; position: relative; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl-step:last-child::before { display: none; }
.tl-step__dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  z-index: 1;
}
.tl-step.is-done .tl-step__dot { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.tl-step.is-now .tl-step__dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tl-step.is-locked .tl-step__dot { background: var(--surface-2); }
.tl-step__body { padding-top: 2px; min-width: 0; }
.tl-step__title { font-weight: 700; color: var(--ink); font-size: var(--step-3); }
.tl-step.is-locked .tl-step__title { color: var(--muted); }
.tl-step__note { font-size: var(--step-2); color: var(--muted); margin-top: 2px; }

.skill-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skill-cell { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.skill-cell__name { font-size: var(--step-1); color: var(--muted); }
.skill-cell__val { font-size: var(--step-3); font-weight: 700; color: var(--ink); }
.skill-cell--weak { border-color: var(--warn); background: var(--warn-soft); }

.compare-tray {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
}

.transcript { display: flex; flex-direction: column; gap: 10px; }
.transcript__line { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; font-size: var(--step-2); }
.transcript__who { font-weight: 700; color: var(--ink); }
.transcript__text { color: var(--text); }

.editor-wrap { display: flex; flex-direction: column; gap: 8px; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.editor-area { min-height: 300px; font-family: var(--font-text); font-size: var(--step-3); line-height: 1.65; }

.panel-stage {
  background: var(--surface-2);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.panel-stage .row { justify-content: center; }

.doc-flag { border-left: 3px solid var(--warn); padding: 8px 0 8px 12px; }
.doc-flag--danger { border-left-color: var(--danger); }

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

@media (max-width: 420px) {
  :root { --pad: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
}
