/* Haiyo — landing page.
   Two layers of styling:
   1. The site itself: an editorial, typographic frame (serif display, mono labels, hairlines).
   2. Product replicas: rendered with the app's own tokens and font stack so they read as the
      real app (values mirror src/styles.css). Replicas respond to their container, not the
      viewport, so the same markup works pinned full-width or squeezed onto a phone. */

:root {
  color-scheme: dark;

  /* App tokens (mirrors src/styles.css, dark) */
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1b212b;
  --rail: #10151c;
  --elevated: #1c2532;
  --ink: #e8eef4;
  --ink-2: #f4f8fc;
  --muted: #9aa7b4;
  --faint: #6e7b8a;
  --line: #2a313c;
  --line-strong: #3a434f;
  --line-soft: #1f252e;
  --blue: #6aa3ff;
  --blue-soft: rgba(106, 163, 255, 0.14);
  --blue-border: rgba(106, 163, 255, 0.34);
  --accent: #3b76ff;
  --accent-hover: #5286ff;
  --on-accent: #ffffff;
  --green: #54c98a;
  --green-soft: rgba(84, 201, 138, 0.14);
  --green-border: rgba(84, 201, 138, 0.32);
  --amber: #e3b252;
  --amber-soft: rgba(227, 178, 82, 0.15);
  --amber-border: rgba(227, 178, 82, 0.34);
  --red: #f2666f;
  --red-soft: rgba(242, 102, 111, 0.15);
  --red-border: rgba(242, 102, 111, 0.34);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 62%);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* Site frame */
  --canvas: #0a0b0d;
  --rule: rgba(232, 238, 244, 0.1);
  --rule-strong: rgba(232, 238, 244, 0.2);
  --text: #ece9e2;
  --text-2: #a7a59f;
  --text-3: #74726d;
  --cta-bg: #ece9e2;
  --cta-ink: #0a0b0d;
  --grain-opacity: 0.05;

  /* Fixed-dark objects (Live CLI and the run board are physical displays in both themes) */
  --term-bg: #0a0e14;
  --term-ink: #c9d4df;
  --term-dim: #6e7b8a;
  --board-bg: #08090a;
  --board-cell: #111316;
  --board-ink: #f1ede4;
  --board-dim: #6b6862;
  --board-amber: #f2b43c;
  --board-green: #5fd38f;
  --board-red: #ff6b6b;
  --board-blue: #7fb0ff;

  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --app-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --max: 1240px;
  --wide: 1400px;
  --gutter: 18px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f7f9fc; --rail: #fafaf9; --elevated: #ffffff;
    --ink: #141922; --ink-2: #0b0f16; --muted: #5b6775; --faint: #8a94a3;
    --line: #d8dee9; --line-strong: #c3ccd8; --line-soft: #edf0f4;
    --blue: #2563eb; --blue-soft: #e7efff; --blue-border: rgba(37, 99, 235, 0.24);
    --accent: #2563eb; --accent-hover: #1d4fd0; --on-accent: #ffffff;
    --green: #15803d; --green-soft: #e6f6ea; --green-border: rgba(21, 128, 61, 0.24);
    --amber: #b7791f; --amber-soft: #fff1d6; --amber-border: rgba(183, 121, 31, 0.28);
    --red: #c2414b; --red-soft: #ffe5e8; --red-border: rgba(194, 65, 75, 0.28);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 30px 70px rgba(30, 24, 10, 0.16);
    --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 62%);
    --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --canvas: #f3f0e8; --rule: rgba(20, 18, 12, 0.12); --rule-strong: rgba(20, 18, 12, 0.24);
    --text: #16140f; --text-2: #5c5850; --text-3: #8b867b;
    --cta-bg: #16140f; --cta-ink: #f3f0e8; --grain-opacity: 0.07;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f7f9fc; --rail: #fafaf9; --elevated: #ffffff;
  --ink: #141922; --ink-2: #0b0f16; --muted: #5b6775; --faint: #8a94a3;
  --line: #d8dee9; --line-strong: #c3ccd8; --line-soft: #edf0f4;
  --blue: #2563eb; --blue-soft: #e7efff; --blue-border: rgba(37, 99, 235, 0.24);
  --accent: #2563eb; --accent-hover: #1d4fd0; --on-accent: #ffffff;
  --green: #15803d; --green-soft: #e6f6ea; --green-border: rgba(21, 128, 61, 0.24);
  --amber: #b7791f; --amber-soft: #fff1d6; --amber-border: rgba(183, 121, 31, 0.28);
  --red: #c2414b; --red-soft: #ffe5e8; --red-border: rgba(194, 65, 75, 0.28);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 30px 70px rgba(30, 24, 10, 0.16);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 62%);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --canvas: #f3f0e8; --rule: rgba(20, 18, 12, 0.12); --rule-strong: rgba(20, 18, 12, 0.24);
  --text: #16140f; --text-2: #5c5850; --text-3: #8b867b;
  --cta-bg: #16140f; --cta-ink: #f3f0e8; --grain-opacity: 0.07;
}

