/* Avasis Exchange v2. Tokens first; see DESIGN-v2.md. No gradients, no glows, no purple. */
:root {
  --bg: #09090b; --surface: #111113; --surface-2: #18181b; --line: #27272a; --line-2: #3f3f46;
  --text: #fafafa; --text-2: #d4d4d8; --muted: #a1a1aa; --faint: #52525b; --ink: #09090b;
  --paid: #f0b100; --pass: #3fb950;
  --wall: #18181b;
  --plus: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28'><path d='M14 11v6M11 14h6' stroke='%2327272a' stroke-width='1'/></svg>");
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1180px; --pad: 40px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #fafafa; --surface: #ffffff; --surface-2: #f4f4f5; --line: #e4e4e7; --line-2: #d4d4d8;
  --text: #09090b; --text-2: #27272a; --muted: #52525b; --faint: #a1a1aa; --ink: #fafafa;
  --paid: #7a4a00; --pass: #14532d;
  --wall: #e4e4e7;
  --plus: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28'><path d='M14 11v6M11 14h6' stroke='%23e4e4e7' stroke-width='1'/></svg>");
  color-scheme: light;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; } }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text-2); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a.link:hover { text-decoration-color: var(--text); }
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
code, pre, kbd, .mono { font-family: var(--mono); }
code { font-size: .92em; padding: 1px 5px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; color: var(--text); }
pre { margin: 0; overflow-x: auto; font-size: 13px; line-height: 1.7; }
pre code { border: 0; padding: 0; background: none; font-size: inherit; }
h1, h2, h3, h4 { color: var(--text); font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
h1 { font-size: 64px; }
h2 { font-size: 40px; }
h3 { font-size: 28px; letter-spacing: -0.015em; }
h4 { font-size: 20px; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { font-size: 19px; line-height: 1.55; color: var(--text-2); max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono-cap { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mark { height: 22px; width: auto; color: var(--muted); }
.mark svg { height: 100%; width: auto; fill: currentColor; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- frame ---------- */
.bar { border-bottom: 1px solid var(--line); background: var(--surface); font: 400 14px/1.4 var(--sans); color: var(--text-2); }
.bar .in { max-width: var(--max); margin: 0 auto; padding: 10px var(--pad); display: flex; gap: 12px; align-items: center; justify-content: center; }
.bar a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.bar button { margin-left: auto; color: var(--muted); }
.nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav .in { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--text); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand small { font: 400 12px/1 var(--mono); color: var(--muted); letter-spacing: .04em; }
.brand .logo { width: 22px; height: 22px; align-self: center; }
.nav nav { display: flex; gap: 22px; font-size: 15px; color: var(--text-2); }
.nav nav a[aria-current="page"] { color: var(--text); }
.nav nav a:hover { color: var(--text); }
.nav .right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.nav .lbl-s { display: none; }
.frame { max-width: var(--max); margin: 0 auto; border-left: 1px dashed var(--line); border-right: 1px dashed var(--line); }
.divider { border-top: 1px dashed var(--line); padding: 10px var(--pad); font: 400 12px/1.4 var(--mono); color: var(--muted); }
.sec { padding: 72px var(--pad); }
.sec.tight { padding: 48px var(--pad); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; font: 500 13px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text); border: 1px solid var(--line-2); white-space: nowrap; transition: background-color .16s ease-out, border-color .16s ease-out, color .16s ease-out; }
.btn:hover { border-color: var(--text); }
.btn .i { width: 15px; height: 15px; }
.btn-primary { background: var(--text); color: var(--ink); border-color: var(--text); }
.btn-primary:hover { background: var(--text-2); border-color: var(--text-2); }
.btn-bracket { position: relative; border-color: transparent; }
.btn-bracket::before, .btn-bracket::after, .btn-bracket .bk::before, .btn-bracket .bk::after { content: ""; position: absolute; width: 8px; height: 8px; border: 0 solid var(--text); }
.btn-bracket::before { left: -1px; top: -1px; border-top-width: 1px; border-left-width: 1px; }
.btn-bracket::after { right: -1px; bottom: -1px; border-bottom-width: 1px; border-right-width: 1px; }
.btn-bracket .bk::before { right: -1px; top: -1px; border-top-width: 1px; border-right-width: 1px; }
.btn-bracket .bk::after { left: -1px; bottom: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.btn-bracket:hover { background: var(--surface-2); border-color: transparent; }
.btn-paid { background: var(--paid); border-color: var(--paid); color: #09090b; }
.btn-paid:hover { filter: none; background: var(--paid); opacity: .9; }
.btn.icon { padding: 0 10px; border-color: transparent; }
.theme-toggle .sun { display: none; } [data-theme="light"] .theme-toggle .sun { display: block; } [data-theme="light"] .theme-toggle .moon { display: none; }
.btn.icon:hover { border-color: var(--line-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; padding: 88px var(--pad) 72px; align-items: start; }
.hero .label { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-bottom: 28px; display: flex; align-items: center; gap: 8px; }
.hero .label i { width: 6px; height: 6px; border-radius: 50%; background: var(--pass); }
.hero h1 { max-width: 15ch; font-size: clamp(44px, 4.6vw, 64px); }
.hero .lede { margin-top: 24px; }
.hero .actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero .note { margin-top: 16px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.live { margin-top: 14px; border: 1px solid var(--line); background: var(--surface); padding: 12px 14px; font: 400 12px/1.6 var(--mono); color: var(--muted); display: flex; gap: 10px; align-items: center; }
.live b { color: var(--pass); font-weight: 500; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--pass); flex: none; }

/* ---------- stacked paper code panel ---------- */
.paper { position: relative; z-index: 0; }
.paper::before, .paper::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); background: var(--surface); z-index: -1; }
.paper::before { transform: translate(6px, 6px); }
.paper::after { transform: translate(12px, 12px); opacity: .55; }
.panel { border: 1px solid var(--line); background: var(--surface); }
.panel .head { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 4px; border-bottom: 1px solid var(--line); height: 44px; font: 400 13px/1 var(--mono); color: var(--muted); overflow-x: auto; }
.panel .head .t { padding: 0 12px; height: 44px; display: inline-flex; align-items: center; gap: 8px; border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.panel .head .t[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.panel .head .t .mark { height: 14px; color: inherit; }
.panel .head .copy { margin-left: auto; }
.panel .body { padding: 18px 20px; }
.panel .foot { border-top: 1px solid var(--line); padding: 12px 20px; font: 400 12px/1.4 var(--mono); color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.panel .foot a { color: var(--text); }
.copy { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/1 var(--mono); color: var(--muted); padding: 6px 8px; }
.copy:hover { color: var(--text); }
.copy.done { color: var(--pass); }
.term { font: 400 13px/1.7 var(--mono); color: var(--text-2); min-height: 300px; white-space: pre-wrap; word-break: break-word; }
.term .c { color: var(--muted); }
.term .k { color: var(--text); }
.term .p { color: var(--paid); }
.term .g { color: var(--pass); }
.term .cur { display: inline-block; width: 7px; height: 14px; background: var(--text); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tok-s { color: var(--pass); } .tok-k { color: var(--text); } .tok-c { color: var(--muted); } .tok-n { color: var(--paid); }

/* ---------- marks band ---------- */
.marks { padding: 28px var(--pad); display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.marks .lead { font: 400 14px/1.4 var(--sans); color: var(--muted); margin-right: 8px; }
.marks .lead b { color: var(--text); font-weight: 500; }
.marks .m { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font: 500 14px/1 var(--sans); }
.marks .m .mark { height: 20px; color: inherit; }
.marks .m:hover { color: var(--text); }

/* ---------- pivot ---------- */
.pivot { display: grid; grid-template-columns: 6fr 6fr; gap: 56px; align-items: start; }
.pivot h2 { max-width: 16ch; }
.pivot p + p { margin-top: 14px; }

/* ---------- board cards ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.pcard { border: 1px solid var(--line); background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 220px; transition: border-color .16s ease-out; }
.pcard:hover { border-color: var(--line-2); }
.pcard .top { display: flex; justify-content: space-between; gap: 12px; align-items: center; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.pcard .top .src { display: inline-flex; gap: 6px; align-items: center; }
.pcard .top .src .mark { height: 14px; color: inherit; }
.pcard h3 { font-size: 17px; line-height: 1.35; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .sig { font: 400 12px/1.5 var(--mono); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .meta { margin-top: auto; display: flex; gap: 14px; font: 400 12px/1.4 var(--mono); color: var(--muted); flex-wrap: wrap; align-items: center; }
.pcard .meta .paid { color: var(--paid); }
.pcard .meta .pass { color: var(--pass); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; flex-wrap: wrap; }

/* ---------- cta on the wall ---------- */
.cta { position: relative; overflow: hidden; padding: 120px var(--pad); text-align: left; }
.cta .wall { position: absolute; inset: 0; margin: 0; font: 400 12px/1.15 var(--mono); color: var(--wall); pointer-events: none; user-select: none; white-space: pre; overflow: hidden; }
.cta .in { position: relative; max-width: 640px; }
.cta .in p { margin-top: 12px; color: var(--muted); }
.cta .actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.cta .paper { margin-top: 32px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); }
footer .in { max-width: var(--max); margin: 0 auto; padding: 40px var(--pad); display: grid; grid-template-columns: 5fr 2fr 2fr 3fr; gap: 32px; font-size: 14px; color: var(--muted); }
footer h5 { margin: 0 0 12px; font: 500 12px/1.4 var(--mono); letter-spacing: .04em; color: var(--muted); }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
footer a:hover { color: var(--text); }
footer .honest { margin-top: 14px; font: 400 12px/1.6 var(--mono); color: var(--muted); max-width: 44ch; }
footer .social { display: flex; gap: 14px; margin-top: 12px; }
footer .social .mark { height: 18px; }

/* ---------- page: problems ---------- */
.filters { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; align-items: center; }
.filters input { height: 40px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 0 12px; font: 400 14px/1 var(--mono); min-width: 280px; }
.filters input:focus { border-color: var(--text); outline: 0; }
.filters .btn[aria-pressed="true"] { border-color: var(--text); background: var(--surface-2); }
.count { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-left: auto; }

/* ---------- page: problem ---------- */
.crumbs { font: 400 12px/1.4 var(--mono); color: var(--muted); display: flex; gap: 8px; margin-bottom: 20px; }
.crumbs a:hover { color: var(--text); }
.ptitle { display: grid; grid-template-columns: 8fr 4fr; gap: 40px; align-items: end; }
.ptitle h1 { font-size: 40px; }
.ptitle .tags { display: flex; gap: 8px; flex-wrap: wrap; font: 400 12px/1 var(--mono); color: var(--muted); margin-bottom: 14px; }
.ptitle .tags span { border: 1px solid var(--line); padding: 6px 8px; }
.ptitle .tags .solved { color: var(--pass); border-color: var(--pass); }
.sig-block { margin-top: 28px; border: 1px solid var(--line); background: var(--surface); padding: 16px 20px; }
.sig-block .mono-cap { margin-bottom: 8px; }
.sig-block .s { font: 400 13px/1.7 var(--mono); color: var(--text); white-space: pre-wrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-top: 0; }
.facts > div { padding: 14px 20px; border-right: 1px solid var(--line); background: var(--surface); }
.facts > div:last-child { border-right: 0; }
.facts .k { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.facts .v { color: var(--text); font-size: 15px; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.facts .v .mark { height: 14px; }
.prose { max-width: 76ch; }
.prose p, .prose li { color: var(--text-2); font-size: 15.5px; }
.prose p + p, .prose p + pre, .prose pre + p, .prose ul, .prose ol, .prose table, .prose h2, .prose h3 { margin-top: 16px; }
.prose h2 { font-size: 24px; margin-top: 28px; } .prose h3 { font-size: 18px; margin-top: 22px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; font-size: 12.5px; }
.prose table { width: 100%; border-collapse: collapse; font: 400 13px/1.5 var(--mono); }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 400; }
/* ---------- docs / publish ---------- */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 48px; margin-top: 40px; }
.toc { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.toc .mono-cap { margin: 14px 0 6px; }
.toc a { color: var(--muted); } .toc a:hover { color: var(--text); }
.docs h2 { font-size: 26px; margin-top: 48px; padding-top: 24px; border-top: 1px dashed var(--line); }
.docs h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.docs p { margin-top: 12px; font-size: 15px; }
.docs .paper { margin-top: 16px; }
.docs table { width: 100%; border-collapse: collapse; font: 400 13px/1.5 var(--mono); margin-top: 16px; }
.docs th, .docs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs th { color: var(--muted); font-weight: 400; }
.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.terms > div { border: 1px solid var(--line); background: var(--surface); padding: 22px; }
.terms h4 { font-size: 16px; margin-bottom: 8px; }
.terms p { font-size: 14.5px; color: var(--muted); }
.terms .big { font: 500 40px/1 var(--mono); color: var(--text); margin-bottom: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) and (min-width: 1001px) {
  .marks { gap: 28px; }
  .hero { gap: 36px; }
}
@media (max-width: 1000px) {
  :root { --pad: 24px; }
  h1 { font-size: 48px; } h2 { font-size: 32px; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 48px; }
  .pivot, .tools, .who, .faq, .case, .numbers, .sol, .mid-task, .docs, .ptitle { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 40px; padding-top: 56px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(2) { border-right: 0; }
  .facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case > div:first-child, .sol .buy { border-right: 0; border-left: 0; border-top: 1px solid var(--line); }
  .mid-task > div:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .num-panel:nth-child(1), .num-panel:nth-child(3) { border-right-width: 0; }
  .num-panel:nth-child(3) { border-bottom-width: 1px; }
  .toc { position: static; }
  footer .in { grid-template-columns: 1fr 1fr; }
  .nav nav { display: none; }
  .terms { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dash .toc { display: flex; flex-wrap: wrap; gap: 6px 18px; }
}
@media (max-width: 640px) {
  :root { --pad: 18px; }
  h1 { font-size: 38px; } h2 { font-size: 28px; } h3 { font-size: 22px; }
  .lede { font-size: 17px; }
  .board { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav .in { gap: 12px; height: 56px; }
  .nav .right .btn-bracket, .nav .right .gh { display: none; }
  .nav .lbl { display: none; } .nav .lbl-s { display: inline; }
  .nav .right { gap: 6px; }
  .bar .in { font-size: 13px; }
  .hero .actions .btn, .cta .actions .btn { width: 100%; justify-content: center; }
  .num-panel .wall { display: none; }
  .marks { gap: 20px; }
  footer .in { grid-template-columns: 1fr; }
  .cta { padding: 80px var(--pad); }
  .divider, .bar .in { padding-left: var(--pad); padding-right: var(--pad); }
  .paper::after { display: none; }
}


/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; margin-top: 8px; }
.dash pre, .dash .panel .body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.dash .panel { max-width: 100%; }
.dash .toc a[aria-current="page"] { color: var(--text); }
.dash h2 { font-size: 26px; }
.dash .section { margin-top: 40px; padding-top: 24px; border-top: 1px dashed var(--line); }
.dash .section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.dash p { margin-top: 10px; font-size: 15px; }
.dash .paper { margin-top: 16px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); margin-top: 20px; }
.kv > div { padding: 18px 20px; border-right: 1px solid var(--line); background: var(--surface); }
.kv > div:last-child { border-right: 0; }
.kv .k { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.kv .v { font: 500 28px/1.1 var(--mono); color: var(--text); margin-top: 6px; letter-spacing: -0.01em; }
.kv .v.paid { color: var(--paid); } .kv .v.pass { color: var(--pass); }
.kv .s { font: 400 12px/1.5 var(--mono); color: var(--muted); margin-top: 4px; }
.tbl { width: 100%; border-collapse: collapse; font: 400 13px/1.5 var(--mono); margin-top: 16px; }
.tbl th, .tbl td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 400; }
.tbl td { color: var(--text-2); }
.tbl td.paid { color: var(--paid); } .tbl td.pass { color: var(--pass); }
.tbl .btn.sm { height: 28px; padding: 0 10px; font-size: 11px; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { margin-top: 16px; border: 1px dashed var(--line); padding: 18px 20px; font: 400 13px/1.6 var(--mono); color: var(--muted); }
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.door { border: 1px solid var(--line); background: var(--surface); padding: 24px; }
.door h3 { font-size: 20px; }
.door p { font-size: 14.5px; color: var(--muted); margin-top: 8px; }
.door form { margin-top: 16px; display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font: 400 12px/1.4 var(--mono); color: var(--muted); }
input.in, textarea.in, select.in { width: 100%; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); padding: 10px 12px; font: 400 14px/1.5 var(--mono); min-width: 0; }
input.in { height: 40px; padding: 0 12px; }
textarea.in { min-height: 120px; resize: vertical; }
input.in:focus, textarea.in:focus, select.in:focus { border-color: var(--text); outline: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.notice { margin-top: 16px; border: 1px solid var(--line); background: var(--surface); padding: 12px 14px; font: 400 13px/1.6 var(--mono); color: var(--text-2); }
.notice.ok { border-color: var(--pass); color: var(--pass); }
.notice.err { border-color: var(--paid); color: var(--paid); }
.status { font: 500 12px/1 var(--mono); border: 1px solid var(--line-2); padding: 5px 8px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); display: inline-block; }
.status.queued, .status.in_progress { color: var(--paid); border-color: var(--paid); }
.status.delivered, .status.paid { color: var(--pass); border-color: var(--pass); }
.tabs-in { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 16px; overflow-x: auto; }
.tabs-in [role="tab"] { padding: 10px 12px; font: 400 13px/1 var(--mono); color: var(--muted); border-bottom: 1px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs-in [role="tab"] .mark { height: 14px; color: inherit; }
.tabs-in [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.prompt-box { border: 1px solid var(--line); background: var(--surface); padding: 18px 20px; font: 400 13px/1.7 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; margin-top: 16px; }

/* ================= v3 ================= */
/* full-bleed hero on the wall */
.bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; }
.hero3 { position: relative; overflow: hidden; background: var(--bg); border-bottom: 1px dashed var(--line); }
.hero3 .hero-wall { position: absolute; inset: 0; margin: 0; font: 400 13px/1.05 var(--mono); color: var(--wall); opacity: .55; overflow: hidden; pointer-events: none; user-select: none; white-space: pre; }
.hero3 .in { position: relative; max-width: var(--max); margin: 0 auto; padding: 76px var(--pad) 64px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.hero3 .label { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-bottom: 26px; display: flex; align-items: center; gap: 8px; }
.hero3 .label i { width: 6px; height: 6px; border-radius: 50%; background: var(--pass); }
.hero3 h1 { max-width: 16ch; font-size: clamp(44px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.03em; }
.hero3 .lede { margin-top: 22px; max-width: 46ch; font-size: 18px; }
.hero3 .actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hsearch { margin-top: 30px; display: flex; align-items: stretch; border: 1px solid var(--line-2); background: var(--surface); padding: 6px 6px 6px 16px; gap: 8px; max-width: 640px; }
.hsearch .prompt { align-self: center; font: 500 20px/1 var(--mono); color: var(--paid); }
.hsearch input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: 400 17px/1.4 var(--mono); padding: 10px 6px; caret-color: var(--paid); }
.hsearch input::placeholder { color: var(--muted); }
.hsearch input:focus { outline: none; }
.hsearch:focus-within { border-color: var(--text); }
.hsearch .btn { flex: none; }

/* connect home + how tiles */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; align-items: start; }
.row.wrap { flex-wrap: wrap; gap: 12px; }
.howtiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.howtile { border: 1px solid var(--line); background: var(--surface); padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.howtile .hn { display: flex; align-items: center; gap: 10px; font: 500 22px/1.2 var(--sans); color: var(--text); }
.howtile .hn .i { width: 20px; height: 20px; color: var(--paid); }
.howtile p { color: var(--muted); font-size: 14px; }
.howtile .paper { margin: 0; }
.howtile .panel .head { flex-wrap: wrap; }
.ref { border: 1px solid var(--line); background: var(--surface); }
.ref > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; font: 500 16px/1.3 var(--sans); color: var(--text); }
.ref > summary::-webkit-details-marker { display: none; }
.ref > summary .i { width: 18px; height: 18px; transition: transform .16s ease-out; }
.ref[open] > summary .i { transform: rotate(45deg); }
.ref-body { padding: 0 22px 22px; }
.ref-item { padding: 22px 0; border-top: 1px dashed var(--line); }
.ref-head { display: flex; gap: 12px; align-items: center; }
.ref-head code { font-size: 15px; color: var(--text); }
.ref-item p { margin-top: 8px; color: var(--muted); font-size: 14px; max-width: 80ch; }
.ref-item .two { margin-top: 14px; }
.ref-item table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.ref-item th, .ref-item td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref-item th { font: 400 12px/1.4 var(--mono); color: var(--muted); }

/* problem page v3 */
.facts .v.heat { display: inline-flex; gap: 6px; align-items: center; font-family: var(--mono); }
.facts .v.heat .i { width: 14px; height: 14px; }
.ctx { margin-top: 28px; border: 1px solid var(--line); background: var(--surface); padding: 0 20px; }
.ctx > summary { cursor: pointer; padding: 14px 0; font: 400 12px/1.4 var(--mono); color: var(--muted); list-style: none; }
.ctx > summary::-webkit-details-marker { display: none; }
.ctx > summary::before { content: "› "; color: var(--paid); }
.ctx[open] > summary::before { content: "‹ "; }
.ctx .prose { padding-bottom: 20px; }
/* responsive v3 */
@media (max-width: 1000px) {
  .hero3 .in { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 56px var(--pad) 48px; min-height: 0; }
  .hero3 h1 { font-size: clamp(38px, 8vw, 56px); }
  .two, .howtiles, .agents, .fixgrid { grid-template-columns: minmax(0, 1fr); }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nums > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .nums > div:nth-child(2n) { border-right: 0; }
}
@media (max-width: 640px) {
  .hsearch { flex-wrap: wrap; padding: 8px; }
  .hsearch .prompt { display: none; }
  .hsearch .btn { width: 100%; justify-content: center; }
  .nums { grid-template-columns: minmax(0, 1fr); }
  .nums > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .fixrow { grid-template-columns: minmax(0, 1fr) auto; }
  .fixrow .app, .fixrow .helped { display: none; }
  .leaders th:nth-child(3), .leaders td:nth-child(3), .leaders th:nth-child(5), .leaders td:nth-child(5) { display: none; }
}
/* v3 polish */
.howtile .panel .head, .connect-home .panel .head { height: auto; min-height: 44px; flex-wrap: wrap; overflow: visible; padding-top: 2px; padding-bottom: 2px; }
.howtile .panel .head .t { padding: 0 9px; height: 38px; font-size: 12px; }
.howtile .panel .body pre, .two .panel .body pre, .ref-item pre, .agent pre, .install pre, .install-line pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.hero3 .hero-wall { opacity: .8; }

/* ================= v4 ================= */
.hero3 .note { margin-top: 14px; font: 400 12px/1.6 var(--mono); color: var(--muted); }
.hero3 .lede { max-width: 50ch; }
.panel.install .foot a { display: inline-flex; gap: 6px; align-items: center; }
.panel.install .foot .i { width: 14px; height: 14px; }
.term.still { min-height: 0; }
.term.still span { display: block; }

/* numbers strip */
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px dashed var(--line); }
.nums > div { padding: 26px var(--pad); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.nums > div:last-child { border-right: 0; }
.nums b { font: 500 40px/1 var(--mono); color: var(--text); letter-spacing: -0.02em; }
.nums span { font: 400 12px/1.4 var(--mono); color: var(--muted); }

/* fix list rows */
.fixlist { border: 1px solid var(--line); background: var(--surface); }
.fixrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 110px 70px; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); transition: background-color .16s ease-out; }
.fixrow:last-child { border-bottom: 0; }
.fixrow:hover { background: var(--surface-2); }
.fixrow .app { display: inline-flex; gap: 8px; align-items: center; font: 400 12px/1.3 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixrow .app .mark { height: 14px; color: inherit; }
.fixrow .err { font: 400 13.5px/1.4 var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixrow .pass, .fixrow .helped { display: inline-flex; gap: 6px; align-items: center; font: 400 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.fixrow .pass.ok { color: var(--pass); }
.fixrow .i { width: 13px; height: 13px; }
.pcard .meta .pass { color: var(--pass); display: inline-flex; gap: 5px; align-items: center; }
.pcard .meta .i { width: 12px; height: 12px; }
.pcard .meta span { display: inline-flex; gap: 5px; align-items: center; }

/* leaders table */
.leaders { width: 100%; border-collapse: collapse; font-size: 15px; border: 1px solid var(--line); background: var(--surface); }
.leaders th, .leaders td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.leaders th { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.leaders td.mono { font-family: var(--mono); font-size: 14px; }
.leaders td.pass { color: var(--pass); }
.leaders tr:last-child td { border-bottom: 0; }

/* fix page */
.tags { display: flex; gap: 8px; flex-wrap: wrap; font: 400 12px/1 var(--mono); color: var(--muted); margin-bottom: 14px; }
.tags span { border: 1px solid var(--line); padding: 6px 8px; }
.tags .solved { color: var(--pass); border-color: var(--pass); }
.sig-h1 { font-family: var(--mono); font-weight: 500; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; max-width: 34ch; }
.sig-h1.long { font-size: clamp(18px, 1.7vw, 24px); max-width: 60ch; }
.facts .v.pass { color: var(--pass); }
.facts .v.mono.small { font-size: 12px; }
.fix .fixtitle { font-size: 30px; }
.fixgrid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 32px; margin-top: 28px; align-items: start; }
.block { margin-top: 24px; }
.block:first-child { margin-top: 0; }
.block .mono-cap { margin-bottom: 10px; }
.block.tried { border: 1px dashed var(--line-2); padding: 18px 20px; background: var(--surface); }
.block.tried .prose p, .block.tried .prose li { color: var(--text-2); }
.block.checkb .paper { margin-top: 4px; }
.report { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.report .msg { font: 400 12px/1.5 var(--mono); color: var(--pass); }
.fixside { position: sticky; top: 88px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); }
.kv1 { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.kv1:last-child { border-bottom: 0; }
.kv1 .k { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.kv1 .v { font: 500 26px/1.1 var(--mono); color: var(--text); margin-top: 6px; }
.kv1 .v.pass { color: var(--pass); }
.kv1 .s { font: 400 12px/1.5 var(--mono); color: var(--muted); margin-top: 4px; }
.install-line { max-width: 720px; }
.install-line p { color: var(--text-2); margin-bottom: 14px; }

/* connect page */
.agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.agent { border: 1px solid var(--line); background: var(--surface); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; scroll-margin-top: 90px; }
.agent .hn { display: flex; align-items: center; gap: 10px; font: 500 20px/1.2 var(--sans); color: var(--text); }
.agent .hn .mark, .agent .hn .i { height: 20px; width: 20px; color: var(--muted); }
.agent .paper { margin: 0; }
.agent .paper::after { display: none; }
.howtile .hn .i { color: var(--pass); }
.sec > .howtiles:first-child, .sec > .agents:first-child { margin-top: 0; }
.hero3 .hero-wall { opacity: .45; }
.reported { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reported .link { display: inline-flex; gap: 4px; align-items: center; }
.cta .wall { opacity: .6; }

/* v4 responsive (after the base rules so they win) */
@media (max-width: 1000px) {
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nums > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .nums > div:nth-child(2n) { border-right: 0; }
  .agents, .fixgrid { grid-template-columns: minmax(0, 1fr); }
  .fixside { position: static; }
  .fixrow { grid-template-columns: 100px minmax(0, 1fr) 90px 60px; gap: 12px; }
}
@media (max-width: 640px) {
  .nums { grid-template-columns: minmax(0, 1fr); }
  .nums > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .nums > div:last-child { border-bottom: 0; }
  .fixrow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .fixrow .app, .fixrow .helped { display: none; }
  .fixrow .err { white-space: normal; }
  .leaders th:nth-child(3), .leaders td:nth-child(3), .leaders th:nth-child(5), .leaders td:nth-child(5) { display: none; }
  .hero3 .in { padding-top: 40px; }
  .facts .v { flex-wrap: wrap; }
  .fix .fixtitle { font-size: 24px; }
}
.door pre, .door .panel .body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.door .paper::after { display: none; }
