/* Tron grid: dark only. Same roles as the pipeline map: agents cyan, gate scripts amber, files neutral, you violet. */
:root {
  --bg: #04070d; --surface: #0a1220; --surface-2: #101b2e; --fg: #dff6ff; --fg-2: #9fbfd2; --muted: #6a8aa0; --line: #17324a;
  --accent: #2ee6ff; --accent-soft: rgba(46, 230, 255, 0.1); --gate: #ffb02e; --gate-soft: rgba(255, 176, 46, 0.1); --human: #c77dff; --human-soft: rgba(199, 125, 255, 0.12);
  --ok: #39ffb0; --warn: #ffb02e; --bad: #ff4d6d; --bad-soft: rgba(255, 77, 109, 0.12); --run: #5fa8ff; --run-soft: rgba(95, 168, 255, 0.14);
  --glow: 0 0 0 1px rgba(46, 230, 255, 0.25), 0 0 18px rgba(46, 230, 255, 0.12);
  --side-w: 216px;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font-body); padding: 0 0 52px var(--side-w); min-height: 100vh; }
/* isometric grid behind everything, fading toward the top */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 60% 110%, rgba(46, 230, 255, 0.13), transparent 70%),
    repeating-linear-gradient(30deg, rgba(46, 230, 255, 0.05) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-30deg, rgba(46, 230, 255, 0.05) 0 1px, transparent 1px 34px);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.35), #000 70%); mask-image: linear-gradient(to bottom, rgba(0,0,0,0.35), #000 70%); }
::selection { background: rgba(46, 230, 255, 0.3); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, pre { font-family: var(--font-mono); font-size: 12.5px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 21px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; text-shadow: 0 0 14px rgba(46, 230, 255, 0.45); } h2 { font-size: 16px; } h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 24px 40px; display: grid; gap: 22px; }
/* side nav */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30; display: flex; flex-direction: column; gap: 22px; padding: 18px 12px;
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.96), rgba(4, 7, 13, 0.96)); border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(46, 230, 255, 0.12), 8px 0 30px rgba(0, 0, 0, 0.4); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--fg); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font: 500 10px var(--font-mono); letter-spacing: 0.18em; color: var(--muted); }
.brand-mark { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 0 5px var(--accent)); }
.side nav { display: grid; gap: 4px; }
.side nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 4px; color: var(--fg-2);
  font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; border: 1px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s; }
.side nav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side nav a:hover { color: var(--fg); background: var(--accent-soft); text-decoration: none; }
.side nav a.active { color: var(--accent); background: linear-gradient(90deg, rgba(46, 230, 255, 0.16), rgba(46, 230, 255, 0.02)); border-color: rgba(46, 230, 255, 0.3);
  text-shadow: 0 0 10px rgba(46, 230, 255, 0.6); }
.side nav a.active svg { filter: drop-shadow(0 0 4px var(--accent)); }
.side nav a.active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.side nav .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center;
  font: 700 11px var(--font-mono); letter-spacing: 0; color: #1a0f00; background: var(--gate); box-shadow: 0 0 10px var(--gate); text-shadow: none; animation: badge-glow 2.4s ease-in-out infinite; }
