/* SKE Version Tracker – ein Stylesheet, hell/dunkel über prefers-color-scheme. */

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --text: #15202b;
  --muted: #5b6b78;
  --border: #dbe2e6;
  --accent: #006e74;
  --accent-ink: #ffffff;
  --focus: #0a84ff;

  --st-preview: #6b54c9;
  --st-supported: #1d7f4e;
  --st-deprecated: #b86e00;
  --st-expired: #c2362f;
  --st-gone: #7a8691;
  --st-preview-bg: #efebfb;
  --st-supported-bg: #e3f3ea;
  --st-deprecated-bg: #fbf0dc;
  --st-expired-bg: #fbe5e3;
  --st-gone-bg: #eceff1;

  --pd: #8a63d2;
  --now: #006e74;
  --grid: #e5eaed;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 1px 8px rgba(16, 24, 32, .04);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1519;
    --surface: #161e23;
    --surface-2: #1d272d;
    --text: #e4eaee;
    --muted: #93a3ae;
    --border: #2a363d;
    --accent: #2fb5b0;
    --accent-ink: #062022;
    --st-preview: #a796f0;
    --st-supported: #4cc387;
    --st-deprecated: #f0a63a;
    --st-expired: #f07a72;
    --st-gone: #8d99a3;
    --st-preview-bg: #2a2445;
    --st-supported-bg: #163528;
    --st-deprecated-bg: #3b2a10;
    --st-expired-bg: #42201e;
    --st-gone-bg: #242d33;
    --pd: #b294f0;
    --now: #2fb5b0;
    --grid: #222c32;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: 1rem; color: var(--muted); }
