:root {
  --ink: #12181d;
  --ink-2: #1c252b;
  --paper: #eef1f2;
  --panel: #ffffff;
  --line: #d3dade;
  --line-soft: #e4e9eb;
  --muted: #5b666d;
  --muted-2: #7d898f;
  --red: #c8102e;
  --red-dark: #940b22;
  --red-soft: #fbeaec;
  --gold: #d99a16;
  --gold-soft: #fff6e2;
  --green: #1b7a4b;
  --green-soft: #e8f5ee;
  --blue: #145a82;
  --blue-soft: #eaf3f8;
  --radius: 3px;
  --rail: 248px;
  --font-body: "Fira Sans", system-ui, sans-serif;
  --font-display: "Fira Sans Condensed", "Fira Sans", system-ui, sans-serif;
  --font-mono: "Fira Code", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--red); }

h1, h2, h3, h4 { margin: 0; line-height: 1.12; }
h1 { font: 700 44px/1.03 var(--font-display); letter-spacing: -0.015em; }
h2 { font: 700 26px/1.1 var(--font-display); letter-spacing: -0.01em; }
h3 { font: 600 17px/1.25 var(--font-body); }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
small { font-size: 12px; }

code, .mono { font-family: var(--font-mono); font-size: 0.86em; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; background: var(--red); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Shell and rail */
.shell { display: flex; min-height: 100vh; }

.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--rail); display: flex; flex-direction: column;
  background: var(--ink); color: #c7d0d4;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  height: 64px; padding: 0 20px; flex: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff; text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--red); color: #fff;
  font: 700 19px/1 var(--font-display);
}
.brand-text { font: 600 17px/1 var(--font-display); letter-spacing: .01em; white-space: nowrap; }
.brand-text span { color: #8f9ca2; font-weight: 400; }

.rail-nav { padding: 18px 12px 8px; }
.nav-label {
  margin: 18px 10px 7px; color: #8b979d;
  font: 600 12px/1 var(--font-body); letter-spacing: .02em;
}
.nav-label:first-child { margin-top: 0; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  min-height: 42px; padding: 9px 10px; margin: 1px 0;
  border-radius: 2px; color: #c7d0d4; text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-link .i { width: 17px; height: 17px; color: #8f9ca2; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.nav-link.is-active .i { color: #fff; }

.rail-foot {
  margin-top: auto; padding: 14px 12px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.who {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  color: #fff; text-decoration: none; border-radius: 2px;
}
.who:hover { background: rgba(255,255,255,.06); color: #fff; }
.who strong { display: block; font-size: 13px; font-weight: 600; }
.who small { display: block; color: #8f9ca2; font-size: 11px; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  background: #2b363c; border: 1px solid #445158; border-radius: 50%;
  color: #fff; font: 600 12px/1 var(--font-mono);
}
.logout {
  display: flex; align-items: center; gap: 9px;
  margin-top: 4px; padding: 8px; color: #8f9ca2; text-decoration: none; font-size: 13px;
}
.logout:hover { color: #fff; }
.logout .i { width: 16px; height: 16px; }

/* Page frame */
.page { flex: 1; min-width: 0; margin-left: var(--rail); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 36px; flex: none;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; color: var(--muted); }
.crumb strong { color: var(--ink); font-weight: 600; }
.crumb .sep { color: #aeb8bd; }
.top-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.season {
  font: 500 11px/1 var(--font-mono); letter-spacing: .02em;
  padding: 5px 8px; border: 1px solid var(--line); color: var(--muted);
  background: #f8fafb;
}
.season span { color: var(--ink); }
.menu { display: none; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 30px 40px 48px; flex: 1; }

.foot {
  display: flex; justify-content: space-between; gap: 16px;
  max-width: 1280px; width: 100%; margin: 0 auto;
  padding: 18px 40px 24px; border-top: 1px solid var(--line);
  color: var(--muted-2); font-size: 12px;
}

/* Buttons and bits */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel); color: var(--ink);
  font: 600 14px/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-secondary { background: var(--panel); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: #f7f9fa; border-color: #b9c3c8; color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f5f6; color: var(--ink); }
.btn-sm, .btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.kicker {
  margin: 0 0 8px; color: var(--red);
  font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
.lede { max-width: 62ch; margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 24px;
}
.page-head .head-actions { display: flex; gap: 10px; flex: none; padding-bottom: 3px; }

/* Home */
.live-panel {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  background: var(--ink); color: #f4f7f8; border: 1px solid var(--ink);
}
.live-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 26px 26px;
}
.live-main { position: relative; padding: 24px 28px 26px; }
.live-top {
  display: flex; align-items: center; gap: 9px;
  color: #aeb8bd; font: 600 11px/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase;
}
.live-dot {
  width: 8px; height: 8px; background: #ff4058; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,64,88,.16);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255,64,88,0); } }
.live-main h2 { margin: 10px 0 4px; font: 500 18px/1.3 var(--font-mono); letter-spacing: -.02em; }
.live-meta { margin: 0; color: #aeb8bd; font-size: 13px; }
.live-stats { display: flex; gap: 34px; margin-top: 22px; }
.live-stats span { display: block; color: #8f9ca2; font-size: 11px; }
.live-stats strong { display: block; margin-top: 2px; color: #fff; font: 700 31px/1 var(--font-display); }
.live-stats .reward { color: #f4c35a; }
.live-side { position: relative; display: flex; flex-direction: column; border-left: 1px solid rgba(255,255,255,.12); }
.live-chart { flex: 1; display: flex; align-items: center; padding: 18px 22px 6px; }
.live-chart svg { width: 100%; height: 132px; overflow: visible; }
.live-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px; border-top: 1px solid rgba(255,255,255,.12);
  color: #fff; text-decoration: none; font-size: 13px; font-weight: 500;
}
.live-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.live-link .i { width: 16px; height: 16px; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 28px; background: var(--panel); border: 1px solid var(--line);
}
.stat { padding: 14px 20px 15px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 2px; font: 700 28px/1 var(--font-display); }
.stat strong em { color: var(--muted-2); font: 400 13px/1 var(--font-body); font-style: normal; }

.panel { background: var(--panel); border: 1px solid var(--line); }
.panel + .panel { margin-top: 18px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 20px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 18px; }
.panel > p, .panel > ul { margin-left: 18px; margin-right: 18px; }
.panel > p + p { margin-top: 8px; }

.segmented { display: flex; border: 1px solid var(--line); background: #f8fafb; }
.segmented button {
  min-height: 30px; padding: 0 11px; border: 0; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted); font: 500 12px/1 var(--font-body); cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: #f8fafb; color: var(--muted);
  font: 600 12px/1.2 var(--font-body); text-align: left; white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfc; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-size: 12px; }
.run-id { display: inline-block; color: var(--ink); font: 500 13px/1.35 var(--font-mono); text-decoration: none; }
.run-id:hover { color: var(--red); text-decoration: underline; }
.sub { display: block; margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.tag {
  display: inline-block; padding: 2px 6px; border: 1px solid var(--line);
  background: #f7f9fa; color: var(--muted); font: 500 11px/1.5 var(--font-mono);
}
.status { position: relative; display: inline-block; padding-left: 12px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-running { color: var(--green); }
.status-finished { color: var(--muted); }
.status-failed { color: var(--red); }
.status-starting { color: var(--gold); }

/* Forms */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.form-section { padding: 22px 24px 24px; margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line); }
.form-section > h2 { font-size: 22px; }
.form-section > .section-note { margin: 5px 0 20px; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 18px; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { min-width: 0; }
.field > label, .field-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.field .raw { margin-left: 5px; color: var(--muted-2); font: 400 11px/1 var(--font-mono); }
.field .hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.field input[type="text"], .field input[type="number"], .field input[type="password"], .field select {
  width: 100%; height: 40px; padding: 0 11px;
  border: 1px solid #b9c3c8; border-radius: 2px; background: #fff;
  color: var(--ink); font: 400 14px/1 var(--font-body);
}
.field select { padding-right: 30px; }
.field input:focus, .field select:focus { border-color: var(--red); outline: 2px solid rgba(200,16,46,.16); outline-offset: 0; }
.input-unit { position: relative; }
.input-unit input { padding-right: 62px !important; }
.input-unit .unit {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); font: 400 11px/1 var(--font-mono); pointer-events: none;
}
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; }
.check input { width: 17px; height: 17px; accent-color: var(--red); }
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.switch-row:last-child { border-bottom: 0; padding-bottom: 0; }
.switch-row strong { display: block; font-size: 14px; }
.switch-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: #c7d0d4; border-radius: 12px; transition: background .15s ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s ease; }
.switch input:checked + span { background: var(--red); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

.summary { position: sticky; top: 86px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--red); }
.summary-head { padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.summary-head h2 { font-size: 20px; }
.summary-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; margin: 0; padding: 15px 18px 17px; font-size: 13px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 500; }
.summary dd.mono { font-size: 12px; }
.summary .summary-action { padding: 0 18px 16px; }
.summary .btn { width: 100%; }
.summary .fine { padding: 0 18px 18px; margin: 0; color: var(--muted-2); font-size: 11px; line-height: 1.45; }

/* Run detail */
.run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back:hover { color: var(--red); }
.back .i { width: 14px; height: 14px; transform: rotate(180deg); }
.run-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.run-title h1 { font: 500 26px/1.2 var(--font-mono); letter-spacing: -.03em; }
.run-actions { display: flex; gap: 9px; flex: none; padding-top: 22px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; background: var(--panel); border: 1px solid var(--line); }
.metric { padding: 14px 18px 15px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 2px; font: 700 30px/1 var(--font-display); }
.metric .delta { margin-top: 3px; color: var(--green); font: 500 11px/1 var(--font-mono); }
.metric .delta.down { color: var(--red); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
.chart-panel { background: var(--panel); border: 1px solid var(--line); }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chart-head h2 { font-size: 20px; }
.chart-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.legend::before { content: ""; width: 18px; height: 2px; background: var(--red); }
.chart { padding: 12px 16px 8px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: #e4e9eb; stroke-width: 1; }
.chart .axis { fill: #7d898f; font: 10px var(--font-mono); }
.chart .line { fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: rgba(200,16,46,.08); }
.chart-foot { display: flex; justify-content: space-between; gap: 12px; padding: 0 18px 14px; color: var(--muted-2); font-size: 11px; }

.settings { background: var(--panel); border: 1px solid var(--line); }
.settings .panel-body { padding: 4px 18px 12px; }
.settings dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; padding: 14px 0; font-size: 13px; }
.settings dt { color: var(--muted); }
.settings dd { margin: 0; text-align: right; font-weight: 500; }
.settings dd.mono { font-size: 12px; }

.log-panel { margin-top: 20px; background: var(--ink); border: 1px solid var(--ink); color: #dce3e6; }
.log-panel pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; color: #b9c6cc; font: 400 12px/1.85 var(--font-mono); }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.log-head h2 { color: #fff; font-size: 18px; }
.log-head span { color: #8f9ca2; font: 400 11px/1 var(--font-mono); }
.log { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font: 400 12px/1.85 var(--font-mono); color: #b9c6cc; }
.log .t { color: #6f7f86; }
.log .ok { color: #72c99a; }

/* Viewer */
.viewer-panel { position: relative; overflow: hidden; background: #0d1317; border: 1px solid #0d1317; }
.viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.1); color: #fff;
}
.viewer-head > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.viewer-head a { color: #fff; font: 400 12px/1 var(--font-mono); }
.viewer-meta { color: #aeb8bd; font-size: 12px; }
.viewer-meta form { display: inline; }
.live-label { color: #fff; font: 600 11px/1 var(--font-mono); }
.viewer-frame iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; background: #0d1317; }
.viewer-empty-body { position: relative; }
.viewer-empty-copy {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px; padding: 24px; text-align: center; color: #fff;
  background: rgba(13,19,23,.3);
}
.viewer-empty-copy p { margin: 0; max-width: 30rem; color: #c7d0d4; font-size: 13px; }
.viewer-empty-copy p:first-child { color: #fff; font: 600 24px/1.2 var(--font-display); }
.viewer-top { position: absolute; inset: 14px 16px auto; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.viewer-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; background: rgba(18,24,29,.8); color: #fff; font: 600 11px/1 var(--font-mono); }
.viewer-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4058; }
.viewer-id { color: #c7d0d4; font: 400 11px/1 var(--font-mono); }
.viewer { aspect-ratio: 16 / 9; display: block; width: 100%; }
.viewer-note { margin: 0; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08); background: #0d1317; color: #8f9ca2; font: 400 11px/1.4 var(--font-mono); }
.viewer-actions { display: flex; gap: 9px; }

.run-list { background: var(--panel); border: 1px solid var(--line); }
.run-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 18px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.run-row:last-child { border-bottom: 0; }
.run-row:hover { background: #fafcfc; }
.run-row .reward { font: 600 13px/1 var(--font-mono); color: var(--ink); }
.run-row .reward span { display: block; color: var(--muted-2); font: 400 10px/1.4 var(--font-body); }
.run-row .btn { min-width: 74px; }

/* Auto */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 22px; }
.choice { padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); }
.choice.is-recommended { border-left: 4px solid var(--red); }
.choice h3 { margin-bottom: 5px; }
.choice p { color: var(--muted); font-size: 13px; }
.choice .tag { margin-bottom: 9px; }
.callout { padding: 14px 16px; margin: 18px 0; border: 1px solid #ecd39b; border-left: 4px solid var(--gold); background: var(--gold-soft); font-size: 13px; }
.callout strong { display: block; margin-bottom: 3px; }
.callout p { color: #6b5316; }

/* Docs */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 38px; align-items: start; max-width: 1040px; }
.doc { grid-column: 1; grid-row: 1; max-width: 78ch; min-width: 0; overflow-wrap: break-word; }
.doc-layout > * { min-width: 0; }
.toc { grid-column: 2; grid-row: 1; }
.doc > h2 { margin: 36px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 25px; }
.doc > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc > h3 { margin: 24px 0 7px; }
.doc p, .doc li { color: #2b353b; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 20px; }
.doc li { margin: 4px 0; }
.doc table { margin: 12px 0 18px; background: var(--panel); border: 1px solid var(--line); }
.doc th { background: #f4f7f8; }
.doc td, .doc th { padding: 9px 12px; font-size: 13px; }
.doc code { padding: 1px 4px; background: #eef1f2; border: 1px solid #e0e5e7; overflow-wrap: anywhere; }
.toc { position: sticky; top: 86px; padding-left: 18px; border-left: 1px solid var(--line); }
.toc h2 { margin-bottom: 10px; font: 600 12px/1 var(--font-body); letter-spacing: .02em; color: var(--muted); }
.toc a { display: block; padding: 4px 0; color: var(--muted); font-size: 13px; text-decoration: none; }
.toc a:hover { color: var(--red); }
.toc a.sub-link { padding-left: 11px; font-size: 12px; }

/* Intelligence */
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.link-row { display: block; padding: 13px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.link-row:hover { color: var(--red); }
.link-row .link-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.link-row .link-title .i { width: 13px; height: 13px; color: var(--muted-2); }
.link-row .link-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.link-row .link-domain { color: var(--muted-2); font: 400 10px/1 var(--font-mono); }
.team-table td { font-size: 13px; }
.team-table .team { font-weight: 600; white-space: nowrap; }
.team-table .team span { display: block; color: var(--muted); font: 400 10px/1.3 var(--font-mono); }

/* About */
.about-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: end; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.about-hero h1 { font-size: 54px; max-width: 14ch; }
.about-hero .lede { font-size: 17px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 28px; }
.about-grid h2 { margin-bottom: 9px; font-size: 23px; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin: 18px 0 8px; }
.flow-step { padding: 14px 15px; background: var(--panel); border: 1px solid var(--line); }
.flow-step span { display: block; color: var(--red); font: 600 10px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.flow-step strong { display: block; margin-top: 4px; font-size: 14px; }
.flow-step small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.flow-arrow { color: var(--muted-2); font: 400 18px/1 var(--font-mono); }

/* Strategy */
.empty-state { padding: 46px 30px; text-align: center; background: var(--panel); border: 1px solid var(--line); }
.empty-state .mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; background: var(--red-soft); color: var(--red); }
.empty-state .mark .i { width: 24px; height: 24px; }
.empty-state h2 { margin-bottom: 6px; font-size: 28px; }
.empty-state p { max-width: 46ch; margin: 0 auto 16px; color: var(--muted); }

/* Login */
.login-body { background: var(--ink); }
.login { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 100vh; }
.login-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 56px 36px; background: var(--ink); color: #fff;
}
.login-brand::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 30px 30px;
}
.login-brand > * { position: relative; }
.brand-light { height: auto; padding: 0; border: 0; }
.login-brand .kicker { color: #f4c35a; margin-bottom: 14px; }
.login-brand h1 { max-width: 11ch; font-size: 64px; line-height: .98; }
.login-lede { max-width: 38ch; margin: 20px 0 0; color: #aeb8bd; font-size: 16px; }
.login-foot { margin: 0; color: #7f8d93; font-size: 12px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--panel); }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { margin-bottom: 4px; font-size: 32px; }
.login-form .form-note { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-form .field { margin-bottom: 16px; }
.login-form .btn { width: 100%; margin-top: 6px; }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 13px; }
.login-form .callout { margin-top: 22px; font-size: 12px; }

/* Run actions */
.col-actions { text-align: right; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 4px; }
.you { display: inline-block; margin-left: 5px; padding: 1px 5px; background: var(--red-soft); color: var(--red-dark); font: 600 10px/1.5 var(--font-body); }
.run-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag-chip { display: inline-block; padding: 1px 6px; background: #eef2f4; border: 1px solid var(--line); color: var(--muted); font: 500 10.5px/1.5 var(--font-mono); }
.saved-chip { background: var(--gold-soft); border-color: #ecd39b; color: #7a5a13; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.dialog { width: min(540px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: 0 24px 70px rgba(18,24,29,.3); }
.dialog::backdrop { background: rgba(18,24,29,.55); }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.dialog-kicker { margin: 0 0 5px; color: var(--muted); font: 600 12px/1 var(--font-body); }
.dialog-head h2 { margin: 0 0 4px; font-size: 28px; }
.dialog-run { margin: 0; color: var(--muted); font: 500 12px/1.4 var(--font-mono); }
.dialog-x { width: 34px; height: 34px; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.dialog-x:hover { color: var(--ink); }
.dialog-body { padding: 18px 24px 24px; }
.dialog-section h3 { margin: 0 0 8px; font-size: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; margin-bottom: 12px; }
.tag-form label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.tag-form-row { display: flex; gap: 8px; }
.tag-form-row input { flex: 1; min-width: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog-actions .btn { flex: 1 1 auto; justify-content: center; }
.dialog-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.dialog-status { margin: 10px 0 0; color: var(--green); font: 500 12px/1.4 var(--font-body); }
#save-run.is-saved { background: var(--gold-soft); border-color: #ecd39b; color: #7a5a13; }
#save-run.is-saved .i { fill: currentColor; }
.confirm { margin-top: 14px; padding: 12px 14px; border: 1px solid #e7b5bd; border-left: 4px solid var(--red); background: var(--red-soft); }
.confirm p { margin: 4px 0 10px; color: #6b1b2a; font-size: 12px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; padding: 10px 14px; background: var(--ink); color: #fff; font: 500 13px/1.2 var(--font-body); box-shadow: 0 10px 30px rgba(18,24,29,.25); }

/* Monitoring */
.head-title { display: flex; align-items: center; gap: 10px; }
.head-title .tag { margin-top: 4px; }
.health-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; background: var(--panel); border: 1px solid var(--line); }
.health-card { padding: 15px 18px 14px; border-right: 1px solid var(--line); }
.health-card:last-child { border-right: 0; }
.health-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.health-state { margin-left: auto; color: var(--green); font-weight: 600; }
.health-card.warn .health-state { color: #8a6100; }
.health-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(27,122,75,.1); }
.health-card.warn .health-dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(217,154,22,.14); }
.health-card strong { display: block; margin-top: 8px; font: 700 28px/1 var(--font-display); }
.health-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.health-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font: 400 10.5px/1.4 var(--font-mono); }
.monitor-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.monitor-main, .monitor-side { display: grid; gap: 20px; }
.resource-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.resource-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.resource-top span { color: var(--muted); }
.resource-top strong { font: 600 12px/1 var(--font-mono); }
.meter { height: 6px; background: #e7ecee; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--red); }
.resource small { display: block; margin-top: 4px; color: var(--muted-2); font-size: 11px; }
.gpu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gpu { padding: 14px; border: 1px solid var(--line); background: #fbfcfc; }
.gpu.is-idle { background: #f7f9fa; }
.gpu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gpu-head > div { display: flex; align-items: center; gap: 7px; }
.gpu-head strong { font-size: 14px; }
.gpu-head .tag { padding: 1px 5px; font-size: 9.5px; }
.gpu-run { margin: 10px 0 12px; min-height: 34px; font-size: 11px; }
.gpu-run .run-id { display: block; font-size: 11px; }
.gpu-run span { color: var(--muted); }
.meter-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; margin-top: 7px; font-size: 10.5px; }
.meter-row span { color: var(--muted); }
.meter-row b { font: 500 10px/1 var(--font-mono); white-space: nowrap; }
.gpu-foot { margin: 11px 0 0; padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font: 400 10px/1.4 var(--font-mono); }
.monitor-live { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font: 600 11px/1 var(--font-mono); }
.monitor-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(27,122,75,.12); }
.traffic-panel .panel-body { padding-bottom: 10px; }
.mini-metrics { display: flex; gap: 28px; margin-bottom: 4px; }
.mini-metrics span { display: block; color: var(--muted); font-size: 11px; }
.mini-metrics strong { display: block; margin-top: 2px; font: 700 24px/1 var(--font-display); }
.mini-metrics em { color: var(--muted-2); font: 400 11px/1 var(--font-body); font-style: normal; }
.monitor-chart { padding-top: 4px; }
.monitor-chart svg { height: auto; }
.traffic-axis { display: flex; justify-content: space-between; padding: 0 0 4px; color: var(--muted-2); font: 400 10px/1 var(--font-mono); }
.usage-bar { display: flex; height: 10px; margin-bottom: 14px; background: #e7ecee; overflow: hidden; }
.usage-list, .user-list { list-style: none; margin: 0; padding: 0; }
.usage-list li { display: grid; grid-template-columns: 8px 1fr auto auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.usage-list li:last-child { border-bottom: 0; }
.usage-dot { width: 7px; height: 7px; }
.usage-list strong { font: 600 11px/1 var(--font-mono); }
.usage-list em { color: var(--muted-2); font: 400 10px/1 var(--font-mono); font-style: normal; }
.subhead { margin: 16px 0 7px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.user-list li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; }
.avatar-sm { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 10px/1 var(--font-body); }
.muted-avatar { background: var(--line); color: var(--muted); }
.user-list strong { font: 600 11px/1 var(--font-mono); }
.cloud-status { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; background: #f7f9fa; border: 1px solid var(--line-soft); }
.cloud-status .health-dot { margin-top: 4px; }
.cloud-status strong { display: block; font-size: 13px; }
.cloud-status p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.warn-dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(217,154,22,.14); }
.cloud-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 14px 0 0; }
.cloud-facts div { padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.cloud-facts div:nth-child(odd) { padding-right: 10px; }
.cloud-facts dt { color: var(--muted); font-size: 10.5px; }
.cloud-facts dd { margin: 2px 0 0; font: 600 12px/1.3 var(--font-mono); }
.panel-note { margin: 12px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.event-panel { margin-top: 20px; }
.log-tools { display: flex; align-items: center; gap: 10px; }
.log-tools .segmented { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); }
.log-tools .segmented button { color: #8f9ca2; border-right-color: rgba(255,255,255,.14); }
.log-tools .segmented button[aria-pressed="true"] { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.log-tools input { width: 180px; height: 32px; padding: 0 10px; border: 1px solid rgba(255,255,255,.14); background: #0d1317; color: #fff; font: 400 11px/1 var(--font-mono); }
.log-tools input::placeholder { color: #6f7f86; }
.event-log { padding: 8px 0; max-height: 420px; overflow: auto; }
.log-line { display: grid; grid-template-columns: 64px 48px 132px minmax(0, 1fr); gap: 10px; margin: 0; padding: 5px 18px; font: 400 11.5px/1.5 var(--font-mono); color: #b9c6cc; }
.log-line[hidden] { display: none; }
.log-line:hover { background: rgba(255,255,255,.035); }
.log-line .t { color: #6f7f86; }
.log-line .lvl { font-weight: 600; }
.log-line .info { color: #7fb7d9; }
.log-line .warn { color: #f0c35b; }
.log-line .error { color: #ff7b8c; }
.log-line .src { color: #dce3e6; }
.log-line .msg { color: #9fadb4; }

/* Mobile */
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(18,24,29,.45); }

@media (max-width: 1180px) {
  main { padding: 26px 28px 40px; }
  .foot { padding-left: 28px; padding-right: 28px; }
  .topbar { padding: 0 28px; }
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-layout { grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; }
}

@media (max-width: 1024px) {
  .rail { transform: translateX(-100%); transition: transform .2s ease; }
  .rail.is-open { transform: translateX(0); }
  .page { margin-left: 0; }
  .menu { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-left: -8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
  .menu .i { width: 22px; height: 22px; }
  .about-hero { grid-template-columns: 1fr; gap: 18px; }
  .about-hero h1 { font-size: 46px; }
  .login-brand h1 { font-size: 54px; }
}

@media (max-width: 760px) {
  main { padding: 20px 18px 36px; }
  .topbar { padding: 0 18px; height: 58px; }
  .foot { padding: 16px 18px 20px; flex-direction: column; gap: 6px; }
  .season { display: none; }
  h1 { font-size: 34px; }
  h2 { font-size: 23px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-head .head-actions { padding-bottom: 0; }
  .live-panel { grid-template-columns: 1fr; }
  .live-side { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .live-stats { gap: 24px; }
  .live-stats strong { font-size: 27px; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-section { padding: 18px; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .run-head { flex-direction: column; gap: 12px; }
  .run-actions { padding-top: 0; }
  .run-title h1 { font-size: 19px; }
  .split, .link-grid, .about-grid { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc, .toc { grid-column: auto; grid-row: auto; }
  .toc { position: static; order: -1; padding: 0 0 14px; border-left: 0; border-bottom: 1px solid var(--line); }
  .toc a { display: inline-block; margin-right: 12px; }
  .toc a.sub-link { display: none; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 300px; padding: 28px 24px; gap: 28px; }
  .login-brand h1 { font-size: 42px; }
  .login-form { padding: 30px 22px 40px; }
  .run-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .run-row .reward { display: none; }
  .runs-table th:nth-child(2), .runs-table td:nth-child(2),
  .runs-table th:nth-child(4), .runs-table td:nth-child(4),
  .runs-table th:nth-child(6), .runs-table td:nth-child(6) { display: none; }
  .play-table th:nth-child(2), .play-table td:nth-child(2) { display: none; }
  .run-title { font-size: 22px; }
  .run-row .tag { display: none; }
  .team-table .hide-sm { display: none; }
  .dialog-head, .dialog-body { padding-left: 18px; padding-right: 18px; }
  .dialog-actions .btn { flex: 1 1 100%; }
  .toast { right: 18px; left: 18px; bottom: 18px; text-align: center; }
}

@media (max-width: 1180px) {
  .monitor-grid { grid-template-columns: minmax(0, 1fr); }
  .monitor-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .health-strip { grid-template-columns: 1fr 1fr; }
  .health-card:nth-child(2) { border-right: 0; }
  .health-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .gpu-grid { grid-template-columns: 1fr; }
  .resource-row { grid-template-columns: 1fr 1fr; }
  .resource-row .resource:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .health-strip { grid-template-columns: 1fr; }
  .health-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .health-card:last-child { border-bottom: 0; }
  .monitor-side { grid-template-columns: 1fr; }
  .resource-row { grid-template-columns: 1fr; }
  .resource-row .resource:last-child { grid-column: auto; }
  .mini-metrics { gap: 18px; flex-wrap: wrap; }
  .log-head { flex-direction: column; align-items: flex-start; }
  .log-tools { width: 100%; flex-wrap: wrap; }
  .log-tools input { flex: 1; min-width: 120px; }
  .log-line { grid-template-columns: 56px 42px 1fr; }
  .log-line .msg { grid-column: 1 / -1; color: #8f9ca2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Django pages: messages, forms rendered by form.as_div, and the manage panel. */
.message {
  margin: 0 0 18px;
  padding: 12px 15px;
  border: 1px solid #b9dcc8;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
  color: #14522f;
  font-size: 14px;
}
.message.error { border-color: #efc3c9; border-left-color: var(--red); background: var(--red-soft); color: var(--red-dark); }
.message.warning { border-color: #ecd6a2; border-left-color: var(--gold); background: var(--gold-soft); color: #6b4b05; }
.message.info { border-color: #c5dce8; border-left-color: var(--blue); background: #eef6fa; color: #124a68; }

.form-page, .auth-form { min-width: 0; }
.form-page form > div, .auth-form form > div { margin-bottom: 16px; }
.form-page form > div > label, .auth-form form > div > label {
  display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600;
}
.form-page input:not([type="checkbox"]):not([type="radio"]),
.form-page select,
.form-page textarea,
.auth-form input:not([type="checkbox"]):not([type="radio"]),
.auth-form select,
.auth-form textarea {
  width: 100%; min-height: 40px; padding: 8px 11px;
  border: 1px solid #b9c3c8; border-radius: 2px; background: #fff;
  color: var(--ink); font: 400 14px/1.3 var(--font-body);
}
.form-page input[type="checkbox"], .auth-form input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--red); }
.form-page input:focus, .form-page select:focus,
.auth-form input:focus, .auth-form select:focus {
  border-color: var(--red); outline: 2px solid rgba(200,16,46,.16); outline-offset: 0;
}
.helptext { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.errorlist { margin: 5px 0 0; padding: 0; color: var(--red); font-size: 12px; list-style: none; }
.auth-form h1 { font-size: 32px; margin-bottom: 5px; }
.auth-form > p { color: var(--muted); font-size: 14px; }
.auth-form h2 { margin: 22px 0 6px; font-size: 19px; }
.auth-form form { margin-top: 18px; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-form fieldset { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); }
.auth-form legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 13px; }

.manage { margin-top: 20px; padding: 18px; background: var(--panel); border: 1px solid var(--line); }
.manage h2 { font-size: 20px; margin-bottom: 10px; }
.manage form { display: inline-flex; align-items: center; gap: 8px; margin: 6px 10px 0 0; }
.manage input[type="text"] { width: 11rem; height: 36px; padding: 0 9px; border: 1px solid #b9c3c8; border-radius: 2px; }
.manage button, .manage .copy {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel); color: var(--ink); font: 600 13px/1 var(--font-body); cursor: pointer;
}
.manage button:hover, .manage .copy:hover { border-color: #b9c3c8; background: #f7f9fa; }
.manage form[action$="/delete/"] button { border-color: #e7b5bd; color: var(--red-dark); }
.manage form[action$="/delete/"] button:hover { background: var(--red-soft); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 16px; margin: 18px 0 24px; }
.card { padding: 15px 18px; background: var(--panel); border: 1px solid var(--line); }
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 12px; }
.card .big { margin: 2px 0 1px; color: var(--ink); font: 700 30px/1 var(--font-display); }
.meter { height: 6px; margin-bottom: 4px; background: #e7ecee; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--red); }

.tag.saved { background: var(--gold-soft); border-color: #ecd39b; color: #7a5a13; }
.doc table { display: table; }

/* Auto Code and monitoring details that the prototype left to its own pages. */
.mono { font-family: var(--font-mono); }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-wrap { padding: 14px 18px 6px; }
.chart-wrap svg { display: block; width: 100%; height: auto; max-height: 240px; color: var(--red); }
.chart-wrap polyline { stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.filter-form > div { display: flex; flex-direction: column; gap: 4px; }
.filter-form label { margin: 0; color: var(--muted); font: 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.filter-form input, .filter-form select { width: auto; min-width: 12rem; margin: 0; padding: 7px 9px; }
.filter-form input[type="search"] { min-width: 18rem; }
.plain-list { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 13px; }
.plain-list li { margin: 8px 0; }
@media (max-width: 700px) {
  .stats.three { grid-template-columns: 1fr; }
  .filter-form input, .filter-form select, .filter-form input[type="search"] { min-width: 0; width: 100%; }
  .filter-form > div { flex: 1 1 100%; }
}