@keyframes badge-glow { 50% { box-shadow: 0 0 3px var(--gate); } }
.side-foot { margin-top: auto; display: flex; white-space: nowrap; align-items: center; gap: 8px; padding: 8px; font: 500 10.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
.side-foot .dot { box-shadow: 0 0 8px var(--ok); }
@media (max-width: 900px) {
  :root { --side-w: 60px; }
  .side { padding: 14px 8px; align-items: center; }
  .brand span, .side nav a span, .side-foot span:last-child { display: none; }
  .brand { padding: 4px 0; } .side nav a { padding: 10px; justify-content: center; } .side nav a.active::before { left: -8px; }
  .side nav .badge { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 4px 0 0; color: var(--fg-2); }
.panel { position: relative; background: linear-gradient(180deg, rgba(16, 27, 46, 0.82), rgba(10, 18, 32, 0.82)); border: 1px solid var(--line); border-radius: 6px; padding: 16px; min-width: 0;
  box-shadow: inset 0 1px 0 rgba(46, 230, 255, 0.1); backdrop-filter: blur(6px); }
.panel::before { content: ""; position: absolute; left: 14px; top: -1px; width: 48px; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.panel > h2 { flex-wrap: wrap; margin-bottom: 12px; font: 600 12.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg); display: flex; align-items: baseline; gap: 8px; }
.panel > h2 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap; font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; transition: box-shadow 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(46, 230, 255, 0.25); }
.btn.primary { background: rgba(46, 230, 255, 0.12); border-color: var(--accent); color: var(--accent); font-weight: 600; text-shadow: 0 0 8px rgba(46, 230, 255, 0.6); box-shadow: inset 0 0 12px rgba(46, 230, 255, 0.15); }
.btn.primary:hover { background: rgba(46, 230, 255, 0.2); box-shadow: 0 0 16px rgba(46, 230, 255, 0.45), inset 0 0 12px rgba(46, 230, 255, 0.2); }
.btn.confirm { background: var(--gate-soft); border-color: var(--gate); color: var(--gate); font-weight: 600; text-shadow: 0 0 8px rgba(255, 176, 46, 0.5); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 3px 9px; font-size: 11px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--fg-2); padding: 2px 6px; }
input[type=text], select { border: 1px solid var(--line); background: var(--bg); border-radius: 4px; padding: 5px 9px; min-width: 0; }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--fg-2); }

.pill { display: inline-block; text-transform: uppercase; letter-spacing: 0.06em; font: 500 11px var(--font-mono); padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-2); white-space: nowrap; }
.pill.done, .pill.used, .pill.ok { color: var(--ok); border-color: currentColor; text-shadow: 0 0 6px currentColor; }
.pill.next, .pill.new, .pill.queued { color: var(--accent); border-color: currentColor; background: var(--accent-soft); }
.pill.running { color: var(--run); border-color: currentColor; background: var(--run-soft); }
.pill.blocked, .pill.failed, .pill.stale, .pill.high { color: var(--bad); border-color: currentColor; }
.pill.medium, .pill.interrupted, .pill.stopped { color: var(--warn); border-color: currentColor; }
.pill.refresh { color: var(--gate); border-color: currentColor; }

