[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262a33;
  --text: #eef0f4;
  --muted: #9097a3;
  --green: #4cc38a;
  --red: #e5604d;
  --accent: #8b7bf4;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, rgba(139,123,244,.12), transparent 60%), var(--bg); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.label, th, dt { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .08em; font-weight: 500; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--accent); }
.button:disabled { opacity: .5; cursor: default; }
.button.ghost { background: transparent; }
.button.discord { min-height: 44px; border-color: #5865f2; background: #5865f2; font-weight: 600; }
.button.discord:hover { background: #4752c4; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; background: var(--accent); color: #0f1115; font-family: "DM Mono", monospace; font-weight: 500; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topbar-right form { margin: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 48px; }
.error { padding: 10px 14px; border: 1px solid var(--red); border-radius: 8px; color: var(--red); }

.hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.big { margin-top: 6px; font-size: clamp(38px, 6vw, 56px); font-weight: 700; letter-spacing: -.02em; }
.big.projected { color: var(--muted); }
.hero-note { grid-column: 1 / -1; margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.card.is-off { border-style: dashed; }
.card-value { font-size: 26px; font-weight: 700; }
.not-set { margin: 0; color: #e8a26a; font-size: 13px; }

.panel { min-width: 0; margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.panel h2 { margin: 0 0 10px; font-size: 16px; }
.panel h3 { margin: 18px 0 8px; color: #cfd3da; font-size: 13px; font-weight: 600; }
.panel p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .panel { margin-bottom: 0; }
.grid + .grid, .grid + .panel { margin-top: 16px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart { display: flex; gap: 8px; height: 200px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 18px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; text-align: right; }
.chart-bars { display: flex; flex: 1; gap: 3px; min-width: 0; }
.day { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; }
.stack { display: flex; margin-top: auto; flex-direction: column-reverse; overflow: hidden; border-radius: 3px 3px 0 0; }
.stack i { display: block; min-height: 2px; }
.day-label { height: 12px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; white-space: nowrap; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 12px; }
.facts div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #12151b; }
.facts dd { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.meter { display: grid; gap: 6px; margin: 4px 0 6px; }
.meter-track { height: 8px; overflow: hidden; border-radius: 99px; background: #232731; }
.meter-track i { display: block; height: 100%; border-radius: 99px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid #1f232b; vertical-align: top; }
td:last-child, th:last-child { text-align: right; }
.panel { overflow-x: auto; }

.login { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-card { display: grid; gap: 14px; max-width: 420px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.login-card h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.25; }
.login-card p { margin: 0; }
.login-error { color: var(--red); font-size: 13px; }
.login-error:empty { display: none; }

@media (max-width: 760px) {
  .hero, .grid { grid-template-columns: minmax(0, 1fr); }
  .grid .panel + .panel { margin-top: 16px; }
  .chart { height: 160px; }
  .page { padding: 18px 16px 40px; }
  .topbar { padding: 14px 16px; }
}

/* Sections */
.tabs-nav { display: flex; gap: 4px; max-width: 1120px; margin: 0 auto; padding: 10px 20px 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs-nav a:hover { color: var(--text); }
.tabs-nav a[aria-current] { border-bottom-color: var(--accent); color: var(--text); }
.count { min-width: 18px; padding: 1px 6px; border-radius: 99px; background: var(--red); color: white; font-size: 11px; font-weight: 600; text-align: center; }
.count[hidden] { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head p { margin: 0; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #12151b; }
.segmented button { padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.controls input[type="search"], .controls select, input.wide, .panel textarea, .actions input { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #12151b; color: var(--text); font: inherit; font-size: 13px; }
.controls input[type="search"] { min-width: 220px; flex: 1 1 220px; }
input.wide { width: 100%; margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.center { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.nowrap { white-space: nowrap; }
.null { color: #5f6570; white-space: nowrap; }
.warn-text { color: #e8a26a; }
.small-value { font-size: 18px; }
.button.primary { border-color: var(--green); background: rgba(76,195,138,.18); }
.table-wrap { overflow-x: auto; }
td.empty { color: var(--muted); text-align: center; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #1c2029; }
td.kinds { max-width: 300px; color: #cfd3da; font-size: 12px; }
.facts small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

/* Bot health */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--green); }
.dot.warn { background: #e8c46a; }
.dot.backoff { background: #e8a26a; }
.dot.failing { background: var(--red); box-shadow: 0 0 0 3px rgba(229,96,77,.25); }

/* Logs */
.level { display: inline-block; padding: 2px 6px; border-radius: 4px; font-family: "DM Mono", monospace; font-size: 10px; }
.level.info { background: #232731; color: var(--muted); }
.level.warn { background: rgba(232,162,106,.18); color: #e8a26a; }
.level.error { background: rgba(229,96,77,.18); color: var(--red); }
.log-message { display: block; color: #d6dae1; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
td code { color: #d6dae1; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Games */
.chart-bars .stack-wrap { position: relative; display: flex; flex: 1; align-items: flex-end; }
.stack-wrap .stack { width: 100%; }
.players-dot { position: absolute; left: 50%; width: 6px; height: 6px; margin: 0 0 -3px -3px; border-radius: 50%; background: #eef0f4; }
.dist { margin-bottom: 14px; }
.dist h3 { margin: 0 0 8px; }
.dist-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 34px; align-items: center; gap: 8px; margin-bottom: 4px; font-family: "DM Mono", monospace; font-size: 11px; }
.dist-bar { height: 12px; border-radius: 3px; background: #1d2129; }
.dist-bar i { display: block; height: 100%; min-width: 2px; border-radius: 3px; }
.dist-count { color: var(--muted); text-align: right; }
.who { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.who img { width: 22px; height: 22px; border-radius: 50%; }
.who.guest { color: var(--muted); }

/* Reports */
.reports { display: grid; gap: 12px; }
.report { padding: 14px; border: 1px solid var(--line); border-left: 3px solid #e8a26a; border-radius: 10px; background: #12151b; }
.report header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 10px; font-size: 13px; }
.report-body { display: flex; gap: 14px; }
.report-thumb { width: 84px; flex: 0 0 84px; align-self: flex-start; border-radius: 6px; }
.report-info { min-width: 0; }
.report-info h3 { margin: 0 0 4px; }
.report-info p { margin: 0 0 4px; font-size: 13px; }
.report a, .panel a { color: #b4a9ff; }
.proof { display: grid; gap: 4px; margin: 8px 0; }
.proof code { padding: 6px 8px; border-radius: 6px; background: var(--bg); font-size: 12px; overflow-wrap: anywhere; }
.report blockquote { margin: 8px 0 0; padding: 8px 10px; border-left: 2px solid var(--line); background: var(--bg); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.panel textarea { width: 100%; min-height: 54px; margin-top: 10px; padding: 8px 10px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.actions[hidden] { display: none; }
.actions input { flex: 1 1 220px; }
.action-result { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.excluded-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.excluded-row p { margin: 3px 0 0; }

/* Card checks */
.disagreement { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-left: 3px solid #e8a26a; border-radius: 8px; background: #12151b; font-size: 13px; }
.disagreement p { margin: 6px 0 0; overflow-wrap: anywhere; }
.pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 760px; overflow-y: auto; }
.picture { min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #12151b; }
.picture img { display: block; width: 100%; aspect-ratio: 5 / 7; border-radius: 6px; background: var(--bg); object-fit: contain; }
.picture figcaption { display: grid; gap: 3px; margin-top: 7px; font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .tabs-nav { padding: 6px 12px 0; }
  .report-thumb { width: 64px; flex-basis: 64px; }
  .pictures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls input[type="search"] { min-width: 0; }
}

/* Card labels */
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.label-card { display: grid; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #12151b; }
.label-card.answered { opacity: .55; }
.label-card.answered:hover, .label-card.answered:focus-within { opacity: 1; }
.label-pictures { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.label-pictures figure { display: grid; gap: 4px; min-width: 0; margin: 0; }
.label-pictures img, .label-guess-none { display: block; width: 100%; height: 190px; border-radius: 6px; background: var(--bg); object-fit: contain; }
.label-guess-none { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.label-info { display: grid; gap: 2px; overflow-wrap: anywhere; }
.label-card .actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.label-card form.actions input { flex: 1 1 160px; min-width: 0; }
.label-tags { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.label-tags label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.label-card .action-result { margin: 0; min-height: 1em; }
/* A crop with the face the bot read boxed: the frame hugs the picture so the box lines up */
.label-crop { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.label-pictures .label-crop img { width: auto; height: auto; max-width: 100%; max-height: 190px; object-fit: fill; }
.label-box { position: absolute; border: 2px solid #ffcc00; border-radius: 3px; pointer-events: none; }
/* Card labels: try-again and search panels, the whole photo */
.label-panel { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.label-panel .controls input[type="search"] { min-width: 0; }
.version-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; }
.version { display: grid; gap: 3px; align-content: start; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.version:hover, .version:focus-visible { border-color: var(--accent); }
.version.best { border-color: var(--green); }
.version img { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 4px; }
.version-name { overflow-wrap: anywhere; }
.version-best { color: var(--green); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .06em; }
.label-photo { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.label-photo img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; border-radius: 6px; }
.link-button { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; letter-spacing: inherit; text-decoration: underline; cursor: pointer; }
