/* Sibling of usage.arhum.club: same surfaces, ink, --s1…--s8 slots and status colours. */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10); --wash: rgba(11,11,11,0.04);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  /* Project colours stay clear of status hues (green/amber/orange/red), so a project never reads as a warning. */
  --r1: #2a78d6; --r2: #7b4fd6; --r3: #d14fa0; --r4: #0f9fb8; --r5: #4a3aa7; --r6: #5f7d99; --r7: #a33fc9; --r8: #3f5fd0;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10); --wash: rgba(255,255,255,0.05);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --r1: #4a95ec; --r2: #9a78ec; --r3: #e472b6; --r4: #2cb6cc; --r5: #8a7ef0; --r6: #8aa3bb; --r7: #c06ae0; --r8: #6f8cf0;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 32px max(12px, env(safe-area-inset-left)); }
main { max-width: 1100px; margin: 0 auto; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 860px) { main { grid-template-columns: 1fr 1fr; align-items: start; } .wide { grid-column: 1 / -1; } }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
h1 { font-size: 20px; margin: 0; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h2 .h2sub { font-weight: 400; }
.card { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--ring); padding: 14px; min-width: 0; }
.muted { color: var(--muted); } .ink2 { color: var(--ink2); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; flex: none; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
[hidden] { display: none !important; }
a { color: var(--s1); }

/* Collapsible cards (as on usage): the title toggles, a folded card keeps its one-line summary. */
.card[data-card] > h2, .card[data-card] > .controls > h2 { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.card[data-card] > h2::before, .card[data-card] > .controls > h2::before { content: "▾"; display: inline-block; width: 16px; color: var(--muted); font-size: 12px; transition: transform .15s; }
.card[data-collapsed] > h2::before, .card[data-collapsed] > .controls > h2::before { transform: rotate(-90deg); }
.card[data-collapsed] > :not(h2):not(.controls):not(.sum), .card[data-collapsed] > .controls > :not(h2) { display: none !important; }
.card[data-collapsed] > h2, .card[data-collapsed] > .controls > h2 { margin-bottom: 0; }
.card[data-collapsed] > .controls { margin-bottom: 0; }
.sum { display: none; font-size: 13px; color: var(--ink2); margin: 6px 0 0 16px; }
.card[data-collapsed] .sum { display: block; }

/* Status pill: icon + words, never colour alone. */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--wash); box-shadow: 0 0 0 1px var(--ring); }
.pill .ic { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.pill.ok .ic { background: var(--good); } .pill.warn .ic { background: var(--warning); color: #000; } .pill.bad .ic { background: var(--critical); }
.pill.ok .ic::after { content: "✓"; } .pill.warn .ic::after { content: "!"; } .pill.bad .ic::after { content: "✕"; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 9px; background: var(--wash); color: var(--ink2); white-space: nowrap; display: inline-flex; align-items: center; }
.hl { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.hl.ok { color: var(--good); } .hl.warn { color: #b07800; } .hl.bad { color: var(--critical); } .hl.off { color: var(--muted); }
@media (prefers-color-scheme: dark) { .hl.warn { color: var(--warning); } }

/* Pools and slot tiles */
.pool { padding: 12px 0; border-top: 1px solid var(--grid); }
.pool:first-child { border-top: 0; padding-top: 2px; }
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
.phead h3 { margin: 0; font-size: 16px; font-weight: 650; }
.phead .facts { color: var(--ink2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pophost { position: relative; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.slot { position: relative; border-radius: 10px; padding: 9px 10px 10px 13px; min-height: 76px; background: var(--wash); box-shadow: 0 0 0 1px var(--ring); overflow: hidden;
  display: flex; flex-direction: column; gap: 2px; transition: background .4s, box-shadow .4s; }
.slot::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, transparent); }
.slot.busy { background: color-mix(in srgb, var(--c) 10%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.slot.idle { background: transparent; box-shadow: inset 0 0 0 1.5px var(--grid); border: 0; justify-content: center; align-items: center; color: var(--muted); font-size: 13px; }
.slot.idle::before { display: none; }
.slots.allidle .slot { min-height: 38px; }
.slot.new { animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.slot .repo { font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; gap: 6px; }
.slot .job { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .el { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.slot .prog { margin-top: auto; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; position: relative; }
.slot .prog i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c); transition: width 1s linear; }
.slot .prog.over i { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 55%, var(--surface)) 5px 9px); }
.slot .eta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.queue { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.qitem { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; padding: 3px 9px 3px 7px; border-radius: 8px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--grid); white-space: nowrap; }
.qitem .w { font-variant-numeric: tabular-nums; color: var(--ink2); margin-left: 6px; }
.qitem.old .w { color: var(--critical); font-weight: 600; }
.qlabel { font-size: 12px; color: var(--muted); margin-right: 2px; }

/* Meters and tiles */
.meter .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meter .val { font-size: 28px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter .bar { position: relative; height: 10px; border-radius: 5px; background: var(--wash); margin: 8px 0 6px; overflow: hidden; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; transition: width .6s; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 14px; margin-bottom: 14px; }
.tile .lbl { font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 2px; }
.tile .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--wash); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring); font-weight: 600; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink2); margin-top: 8px; }

/* ⓘ popovers (definitions) */
details.info { display: inline-block; }
details.info summary { list-style: none; cursor: pointer; color: var(--muted); font-weight: 400; padding: 0 3px; }
details.info summary::-webkit-details-marker { display: none; }
details.info[open] summary { color: var(--s1); }
details.info .pop { position: absolute; z-index: 20; left: 0; right: 0; top: 26px; max-width: 420px; background: var(--surface); color: var(--ink2);
  box-shadow: 0 0 0 1px var(--ring), 0 8px 24px rgba(0,0,0,.18); border-radius: 10px; padding: 4px 12px; font-size: 13px; font-weight: 400; text-align: left; white-space: normal; }
details.info .pop p { margin: 8px 0; }

/* Tables */
.tablebox { overflow-x: auto; margin-top: 6px; }
.tablebox + .tablebox { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink2); padding: 4px 6px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 7px 6px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
.ubar { display: inline-block; width: 40px; height: 6px; border-radius: 3px; background: var(--wash); vertical-align: 1px; margin-left: 6px; overflow: hidden; position: relative; }
.ubar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); border-radius: 3px; }
td:first-child { white-space: nowrap; }
@media (max-width: 560px) { .xs-hide { display: none; } table { font-size: 13px; } td, th { padding-left: 4px; padding-right: 4px; } }

/* Ranked lists */
.rank { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); font-size: 14px; align-items: baseline; }
.rank:last-child { border-bottom: 0; }
.rank .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.rank .sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-left: 15px; }
.rank .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; margin: 2px 0 0 15px; }
.routes { display: grid; gap: 6px; }
.route { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 14px; }
.route .arrow { color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* Charts */
svg { display: block; width: 100%; overflow: visible; }
svg text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg text.lane { fill: var(--ink2); font-size: 12px; font-weight: 600; }
.chartbox { position: relative; touch-action: pan-y; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring), 0 4px 16px rgba(0,0,0,.18);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 160px; max-width: 260px; z-index: 30; display: none; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip b { font-size: 13px; }
footer { font-size: 12px; color: var(--muted); }
footer p { margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
