:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #1b1b1b; --muted: #6b6b6b; --line: #e3e0da;
  --accent: #b3261e; --accent-ink: #ffffff; --ok: #1f7a3a; --warn: #9a6700; --side: #141414; --side-ink: #e9e7e3;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --panel: #1c1c1c; --ink: #ecebe8; --muted: #a3a19c; --line: #2e2d2b; --side: #0b0b0b; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 1rem .75rem; display: flex; flex-direction: column; gap: 1rem; }
.side .muted { color: #9c9a95; }
.brand-name { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brand-sub { font-size: .8rem; color: #9c9a95; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--side-ink); text-decoration: none; padding: .35rem .5rem; border-radius: 6px; display: flex; justify-content: space-between; gap: .5rem; }
.nav a:hover { background: #222; }
.nav a.active { background: var(--accent); color: var(--accent-ink); }
.nav a.active .muted { color: #f3d6d4; }
.nav-head { margin-top: .75rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #8a8883; padding: 0 .5rem; }
.who { margin-top: auto; }
.who a { color: var(--side-ink); }
.nav-toggle, .nav-burger { display: none; }
.main { padding: 1.5rem 2rem 3rem; max-width: 1100px; width: 100%; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat { font-size: 1.6rem; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .6rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.tag { display: inline-block; font-size: .75rem; padding: 0 .45rem; border-radius: 999px; background: var(--line); color: var(--ink); }
.tag.ok { background: #d8f0de; color: var(--ok); }
.tag.warn { background: #fbefd0; color: var(--warn); }
.tag.bad { background: #f8dad7; color: var(--accent); }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: .35rem .8rem; border-radius: 6px; cursor: pointer; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
textarea, input[type=text], input[type=url], select { font: inherit; width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
textarea { min-height: 4.5rem; }
input[type=checkbox] { width: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; }
.error { color: var(--accent); background: #f8dad7; padding: .5rem .75rem; border-radius: 6px; }
.answer { white-space: pre-wrap; }
.tabs { display: flex; gap: .25rem; margin: .75rem 0; flex-wrap: wrap; }
.tabs button.on { background: var(--ink); color: var(--panel); }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: .6rem 1rem; background: #fbefd0; color: #000; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { padding: .75rem 16px; }
  .nav-burger { display: inline-block; color: var(--side-ink); cursor: pointer; }
  .nav { display: none; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .main { padding: 1rem 16px 3rem; }
  .grid2 { grid-template-columns: 1fr; }
  th, td { font-size: .9rem; }
}
.bare { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.login form { display: flex; flex-direction: column; gap: .6rem; }
.login label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.login input[type=password] { font: inherit; width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.wide { width: 100%; text-align: center; display: block; }
.or { text-align: center; color: var(--muted); font-size: .85rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--side-ink); text-decoration: underline; cursor: pointer; }

/* ---- Route map (landing page): full window ---- */
.main:has(.rm-wrap) { max-width: none; padding: 0; }
.rm-wrap { position: relative; height: 100vh; overflow: hidden; background: #070c15; }
.rm-map { position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, #12233a 0%, #0b1626 45%, #070c15 100%); }
.rm-board { position: absolute; top: 14px; left: 14px; right: 70px; max-width: 760px; z-index: 3; background: rgba(5, 8, 13, .82); backdrop-filter: blur(6px); border: 1px solid #1d2633; border-radius: 10px; padding: .6rem .8rem; color: #ffb648; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.rm-board-title { display: flex; gap: .75rem; align-items: baseline; color: #c9d6e8; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; margin-bottom: .45rem; }
.rm-board-code { color: #ffb648; font-weight: 700; font-size: 1.05rem; }
.rm-board-rows { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.rm-flap { display: flex; justify-content: space-between; align-items: center; gap: .4rem; background: #0e141d; border: 1px solid #1d2633; border-radius: 4px; padding: .3rem .5rem; color: #8ea2bd; text-decoration: none; font-size: .72rem; letter-spacing: .08em; }
.rm-flap b { color: #ffb648; font-size: 1.05rem; font-weight: 700; background: #05080d; padding: 0 .3rem; border-radius: 3px; box-shadow: inset 0 -1px 0 #1d2633, inset 0 1px 0 #000; }
.rm-flap:hover { border-color: #ffb648; }
.rm-full { position: absolute; top: 14px; right: 14px; z-index: 3; width: 42px; height: 42px; font-size: 1.2rem; background: rgba(5, 8, 13, .82); color: #c9d6e8; border: 1px solid #1d2633; border-radius: 8px; }
.rm-full:hover { border-color: #ffb648; color: #ffb648; }
.rm-wrap .rm-legend { position: absolute; left: 14px; bottom: 12px; z-index: 3; color: #8ea2bd; background: rgba(5, 8, 13, .7); padding: .35rem .6rem; border-radius: 8px; }
.rm-wrap .rm-legend .muted { color: #5a7798; }
.rm-wrap > .error { position: absolute; bottom: 60px; left: 14px; z-index: 3; }
.rm-loading { color: #8ea2bd; padding: 1rem; font-family: ui-monospace, Menlo, monospace; }
.rm-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.rm-svg:active { cursor: grabbing; }
.rm-ring { fill: none; stroke: #2a4262; stroke-width: 1; stroke-dasharray: 2 6; opacity: .55; }
.rm-ring-outer { stroke-dasharray: none; opacity: .7; }
.rm-tick { stroke: #3a5677; stroke-width: 1.2; }
.rm-bearing { fill: #5a7798; font: 600 19px ui-monospace, Menlo, monospace; text-anchor: middle; }
.rm-grid { stroke: #183048; stroke-width: .6; opacity: .45; }
.rm-link { fill: none; transition: opacity .15s, stroke-width .15s; }
.rm-trunk { stroke-width: 3.2; opacity: .6; }
.rm-route { stroke-width: .9; opacity: .32; }
.rm-talks { stroke-width: 2.6; opacity: .55; stroke-linecap: round; }
.rm-uses { stroke-width: .8; opacity: .3; }
.rm-reads, .rm-covers { stroke: #9fb2cf; stroke-width: .9; opacity: .3; }
.rm-focusing .rm-link { opacity: .05; }
.rm-focusing .rm-link.rm-hot { opacity: .95; stroke-width: 1.8; }
.rm-node { cursor: pointer; }
.rm-leaf { stroke-width: 1.6; transition: r .12s; }
.rm-leaf.rm-hot { stroke: #fff; stroke-width: 2; }
.rm-proposal { animation: rm-pulse 1.6s ease-in-out infinite; }
@keyframes rm-pulse { 50% { opacity: .45; } }
.rm-hub-halo { fill: #e8f1ff; opacity: .08; }
.rm-hub-core { fill: #0e1a2b; stroke: #e8f1ff; stroke-width: 2.5; filter: url(#rm-glow); }
.rm-runway { fill: #e8f1ff; }
.rm-code { fill: #f1f5fb; font: 700 30px ui-monospace, Menlo, monospace; text-anchor: middle; letter-spacing: .12em; paint-order: stroke; stroke: #0b1626; stroke-width: 6px; }
.rm-code-hub { font-size: 40px; fill: #ffb648; }
.rm-name { fill: #9fb2cf; font: 500 21px system-ui, sans-serif; text-anchor: middle; paint-order: stroke; stroke: #0b1626; stroke-width: 5px; }
.rm-leaf-label { display: none; fill: #c9d6e8; font: 500 11px system-ui, sans-serif; paint-order: stroke; stroke: #0b1626; stroke-width: 3px; pointer-events: none; }
.rm-zoomed .rm-leaf-label { display: block; }
.rm-plane { filter: url(#rm-glow); pointer-events: none; }
.rm-tip { display: none; position: absolute; max-width: 260px; background: rgba(5, 8, 13, .94); border: 1px solid #2a4262; border-radius: 8px; padding: .5rem .65rem; color: #e8f1ff; font-size: .85rem; pointer-events: none; z-index: 2; }
.rm-tip-kind { font: 600 .7rem ui-monospace, Menlo, monospace; color: #ffb648; letter-spacing: .08em; text-transform: uppercase; }
.rm-tip-title { margin-top: .15rem; }
.rm-tip-detail { color: #8ea2bd; font-size: .78rem; margin-top: .15rem; }
.rm-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; align-items: center; }
.rm-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.rm-key-dot { background: #8fa3c8; }
.rm-key-ring { border: 2px solid #8fa3c8; width: 9px; height: 9px; }
.rm-key-big { background: #f2a33a; width: 13px; height: 13px; }
@media (max-width: 760px) {
  .rm-wrap { height: 82vh; }
  .rm-board-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rm-board { right: 64px; }
  .rm-wrap .rm-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rm-proposal { animation: none; } }
