/* Status + Statistik pages. Extends the live ui.css tokens; no new colours except chart fill steps of --brand. */
.top nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.page-head { padding: 56px 0 32px; }
.page-head h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 12px; }
.page-head p { margin: 0; color: var(--mute); max-width: 64ch; }
.page-head .meta { margin-top: 14px; font-size: .8125rem; color: var(--faint); }
.page-head .meta b { color: var(--mute); font-weight: 600; }
main > section.pane { padding: 0 0 56px; }

/* summary strip */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.summary div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.summary dt { font-size: .8125rem; color: var(--faint); margin-bottom: 6px; }
.summary dd { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.summary dd small { font-size: .875rem; font-weight: 500; color: var(--faint); margin-left: 4px; letter-spacing: 0; }

/* sync table */
.sync { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sync th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-2); }
.sync td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; font-size: .9375rem; }
.sync tbody tr:first-child td { border-top: 0; }
.sync tbody tr:hover td { background: var(--surface-2); }
.repo { display: flex; align-items: center; gap: 12px; font-weight: 600; white-space: nowrap; }
.repo .logo { margin: 0; width: 30px; height: 30px; justify-self: auto; }
.repo small { display: block; font-weight: 400; font-size: .75rem; color: var(--faint); font-family: var(--mono); }
.when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.when small { display: block; font-size: .75rem; color: var(--faint); }
.src { font-family: var(--mono); font-size: .75rem; color: var(--mute); white-space: nowrap; }
.src small { display: block; color: var(--faint); font-family: var(--sans); }

/* lag meter: 0..24h track, tick at 24h; beyond = full + stale */
.lag { display: grid; grid-template-columns: 88px auto; align-items: center; gap: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .875rem; }
.lag .track { height: 6px; border-radius: 3px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.lag .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--fresh); }
.lag.warn .track i { background: var(--stale); }
.lag.bad .track i { background: var(--fail); }
.lag.bad { color: var(--fail); font-weight: 600; }
.lag.none { color: var(--faint); font-size: .8125rem; }
.lag.none .track { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 5px); }

/* run history pips */
.pips { display: flex; gap: 3px; align-items: center; }
.pips i { width: 8px; height: 18px; border-radius: 2px; background: var(--fresh); opacity: .85; }
.pips i.f { background: var(--fail); opacity: 1; }
.pips i.e { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.pips-empty { font-size: .75rem; color: var(--faint); }

.foot-note { margin: 18px 0 0; font-size: .8125rem; color: var(--faint); max-width: 90ch; }
.foot-note code { color: var(--mute); }

/* ---------- statistik ---------- */
.ranges { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 18px; }
.ranges button { font: 600 .875rem var(--sans); color: var(--mute); background: transparent; border: 0; border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; }
.ranges button:hover { color: var(--ink); }
.ranges button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px #24527F; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.card h2 { font-size: 1.0625rem; font-weight: 650; margin: 0 0 4px; letter-spacing: -0.01em; }
.card .sub { margin: 0 0 16px; font-size: .8125rem; color: var(--faint); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text, .chart .xl text { fill: var(--faint); font: 500 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--brand); }
.chart .bar.part { fill: color-mix(in srgb, var(--brand) 45%, transparent); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.on { fill: var(--link); }
.tip { position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--line-hover); border-radius: var(--r-sm);
  padding: 8px 10px; font-size: .8125rem; line-height: 1.45; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; display: none; box-shadow: 0 12px 24px -12px rgba(0,0,0,.6); }
.tip b { display: block; color: var(--ink); }
.tip span { color: var(--mute); }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li { display: grid; grid-template-columns: 150px 1fr 112px; align-items: center; gap: 12px; font-size: .875rem; }
.hbars .lbl { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.hbars .lbl .logo { margin: 0; width: 20px; height: 20px; border-radius: 5px; justify-self: auto; }
.hbars .lbl .logo::after { inset: 3px; }
.hbars .bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--brand); min-width: 2px; }
.hbars .val { text-align: right; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbars .val small { color: var(--faint); margin-left: 6px; }

.files { width: 100%; border-collapse: collapse; font-size: .875rem; }
.files td { padding: 8px 0; border-top: 1px solid var(--line); }
.files tr:first-child td { border-top: 0; }
.files td.p { font-family: var(--mono); font-size: .75rem; color: var(--mute); max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 16px; }
.files td.p b { color: var(--ink); font-weight: 500; }
.files td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }

