/* THE HIVE — site styles. Dark navy / electric blue. */
:root {
  --bg: #050b1a;
  --bg-2: #0a1530;
  --panel: rgba(16, 32, 70, 0.55);
  --panel-solid: #0e1d42;
  --line: rgba(80, 150, 255, 0.18);
  --line-strong: rgba(80, 170, 255, 0.45);
  --text: #e6eefc;
  --muted: #8fa6d1;
  --dim: #5d73a0;
  --blue: #2f8cff;
  --cyan: #38d6ff;
  --red: #ff4d63;
  --green: #2fd98c;
  --amber: #ffbe3d;
  --violet: #9b7bff;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
body::before { /* hex grid */
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z M28 64 L28 97' fill='none' stroke='%232f8cff' stroke-opacity='0.07' stroke-width='1'/%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
body::after { /* glow */
  content: "";
  position: fixed; inset: -20% -10% auto -10%; height: 80vh; z-index: -1;
  background:
    radial-gradient(40% 50% at 20% 20%, rgba(47, 140, 255, 0.22), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(56, 214, 255, 0.14), transparent 70%);
  pointer-events: none;
}
body.page-r1::after {
  background:
    radial-gradient(40% 50% at 20% 20%, rgba(255, 77, 99, 0.16), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(47, 140, 255, 0.18), transparent 70%);
}
body.page-tx::after {
  background:
    radial-gradient(40% 50% at 20% 20%, rgba(155, 123, 255, 0.2), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(56, 214, 255, 0.14), transparent 70%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); }
code { overflow-wrap: anywhere; font-size: 0.88em; background: rgba(47, 140, 255, 0.12); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: #bfe4ff; }
img { max-width: 100%; height: auto; display: block; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(5, 11, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--text); font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(56, 214, 255, 0.6)); }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: 14px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid transparent; transition: all .2s; white-space: nowrap;
}
.nav-links a span { font-family: var(--mono); color: var(--dim); margin-right: 6px; font-size: 12px; }
.nav-links a:hover { color: var(--text); text-decoration: none; background: rgba(47, 140, 255, 0.1); }
.nav-links a.active { color: var(--text); border-color: var(--line-strong); background: rgba(47, 140, 255, 0.14); box-shadow: 0 0 20px rgba(47, 140, 255, 0.25) inset; }
.nav-links a.active span { color: var(--cyan); }
@media (max-width: 760px) {
  .nav .wrap { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .nav-links { margin-left: 0; width: 100%; justify-content: space-between; gap: 4px; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .nav-links a .long { display: none; }
}

/* ---------- hero ---------- */
.hero { padding: 88px 0 56px; position: relative; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan); padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(56, 214, 255, 0.06);
}
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; animation: pulse 1.8s infinite; }
.kicker.red { color: var(--red); border-color: rgba(255, 77, 99, 0.45); background: rgba(255, 77, 99, 0.07); }
.kicker.green { color: var(--green); border-color: rgba(47, 217, 140, 0.45); background: rgba(47, 217, 140, 0.07); }
.kicker.violet { color: var(--violet); border-color: rgba(155, 123, 255, 0.45); background: rgba(155, 123, 255, 0.08); }
@keyframes pulse { 50% { opacity: .35; } }

h1 {
  font-size: clamp(40px, 7vw, 84px); line-height: 1.02; letter-spacing: -0.03em;
  margin: 22px 0 18px; font-weight: 700;
}
.grad { background: linear-gradient(100deg, #fff 10%, var(--cyan) 50%, var(--blue) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-red { background: linear-gradient(100deg, #fff 10%, #ff8a98 45%, var(--red) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-green { background: linear-gradient(100deg, #fff 10%, #7ff0bd 45%, var(--green) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-violet { background: linear-gradient(100deg, #fff 10%, #c7b6ff 45%, var(--violet) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 760px; margin: 0; }
.lede strong { color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 44px; }
.stat {
  padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); box-shadow: 0 0 14px var(--blue); }
.stat.red::before { background: var(--red); box-shadow: 0 0 14px var(--red); }
.stat.green::before { background: var(--green); box-shadow: 0 0 14px var(--green); }
.stat.violet::before { background: var(--violet); box-shadow: 0 0 14px var(--violet); }
.stat .num { font-family: var(--mono); font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 14px; margin-top: 6px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- sections ---------- */
section { padding: 56px 0; }
.sec-head { margin-bottom: 28px; }
.sec-num { font-family: var(--mono); color: var(--cyan); font-size: 13px; letter-spacing: 0.2em; }
h2 { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; margin: 8px 0 10px; letter-spacing: -0.02em; }
h3 { font-size: 21px; margin: 0 0 8px; }
.sec-head p { color: var(--muted); max-width: 760px; margin: 0; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; position: relative;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.figure { padding: 10px; border-radius: var(--radius); background: #0b1530; border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(47, 140, 255, 0.35); }
.figure img { border-radius: 10px; width: 100%; }

/* reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- agents ---------- */
.agent { text-align: left; transition: transform .25s, border-color .25s; }
.agent:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.hex {
  width: 58px; height: 64px; display: grid; place-items: center; font-size: 26px; margin-bottom: 14px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, rgba(56, 214, 255, 0.35), rgba(47, 140, 255, 0.12));
}
.agent .role { color: var(--muted); font-size: 15px; margin: 0; }
.agent .uid { font-family: var(--mono); font-size: 12.5px; color: var(--cyan); margin-top: 12px; display: inline-block; }
.agent.queen .hex { background: linear-gradient(160deg, rgba(255, 190, 61, 0.45), rgba(255, 190, 61, 0.1)); }

/* ---------- terminal ---------- */
.term {
  background: #040915; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(47, 140, 255, 0.06) inset;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #0a1430; border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3a63; display: block; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-title { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-bar button { margin-left: auto; }
.term pre {
  margin: 0; padding: 18px 20px; font-size: 13.5px; line-height: 1.7; color: #cfe0ff;
  white-space: pre-wrap; word-break: break-word; min-height: 3em;
}
.term .t-tool { color: var(--cyan); font-weight: 700; }
.term .t-err { color: var(--red); }
.term .t-ok { color: var(--green); }
.term .t-dim { color: var(--dim); }
.term .t-warn { color: var(--amber); }
.term .t-red { color: #ff8a98; background: rgba(255, 77, 99, 0.12); }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--cyan); vertical-align: text-bottom; animation: pulse 1s steps(1) infinite; }

.btn {
  font: inherit; font-size: 14px; cursor: pointer; color: var(--text);
  background: rgba(47, 140, 255, 0.14); border: 1px solid var(--line-strong);
  padding: 7px 14px; border-radius: 999px; transition: all .2s; font-family: var(--sans);
}
.btn:hover { background: rgba(47, 140, 255, 0.28); box-shadow: 0 0 18px rgba(47, 140, 255, 0.35); }
.btn:focus-visible, .chip-btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn.small { font-size: 12.5px; padding: 4px 11px; }
.btn.primary { background: linear-gradient(120deg, var(--blue), #1fb6ff); border-color: transparent; font-weight: 600; color: #021027; }
.btn.primary:hover { box-shadow: 0 0 28px rgba(56, 214, 255, 0.6); }

/* ---------- tags / labels ---------- */
.tag { display: inline-block; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; vertical-align: middle; }
.tag.verified { color: var(--green); border-color: rgba(47, 217, 140, 0.5); background: rgba(47, 217, 140, 0.08); }
.tag.breach, .tag.critical { color: var(--red); border-color: rgba(255, 77, 99, 0.55); background: rgba(255, 77, 99, 0.1); }
.tag.hyp { color: var(--violet); border-color: rgba(155, 123, 255, 0.55); background: rgba(155, 123, 255, 0.1); }
.tag.expected, .tag.medium { color: var(--amber); border-color: rgba(255, 190, 61, 0.5); background: rgba(255, 190, 61, 0.08); }
.tag.high { color: #ff8f5a; border-color: rgba(255, 143, 90, 0.5); background: rgba(255, 143, 90, 0.08); }
.tag.low, .tag.info { color: var(--muted); border-color: var(--line-strong); background: rgba(143, 166, 209, 0.08); }
.tag.l1 { color: var(--amber); border-color: rgba(255, 190, 61, 0.5); }
.tag.l2 { color: var(--cyan); border-color: rgba(56, 214, 255, 0.5); }
.tag.l3 { color: var(--green); border-color: rgba(47, 217, 140, 0.6); background: rgba(47, 217, 140, 0.12); }

/* ---------- attack board (R1) ---------- */
.attacks { display: grid; gap: 12px; }
.attack {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 16px;
  padding: 16px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  cursor: pointer; transition: all .25s; text-align: left; font: inherit; color: inherit; width: 100%;
}
.attack:hover { border-color: var(--line-strong); transform: translateX(4px); }
.attack .n { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--dim); }
.attack .t { font-weight: 600; font-size: 18px; }
.attack .s { color: var(--muted); font-size: 14.5px; }
.attack.breach { border-color: rgba(255, 77, 99, 0.55); background: linear-gradient(90deg, rgba(255, 77, 99, 0.16), rgba(16, 32, 70, 0.55) 60%); box-shadow: 0 0 40px -10px rgba(255, 77, 99, 0.45); }
.attack.breach .n { color: var(--red); }
.attack.warn { border-color: rgba(255, 190, 61, 0.4); }
.attack.warn .n { color: var(--amber); }
.attack.held .n { color: var(--green); }
.attack-detail { display: none; padding: 4px 4px 4px 76px; color: var(--muted); font-size: 15px; }
.attack-detail.open { display: block; animation: fadeIn .35s ease; }
.attack-detail q { color: var(--text); font-style: italic; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 600px) {
  .attack { grid-template-columns: 40px 1fr; }
  .attack > :last-child { grid-column: 2; justify-self: start; }
  .attack-detail { padding-left: 4px; }
}

/* big quote */
.quote {
  font-size: clamp(22px, 3.4vw, 34px); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em;
  padding: 34px 36px; border-radius: 20px; position: relative;
  background: linear-gradient(135deg, rgba(255, 77, 99, 0.14), rgba(16, 32, 70, 0.6));
  border: 1px solid rgba(255, 77, 99, 0.4);
}
.quote .who { display: block; font-size: 14px; font-weight: 400; font-family: var(--mono); color: var(--muted); margin-top: 16px; letter-spacing: 0; }
.quote.blue { background: linear-gradient(135deg, rgba(47, 140, 255, 0.18), rgba(16, 32, 70, 0.6)); border-color: var(--line-strong); }

/* lists */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { padding-left: 32px; position: relative; color: var(--muted); }
.ticks li strong { color: var(--text); }
.ticks li::before { content: "▸"; position: absolute; left: 6px; color: var(--cyan); }
.ticks.red li::before { color: var(--red); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); background: rgba(10, 21, 48, 0.8); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(47, 140, 255, 0.07); }
td.bad { color: #ff8a98; }
td.good { color: #7ff0bd; }

/* ---------- permission matrix (R2) ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  font: inherit; font-family: var(--mono); font-size: 14px; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--line); padding: 8px 16px; border-radius: 10px; transition: all .2s;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active { color: #021027; background: var(--cyan); border-color: var(--cyan); font-weight: 700; box-shadow: 0 0 24px rgba(56, 214, 255, 0.45); }
.matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cell {
  padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10, 21, 48, 0.7);
  transition: all .35s; position: relative; overflow: hidden;
}
.cell .path { font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-all; }
.cell .perm { display: flex; gap: 8px; margin-top: 10px; font-family: var(--mono); font-size: 12.5px; }
.cell .perm b { padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.cell .perm .y { color: var(--green); background: rgba(47, 217, 140, 0.12); }
.cell .perm .n { color: var(--red); background: rgba(255, 77, 99, 0.1); }
.cell .perm .na { color: var(--dim); background: rgba(93, 115, 160, 0.12); }
.cell.open { border-color: rgba(47, 217, 140, 0.5); box-shadow: 0 0 26px -8px rgba(47, 217, 140, 0.55); }
.cell.flash { animation: flash .5s ease; }
@keyframes flash { from { transform: scale(0.96); opacity: .4; } }

/* attack console (R2) */
.console { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
@media (max-width: 860px) { .console { grid-template-columns: 1fr; } }
.cmd-list { display: grid; gap: 8px; align-content: start; }
.chip-btn {
  text-align: left; font: inherit; font-family: var(--mono); font-size: 13px; cursor: pointer; color: #cfe0ff;
  background: rgba(10, 21, 48, 0.75); border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; transition: all .2s;
  word-break: break-all;
}
.chip-btn:hover { border-color: var(--line-strong); background: rgba(47, 140, 255, 0.12); }
.chip-btn.active { border-color: var(--red); background: rgba(255, 77, 99, 0.1); color: var(--text); }
.chip-btn small { display: block; font-family: var(--sans); color: var(--muted); font-size: 12.5px; margin-bottom: 2px; word-break: normal; }

/* layers */
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.layer { padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.layer .big { font-family: var(--mono); font-size: 34px; font-weight: 700; }
.layer.l1 .big { color: var(--amber); } .layer.l2 .big { color: var(--cyan); } .layer.l3 .big { color: var(--green); }
.layer.l3 { border-color: rgba(47, 217, 140, 0.5); box-shadow: 0 0 40px -12px rgba(47, 217, 140, 0.5); }
.layer p { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }
@media (max-width: 700px) { .layers { grid-template-columns: 1fr; } }

/* split R1/R2 */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split .term.r1 { border-color: rgba(255, 77, 99, 0.5); }
.split .term.r2 { border-color: rgba(47, 217, 140, 0.5); }
.verdict { margin-top: 12px; font-weight: 700; font-family: var(--mono); font-size: 14px; }
.verdict.bad { color: var(--red); } .verdict.good { color: var(--green); }

/* ---------- cipher (TX) ---------- */
.tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.tile {
  width: 34px; height: 44px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 19px;
  border-radius: 8px; background: rgba(10, 21, 48, 0.9); border: 1px solid var(--line); color: var(--cyan);
  transition: transform .45s, background .45s, color .45s, border-color .45s; perspective: 400px;
}
.tile.gap { width: 14px; background: transparent; border: 0; }
.tile.solved { color: #fff; background: linear-gradient(160deg, rgba(155, 123, 255, 0.55), rgba(47, 140, 255, 0.3)); border-color: rgba(155, 123, 255, 0.7); transform: rotateX(360deg); }
@media (max-width: 600px) { .tile { width: 26px; height: 36px; font-size: 15px; } .tile.gap { width: 8px; } }

.lab { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
@media (max-width: 860px) { .lab { grid-template-columns: 1fr; } }
.ctrl label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13.5px; color: var(--muted); margin: 14px 0 6px; }
.ctrl label b { color: var(--cyan); font-size: 15px; }
input[type=range] { width: 100%; accent-color: var(--cyan); }
.formula { font-family: var(--mono); font-size: 20px; padding: 14px 16px; border-radius: 12px; background: #040915; border: 1px solid var(--line); text-align: center; }
.formula b { color: var(--cyan); }
.meter { height: 10px; border-radius: 999px; background: rgba(93, 115, 160, 0.2); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--amber), var(--green)); transition: width .3s; border-radius: inherit; }
.out-text { font-family: var(--mono); font-size: 16px; line-height: 1.8; word-break: break-all; padding: 18px; border-radius: 12px; background: #040915; border: 1px solid var(--line); min-height: 120px; transition: border-color .3s, box-shadow .3s; }
.out-text.hit { border-color: var(--green); box-shadow: 0 0 34px -8px rgba(47, 217, 140, 0.6); color: #fff; }
.status-line { font-family: var(--mono); font-size: 13px; margin-top: 10px; color: var(--muted); }
.status-line.hit { color: var(--green); }

/* chat mock */
.chat { display: grid; gap: 12px; }
.bubble { max-width: 88%; padding: 13px 16px; border-radius: 16px; font-size: 15px; }
.bubble.user { justify-self: end; background: rgba(47, 140, 255, 0.22); border: 1px solid var(--line-strong); border-bottom-right-radius: 4px; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.bubble.bot { background: rgba(10, 21, 48, 0.9); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--muted); }
.bubble.bot.err { border-color: rgba(255, 77, 99, 0.5); color: #ff8a98; }
.bubble .who { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--dim); margin-bottom: 4px; text-transform: uppercase; }
.streaming .ghost { color: var(--text); opacity: 0.85; }
.strike { text-decoration: line-through; text-decoration-color: var(--red); opacity: .45; }

.timeline { position: relative; display: grid; gap: 14px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--violet), var(--cyan)); }
.timeline li { list-style: none; position: relative; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
.timeline li strong { color: var(--text); }

.hyp-bar { display: grid; grid-template-columns: 170px 1fr 46px; align-items: center; gap: 12px; margin: 10px 0; font-size: 14.5px; }
.hyp-bar .bar { height: 12px; border-radius: 999px; background: rgba(93, 115, 160, 0.2); overflow: hidden; }
.hyp-bar .bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.hyp-bar .pct { font-family: var(--mono); color: var(--muted); font-size: 13px; text-align: right; }
@media (max-width: 600px) { .hyp-bar { grid-template-columns: 1fr 40px; } .hyp-bar .bar { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- footer / next ---------- */
.next {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 30px 32px; border-radius: 20px; border: 1px solid var(--line-strong);
  background: linear-gradient(120deg, rgba(47, 140, 255, 0.2), rgba(56, 214, 255, 0.06));
  transition: all .3s; color: var(--text);
}
.next:hover { text-decoration: none; box-shadow: 0 0 50px -10px rgba(56, 214, 255, 0.5); transform: translateY(-2px); }
.next .lbl { font-family: var(--mono); font-size: 12.5px; color: var(--cyan); letter-spacing: 0.16em; }
.next .ttl { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
.next .arrow { font-size: 34px; color: var(--cyan); }
footer { padding: 40px 0 60px; color: var(--dim); font-size: 14px; border-top: 1px solid var(--line); margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
footer a { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; }

.callout { border-left: 3px solid var(--cyan); padding: 14px 18px; background: rgba(56, 214, 255, 0.06); border-radius: 0 12px 12px 0; color: var(--muted); }
.callout strong { color: var(--text); }
.callout.red { border-color: var(--red); background: rgba(255, 77, 99, 0.07); }
.callout.green { border-color: var(--green); background: rgba(47, 217, 140, 0.07); }
.mt { margin-top: 18px; } .mt2 { margin-top: 32px; }
.muted { color: var(--muted); }
.center { text-align: center; }
@media (prefers-reduced-motion: reduce) { .tile, .tile.solved { transition: none; transform: none; } }