/* weeks strip */
.weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.weeks div { background: rgba(10, 18, 32, 0.9); padding: 10px 14px; display: grid; gap: 2px; }
.weeks .k { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.weeks .v { font: 600 16px var(--font-mono); color: var(--accent); text-shadow: 0 0 10px rgba(46, 230, 255, 0.5); }
.weeks .d { color: var(--fg-2); font-size: 12.5px; }
@media (max-width: 700px) { .weeks { grid-template-columns: 1fr 1fr; } }

/* isometric diagram */
.diagram { overflow-x: auto; padding: 10px 6px; background: radial-gradient(ellipse 70% 70% at 50% 60%, rgba(46, 230, 255, 0.07), transparent 70%), rgba(4, 7, 13, 0.7); }
.diagram svg { display: block; width: 100%; min-width: 760px; height: auto; max-height: 76vh; color: var(--fg); overflow: visible; }
.floor-a { stop-color: rgba(46, 230, 255, 0.07); } .floor-b { stop-color: rgba(46, 230, 255, 0.015); }
.d-floor { fill: url(#floor-g); }
.d-floor-edge { fill: none; stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1.2; filter: drop-shadow(0 0 4px var(--accent)); }
.d-grid { stroke: var(--accent); stroke-opacity: 0.1; stroke-width: 1; }
.d-row { font: 700 15px var(--font-mono); fill: var(--accent); fill-opacity: 0.55; letter-spacing: 0.25em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 2px 10px 0; font-size: 12.5px; color: var(--fg-2); }
.legend b { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-right: 6px; }
.legend .keys { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.legend .keys i { width: 9px; height: 9px; transform: rotate(45deg) scaleY(0.7); border: 1px solid; margin-left: 8px; }
.k-done { color: var(--ok); background: currentColor; } .k-next { color: var(--accent); } .k-running { color: var(--run); background: currentColor; }
.k-blocked { color: var(--bad); background: currentColor; } .k-pending { color: #4f6f88; } .k-reminder { color: var(--human); }
.legend .keys i { box-shadow: 0 0 6px currentColor; }
.d-edge { stroke: var(--muted); stroke-opacity: 0.5; stroke-width: 2; fill: none; }
.d-edge.lit { stroke: var(--accent); stroke-opacity: 0.8; filter: drop-shadow(0 0 3px var(--accent)); }
.d-ah { fill: var(--accent); }
.d-flow { stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 10 90; animation: flow 1.8s linear infinite; filter: drop-shadow(0 0 4px var(--accent)); }
@keyframes flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.d-human-edge { stroke: var(--human); stroke-dasharray: 3 5; stroke-width: 1.8; fill: none; filter: drop-shadow(0 0 3px var(--human)); animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -16; } }

.node { cursor: pointer; --c: var(--muted); }
.node:focus { outline: none; }
.node.done { --c: var(--ok); } .node.next { --c: var(--accent); } .node.running { --c: var(--run); } .node.blocked { --c: var(--bad); }
.node.reminder { --c: var(--human); } .node.task { --c: var(--gate); } .node.pending, .node.idle:not(.task) { --c: #4f6f88; }
.node .shadow { fill: var(--c); fill-opacity: 0.1; filter: blur(4px); }
.node .blk { transition: transform 0.2s ease; }
.node .face-t { fill: color-mix(in srgb, var(--c) 22%, #06101c); stroke: var(--c); stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 0 5px var(--c)); }
.node .face-l { fill: color-mix(in srgb, var(--c) 12%, #050b14); stroke: var(--c); stroke-opacity: 0.55; stroke-width: 1; }
.node .face-r { fill: color-mix(in srgb, var(--c) 6%, #03070d); stroke: var(--c); stroke-opacity: 0.4; stroke-width: 1; }
.node .core { fill: var(--c); fill-opacity: 0.2; stroke: var(--c); stroke-opacity: 0.6; }
.node.done .core, .node.running .core, .node.blocked .core { fill-opacity: 0.55; filter: drop-shadow(0 0 6px var(--c)); }
.node .beam { stroke: var(--c); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 2 3; }
.node .ring { fill: rgba(4, 9, 17, 0.92); stroke: var(--c); stroke-width: 1.6; filter: drop-shadow(0 0 6px var(--c)); }
.node.done .ring, .node.blocked .ring { fill: color-mix(in srgb, var(--c) 22%, #040911); }
.node .glyph { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.node .glyph .solid { fill: var(--c); stroke: none; }
.node .glyph .spin { stroke-dasharray: 18 10; transform-origin: 0 0; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.node .halo { fill: none; stroke: var(--c); stroke-width: 1; transform-origin: 0 0; animation: halo 2s ease-out infinite; }
@keyframes halo { from { transform: scale(0.75); opacity: 0.9; } to { transform: scale(1.45); opacity: 0; } }
.node .bob { animation: bob 3.2s ease-in-out infinite; }
.node.pending .bob, .node.idle:not(.task) .bob { animation: none; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.node .flagdot circle { fill: var(--gate); filter: drop-shadow(0 0 4px var(--gate)); }
.node .flagdot text { font: 700 9.5px var(--font-mono); fill: #1a0f00; text-anchor: middle; }
.d-name { font: 600 11px var(--font-mono); letter-spacing: 0.08em; fill: var(--c); fill-opacity: 0.85; text-transform: uppercase; }
.node:hover .d-name, .node:focus-visible .d-name { fill-opacity: 1; filter: drop-shadow(0 0 4px var(--c)); }
.node:hover .ring, .node:focus-visible .ring { stroke-width: 2.4; }
.node:hover .blk, .node:focus-visible .blk { transform: translateY(-5px); }
.node:focus-visible .face-t { stroke-width: 2.4; }
.node.next .face-t { stroke-dasharray: 6 4; animation: march 1.2s linear infinite; }
.node.running .blk { animation: hover-pulse 1.6s ease-in-out infinite; }
.node.running .face-t { animation: pulse 1.6s ease-in-out infinite; }
@keyframes hover-pulse { 50% { transform: translateY(-6px); } }
@keyframes pulse { 50% { stroke-opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .d-flow, .d-human-edge, .node.next .face-t, .node.running .blk, .node.running .face-t, .node .bob, .node .halo, .node .glyph .spin, .side nav .badge, .dot.running { animation: none; }
  .node .blk { transition: none; }
}

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }

.list { display: grid; gap: 2px; }
.list-item { display: grid; gap: 2px; padding: 8px 10px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.list-item:hover { background: var(--accent-soft); border-color: rgba(46, 230, 255, 0.2); }
.list-item .title { font-weight: 500; }
.list-item .sub { color: var(--muted); font-size: 12px; }
.flag-item { grid-template-columns: 1fr auto; align-items: center; }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 44px; width: min(520px, 100vw); background: rgba(8, 14, 25, 0.97); border-left: 1px solid var(--accent);
  z-index: 40; display: grid; grid-template-rows: auto 1fr; box-shadow: -12px 0 40px rgba(0, 0, 0, 0.6), -1px 0 14px rgba(46, 230, 255, 0.25); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow-y: auto; padding: 16px 18px 28px; display: grid; gap: 18px; align-content: start; }
.drawer-body section { display: grid; gap: 8px; }
.drawer-body h3 { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.scrim { position: fixed; inset: 0 0 44px 0; background: rgba(0, 0, 0, 0.5); z-index: 35; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.run-box { border: 1px solid var(--line); border-radius: 4px; padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.run-box p { margin: 0; color: var(--fg-2); font-size: 12.5px; }

/* console */
.console { position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 50; background: rgba(6, 11, 20, 0.97); border-top: 1px solid var(--line); box-shadow: 0 -1px 12px rgba(46, 230, 255, 0.12); }
.console-bar { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; }
.console-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; text-align: left; padding: 0; }
.console-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12.5px; }
.console-actions { display: flex; gap: 8px; align-items: center; }
.console-actions select { max-width: 280px; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.running { background: var(--run); box-shadow: 0 0 8px var(--run); animation: blink 1s infinite; } .dot.done { background: var(--ok); }
.dot.failed, .dot.blocked { background: var(--bad); } .dot.stopped, .dot.interrupted { background: var(--warn); }
@keyframes blink { 50% { opacity: 0.3; } }
.console-log { display: none; height: 42vh; overflow-y: auto; padding: 8px 16px 16px; border-top: 1px solid var(--line); font: 12px/1.55 var(--font-mono); background: var(--bg); }
.console[data-open="true"] .console-log { display: block; }
.ln { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1px 0; }
.ln.sub { padding-left: 22px; }
.ln.tool { color: var(--accent); } .ln.tool::before { content: "→ "; }
.ln.err { color: var(--bad); } .ln.info { color: var(--muted); } .ln.end { color: var(--fg); font-weight: 600; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.ln.text { color: var(--fg); padding: 4px 0; } .ln.out { color: var(--fg-2); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--surface); border-radius: 6px; width: min(900px, 100%); max-height: 86vh; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--accent); box-shadow: 0 0 30px rgba(46, 230, 255, 0.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { overflow: auto; padding: 14px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal-foot:empty { display: none; }
.toast { position: fixed; bottom: 60px; left: calc(50% + var(--side-w) / 2); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 6px; z-index: 70; max-width: 90vw; }
.toast { background: var(--surface-2); color: var(--accent); border: 1px solid var(--accent); box-shadow: 0 0 16px rgba(46, 230, 255, 0.3); font-family: var(--font-mono); font-size: 12.5px; }
.toast.error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* diff */
.diff { font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.diff .add { background: color-mix(in srgb, var(--ok) 16%, transparent); display: block; }
.diff .del { background: color-mix(in srgb, var(--bad) 16%, transparent); display: block; }
.diff .ctx { color: var(--muted); display: block; }
.diff .gap { color: var(--muted); display: block; font-style: italic; }

/* rendered markdown */
.md { line-height: 1.6; max-width: 80ch; overflow-wrap: anywhere; }
.md h1 { font-size: 20px; margin: 18px 0 8px; text-transform: none; letter-spacing: 0; text-shadow: none; } .md h2 { font-size: 17px; margin: 18px 0 8px; } .md h3 { font-size: 15px; margin: 16px 0 6px; } .md h4 { font-size: 14px; margin: 14px 0 6px; }
.md p, .md ul, .md ol { margin: 0 0 10px; }
.md pre { background: var(--surface-2); padding: 10px; border-radius: 6px; overflow-x: auto; }
.md code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.md pre code { background: none; padding: 0; }
.md table { margin: 8px 0 14px; display: block; overflow-x: auto; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--fg-2); }

/* findings */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cards { display: grid; gap: 12px; }
.fcard { background: rgba(10, 18, 32, 0.85); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: grid; gap: 8px; min-width: 0; }
.fcard.stale { opacity: 0.65; }
.fcard .head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.fcard h3 { font-size: 15px; }
.fcard p { margin: 0; color: var(--fg-2); }
.fcard ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.fcard pre { margin: 0; background: var(--surface-2); padding: 10px; border-radius: 6px; overflow-x: auto; white-space: pre; }
.kw { display: flex; flex-wrap: wrap; gap: 4px; }
.kw span { font-size: 12px; background: var(--surface-2); padding: 1px 7px; border-radius: 4px; color: var(--fg-2); }

/* performance */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: rgba(10, 18, 32, 0.85); border: 1px solid var(--line); border-radius: 6px; box-shadow: inset 0 1px 0 rgba(46, 230, 255, 0.12); padding: 12px 14px; display: grid; gap: 2px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font: 650 22px var(--font-mono); color: var(--accent); text-shadow: 0 0 10px rgba(46, 230, 255, 0.45); font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chart-box { position: relative; height: 230px; }
.note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

/* docs editor */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } }
.doc-list { display: grid; gap: 14px; position: sticky; top: 20px; }
.doc-list h3 { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0 10px; margin-bottom: 4px; }
.doc-list { min-width: 0; overflow: hidden; }
.doc-list .list-item { min-width: 0; }
.doc-list .list-item .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list .list-item.active { background: var(--accent-soft); border-color: var(--accent); }
.doc-list .list-item .title { font-family: var(--font-mono); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.mod { width: 7px; height: 7px; border-radius: 50%; background: var(--gate); display: inline-block; }
.editor { display: grid; gap: 10px; min-width: 0; }
.editor textarea { width: 100%; min-height: 62vh; resize: vertical; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; background: var(--bg); caret-color: var(--accent);
  font: 13px/1.55 var(--font-mono); tab-size: 2; }
.md-view > .tabs { margin-bottom: 12px; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tabs button { border: 0; background: var(--surface); padding: 5px 12px; cursor: pointer; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.preview { background: rgba(10, 18, 32, 0.85); border: 1px solid var(--line); border-radius: 4px; padding: 16px 20px; min-height: 62vh; }
.banner { padding: 10px 14px; border-radius: 8px; background: var(--gate-soft); color: var(--fg); border: 1px solid var(--gate); font-size: 13px; }

/* signed-in user (side nav) and the login page */
.side-user { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--line); margin-top: auto; min-width: 0; }
.side-user + .side-foot { margin-top: 0; }
.me { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font: 500 11px var(--font-mono); color: var(--fg-2); }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me img { width: 22px; height: 22px; border-radius: 50%; flex: none; }
@media (max-width: 900px) { .side-user { flex-direction: column; padding: 8px 0; } .me span { display: none; } .side-user .btn { font-size: 10px; padding: 4px 6px; } }
body.login-page { padding: 16px; display: grid; place-items: center; }
.login { width: min(420px, 100%); display: grid; gap: 16px; padding: 28px; }
.login-actions { display: flex; flex-wrap: wrap; gap: 10px; }