small, .muted { color: var(--muted); }
small { font-weight: normal; font-size: .82em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* --- Kopf ------------------------------------------------------------------ */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand svg rect { fill: var(--accent); }
.brand svg path { fill: var(--accent-ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { font-size: .75rem; }
.tabs { display: flex; gap: 4px; }
.tabs a {
  padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.poll { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); cursor: help; }
.poll .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-gone); }
.poll-ok .dot { background: var(--st-supported); box-shadow: 0 0 0 3px var(--st-supported-bg); }
.poll-warn .dot { background: var(--st-deprecated); box-shadow: 0 0 0 3px var(--st-deprecated-bg); }
.poll-err .dot { background: var(--st-expired); box-shadow: 0 0 0 3px var(--st-expired-bg); }

/* --- Filter ---------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 14px 22px; padding-top: 18px; padding-bottom: 18px; align-items: flex-end; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.f > span { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; }
.f-end { margin-left: auto; }
.row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
input[type="date"], input[type="time"], select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; min-height: 36px; font-size: .9rem;
}
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: .9rem; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.seg-sm button { padding: 4px 9px; font-size: .82rem; }
.btn, .icon-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; min-height: 36px; cursor: pointer; font-size: .9rem;
}
.btn:hover, .icon-btn:hover { background: var(--surface-2); }
.icon-btn { padding: 4px 10px; font-size: 1.05rem; line-height: 1; }

/* --- Karten, Tabellen ------------------------------------------------------ */
main { padding-bottom: 32px; min-height: 50vh; }
main[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px; min-width: 0;
}
.card h2 small { margin-left: 6px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
table.compact td { padding: 4px 8px; }

.vlink {
  font-family: var(--mono); font-size: .88em; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left;
}
.vlink:hover { text-decoration: underline; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.badge.st-preview { color: var(--st-preview); background: var(--st-preview-bg); }
.badge.st-supported { color: var(--st-supported); background: var(--st-supported-bg); }
.badge.st-deprecated { color: var(--st-deprecated); background: var(--st-deprecated-bg); }
.badge.st-expired { color: var(--st-expired); background: var(--st-expired-bg); }
.badge.st-gone, .badge.st-unknown { color: var(--st-gone); background: var(--st-gone-bg); }

.cd { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-urgent { color: var(--st-expired); font-weight: 600; }
.cd-soon { color: var(--st-deprecated); font-weight: 600; }
.cd-later { color: var(--muted); }
.cd-past { color: var(--st-gone); }

.tag {
  display: inline-block; font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 5px; margin-left: 6px;
  color: var(--pd); border: 1px solid currentColor; vertical-align: middle; text-transform: uppercase; letter-spacing: .03em;
}
.tag-lg { font-size: .8rem; padding: 2px 9px; }
.tag-sel { color: var(--accent); }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; }
.stat strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }

.callout { border-left: 4px solid var(--st-deprecated); }
.callout p { margin: -4px 0 10px; font-size: .88rem; }
.exp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.exp-list li { display: grid; grid-template-columns: minmax(220px, auto) 1fr; gap: 6px 16px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--grid); }
.exp-list li:first-child { border-top: 0; }
.exp-when { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.exp-what { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-size: .88rem; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary h2 { display: inline; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }

.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); margin-bottom: 16px; }
.empty strong { color: var(--text); }
.empty.warn { border-color: var(--st-deprecated); text-align: left; padding: 14px 18px; }
.err, .empty.err { color: var(--st-expired); }

/* --- Zeitleiste ------------------------------------------------------------ */
.tl-card { padding: 12px 8px 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); padding: 0 10px 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.sw.st-preview { background: var(--st-preview); }
.sw.st-supported { background: var(--st-supported); }
.sw.st-deprecated { background: var(--st-deprecated); }
.sw.st-expired { background: var(--st-expired); }
.sw-open { background: linear-gradient(90deg, var(--surface), var(--st-supported)); }
.sw-exp { width: 10px; height: 10px; background: var(--st-expired); transform: rotate(45deg); border-radius: 1px; }
.ln { display: inline-block; width: 0; height: 14px; border-left: 2px solid; }
.ln-pd { border-color: var(--pd); border-left-style: dashed; }
.ln-now { border-color: var(--now); }
.tl { width: 100%; overflow-x: auto; }
.tl svg { display: block; font-size: 12px; }
.tl .axis { fill: var(--muted); font-size: 12px; font-weight: 600; }
.tl .axis-sm { font-size: 10px; font-weight: 400; }
.tl .grid { stroke: var(--grid); stroke-width: 1; }
.tl .grid-major { stroke: var(--border); }
.tl .group { fill: var(--text); font-weight: 700; font-size: 13px; }
.tl .group-sep { stroke: var(--border); }
.tl .row-sep { stroke: var(--grid); stroke-width: .5; }
.tl .vlabel { fill: var(--accent); font-family: var(--mono); font-size: 11.5px; cursor: pointer; }
.tl .vlabel:hover { text-decoration: underline; }
.tl .bar { stroke: var(--surface); stroke-width: 1; }
.tl .bar.st-preview { fill: var(--st-preview); }
.tl .bar.st-supported { fill: var(--st-supported); }
.tl .bar.st-deprecated { fill: var(--st-deprecated); }
.tl .bar.st-expired { fill: var(--st-expired); }
.tl .bar.st-unknown { fill: var(--st-gone); }
.tl .bar:hover { filter: brightness(1.12); }
.tl .fade-a { stop-color: var(--surface); stop-opacity: 1; }
.tl .fade-b { stop-color: var(--surface); stop-opacity: 0; }
.tl .open-start { pointer-events: none; }
.tl .pd { stroke: var(--pd); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .75; }
.tl .now { stroke: var(--now); stroke-width: 2; }
.tl .now-label { fill: var(--now); font-size: 10px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.tl .pd-label { fill: var(--pd); font-size: 9px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.tl .planned { stroke: var(--st-deprecated); stroke-width: 2; stroke-dasharray: 2 3; opacity: .8; }
.tl .exp { fill: var(--st-expired); stroke: var(--surface); stroke-width: 1.5; }
.tl .gone { stroke: var(--st-gone); stroke-width: 2; fill: none; stroke-linecap: round; }
.tl .hit { cursor: default; }

.tooltip {
  position: fixed; z-index: 50; max-width: 320px; pointer-events: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: .82rem; line-height: 1.5; box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

/* --- Was war am …? --------------------------------------------------------- */
.at-head { margin: 4px 0 14px; }
.at-head h1 { margin-bottom: 2px; }
.at-head p { margin: 0; }
.summary ul { margin: 0; padding-left: 18px; }
.summary li { margin: 2px 0; }
.summary li.hl { color: var(--st-expired); }
.at-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.at-grid .card { margin-bottom: 0; }
.days { list-style: none; margin: 0; padding: 0; }
.day { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); position: relative; }
.day::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.day-sel { border-left-color: var(--accent); background: linear-gradient(90deg, var(--surface-2), transparent 70%); border-radius: 0 8px 8px 0; }
.day-sel::before { border-color: var(--accent); background: var(--accent); }
.day-head { font-weight: 600; margin-bottom: 4px; }
.day-head a { color: var(--text); text-decoration: none; }
.day-head a:hover { text-decoration: underline; }
.evs { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 44px 96px 1fr; gap: 8px; align-items: baseline; padding: 3px 0; font-size: .9rem; }
.ev time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; }
.ev-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.t-appeared { color: var(--st-preview); }
.t-state_changed { color: var(--accent); }
.t-expiration_changed { color: var(--st-deprecated); }
.t-disappeared { color: var(--st-gone); }
.t-exp { color: var(--st-expired); }
.ev-exp { background: var(--st-expired-bg); border-radius: 6px; padding: 4px 6px; margin: 2px 0; }
.ev-none { display: block; color: var(--muted); font-size: .85rem; }
.ev-initial details ul { margin: 6px 0 0; padding-left: 16px; }
.ev-initial summary { color: var(--muted); }
.ev-initial summary::before { content: "▸ "; }

/* --- Dialog ---------------------------------------------------------------- */
dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(10, 16, 20, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.dlg-head h2 { font-family: var(--mono); font-size: 1.05rem; margin: 0; word-break: break-all; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.hist { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.hist li { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--grid); }
.hist time { color: var(--muted); font-variant-numeric: tabular-nums; }
.dlg-links { margin: 14px 0 0; font-size: .9rem; }

/* --- Fuß ------------------------------------------------------------------- */
.foot { border-top: 1px solid var(--border); padding-top: 16px; padding-bottom: 32px; font-size: .82rem; color: var(--muted); }
.foot p { margin: 0 0 6px; max-width: 900px; }
.foot strong { color: var(--text); }

/* --- Responsiv ------------------------------------------------------------- */
@media (max-width: 900px) {
  .at-grid { grid-template-columns: 1fr; }
  .exp-list li { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top-inner { gap: 8px 12px; padding-top: 8px; padding-bottom: 8px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tabs a { padding: 6px 10px; white-space: nowrap; }
  .brand small { display: none; }
  .f-end { margin-left: 0; }
  .hide-sm { display: none; }
  .ev { grid-template-columns: 40px 1fr; }
  .ev .ev-type { display: none; }
  .hist li { grid-template-columns: 1fr; gap: 0; }
}