@media (max-width: 1100px) {
  .src { display: none; }
  .sync th.c-src { display: none; }
}
@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .page-head { padding: 40px 0 24px; }
  /* sync table -> stacked cards */
  .sync, .sync tbody, .sync tr, .sync td { display: block; }
  .sync thead { display: none; }
  .sync { background: transparent; border: 0; overflow: visible; }
  .sync tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 10px;
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "r s" "l l" "w p"; gap: 12px 12px; }
  .sync td { border: 0 !important; padding: 0; background: transparent !important; }
  .sync td.c-repo { grid-area: r; } .sync td.c-state { grid-area: s; justify-self: end; }
  .sync td.c-lag { grid-area: l; } .sync td.c-when { grid-area: w; } .sync td.c-runs { grid-area: p; justify-self: end; align-self: end; }
  .sync td.c-sched, .sync td.c-src { display: none; }
  .lag { grid-template-columns: 1fr auto; }
}
@media (max-width: 560px) {
  .summary dd { font-size: 1.5rem; }
  .hbars li { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "l v" "b b"; gap: 6px 8px; }
  .hbars .lbl { grid-area: l; } .hbars .val { grid-area: v; } .hbars .bar { grid-area: b; }
  .card { padding: 16px; }
  .ranges { display: flex; } .ranges button { flex: 1; }
}
/* fit: 1240 wrap */
.sync { table-layout: auto; }
.sync th, .sync td { padding-left: 12px; padding-right: 12px; }
.sync .state { white-space: nowrap; }
.src { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1300px) { .c-sched small { display: none; } }
/* ui.css gives .state grid-area:t under 900px; neutralise it outside distro rows */
.sync .state { grid-area: auto; }
@media (max-width: 900px) {
  .sync tr { grid-template-columns: minmax(0, 1fr) auto; }
  .repo { white-space: normal; min-width: 0; }
}

/* ---------- shared chrome: language toggle, footer nav, preview strip ---------- */
.top-right { display: flex; align-items: center; gap: 12px; }
.lang { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.lang button { font: 600 .75rem var(--sans); letter-spacing: .04em; color: var(--mute); background: transparent; border: 0; border-radius: var(--r-sm); padding: 6px 9px; cursor: pointer; min-width: 34px; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px #24527F; }
.preview-bar { background: var(--stale); color: #1A1204; font: 600 .8125rem/1.4 var(--sans); text-align: center; padding: 6px 16px; }
.foot-note a { color: var(--link); }
@media (max-width: 560px) { .lang button { padding: 8px 10px; } }

/* status table: fixed columns so long values ellipsise instead of pushing past the wrap */
.sync { table-layout: fixed; }
.sync th { overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em; }
.sync th:nth-child(1) { width: 19%; } .sync th:nth-child(2) { width: 11%; } .sync th:nth-child(3) { width: 13%; }
.sync th:nth-child(4) { width: 19%; } .sync th:nth-child(5) { width: 14%; } .sync th:nth-child(6) { width: 11%; }
.src { max-width: 100%; }
.repo > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lag { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
.lag > span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .sync th:nth-child(1) { width: 24%; } .sync th:nth-child(4) { width: 22%; } .sync th:nth-child(5) { width: 17%; } }
@media (max-width: 900px) { .lag { grid-template-columns: 1fr auto; } }

/* status legend (end of page) */
.legend-box { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.legend-box h2 { font-size: 1.0625rem; font-weight: 650; margin: 0 0 14px; }
.legend-box dl { margin: 0; display: grid; gap: 12px; }
.legend-box dl > div { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
.legend-box dt { display: flex; align-items: center; min-height: 22px; }
.legend-box dd { margin: 0; color: var(--mute); font-size: .875rem; line-height: 1.6; }
.legend-box dd em { font-style: normal; color: var(--ink); }
.legend-box .lg-term { font-size: .8125rem; font-weight: 600; color: var(--ink); }
.legend-box .pips i { height: 14px; }

/* header nav stays reachable on small screens (ui.css hides it under 900px) */
@media (max-width: 900px) { .top nav { display: flex; } }
@media (max-width: 640px) {
  .top .wrap { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "b l" "n n"; min-height: 0; padding-top: 6px; padding-bottom: 6px; row-gap: 2px; }
  .top-right { display: contents; }
  .brand { grid-area: b; } .lang { grid-area: l; }
  .top nav { grid-area: n; gap: 2px; margin: 0 -10px; overflow-x: auto; }
  .top nav a { padding: 8px 10px; font-size: .8125rem; white-space: nowrap; }
  .legend-box dl > div { grid-template-columns: 1fr; gap: 4px; }
}
