/* Celeste Reports. Built on the console's variables. Series colours are a colour-blind-checked palette, selected
   separately for the light and dark surfaces; charts.js reads them from here. */
:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #ffffff; --text: #1d2330; --muted: #5d687c; --line: #e3e6eb; --axis: #c3c8d1;
  --accent: #2459d6; --ok: #006300; --bad: #b42318; --warn: #9a5b00; --warn-bg: #fff3dc; --neutral-bg: #eef0f3;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4;
  --series-6: #008300; --series-7: #6250d6; --series-0: #98a2b3;
  --ord-1: #86b6ef; --ord-2: #5598e7; --ord-3: #2a78d6; --ord-4: #1c5cab; --ord-5: #104281;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12151b; --surface: #1a1f27; --text: #e6e9ef; --muted: #98a2b3; --line: #2b323d; --axis: #444d5c;
    --accent: #7ea2ff; --ok: #0ca30c; --bad: #ff8a80; --warn: #f5c060; --warn-bg: #3a2c10; --neutral-bg: #262c36;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
    --series-6: #0ca30c; --series-7: #9085e9; --series-0: #667085;
    --ord-1: #184f95; --ord-2: #256abf; --ord-3: #3987e5; --ord-4: #6da7ec; --ord-5: #9ec5f4;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 22px; margin: 4px 0 8px; }
h2 { font-size: 15px; margin: 0 0 10px; }
main { max-width: 1320px; margin: 0 auto; padding: 20px 16px 40px; }
main > section { margin-bottom: 24px; }
footer { max-width: 1320px; margin: 0 auto; padding: 0 16px 24px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bad { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; }

input, select, button { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text); }
button { cursor: pointer; }
button.primary, .button { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { button.primary, .button { color: #0d1117; } }
.button { display: inline-block; padding: 9px 16px; border-radius: 8px; }
.button:hover { text-decoration: none; opacity: .92; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); }
.brand span { font-weight: 400; color: var(--muted); }
.top nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.top nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.top nav a.active, .top nav a:hover { background: var(--neutral-bg); color: var(--text); text-decoration: none; }
.user { margin-left: auto; position: relative; }
.user summary { cursor: pointer; color: var(--muted); }
.user .menu { position: absolute; right: 0; top: 28px; z-index: 10; min-width: 220px; padding: 4px 14px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 15%); }

.hero { text-align: center; padding: 12px 0; }
.bigsearch { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.bigsearch input { flex: 1; padding: 10px 14px; font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.cards li { display: flex; }
.card { display: flex; flex-direction: column; gap: 6px; width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card.narrow { display: block; max-width: 460px; margin: 40px auto; }
.count { font-size: 12px; color: var(--accent); margin-top: auto; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--neutral-bg); color: var(--muted); vertical-align: middle; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--neutral-bg); color: var(--muted); font-size: 12px; }
.chip.active { background: var(--accent); color: var(--surface); }

.crumb { margin: 0; font-size: 12px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.caveats { border-left: 3px solid var(--warn); background: var(--warn-bg); border-radius: 0 8px 8px 0; padding: 8px 14px; margin: 0 0 14px; }
.caveats ul { margin: 4px 0 0; padding-left: 18px; }
.banner { background: var(--warn-bg); color: var(--warn); padding: 8px 14px; border-radius: 8px; }

/* one filter row above everything it scopes */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; padding: 12px 14px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.filters label, .filters .field { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.filters select, .filters input, .filters summary { font-size: 14px; color: var(--text); }
.multi { position: relative; }
.multi summary { cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 150px; max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi .options { position: absolute; z-index: 10; top: 38px; left: 0; display: grid; gap: 2px; width: max-content;
  min-width: 100%; max-width: min(340px, 90vw); max-height: 320px; overflow: auto; margin: 0; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 15%); }
.multi .options label { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text); padding: 3px 0; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.tile > header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tile h2 { margin-bottom: 6px; }
.tile.kpi h2 { font-size: 12px; font-weight: 500; color: var(--muted); }
.export { font-size: 12px; white-space: nowrap; }
.value { font-size: 28px; font-weight: 650; margin: 0; }
.delta { margin: 4px 0 0; font-size: 12.5px; }
.delta.good { color: var(--ok); } .delta.bad { color: var(--bad); } .delta.neutral { color: var(--text); }
.w-1 { grid-column: span 1; } .w-2 { grid-column: span 2; } .w-3 { grid-column: span 3; } .w-4 { grid-column: span 4; }
.w-5 { grid-column: span 5; } .w-6 { grid-column: span 6; } .w-7 { grid-column: span 7; } .w-8 { grid-column: span 8; }
.w-9 { grid-column: span 9; } .w-10 { grid-column: span 10; } .w-11 { grid-column: span 11; } .w-12 { grid-column: span 12; }
@media (max-width: 1000px) {
  .tile.kpi { grid-column: span 6; }
  .tile:not(.kpi) { grid-column: span 12; }
}
@media (max-width: 640px) {
  .tile, .tile.kpi { grid-column: span 12; }
  .value { font-size: 24px; }
  .top nav { order: 3; flex-basis: 100%; }
  .search { order: 4; flex-basis: 100%; } .search input { width: 100%; }
}

.chart { width: 100%; }
.data summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.scroll { overflow: auto; max-height: 480px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td.r, th.r { text-align: right; }
td.r { white-space: nowrap; }

@media print { .filters, .top nav, .search, .export { display: none; } }
