/* 화로 — one system for every screen: warm off-white panels with hairline
   edges and printed labels, IBM Plex type, a single orange accent that only
   ever means "the one thing to press or the one thing that is live", and
   hardware parts (lamps, LED bars that light up, a power switch, dark
   readouts) wherever state matters. */

:root {
  --bg: #ebe9e3;
  --surface: #f8f7f3;
  --surface-2: #f0eee8;
  --ink: #171614;
  --ink-2: #4f4c47;
  --ink-3: #66635c;
  --hair: rgba(23, 22, 20, 0.1);
  --hair-2: rgba(23, 22, 20, 0.2);
  --line: rgba(23, 22, 20, 0.3);
  --fill: #171614;
  --on-fill: #f8f7f3;
  --track: #e4e1d9;
  --accent: #ff4f00;
  --accent-press: #e84800;
  --accent-soft: rgba(255, 79, 0, 0.12);
  --on-accent: #171614;
  --ok: #12904f;
  --warn: #b97f00;
  --bad: #d23a2f;
  --screen: #161614;
  --screen-2: #1e1e1b;
  --screen-ink: #ebe8e1;
  --screen-dim: #a19d94;
  --screen-faint: #8e8a82;
  --screen-hair: rgba(255, 255, 255, 0.08);
  --screen-warn: #f0b93a;
  --screen-bad: #ff8a7c;
  --screen-me: #ff9a66;
  --mark-tile: #171614;
  --mark-bowl: #f8f7f3;
  --edge: 0 1px 0 rgba(23, 22, 20, 0.04);

  --r-lg: 12px;
  --r-md: 8px;
  --r-sm: 3px;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans KR", ui-monospace, "SF Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.35, 0.5, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1f1f1d;
    --surface-2: #272725;
    --ink: #edebe5;
    --ink-2: #b4b0a7;
    --ink-3: #8f8b82;
    --hair: rgba(237, 235, 229, 0.09);
    --hair-2: rgba(237, 235, 229, 0.18);
    --line: rgba(237, 235, 229, 0.26);
    --fill: #cfccc4;
    --on-fill: #161614;
    --track: #2e2e2b;
    --accent: #ff5a14;
    --accent-press: #ff6d2e;
    --accent-soft: rgba(255, 90, 20, 0.16);
    --on-accent: #121211;
    --ok: #2fbf73;
    --warn: #e0a72a;
    --bad: #f0645a;
    --screen: #080807;
    --screen-2: #10100f;
    --screen-hair: rgba(255, 255, 255, 0.1);
    --mark-tile: #2a2a27;
    --mark-bowl: #edebe5;
    --edge: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1f1f1d;
  --surface-2: #272725;
  --ink: #edebe5;
  --ink-2: #b4b0a7;
  --ink-3: #8f8b82;
  --hair: rgba(237, 235, 229, 0.09);
  --hair-2: rgba(237, 235, 229, 0.18);
  --line: rgba(237, 235, 229, 0.26);
  --fill: #cfccc4;
  --on-fill: #161614;
  --track: #2e2e2b;
  --accent: #ff5a14;
  --accent-press: #ff6d2e;
  --accent-soft: rgba(255, 90, 20, 0.16);
  --on-accent: #121211;
  --ok: #2fbf73;
  --warn: #e0a72a;
  --bad: #f0645a;
  --screen: #080807;
  --screen-2: #10100f;
  --screen-hair: rgba(255, 255, 255, 0.1);
  --mark-tile: #2a2a27;
  --mark-bowl: #edebe5;
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--hair-2); }
a:hover { text-decoration-color: currentColor; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }

.num, .mono { font-family: var(--mono); font-feature-settings: "tnum", "zero"; }
.num { white-space: nowrap; overflow-wrap: normal; }

