/* =========================================================
   EPG Planer – Dokumentation (Feed Guide & User Manual)
   gleiche Farben und Schrift wie die App
   ========================================================= */

:root {
    color-scheme: dark;
    --bg-main: #0e1115;
    --bg-panel: #14181e;
    --bg-panel-light: #1c222a;
    --bg-row: #161b21;
    --surface-head: #11151a;
    --border: rgba(255, 255, 255, .08);
    --border-soft: rgba(255, 255, 255, .045);
    --text: #e9edf2;
    --text-secondary: #8a95a3;
    --text-dark: #5a6470;
    --accent: #4c8dff;
    --accent-soft: rgba(76, 141, 255, .15);
    --onair: #f04a5b;
    --next: #3ccf8e;
    --warning: #f2b14c;
    --r-lg: 10px;
    --r-md: 7px;
    --r-sm: 5px;
    --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
    margin: 0;
    font: 14px/1.65 Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    letter-spacing: .1px;
    color: var(--text);
    background: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}
a { color: #9cc0ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Kopfzeile ---------- */
.doc-top {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px; background: rgba(14, 17, 21, .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.doc-logo {
    display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 9px;
    font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #fff;
    background: linear-gradient(135deg, var(--accent), #1a5fae); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}
.doc-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; line-height: 1.2; }
.doc-sub { font-size: 11.5px; color: var(--text-secondary); }
.doc-top .spacer { flex: 1; }
.doc-top .tag {
    padding: 3px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
    color: var(--next); background: rgba(60,207,142,.12); border: 1px solid rgba(60,207,142,.35); border-radius: 99px;
}

/* ---------- Layout: Inhaltsverzeichnis + Text ---------- */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }
.toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 13px; }
.toc b { display: block; margin-bottom: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--text-dark); }
.toc a { display: block; padding: 4px 10px; color: var(--text-secondary); border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); text-decoration: none; background: var(--bg-row); }
.toc a.sub { padding-left: 22px; font-size: 12.5px; }
.toc a.is-active { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); }

main { min-width: 0; max-width: 820px; }
h1 { margin: 0 0 6px; font-size: 30px; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; }
.lead { margin: 0 0 28px; font-size: 16px; color: var(--text-secondary); }
h2 {
    margin: 48px 0 14px; padding-top: 18px; font-size: 20px; font-weight: 650;
    border-top: 1px solid var(--border);
}
h2 .num { margin-right: 8px; font-family: var(--mono); font-size: 14px; color: var(--accent); }
h3 { margin: 28px 0 8px; font-size: 15.5px; font-weight: 650; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 4px; }
li::marker { color: var(--text-dark); }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---------- Code ---------- */
code, kbd {
    padding: 1px 6px; font-family: var(--mono); font-size: 12.5px;
    background: var(--bg-panel-light); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
}
kbd { padding: 1px 7px; font-size: 11.5px; border-bottom-width: 2px; }
pre {
    position: relative; margin: 0 0 16px; padding: 14px 16px; overflow-x: auto;
    font: 12.5px/1.6 var(--mono); color: #cfd6df;
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-lg);
}
pre code { padding: 0; font-size: inherit; background: none; border: 0; }
pre .c { color: var(--text-dark); }
pre .k { color: #9cc0ff; }
pre .s { color: #a5e3c4; }
pre .a { color: #f2c27a; }
.copy {
    position: absolute; top: 8px; right: 8px; padding: 3px 9px; font: 600 11px/1.4 Inter, system-ui, sans-serif;
    color: var(--text-secondary); background: var(--bg-panel-light); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer;
}
.copy:hover { color: var(--text); border-color: rgba(255,255,255,.18); }

/* ---------- Tabellen ---------- */
.table-wrap { margin: 0 0 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    padding: 9px 12px; text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
    color: var(--text-secondary); background: var(--surface-head); border-bottom: 1px solid var(--border);
}
td { padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td.mono, th.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Hinweise & Karten ---------- */
.note {
    margin: 0 0 16px; padding: 12px 14px 12px 16px; font-size: 13.5px;
    background: var(--accent-soft); border: 1px solid rgba(76,141,255,.3); border-radius: var(--r-lg); box-shadow: inset 3px 0 0 var(--accent);
}
.note.warn { background: rgba(242,177,76,.08); border-color: rgba(242,177,76,.35); box-shadow: inset 3px 0 0 var(--warning); }
.note.ok { background: rgba(60,207,142,.08); border-color: rgba(60,207,142,.35); box-shadow: inset 3px 0 0 var(--next); }
.note > :last-child { margin-bottom: 0; }
.note b:first-child { display: block; margin-bottom: 2px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0 0 18px; }
.card { padding: 14px 16px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card h4 { margin: 0 0 4px; font-size: 13.5px; font-weight: 650; }
.card p { margin: 0; font-size: 12.5px; color: var(--text-secondary); }
.card .pill { display: inline-block; margin-bottom: 8px; }

.pill {
    padding: 1px 8px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    color: #9cc0ff; background: var(--accent-soft); border-radius: 99px;
}
.pill.green { color: var(--next); background: rgba(60,207,142,.14); }
.pill.amber { color: var(--warning); background: rgba(242,177,76,.14); }
.pill.red { color: #ff8a96; background: rgba(240,74,91,.14); }

.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { position: relative; margin-bottom: 10px; padding-left: 36px; }
.steps li::before {
    counter-increment: s; content: counter(s);
    position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 24px; height: 24px;
    font-size: 12px; font-weight: 700; color: #9cc0ff; background: var(--accent-soft); border-radius: 50%;
}

.ui { padding: 1px 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--bg-panel-light); border: 1px solid var(--border); border-radius: var(--r-sm); }

.doc-foot { margin-top: 56px; padding-top: 18px; font-size: 12px; color: var(--text-dark); border-top: 1px solid var(--border); }

/* ---------- Schmale Fenster ---------- */
@media (max-width: 900px) {
    .doc { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
    .toc { position: static; max-height: none; margin-bottom: 24px; padding: 12px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-lg); }
    .doc-top .doc-sub { display: none; }
    h1 { font-size: 25px; }
}
@media print {
    :root { color-scheme: light; }
    body { color: #111; background: #fff; }
    .doc-top, .toc, .copy { display: none; }
    .doc { display: block; padding: 0; }
    pre, .table-wrap, .note, .card { border-color: #ccc; background: #f6f7f9; color: #111; }
    h2 { border-color: #ccc; }
}