/* ================= Base ================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Film grain: one fixed, non-interactive layer. Keeps large flat areas from feeling digital-flat. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; 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; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 760px) { :root { --gutter: 32px; } }

h1, h2, h3 { text-wrap: balance; }
.idx-row code, .sec-head code { font-family: var(--mono); font-size: 0.82em; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 4px; }
.label {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.serif { font-family: var(--display); font-weight: 400; }
em.it { font-family: var(--display); font-style: italic; font-weight: 400; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: transparent; color: var(--text);
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { border-color: var(--text-2); }
.btn.solid { background: var(--cta-bg); border-color: var(--cta-bg); color: var(--cta-ink); }
.btn.solid:hover { background: transparent; color: var(--text); border-color: var(--text); }
.btn .arr { font-family: var(--mono); font-size: 13px; transition: transform 0.2s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn.small { height: 36px; padding: 0 15px; font-size: 13.5px; }

/* ================= Nav ================= */

.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--canvas) 80%, transparent);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; white-space: nowrap; }
@media (max-width: 480px) { .nav-actions .theme-toggle { display: none; } .nav-inner { gap: 12px; } }
.brand-mark { width: 24px; height: 24px; flex: none; }
.nav-links { display: none; gap: 2px; }
.nav-links a { padding: 6px 10px; color: var(--text-2); font-size: 14px; text-decoration: none; border-radius: 6px; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2); }
.theme-toggle:hover { color: var(--text); border-color: var(--rule-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
@media (min-width: 980px) { .nav-links { display: flex; } }

.lang-switch { font-size: 13.5px; color: var(--text-2); text-decoration: none; padding: 6px 6px; }
.lang-switch:hover { color: var(--text); }

/* ================= Japanese typography =================
   Latin glyphs keep the Instrument faces; Japanese falls through to Shippori Mincho
   (display) and Noto Sans JP (text). Japanese has no true italic, so emphasis is tone only. */
html[lang="ja"] {
  --display: "Instrument Serif", "Hiragino Mincho ProN", "Shippori Mincho", "Yu Mincho", serif;
  --sans: "Instrument Sans", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}
html[lang="ja"] body { line-height: 1.85; }
html[lang="ja"] :is(p, li, .leaves, .flow, .label) { word-break: auto-phrase; line-break: strict; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] summary { word-break: auto-phrase; line-break: strict; }
html[lang="ja"] em, html[lang="ja"] :is(h1, h2, h3) em { font-style: normal; }
html[lang="ja"] :is(h1, h2, h3, summary, .surf-item .t) { font-feature-settings: "palt" 1; }
html[lang="ja"] .hero h1 { font-size: clamp(38px, 6.4vw, 92px); line-height: 1.16; letter-spacing: -0.02em; font-weight: 500; }
html[lang="ja"] .hero-side p { font-size: 17px; line-height: 1.9; }
html[lang="ja"] .sec-head h2 { font-size: clamp(30px, 4.4vw, 60px); line-height: 1.22; letter-spacing: -0.01em; max-width: none; font-weight: 500; }
html[lang="ja"] .closing h2 { font-size: clamp(32px, 5.4vw, 80px); line-height: 1.2; letter-spacing: -0.01em; max-width: 15em; font-weight: 500; }
html[lang="ja"] .story-title h2 { font-size: clamp(24px, 2.6vw, 36px); line-height: 1.3; letter-spacing: -0.03em; font-weight: 500; }
html[lang="ja"] .story-cap h3 { font-size: 21px; font-weight: 500; }
html[lang="ja"] .story-cap p { line-height: 1.8; }
html[lang="ja"] .surf-item button .t { font-size: clamp(21px, 2.1vw, 27px); line-height: 1.35; font-weight: 500; }
html[lang="ja"] .idx-row h3 { font-size: clamp(21px, 2.2vw, 28px); line-height: 1.35; font-weight: 500; }
html[lang="ja"] .autonomy h3 { font-size: clamp(24px, 2.5vw, 32px); line-height: 1.35; font-weight: 500; }
html[lang="ja"] .faq summary { font-size: clamp(17px, 1.7vw, 20px); line-height: 1.55; font-weight: 500; }
html[lang="ja"] .label { letter-spacing: 0.03em; }

/* ================= Hero ================= */

.hero { padding: clamp(40px, 7vw, 92px) 0 0; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: end; }
.hero h1 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(46px, 8.6vw, 128px); line-height: 0.92; letter-spacing: -0.025em; color: var(--text);
}
.hero h1 em { font-style: italic; color: var(--text-2); }
.hero-side { display: grid; gap: 22px; max-width: 460px; }
.hero-side p { margin: 0; color: var(--text-2); font-size: 18px; line-height: 1.5; }
.hero-side p strong { color: var(--text); font-weight: 600; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 1080px) {
  .hero-top { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 56px; }
}

/* ----- Run board (split-flap) ----- */

.board-wrap { margin-top: clamp(36px, 5vw, 64px); }
.board {
  background: var(--board-bg); color: var(--board-ink); border-radius: 14px;
  border: 1px solid #1d1f23; box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: var(--mono); overflow: hidden; position: relative;
}
.board::after {
  /* faint horizontal louvres, like a physical display */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}
.board-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid #1d1f23; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--board-dim);
}
.board-head .ttl { color: var(--board-ink); font-weight: 700; display: inline-flex; gap: 10px; align-items: center; }
.board-head .ttl i { width: 8px; height: 8px; border-radius: 50%; background: var(--board-green); box-shadow: 0 0 10px var(--board-green); }
.board-head .clock { color: var(--board-amber); font-size: 15px; font-weight: 700; letter-spacing: 0.12em; }
.board-meta { display: flex; gap: 18px; align-items: center; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.board-table th {
  text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.1em; color: var(--board-dim);
  padding: 12px 10px 8px; text-transform: uppercase;
}
.board-table th:first-child, .board-table td:first-child { padding-left: 18px; }
.board-table th:last-child, .board-table td:last-child { padding-right: 18px; }
.board-table td { padding: 5px 10px; border-top: 1px solid #16181b; white-space: nowrap; }
.board-table tr.row-enter td { animation: row-in 0.5s ease both; }
.flap { display: inline-flex; gap: 2px; }
.flap b {
  display: inline-grid; place-items: center; min-width: 0.92em; height: 1.75em; padding: 0 1px;
  background: var(--board-cell); border-radius: 3px; font-weight: 600; position: relative; overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.6);
}
.flap b::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.55); }
.flap b.sp { background: transparent; box-shadow: none; }
.flap b.sp::after { display: none; }
.flap.amber { color: var(--board-amber); }
.flap.green { color: var(--board-green); }
.flap.red { color: var(--board-red); }
.flap.blue { color: var(--board-blue); }
.flap.dim { color: var(--board-dim); }
.b-id { color: var(--board-dim); }
.b-title { color: var(--board-ink); max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.b-proj { color: var(--board-dim); }
.pips { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 8px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: #26292e; transition: background 0.3s ease; }
.pips i.on { background: var(--board-green); }
.pips i.now { background: var(--board-amber); box-shadow: 0 0 8px var(--board-amber); }
.pips i.bad { background: var(--board-red); }
.board-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px;
  border-top: 1px solid #1d1f23; font-size: 12px; letter-spacing: 0.06em; color: var(--board-dim); text-transform: uppercase;
}
.board-foot .msg { color: var(--board-ink); }
.board-note { margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.c-stage-label { color: var(--board-dim); font-size: 12px; }
@media (max-width: 1080px) {
  .board-table .c-proj, .board-table .c-stage-label { display: none; }
  .b-title { max-width: 230px; }
}
@media (max-width: 680px) {
  .board-table { font-size: 11px; }
  .board-table .c-id, .board-table .c-pr { display: none; }
  .board-table th, .board-table td { padding-left: 6px; padding-right: 6px; }
  .board-table th:first-child, .board-table td:first-child { padding-left: 12px; }
  .board-table th:last-child, .board-table td:last-child { padding-right: 12px; }
  .b-title { max-width: 120px; }
  .pips { gap: 3px; margin-right: 0; }
  .pips i { width: 6px; height: 6px; }
  .board-head { padding: 12px; }
  .board-head .board-meta .sub { display: none; }
  .board-foot { padding: 10px 12px; }
}

/* ================= Section scaffolding ================= */

.sec { padding: clamp(80px, 11vw, 150px) 0; border-top: 1px solid var(--rule); }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head h2 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(38px, 5.6vw, 76px); line-height: 0.98; letter-spacing: -0.02em; max-width: 14ch;
}
.sec-head h2 em { font-style: italic; color: var(--text-2); }
.sec-head p { margin: 0; max-width: 560px; color: var(--text-2); font-size: 18px; }
@media (min-width: 980px) {
  .sec-head.split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; gap: 48px; }
}

/* ================= Story (pinned, scroll-driven run) ================= */

.story { border-top: 1px solid var(--rule); position: relative; }
.story-stage { padding: 40px 0 48px; }
.story.pinned { height: 640vh; }
.story.pinned .story-stage {
  position: sticky; top: 62px; height: calc(100vh - 62px); padding: 22px 0 22px;
  display: flex; flex-direction: column;
}
.story.pinned .story-stage > .wrap-wide { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.story-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
.story-title { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.story-title h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.4vw, 46px); line-height: 1; letter-spacing: -0.015em; }
.story-cap { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; min-height: 56px; }
.story-cap .n { font-family: var(--mono); font-size: 13px; color: var(--text-3); padding-top: 4px; }
.story-cap h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.story-cap p { margin: 0; color: var(--text-2); font-size: 15.5px; max-width: 760px; }
.story-cap .leaves { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 6px; }
.story-cap.swap { animation: cap-in 0.35s ease both; }
@media (min-width: 1100px) {
  .story-head { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); align-items: end; gap: 40px; }
}

.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.steps button {
  position: relative; text-align: left; border: 0; background: none; cursor: pointer; padding: 10px 0 0; color: var(--text-3);
  font-size: 12.5px; font-weight: 500; display: grid; gap: 2px;
}
.steps button .n { font-family: var(--mono); font-size: 11px; }
.steps button::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--rule); border-radius: 2px; }
.steps button .fill { position: absolute; top: 0; left: 0; height: 2px; width: 0; background: var(--text); border-radius: 2px; }
.steps button.done, .steps button.active { color: var(--text); }
.steps button.done .fill { width: 100%; }
.steps button.active .fill { background: var(--text); }
@media (max-width: 700px) {
  /* labels stay readable to screen readers; only the numbers show */
  .steps button .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.app-fit { container-type: inline-size; container-name: win; width: 100%; }
.story.pinned .window { flex: 1; min-height: 0; }
.story.pinned .app-fit { position: absolute; top: 0; left: 0; }
.story.pinned .app { height: 100%; min-height: 0; }
@media (max-height: 820px) {
  .story.pinned .story-stage { padding: 12px 0; }
  .story.pinned .story-title h2 { font-size: 28px; }
  .story.pinned .story-cap h3 { font-size: 22px; }
  .story.pinned .story-cap .leaves { display: none; }
  .story.pinned .steps { margin-bottom: 10px; }
}
.story-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.play-ctl { display: none; align-items: center; gap: 8px; }
.story:not(.pinned) .play-ctl { display: inline-flex; }
.play-btn { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.play-btn svg { width: 12px; height: 12px; }
.scroll-hint { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.story:not(.pinned) .scroll-hint { display: none; }

/* ================= Product surfaces switcher ================= */

.surfaces { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1000px) { .surfaces { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: 56px; } }
.surf-list { display: grid; border-top: 1px solid var(--rule); }
.surf-item { border-bottom: 1px solid var(--rule); }
.surf-item button {
  width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  padding: 22px 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--text-3);
}
.surf-item button .n { font-family: var(--mono); font-size: 12px; }
.surf-item button .t { font-family: var(--display); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.05; color: var(--text-2); transition: color 0.2s ease; }
.surf-item button .k { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.surf-item.active button .t, .surf-item button:hover .t { color: var(--text); }
.surf-body { display: none; padding: 0 0 24px 58px; color: var(--text-2); font-size: 16px; }
.surf-item.active .surf-body { display: block; animation: cap-in 0.35s ease both; }
.surf-body p { margin: 0 0 12px; }
.surf-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.surf-body li { position: relative; padding-left: 18px; font-size: 15px; }
.surf-body li::before { content: "—"; position: absolute; left: 0; color: var(--text-3); }
.surf-stage { position: relative; }
.surf-stage .mini { display: none; }
.surf-stage .mini.active { display: block; animation: cap-in 0.4s ease both; }
@media (max-width: 999px) { .surf-body { padding-left: 0; } }

/* ================= Use-case index ================= */

.index { border-top: 1px solid var(--rule); counter-reset: idx; }
.idx-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 26px 0; border-bottom: 1px solid var(--rule);
  transition: background 0.25s ease;
}
.idx-row .n { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.idx-row h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 2.8vw, 36px); line-height: 1.05; letter-spacing: -0.01em; }
.idx-row p { margin: 0; color: var(--text-2); font-size: 16px; }
.idx-row .flow { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--text); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.idx-row .flow i { font-style: normal; color: var(--text-3); }
.idx-row .uses { margin-top: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
@media (min-width: 900px) {
  .idx-row { grid-template-columns: 70px minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 28px; align-items: baseline; padding: 30px 0; }
  .idx-row:hover { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 3%, transparent), transparent); }
}