/* ---------- frame ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px max(20px, env(safe-area-inset-left)) 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand small { font-weight: 400; font-size: 13px; color: var(--ink-3); letter-spacing: 0; }
.mark { display: block; width: 28px; height: 28px; }
.mark .tile { fill: var(--mark-tile); }
.mark .bowl { fill: var(--mark-bowl); }
.mark .legs { stroke: var(--mark-bowl); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.mark .coal { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 2.5px var(--accent)); }
.acct { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.acct .mono { font-size: 12px; color: var(--ink-3); }
.acct svg { width: 16px; height: 16px; color: var(--ink-3); }

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px max(20px, env(safe-area-inset-left)) 96px;
}

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

.eyebrow { font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-3); }
.label { font-size: 12px; line-height: 1.4; font-weight: 500; color: var(--ink-3); }
/* A printed panel label: the word, then a hairline running to the edge. */
.label.ruled { display: flex; align-items: center; gap: 12px; }
.label.ruled::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.h1 {
  margin: 12px 0 0;
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.lede { margin: 16px 0 0; max-width: 34em; color: var(--ink-2); font-size: 16px; }
.title { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---------- surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--edge);
}
.card-pad { padding: 24px; }
.rule { height: 1px; background: var(--hair); border: 0; margin: 24px 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/22px var(--sans);
  padding: 0 8px;
  border: 1px solid var(--hair-2);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip small { font: inherit; color: var(--ink-3); }

/* ---------- lamps ---------- */

/* A lamp is the mark's coal bed on its own: a short bar that is cold ash,
   a coal catching (busy), a live ember (on), or a plain warning colour. */
.lamp {
  --c: var(--ink-3);
  flex: none;
  width: 14px; height: 5px;
  border-radius: 2.5px;
  /* Ash: grey with the grain of a burnt-out coal, so it never reads as a dash. */
  background: repeating-linear-gradient(90deg, #8d887c 0 3px, #6f6b62 3px 4px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
  transition: background 0.3s, box-shadow 0.3s;
}
.lamp.on {
  --c: var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 80%, #000) 0%, var(--c) 30%, color-mix(in srgb, var(--c) 70%, #ffd27a) 55%, var(--c) 80%);
  box-shadow: 0 0 6px color-mix(in srgb, var(--c) 70%, transparent);
  animation: ember 4.2s linear infinite;
}
.lamp.warn { --c: var(--warn); background: var(--c); }
.lamp.bad { --c: var(--bad); background: var(--c); }
.lamp.busy {
  --c: var(--accent);
  background: linear-gradient(90deg, var(--track) 0 30%, var(--c) 50%, var(--track) 70% 100%) 0 0 / 300% 100%;
  box-shadow: 0 0 0 1px var(--hair) inset;
  animation: catch 1.3s linear infinite;
}
/* Uneven on purpose: an even pulse reads as a notification badge. */
@keyframes ember {
  0%, 100% { box-shadow: 0 0 6px color-mix(in srgb, var(--c) 70%, transparent); filter: none; }
  17% { box-shadow: 0 0 9px color-mix(in srgb, var(--c) 85%, transparent); filter: brightness(1.12); }
  29% { box-shadow: 0 0 5px color-mix(in srgb, var(--c) 60%, transparent); filter: brightness(0.94); }
  52% { box-shadow: 0 0 8px color-mix(in srgb, var(--c) 80%, transparent); filter: brightness(1.06); }
  71% { box-shadow: 0 0 4px color-mix(in srgb, var(--c) 55%, transparent); filter: brightness(0.9); }
}
@keyframes catch { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .lamp.on, .lamp.busy { animation: none; } }

/* ---------- LED bars: every gauge, counter and countdown ---------- */

.leds { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.leds i {
  height: 10px;
  border-radius: 1.5px;
  background: transparent;
  box-shadow: 0 0 0 1px var(--hair-2) inset;
  transition: background 0.35s var(--ease), box-shadow 0.35s;
}
.leds i.used { background: var(--ink-3); box-shadow: none; }
.leds i.add, .leds i.lit { background: var(--fill); box-shadow: none; }
/* Lit LEDs give off light in their own colour. */
.leds.ok i.lit { background: var(--ok); box-shadow: 0 0 6px -1px var(--ok); }
.leds.warn i.lit { background: var(--warn); box-shadow: 0 0 6px -1px var(--warn); }
.leds.bad i.lit, .leds.bad i.used { background: var(--bad); box-shadow: 0 0 6px -1px var(--bad); }
.leds.busy i.lit { background: var(--accent); box-shadow: 0 0 6px -1px var(--accent); }
.leds i.next { animation: blink 1.2s steps(1) infinite; }
.leds.idle i { animation: idle 1.6s var(--ease) infinite; }
@keyframes blink { 50% { background: var(--ink-3); } }
@keyframes idle { 50% { background: var(--hair); } }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.meter-head .num { font-size: 12px; color: var(--ink); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 1.5px; }
.legend .used { background: var(--ink-3); }
.legend .add { background: var(--fill); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-press); border-color: transparent; }
.btn-primary:disabled { opacity: 1; background: var(--surface-2); color: var(--ink-3); box-shadow: 0 0 0 1px var(--hair) inset; }
.btn-big { min-height: 52px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn-danger:hover { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.btn-text { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); font-weight: 500; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: color 0.15s, text-decoration-color 0.15s; }
.btn-text:hover { color: var(--ink); text-decoration-color: var(--hair-2); }
.btn-text svg { width: 16px; height: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.spread { gap: 24px; }

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

.notice {
  position: relative;
  overflow: hidden;
  display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 20px 24px 20px 27px;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15px;
  color: var(--ink-2);
}
.notice::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c, var(--ink-3)); }
.notice.busy { --c: var(--accent); }
.notice.bad { --c: var(--bad); }
.notice.warn { --c: var(--warn); }
.notice .lamp { margin-top: 10px; }
.notice:not(.bad):not(.busy):not(.warn)::before { display: none; }
.notice .title { color: var(--ink); }
.notice p { margin: 4px 0 0; max-width: 44em; }
.notice .row { margin-top: 16px; }
.notice details { margin-top: 12px; font-size: 13px; }
.notice pre { margin: 8px 0 0; white-space: pre-wrap; font: 12px/1.6 var(--mono); color: var(--ink-3); }
summary { list-style: none; cursor: pointer; color: var(--ink-2); width: fit-content; }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; margin: 0 10px 2px 1px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}
details[open] > summary::before { transform: rotate(45deg); }
details > p { margin-top: 8px; }

/* ---------- connect ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "intro card" "facts card";
  grid-template-rows: auto 1fr;
  column-gap: 48px;
  align-items: start;
}
.split > .intro { grid-area: intro; }
.split > .steps, .split > .choices { grid-area: card; }
.split > .facts { grid-area: facts; }
.facts { display: grid; grid-template-columns: 104px minmax(0, 1fr); margin: 40px 0 0; border-top: 1px solid var(--hair); }
.facts dt, .facts dd { margin: 0; border-bottom: 1px solid var(--hair); }
.facts dt { padding: 18px 16px 14px 0; }
.facts dd { padding: 14px 0; color: var(--ink-2); font-size: 15px; }
.side-facts { margin-top: 16px; }
.side-facts dt { padding: 14px 20px 12px 0; }
.side-facts dd { padding: 10px 0; font-size: 14px; }
.side-facts > :nth-last-child(-n + 2) { border-bottom: 0; }

.steps { overflow: hidden; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 16px; padding: 24px; }
.step + .step { border-top: 1px solid var(--hair); }
.step.now { box-shadow: inset 3px 0 0 var(--ink); }
.step-n {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hair-2);
  font: 600 12px/1 var(--mono);
  color: var(--ink-3);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.step.now .step-n { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.step.done .step-n { color: var(--ok); }
.step.done .step-n svg { width: 15px; height: 15px; stroke-width: 2; }
.step-title { margin: 0; font-size: 17px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.step.done .step-title { font-weight: 500; color: var(--ink-2); }
.step.later .step-title { font-weight: 500; color: var(--ink-3); }
.step-summary { font-size: 13px; color: var(--ink-3); }
.step-body { grid-column: 2; margin-top: 8px; color: var(--ink-2); }
.step-body > * + * { margin-top: 16px; }
.step-body p { margin: 0; }

.path-wrap > .label { margin-bottom: 10px; }
.path-wrap > p { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }
.path { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--hair); border-radius: var(--r-md); }
.path li { display: grid; grid-template-columns: 24px max-content minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 14px; font-size: 15px; color: var(--ink); }
.path li + li { border-top: 1px solid var(--hair); }
.path .en { font-size: 13px; color: var(--ink-3); }

.keybox {
  position: relative;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}
.keybox pre {
  margin: 0;
  padding: 12px 14px 0;
  max-height: 87px;
  overflow: hidden;
  font: 12px/1.55 var(--mono);
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.keybox::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 28px;
  background: linear-gradient(transparent, var(--surface-2));
  pointer-events: none;
}
.step-body .key-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.fp { font: 12px var(--mono); }

.field {
  width: 100%;
  min-height: 148px;
  max-height: 260px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font: 13px/1.6 var(--mono);
  resize: none;
  field-sizing: content;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 4px var(--accent-soft); }
.field::placeholder { color: var(--ink-3); }
input.field { min-height: 44px; }
.checks { display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.check svg { width: 16px; height: 16px; flex: none; stroke-width: 2.2; }
.check.good svg { color: var(--ok); }
.check.bad { color: var(--bad); }

.settle-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.settle-meta .num { flex: none; }

/* ---------- create ---------- */

.block-note { margin-top: 32px; }
.create { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; margin-top: 40px; }
.presets { overflow: hidden; transition: opacity 0.3s; }
.presets[inert] { opacity: 0.45; }
.presets[inert] .preset[aria-checked="true"] { box-shadow: none; background: transparent; }
.preset {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 16px;
  width: 100%;
  min-height: 92px;
  padding: 20px 24px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.preset + .preset { border-top: 1px solid var(--hair); }
.preset:hover { background: var(--surface-2); }
.preset[aria-checked="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.preset > :not(.radio) { grid-column: 2; }
.radio {
  grid-row: 1 / span 2; grid-column: 1;
  margin-top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  background: var(--surface);
  transition: border-color 0.15s, border-width 0.2s var(--spring);
}
.preset[aria-checked="true"] .radio { border: 6px solid var(--accent); }
.preset-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-weight: 600; font-size: 17px; line-height: 28px; letter-spacing: -0.01em; }
.preset-blurb { margin-top: 2px; color: var(--ink-2); font-size: 15px; }
.preset-extra { margin-top: 12px; display: grid; gap: 10px; cursor: auto; }
.preset-extra p { margin: 0; font-size: 13px; color: var(--ink-3); }

.summary { position: sticky; top: 24px; }
.price { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.price .num { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; font-feature-settings: "tnum"; }
.price span:last-child { color: var(--ink-2); }
.meters-stack { display: grid; gap: 20px; }
.agree { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.agree input { appearance: none; margin: 2px 0 0; width: 20px; height: 20px; border-radius: var(--r-sm); border: 1.5px solid var(--ink-3); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.agree input:checked { background: var(--fill); border-color: var(--fill); }
.agree input:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--on-fill); border-bottom: 2px solid var(--on-fill); transform: translateY(-1px) rotate(-45deg); }
.agree.nudge input { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cta { margin-top: 24px; }
.cta-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.cta-hint.warn { color: var(--ink); font-weight: 500; }
.mobile-cta { display: none; }

/* ---------- building ---------- */

/* The stage is the build's readout: a dark strip with the elapsed time and
   six phase bars, the current one burning orange. */
.stage {
  margin-top: 32px;
  padding: 20px 24px 22px;
  border-radius: var(--r-lg);
  background: var(--screen);
  color: var(--screen-ink);
  border: 1px solid var(--screen-hair);
}
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.stage-top .label { color: var(--screen-dim); }
.stage-time { font: 500 28px/1 var(--mono); letter-spacing: -0.01em; color: var(--screen-ink); font-feature-settings: "tnum"; }
.phases { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 20px; }
.phase { font-size: 13px; color: var(--screen-faint); }
.phase::before { content: ""; display: block; height: 6px; border-radius: 1.5px; margin-bottom: 10px; background: rgba(255, 255, 255, 0.1); }
.phase.done { color: var(--screen-dim); }
.phase.done::before { background: var(--screen-dim); }
.phase.now { color: var(--screen-ink); font-weight: 600; }
.phase.now::before {
  background: linear-gradient(90deg, var(--accent) 0 40%, color-mix(in srgb, var(--accent) 45%, #000) 50%, var(--accent) 60% 100%);
  background-size: 250% 100%;
  animation: sweep 1.6s linear infinite;
  box-shadow: 0 0 12px -1px var(--accent);
}
.phases.stalled .phase.now { color: var(--screen-bad); }
.phases.stalled .phase.now::before { animation: none; background: var(--screen-bad); box-shadow: 0 0 10px -2px var(--screen-bad); }
.phase-caption { display: none; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.build { margin-top: 24px; display: grid; gap: 24px; }
.log-wrap > .label { margin-bottom: 4px; }
.log {
  max-height: 300px;
  overflow: auto;
  -webkit-mask-image: linear-gradient(transparent, #000 20px);
  mask-image: linear-gradient(transparent, #000 20px);
}
.log ol { margin: 0; padding: 12px 0 0; }
.log li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 3px 0; color: var(--ink-2); list-style: none; font-size: 14px; }
.log li time { font: 12px var(--mono); color: var(--ink-3); }
.log li.mark-phase { margin-top: 10px; color: var(--ink); font-weight: 600; }
.log li.mark-phase:first-child { margin-top: 0; }
.log li.live span::after { content: ""; display: inline-block; width: 12px; height: 4px; margin-left: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--track) 0 30%, var(--accent) 50%, var(--track) 70% 100%) 0 0 / 300% 100%; vertical-align: 3px; animation: catch 1.3s linear infinite; }
.countdown { display: flex; align-items: center; gap: 12px; margin-top: 14px; max-width: 400px; }
.countdown .leds { flex: 1; }
.countdown .num { font-size: 12px; color: var(--ink-2); min-width: 3ch; text-align: right; }

/* ---------- dark readouts ---------- */

/* The address readout: a recessed dark screen, like the console. */
.lcd {
  display: grid; gap: 12px;
  padding: 16px 16px 16px 20px;
  border-radius: var(--r-md);
  background: var(--screen);
  border: 1px solid var(--screen-hair);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.45);
  color: var(--screen-ink);
}
.lcd-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.lcd .num { white-space: nowrap; font-size: clamp(26px, 3.2vw, 36px); font-weight: 500; letter-spacing: -0.01em; text-shadow: 0 0 18px rgba(255, 255, 255, 0.12); }
.lcd .btn { flex: none; background: transparent; color: var(--screen-ink); border-color: rgba(255, 255, 255, 0.22); }
.lcd .btn:hover { border-color: rgba(255, 255, 255, 0.45); }
.lcd.off .num, .lcd .num.dim { color: var(--screen-faint); text-shadow: none; }
.lcd .num.dim { font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; }
.lcd .leds i { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset; }
.lcd .leds.idle i { animation-name: idle-screen; }
@keyframes idle-screen { 50% { background: rgba(255, 255, 255, 0.12); } }
.lcd-how { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; margin: 0; padding-top: 12px; border-top: 1px solid var(--screen-hair); font-size: 13px; }
.lcd-how dt { color: var(--screen-faint); }
.lcd-how dd { margin: 0; color: var(--screen-dim); }
.lcd-how .mono { color: var(--screen-ink); }

.console {
  margin-top: 24px;
  border-radius: var(--r-lg);
  background: var(--screen);
  color: var(--screen-ink);
  border: 1px solid var(--screen-hair);
  overflow: hidden;
}
.console-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--screen-hair); }
.console-head .label { color: var(--screen-dim); }
.console-out {
  height: 280px; overflow: auto;
  padding: 14px 24px;
  font: 12.5px/1.7 var(--mono);
  -webkit-mask-image: linear-gradient(transparent, #000 18px);
  mask-image: linear-gradient(transparent, #000 18px);
}
.console-out.quiet { height: 120px; }
.console-out div { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; color: var(--screen-dim); }
.console-out time { color: var(--screen-faint); }
.console-out span { white-space: pre-wrap; overflow-wrap: anywhere; }
.console-out .warn { color: var(--screen-warn); }
.console-out .error { color: var(--screen-bad); }
.console-out .chat { color: var(--screen-ink); }
.console-out .me { color: var(--screen-me); }
.console-out .note { grid-template-columns: minmax(0, 1fr); color: var(--screen-faint); font-family: var(--sans); }
.console-out .note time { display: none; }
.console-in { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 24px; background: var(--screen-2); border-top: 1px solid var(--screen-hair); }
.console-in span { font: 600 16px var(--mono); color: var(--accent); }
.console-in input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font: 13px var(--mono); color: var(--screen-ink); outline: none; }
.console-in input::placeholder { color: var(--screen-faint); }
.console-in input:disabled { cursor: not-allowed; }
.quick { display: flex; gap: 8px; }
.quick button { min-height: 40px; border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: var(--screen-ink); border-radius: var(--r-md); padding: 0 12px; font-size: 13px; cursor: pointer; transition: background 0.15s, border-color 0.15s, opacity 0.2s; }
.quick button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.3); }
.quick button:disabled { opacity: 0.35; cursor: not-allowed; }


.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--fill);
  color: var(--on-fill);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.3s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- motion ---------- */

.enter > * { animation: rise 0.6s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: 0.06s; }
.enter > *:nth-child(3) { animation-delay: 0.12s; }
.enter > *:nth-child(4) { animation-delay: 0.18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

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

.alert-line { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; margin: 14px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.alert-line svg { width: 16px; height: 16px; margin-top: 2px; }
.alert-line b { display: block; font-weight: 600; color: var(--ink-2); }
.alert-to { display: block; margin-top: 2px; color: var(--ink-3); overflow-wrap: anywhere; }

/* ---------- welcome and the signup guide ---------- */

.intro-link { margin-top: 20px; }
.choices { overflow: hidden; }
.choice {
  display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 104px; padding: 24px;
  border: 0; background: transparent; text-align: left; color: inherit; font: inherit;
  cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
}
.choice + .choice { border-top: 1px solid var(--hair); }
.choice:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.choice > svg { flex: none; width: 20px; height: 20px; color: var(--ink-3); transition: transform 0.2s var(--spring), color 0.15s; }
.choice:hover > svg { color: var(--ink); transform: translateX(3px); }
.choice-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.choice-title { font-weight: 600; font-size: 19px; line-height: 28px; letter-spacing: -0.01em; color: var(--ink); }
.choice-blurb { color: var(--ink-2); font-size: 15px; }
.choice.open { cursor: auto; box-shadow: inset 3px 0 0 var(--ink); background: var(--surface-2); }
.choice.open .pass-row { margin-top: 12px; }
.choice.open .notice { margin-top: 12px; padding: 14px 16px 14px 19px; font-size: 14px; }

.step-back { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color 0.15s; }
.step-back:hover { text-decoration-color: var(--hair-2); }
.guide .step-title .chip { margin-left: 10px; vertical-align: 2px; }
.step-body .hint { font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.path-mark { display: flex; align-self: center; color: var(--ink-3); }
.path-mark svg { width: 16px; height: 16px; }
.path-note { grid-column: 2 / -1; margin-top: -8px; font-size: 13px; color: var(--ink-3); }
.path-note b { font-weight: 600; color: var(--ink); }
.ready { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.ready li { display: grid; gap: 2px; padding: 12px 0 12px 22px; border-bottom: 1px solid var(--hair); position: relative; font-size: 14px; }
.ready li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 8px; height: 1.5px; border-radius: 1px; background: var(--ink-3); }
.ready b { font-weight: 600; color: var(--ink); }
.ready span { color: var(--ink-3); line-height: 1.55; }
.callout { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 0 0 1px var(--hair) inset; font-size: 14px; }
.callout svg { width: 18px; height: 18px; margin-top: 2px; color: var(--ink-2); }
.callout b { color: var(--ink); }
.regions { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--hair); border-radius: var(--r-md); overflow: hidden; }
.regions li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 60px; padding: 10px 16px; }
.regions li + li { border-top: 1px solid var(--hair); }
.regions li.best { background: var(--surface-2); }
.region-name { display: block; font-weight: 600; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.region-city { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.region-note { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.fixes { display: grid; gap: 8px; margin: 10px 0 0; padding: 0 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.safe { display: grid; gap: 10px; margin: 0; padding: 14px 16px; list-style: none; border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 0 0 1px var(--hair) inset; }
.safe li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.safe svg { width: 16px; height: 16px; margin-top: 3px; color: var(--ink-3); }
.note-field { display: grid; gap: 8px; font-size: 13px; color: var(--ink-3); }
.note-field .input { max-width: 320px; }
/* The guide's blocks reset their own margins; the rhythm between them is this. */
.guide .step-body > * + * { margin-top: 16px; }
.guide .step-body > .hint { margin-top: 10px; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "card" "facts"; grid-template-rows: none; }
  .split > .steps, .split > .choices { margin-top: 32px; }
  .create { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .summary { position: static; }
  .page { padding-top: 32px; }
}
@media (max-width: 560px) {
  .brand small, .acct .mono { display: none; }
  .h1 { font-size: 30px; }
  .lede { font-size: 15px; }
  .card-pad, .step { padding: 20px; }
  .step-body { grid-column: 1 / -1; margin-top: 16px; }
  .step-body .row .btn { flex: 1 1 100%; }
  .step-body > .btn { width: 100%; }
  .preset { padding: 18px 20px; }
  .grant-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .path li { grid-template-columns: 24px minmax(0, 1fr); row-gap: 0; }
  .path .en { grid-column: 2; font-size: 12px; }
  .path-note { margin-top: 2px; }
  .note-field .input { max-width: none; }
  .choice { min-height: 92px; padding: 20px; }
  .choice-title { font-size: 17px; }
  .regions li { padding: 10px 14px; }
  .stage { padding: 16px 16px 18px; }
  .stage-time { font-size: 22px; }
  .phases { gap: 3px; margin-top: 16px; }
  .phase { font-size: 0; }
  .phase::before { margin-bottom: 0; }
  .phase-caption { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--screen-ink); }
  .stalled + .phase-caption { color: var(--screen-bad); }
  .log li { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .lcd { padding: 12px 12px 14px 16px; }
  .lcd-main { gap: 12px; }
  .lcd .num { font-size: 22px; }
  .lcd .btn { padding: 0 12px; }
  .console-head { padding-left: 20px; }
  .console-out { padding: 12px 20px; }
  .console-in { padding-left: 20px; }
  .quick { gap: 6px; }
  .quick button { min-height: 44px; padding: 0 10px; }
  .summary .cta { display: none; }
  .mobile-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    position: sticky; bottom: 0; z-index: 2;
    margin: 0 -20px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--hair);
    font-weight: 600;
  }
  .mobile-cta small { font-weight: 400; color: var(--ink-3); font-size: 13px; }
  .mobile-cta .btn { min-height: 48px; padding: 0 22px; }
}

/* ---------- opening an invite ---------- */

.pass-row { display: flex; gap: 8px; }
.pass-row .input { flex: 1; min-width: 0; }
.pass-input { min-height: 48px; font: 500 20px var(--mono); letter-spacing: 0.08em; }
.pass-row .btn { min-height: 48px; padding: 0 22px; }
.join-server { padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 0 0 1px var(--hair) inset; }
.join-name { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.join-who { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.grants-role { font-size: 13px; font-weight: 600; color: var(--ink); }
.grant-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column; gap: 0 24px; margin: 8px 0 0; padding: 0; list-style: none; }
.grant-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 14px; }
.grant-list li span:last-child { font-size: 13px; }
.grant-list li.g2 span:last-child { color: var(--ink); font-weight: 600; }
.grant-list li.g1 span:last-child { color: var(--ink-2); }
.grant-list li.g0 { color: var(--ink-3); }
.grant-list li.g0 span:last-child { color: var(--ink-3); }
.step-body .grants-note { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }
