/*
 * Patchday-Übersicht
 * Ruhige Arbeitsoberfläche; das einzige auffällige Element ist der gelbe Textmarker
 * (und der gelbe Punkt in der Navigation) für alles, was erledigt werden muss.
 */

:root {
    color-scheme: light dark;
    --paper: #f5f6f8;
    --surface: #ffffff;
    --ink: #1b2130;
    --muted: #5b6474;
    --line: #d9dee5;
    --line-strong: #1b2130;
    --hover: #eef1f5;
    --code-bg: #eef0f4;
    --gelb: #ffd200;
    --marker-ink: #1d1a00;
    --ok: #1e7346;
    --warn: #8f4a00;
    --bad: #b42318;
    --link: #1f4fbf;
    --font: "Atkinson Hyperlegible Next", system-ui, sans-serif;
    --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #12151b;
        --surface: #1a1e26;
        --ink: #e5e8ee;
        --muted: #98a1b1;
        --line: #2a303b;
        --line-strong: #98a1b1;
        --hover: #20252e;
        --code-bg: #232833;
        --gelb: #f2c400;
        --ok: #5cc890;
        --warn: #f2a65a;
        --bad: #ff7a6e;
        --link: #8fb1ff;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
}

a {
    color: var(--link);
    text-underline-offset: 0.15em;
}

:focus-visible {
    outline: 3px solid var(--gelb);
    outline-offset: 2px;
}

.page {
    max-width: 78rem;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Navigation */

.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.25rem;
    max-width: 78rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    list-style: none;
}

.nav a {
    position: relative;
    display: block;
    padding: 0.8rem 0.75rem;
    color: var(--muted);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.nav a:hover {
    color: var(--ink);
}

.nav a[aria-current="page"] {
    color: var(--ink);
    box-shadow: inset 0 -3px 0 var(--ink);
}

.dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-left: 0.2rem;
    border-radius: 50%;
    background: var(--gelb);
    vertical-align: 0.1em;
}

/* Kopf */

.top h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.lede {
    max-width: 46rem;
    margin: 0.6rem 0 1.25rem;
    color: var(--muted);
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin: 0.5rem 0 1.25rem;
    color: var(--muted);
}

.global-commands {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.hint {
    color: var(--muted);
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

h2 {
    margin: 0 0 0.75rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.25;
}

h3 {
    margin: 1.25rem 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
}

.page > section + section {
    margin-top: 3rem;
}

.section-lede {
    margin: -0.25rem 0 1rem;
    color: var(--muted);
}

/* Textmarker: gelb hinterlegt = hier ist etwas zu tun */

.mark {
    color: var(--marker-ink);
    background: linear-gradient(
        100deg,
        transparent 0.12em,
        var(--gelb) 0.3em,
        var(--gelb) calc(100% - 0.3em),
        transparent calc(100% - 0.12em)
    );
    padding: 0.08em 0.5em;
    font-weight: 600;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.overview .mark,
.top .mark {
    white-space: nowrap;
}

.state-ready {
    color: var(--ok);
    font-weight: 600;
}

.tag {
    display: inline-block;
    padding: 0 0.4em;
    border: 1px solid var(--line);
    border-radius: 0.25rem;
    color: var(--muted);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.mono {
    font-family: var(--mono);
    font-size: 0.875em;
}

.small {
    font-size: 0.8125rem;
}

.sub {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.muted,
.zero,
.none {
    color: var(--muted);
}

.bad {
    color: var(--bad);
}

/* Kopier-Knöpfe */

.copy,
.chip {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.copy {
    flex: none;
    padding: 0.2rem 0.6rem;
    font-size: 0.8125rem;
}

.copy:hover,
.chip:hover {
    border-color: var(--line-strong);
}

.copy[data-done],
.chip[data-done] {
    border-color: var(--ok);
    color: var(--ok);
}

/* Tabellen */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border-top: 2px solid var(--line-strong);
}

.overview,
.matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.overview th,
.overview td,
.matrix th,
.matrix td {
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.overview thead th,
.matrix thead th {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.overview tbody th,
.matrix tbody th {
    font-weight: 600;
    white-space: nowrap;
}

.overview tbody th a,
.matrix tbody th a {
    color: inherit;
}

.overview tbody tr:hover {
    background: var(--hover);
}

.overview .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.overview .when {
    white-space: nowrap;
    color: var(--muted);
}

/* Name und Knöpfe bleiben beieinander, die letzte Spalte nimmt den Rest der Breite */
.matrix th:first-child,
.matrix td {
    width: 1%;
}

.matrix td {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    vertical-align: middle;
}

.matrix td:last-child {
    width: auto;
}

.matrix tbody th {
    vertical-align: middle;
    padding-right: 1.5rem;
}

.smoke--ok {
    color: var(--ok);
}

.smoke--warn {
    color: var(--warn);
}

.smoke--bad {
    color: var(--bad);
    font-weight: 600;
}

.smoke--none {
    color: var(--muted);
}

/* Detailseite */

.todo {
    margin-bottom: 3rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-left: 4px solid var(--gelb);
}

.todo h2 {
    font-size: 1.125rem;
}

.todo ul {
    margin: 0;
    padding-left: 1.1rem;
}

.todo li + li {
    margin-top: 0.45rem;
}

.todo .is-info {
    color: var(--muted);
}

.todo .mark {
    white-space: normal;
}

.todo p {
    margin: 0;
}

.detail {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 3rem;
}

.facts {
    min-width: 0;
}

.table-scroll {
    overflow-x: auto;
}

.facts > section + section,
.side > section + section {
    margin-top: 2.5rem;
}

.facts p {
    margin: 0 0 0.5rem;
    max-width: 46rem;
}

.changes li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}

.more {
    margin-top: 0.75rem;
}

.more > summary {
    color: var(--link);
    cursor: pointer;
    font-size: 0.9375rem;
}

.more[open] > summary {
    margin-bottom: 0.6rem;
}

.more.inline {
    margin-top: 0;
}

.pairs {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.4rem 1.25rem;
    margin: 0;
    font-size: 0.9375rem;
}

.pairs dt {
    color: var(--muted);
}

.pairs dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.scroll {
    max-height: 24rem;
    overflow: auto;
    border: 1px solid var(--line);
    background: var(--surface);
}

.list {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--surface);
}

.list th,
.list td {
    padding: 0.4rem 0.6rem;
    text-align: left;
    vertical-align: baseline;
    border-bottom: 1px solid var(--line);
}

/* lange Paketnamen dürfen überall umbrechen, normaler Text nur zwischen Wörtern */
.list td.mono {
    overflow-wrap: anywhere;
}

.list .nowrap {
    white-space: nowrap;
}

.list thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8125rem;
}

.list tr:last-child td {
    border-bottom: 0;
}

.inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}

.plain {
    margin: 0;
    padding: 0;
    list-style: none;
}

.plain li + li {
    margin-top: 0.5rem;
}

.problem {
    display: block;
    margin-left: 1rem;
    font-size: 0.875rem;
}

.problem .bad {
    display: inline-block;
    min-width: 2.25rem;
}

.log li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
}

.log .sub {
    display: inline;
}

/* Lange Logzeilen (z. B. JSON-Kontext) umbrechen statt in die Nachbarspalte laufen */
.log li > .mono {
    flex: 1 1 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Seitenspalte: Befehle, Links, Hinweise */

.side {
    min-width: 0;
}

.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    margin-bottom: 0.9rem;
}

.step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.step-head > span::before {
    content: counter(step) ". ";
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.cmd {
    display: block;
    max-height: 7.5em;
    overflow: auto;
    padding: 0.5rem 0.65rem;
    background: var(--code-bg);
    border-radius: 0.3rem;
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notes {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9375rem;
}

.notes li + li {
    margin-top: 0.4rem;
}

@media (max-width: 60rem) {
    .page {
        padding: 1.5rem 1rem 3rem;
    }

    .nav ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 0.5rem;
    }

    .nav a {
        white-space: nowrap;
    }

    .detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
    }
}