/* ================= Example runs ================= */

.sc-tabs { display: flex; gap: 0; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.sc-tab {
  position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px 14px 0; margin-right: 18px;
  border: 0; background: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-3); text-align: left;
}
.sc-tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.sc-tab .dot.high { background: var(--green); } .sc-tab .dot.medium { background: var(--amber); } .sc-tab .dot.low, .sc-tab .dot.blocked { background: var(--red); }
.sc-tab[aria-selected="true"] { color: var(--text); }
.sc-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 18px; bottom: -1px; height: 2px; background: var(--text); }
.sc-note { margin-top: 16px; }

/* ================= Safety spec sheet ================= */

.spec { border-top: 1px solid var(--rule); }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.spec-row .k { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding-top: 4px; }
.spec-row .v h3 { margin: 0 0 4px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.spec-row .v p { margin: 0; color: var(--text-2); font-size: 16px; max-width: 720px; }
@media (min-width: 900px) { .spec-row { grid-template-columns: 240px minmax(0, 1fr); gap: 32px; } }

.autonomy { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
@media (min-width: 980px) { .autonomy { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; } }
.autonomy h3 { margin: 10px 0 10px; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3vw, 40px); line-height: 1.05; }
.autonomy > div > p { margin: 0; color: var(--text-2); }
.seg { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--rule-strong); border-radius: 999px; flex-wrap: wrap; }
.seg button { min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--cta-bg); color: var(--cta-ink); }
.level-desc { margin-top: 18px; color: var(--text); font-size: 17px; min-height: 52px; }
.level-flags { margin-top: 14px; display: grid; border-top: 1px solid var(--rule); }
.flag { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.flag .v { font-family: var(--mono); font-size: 13px; }
.flag .v.on { color: var(--green); } .flag .v.mid { color: var(--amber); } .flag .v.off { color: var(--text-3); }
.floor { margin-top: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); }
.floor b { color: var(--red); font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; padding-top: 2px; }

/* ================= Closing / start ================= */

.closing h2 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(44px, 7.4vw, 112px); line-height: 0.95; letter-spacing: -0.025em; max-width: 13ch;
}
.closing h2 em { font-style: italic; color: var(--text-2); }
.start-grid { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .start-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.start-step { padding: 24px 24px 24px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .start-step { border-bottom: 0; } .start-step + .start-step { border-left: 1px solid var(--rule); padding-left: 24px; } }
.start-step h3 { margin: 8px 0 6px; font-size: 19px; font-weight: 600; }
.start-step p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.start-step ul { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14.5px; color: var(--text-2); display: grid; gap: 4px; }
.start-step li span { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-left: 6px; }
.closing-cta { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.closing-cta .label { margin-left: 6px; }

/* ================= FAQ ================= */

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 0; display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 16px;
  font-size: clamp(19px, 2vw, 23px); font-family: var(--display); line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--text-3); font-size: 18px; text-align: right; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 24px; color: var(--text-2); max-width: 760px; }
@media (min-width: 980px) { .faq-layout { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 56px; } }

/* ================= Footer ================= */

footer { border-top: 1px solid var(--rule); padding: 36px 0 52px; color: var(--text-3); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot nav a { text-decoration: none; color: var(--text-2); }
.foot nav a:hover { color: var(--text); }

/* =====================================================================
   PRODUCT REPLICAS — app tokens + app font, container-responsive
   ===================================================================== */

.window, .mini, .sc-grid { font-family: var(--app-font); }
.window {
  position: relative;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  box-shadow: var(--shadow-lg); overflow: hidden; isolation: isolate;
}
.window::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: var(--hairline); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill.blue { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-border); }
.pill.green { color: var(--green); background: var(--green-soft); border-color: var(--green-border); }
.pill.amber { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-border); }
.pill.red { color: var(--red); background: var(--red-soft); border-color: var(--red-border); }

.app {
  --rail-w: 232px;
  display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 560px; font-size: 13px; line-height: 1.4; color: var(--ink); position: relative; width: 100%;
}
.app-rail { background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px 10px 10px; gap: 8px; min-width: 0; }
.lights { display: flex; gap: 7px; padding: 2px 4px 10px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.rail-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.rail-head b { font-size: 14px; }
.icon-btn { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 14px; background: var(--panel); }
.rail-nav { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-weight: 600; }
.rail-nav .count { margin-left: auto; color: var(--muted); font-size: 11px; font-family: var(--app-mono); }
.rail-project { border-radius: 9px; padding: 7px 9px; border: 1px solid transparent; }
.rail-project.active { background: var(--blue-soft); border-color: var(--blue-border); }
.rail-project .name { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.rail-project .branch { color: var(--muted); font-size: 11.5px; padding-left: 17px; }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-left: auto; flex: none; }
.sdot.run { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.sdot.warn { background: var(--amber); }
.sdot.ok { background: var(--green); }
.rail-tasks { list-style: none; margin: 0 0 0 12px; padding: 0 0 0 10px; border-left: 1px solid var(--line); display: grid; gap: 2px; }
.rail-task { display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 8px; min-width: 0; transition: background 0.25s ease; }
.rail-task.current { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.rail-task .tt { min-width: 0; flex: 1; }
.rail-task .t1 { font-weight: 650; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-task .t2 { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-task .pill { height: 20px; font-size: 10.5px; padding: 0 7px; }
.rail-task.enter { animation: slide-in 0.45s ease both; }
.rail-foot { margin-top: auto; display: flex; gap: 6px; }
.rail-foot .new { flex: 1; height: 32px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 650; font-size: 12.5px; transition: transform 0.12s ease, filter 0.12s ease; }
.rail-foot .new.pressed { transform: scale(0.96); filter: brightness(1.15); }
.rail-foot .icon-btn { width: 32px; height: 32px; }

.app-main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.app-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.app-summary h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.app-summary p { margin: 2px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-summary > div:first-child { min-width: 0; }
.summary-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 11.5px; font-weight: 600; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-chip.pr { color: var(--green); border-color: var(--green-border); background: var(--green-soft); transition: opacity 0.4s ease, transform 0.4s ease; }
.meta-chip.pr.hidden { opacity: 0; transform: translateY(-4px); }
.app-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow: hidden; }
.app-tabs span { position: relative; padding: 9px 9px 10px; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.app-tabs span em { font-style: normal; font-family: var(--app-mono); font-size: 10.5px; color: var(--faint); background: var(--panel-2); border-radius: 999px; padding: 0 6px; }
.app-tabs span.active { color: var(--ink); }
.app-tabs span.active::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; background: var(--blue); border-radius: 2px; }

.app-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; padding: 14px; min-height: 0; }
.panel { background: var(--panel); background-image: var(--sheen); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--hairline); min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.run-card { padding: 18px; gap: 16px; }
.run-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.run-top > div { min-width: 0; }
.run-top > .pill { flex: none; }
.run-top h4 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.run-top .branch { margin-top: 6px; }
.run-top .meta-chip { max-width: 100%; }
.run-mid { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .fill { transition: stroke-dashoffset 0.6s ease; }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .pct { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.ring .pct sup { font-size: 11px; color: var(--muted); font-weight: 600; }
.ring .ph { margin-top: 4px; font-size: 9.5px; letter-spacing: 0.1em; color: var(--blue); font-weight: 700; text-transform: uppercase; }
.ring.done .ph { color: var(--green); }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); flex: 1; min-width: 0; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.step::before { content: ""; position: absolute; top: 10px; left: calc(-50% + 12px); right: calc(50% + 12px); height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step.done::before, .step.active::before { background: var(--green); }
.step .node { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--panel); display: grid; place-items: center; transition: background 0.3s ease, border-color 0.3s ease; }
.step .node svg { width: 12px; height: 12px; opacity: 0; transition: opacity 0.2s ease; }
.step.done .node { background: var(--green); border-color: var(--green); color: var(--bg); }
.step.done .node svg { opacity: 1; }
.step.active .node { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); animation: pulse 1.6s ease-in-out infinite; }
.step.active .node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.step .lbl { font-size: 10.5px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.step.active .lbl { color: var(--blue); }
.step.done .lbl { color: var(--ink); }
.status-line { font-family: var(--app-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.status-line .ok { color: var(--green); } .status-line .err { color: var(--red); } .status-line .run { color: var(--blue); }
.criteria-mini { display: grid; gap: 6px; }
.criteria-mini .c { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.criteria-mini .box { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-strong); flex: none; margin-top: 1px; display: grid; place-items: center; transition: background 0.3s ease, border-color 0.3s ease; }
.criteria-mini .box svg { width: 9px; height: 9px; opacity: 0; color: var(--bg); }
.criteria-mini .c.met { color: var(--ink); }
.criteria-mini .c.met .box { background: var(--green); border-color: var(--green); }
.criteria-mini .c.met .box svg { opacity: 1; }
.criteria-head { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--faint); text-transform: uppercase; }

.side { overflow: hidden; }
.side-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); flex: none; }
.side-tabs span { position: relative; padding: 10px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-tabs span.active { color: var(--ink); }
.side-tabs span.active::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }
.side-view { display: none; flex: 1; min-height: 0; }
.side-view.active { display: flex; flex-direction: column; animation: fade-in 0.3s ease both; }
.term { flex: 1; margin: 10px; border-radius: 9px; background: var(--term-bg); color: var(--term-ink); font-family: var(--app-mono); font-size: 11.5px; line-height: 1.55; padding: 10px 12px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; border: 1px solid #1c232d; }
.term .ln { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; white-space: nowrap; animation: line-in 0.25s ease both; }
.term .ln .ph { color: #7d8ea3; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.term .ln .msg { overflow: hidden; text-overflow: ellipsis; }
.term .ln.sys .msg { color: var(--term-dim); } .term .ln.err .msg { color: #f2666f; } .term .ln.ok .msg { color: #54c98a; } .term .ln.hi .msg { color: #8fb9ff; }
.term .cursor { display: inline-block; width: 7px; height: 13px; background: #8fb9ff; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.diff-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); flex: 1; min-height: 0; }
.diff-files { border-right: 1px solid var(--line); padding: 10px 8px; display: grid; align-content: start; gap: 4px; }
.diff-files .lbl { font-size: 10px; letter-spacing: 0.08em; font-weight: 700; color: var(--faint); text-transform: uppercase; padding: 0 6px 4px; }
.diff-file { padding: 6px 8px; border-radius: 7px; font-size: 11.5px; display: grid; gap: 1px; border: 1px solid transparent; }
.diff-file.active { background: var(--blue-soft); border-color: var(--blue-border); }
.diff-file b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diff-file small { color: var(--muted); font-size: 10.5px; }
.diff-file .add { color: var(--green); font-family: var(--app-mono); } .diff-file .del { color: var(--red); font-family: var(--app-mono); }
.diff-code { padding: 10px; overflow: hidden; font-family: var(--app-mono); font-size: 11px; line-height: 1.6; }
.diff-code .path { font-family: var(--app-font); font-size: 11.5px; font-weight: 650; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl { white-space: pre; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; border-radius: 3px; }
.dl.add { background: var(--green-soft); color: var(--green); } .dl.del { background: var(--red-soft); color: var(--red); }
.dl.hunk { background: var(--blue-soft); color: var(--blue); } .dl.ctx { color: var(--muted); }
.dl.enter { animation: line-in 0.22s ease both; }
.art-list { padding: 10px; display: grid; gap: 6px; align-content: start; overflow: hidden; }
.art { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); animation: slide-in 0.35s ease both; }
.art .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-family: var(--app-mono); font-size: 10px; font-weight: 700; color: var(--blue); background: var(--blue-soft); }
.art .ic.g { color: var(--green); background: var(--green-soft); } .art .ic.a { color: var(--amber); background: var(--amber-soft); }
.art b { display: block; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art small { color: var(--muted); font-size: 11px; }
.shot { margin-top: 2px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); animation: slide-in 0.35s ease both; }
.shot .bar { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.shot .bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.shot .body { padding: 10px; display: grid; gap: 6px; max-width: 260px; margin: 0 auto; }
.shot .body .f { height: 20px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); }
.shot .body .msg { font-size: 11px; color: var(--red); background: var(--red-soft); border: 1px solid var(--red-border); border-radius: 6px; padding: 5px 8px; }
.shot .body .b { height: 22px; border-radius: 6px; background: var(--accent); opacity: 0.85; }

.composer-veil { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.35s ease; padding: 16px; }
.composer-veil.show { opacity: 1; }
.composer { width: min(520px, 100%); background: var(--elevated); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px; display: grid; gap: 12px; transform: translateY(8px) scale(0.985); transition: transform 0.35s ease; }
.composer-veil.show .composer { transform: none; }
.composer h4 { margin: 0; font-size: 15px; }
.composer .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 11px; font-weight: 650; color: var(--muted); }
.input { min-height: 34px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); font-size: 12.5px; color: var(--ink); }
.input.focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input.area { min-height: 54px; color: var(--muted); }
.issue-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--blue-border); background: var(--blue-soft); border-radius: 8px; font-size: 12px; }
.issue-pick .src { font-family: var(--app-mono); font-size: 11px; color: var(--blue); font-weight: 700; }
.composer-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.composer-foot .hint { font-size: 11px; color: var(--muted); }
.composer-foot .btns { display: flex; gap: 6px; }
.fake-btn { height: 30px; padding: 0 12px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 650; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); transition: transform 0.12s ease, filter 0.12s ease; white-space: nowrap; }
.fake-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fake-btn.pressed { transform: scale(0.95); filter: brightness(1.2); }
.caret::after { content: ""; display: inline-block; width: 1.5px; height: 14px; background: var(--blue); margin-left: 1px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }

/* A macOS desktop notification (the app notifies through the OS, not an in-app toast) */
.toast {
  position: absolute; right: 14px; top: 14px; z-index: 6; width: min(340px, calc(100% - 28px));
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 13px;
  border-radius: 16px; color: #1d1d1f; background: rgba(246, 246, 248, 0.86);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--app-font);
  opacity: 0; transform: translateX(24px); transition: opacity 0.4s ease, transform 0.45s cubic-bezier(.2,.8,.2,1); pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast .ic svg, .toast .ic img { width: 34px; height: 34px; display: block; }
.toast .app-name { display: flex; justify-content: space-between; font-size: 11px; color: #6e6e73; font-weight: 500; }
.toast .app-name i { font-style: normal; }
.toast b { display: block; font-size: 12.5px; font-weight: 600; margin-top: 1px; }
.toast small { display: block; color: #3a3a3c; font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Container-driven layout for the app replica */
@container win (max-width: 1020px) { .app { --rail-w: 200px; } }
@container win (max-width: 940px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-rail { display: none; }
}
@container win (max-width: 700px) {
  .app { min-height: 0; }
  .app-body { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .app-summary .meta-chip.branch { display: none; }
  .run-card { padding: 14px; }
  .run-mid { flex-direction: column; align-items: stretch; }
  .ring { margin: 0 auto; }
  .diff-wrap { grid-template-columns: minmax(0, 1fr); }
  .diff-files { display: none; }
  .term { min-height: 200px; font-size: 10.5px; }
  .term .ln { grid-template-columns: 62px minmax(0, 1fr); }
}

/* Small replicas used in the surfaces switcher */
.mini { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow-lg); overflow: hidden; font-size: 12.5px; color: var(--ink); container-type: inline-size; container-name: mini; }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mini-head b { font-size: 13.5px; }
.mini-head small { color: var(--muted); font-size: 11.5px; display: block; }
.kb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; min-height: 360px; }
.kb-col { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kb-col h5 { margin: 0 0 2px; display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; }
.kb-col h5 em { font-style: normal; font-family: var(--app-mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.kb-col.run h5 em { color: var(--blue); border-color: var(--blue-border); background: var(--blue-soft); }
.kb-card { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); padding: 7px 8px; display: grid; gap: 5px; min-width: 0; will-change: transform; }
.kb-card b { font-size: 11.5px; line-height: 1.25; font-weight: 650; }
.kb-card .row { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-card .pill { height: 18px; font-size: 10px; padding: 0 6px; }
.kb-card.p0 { border-left-color: var(--red); } .kb-card.p1 { border-left-color: var(--blue); } .kb-card.p2 { border-left-color: var(--amber); } .kb-card.p3 { border-left-color: var(--line-strong); }
.kb-card .bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.kb-card .bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width 0.5s linear; }
.kb-card.is-done .bar { display: none; }
.kb-meta { display: flex; align-items: center; gap: 8px; }
@container mini (max-width: 560px) { .kb { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.inbox { padding: 10px; display: grid; gap: 8px; min-height: 360px; align-content: start; }
.ib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease, border-color 0.3s ease; max-height: 220px; overflow: hidden; }
.ib-row.gone { display: none; }
.ib-row.hidden { opacity: 0; transform: translateY(8px); }
.ib-row.leaving { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -8px; border-color: transparent; }
.ib-row.ok { border-color: var(--green-border); }
.ib-row .t { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ib-row .t span { color: var(--muted); font-size: 11.5px; }
.ib-row .t .sdot { margin-left: 0; }
.ib-row .t b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row .m { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.ib-row .m .mono { font-family: var(--app-mono); font-size: 11px; }
.ib-row .acts { display: flex; gap: 6px; }
@container mini (max-width: 560px) {
  .ib-row { grid-template-columns: minmax(0, 1fr); }
  .ib-row .acts .fake-btn:last-child { display: none; }
}

.ct { padding: 10px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 360px; align-content: start; }
.ct-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px; min-width: 0; }
.ct-card.wide { grid-column: 1 / -1; }
.ct-label { font-size: 10.5px; letter-spacing: 0.08em; font-weight: 700; color: var(--faint); text-transform: uppercase; }
.ct-big { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ct-big small { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.gauge { height: 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; margin-top: 10px; }
.gauge i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width 0.5s linear, background 0.3s ease; }
.gauge.warn i { background: var(--amber); }
.ct-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.ct-table td { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.ct-table td:nth-child(2) { text-align: right; font-family: var(--app-mono); color: var(--muted); padding-right: 10px; }
.ct-table td:last-child { text-align: right; }
.ct-table .pill { height: 19px; font-size: 10.5px; }
.ct-hold { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--amber-border); background: var(--amber-soft); color: var(--ink); font-size: 12px; opacity: 0; transform: translateY(6px); transition: opacity 0.35s ease, transform 0.35s ease; margin-top: 10px; }
.ct-hold.show { opacity: 1; transform: none; }
.ct-hold b { color: var(--amber); }
.held { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; font-size: 12px; flex-wrap: wrap; }
@container mini (max-width: 560px) { .ct { grid-template-columns: minmax(0, 1fr); } }

/* Example-run cards (app PR format) */
.sc-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 14px; align-items: start; color: var(--ink); }
@media (max-width: 900px) { .sc-grid { grid-template-columns: minmax(0, 1fr); } }
.sc-col { display: grid; gap: 14px; min-width: 0; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); background-image: var(--sheen); padding: 16px; min-width: 0; }
.card-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: 0.08em; font-weight: 700; color: var(--faint); text-transform: uppercase; margin-bottom: 10px; }
.ticket h3 { margin: 6px 0 6px; font-size: 18px; letter-spacing: -0.015em; }
.ticket p { margin: 0; color: var(--muted); font-size: 14px; }
.ticket .src { display: inline-flex; align-items: center; gap: 6px; font-family: var(--app-mono); font-size: 12px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 12px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--green-border); }
.timeline li:last-child::before { display: none; }
.timeline .nd { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--bg); font-weight: 700; font-size: 12px; }
.timeline .nd svg { width: 12px; height: 12px; }
.timeline .nd.warn { background: var(--amber); }
.timeline b { display: block; font-size: 14px; }
.timeline span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.timeline code { font-family: var(--app-mono); font-size: 12px; }
.pr { padding: 0; overflow: hidden; }
.pr.blocked { border-color: var(--red-border); }
.pr.blocked .pr-status { border-color: var(--red-border); background: var(--red-soft); color: var(--ink); font-family: var(--app-mono); font-size: 12.5px; }
.diff-card { display: grid; gap: 10px; }
.diff-card .card-label { margin-bottom: 0; }
.diff-card .card-label code { font-family: var(--app-mono); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.pr-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.pr-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.pr-head .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; }
.pr-head code { font-family: var(--app-mono); font-size: 11.5px; padding: 1px 6px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); overflow-wrap: anywhere; }
.pr-body { padding: 16px; font-size: 14px; display: grid; gap: 14px; }
.pr-body h4 { margin: 0 0 6px; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.pr-body h5 { margin: 0 0 6px; font-size: 14px; color: var(--amber); }
.pr-body p { margin: 0; color: var(--ink); }
.pr-body ul { margin: 0; padding-left: 20px; color: var(--ink); }
.pr-body ul li { margin: 3px 0; }
.pr-body ul.checks { list-style: none; padding-left: 0; }
.pr-body ul.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; }
.pr-body ul.checks .cb { width: 15px; height: 15px; margin-top: 3px; border-radius: 4px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.pr-body ul.checks .cb.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.pr-body ul.checks .cb svg { width: 10px; height: 10px; }
.pr-body em { color: var(--muted); }
.pr-body code { font-family: var(--app-mono); font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.pr-status { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-soft); font-size: 13.5px; }
.pr-body details { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: var(--panel-2); }
.pr-body summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.pr-body blockquote { margin: 10px 0 6px; padding: 2px 12px; border-left: 3px solid var(--line-strong); color: var(--ink); font-weight: 600; }
.pr-body .review-text { color: var(--muted); font-size: 13.5px; }
.pr-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); font-family: var(--app-mono); overflow-wrap: anywhere; }
.pr-diff { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; font-family: var(--app-mono); font-size: 11.5px; line-height: 1.6; background: var(--bg); }
.pr-diff .fh { padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-family: var(--app-font); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.pr-diff .dl { padding: 0 10px; overflow-x: auto; text-overflow: clip; }
.pr-evidence { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.pr-evidence .cap { padding: 6px 10px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.mock-table { padding: 10px; display: grid; gap: 4px; font-size: 11px; }
.mock-table .r { display: grid; grid-template-columns: 1.4fr 1.6fr 0.8fr; gap: 8px; padding: 5px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.mock-table .r.h { background: transparent; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 9.5px; }
.mock-table .pg { display: flex; justify-content: flex-end; gap: 4px; margin-top: 4px; }
.mock-table .pg i { font-style: normal; min-width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 10.5px; color: var(--muted); }
.mock-table .pg i.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ================= Motion ================= */

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--blue-soft); } 50% { box-shadow: 0 0 0 7px var(--blue-soft); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cap-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; } to { opacity: 1; } }

.reveal { transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1); }
html.js-reveal .reveal:not(.in) { opacity: 0; transform: translateY(18px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js-reveal .reveal:not(.in) { opacity: 1; transform: none; }
}

/* Haiyo wordmark: letters follow the theme's text colour, the dot stays vermilion. */
.brand-logo { position: relative; display: inline-block; height: 28px; aspect-ratio: 630 / 258; flex: none; }
.brand-ink { position: absolute; inset: 0; background: currentColor;
  -webkit-mask: url("brand/haiyo-wordmark-mask.png") center / 100% 100% no-repeat;
          mask: url("brand/haiyo-wordmark-mask.png") center / 100% 100% no-repeat; }
.brand-dot { position: absolute; left: 46.847%; top: 4.219%; width: 6.685%; aspect-ratio: 1; border-radius: 50%; background: #E5482D; }
/* High-contrast mode drops background colours; keep the wordmark visible. */
@media (forced-colors: active) {
  .brand-ink { forced-color-adjust: none; background: CanvasText; }
  .brand-dot { forced-color-adjust: none; }
}
