:root {
    color-scheme: light dark;
    --bg: #f2f2f7;
    --card: #ffffff;
    --text: #1c1c1e;
    --secondary: #6c6c70;
    --accent: #0a84ff;
    --separator: #e0e0e5;
    --negative: #ff3b30;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --card: #1c1c1e;
        --text: #ffffff;
        --secondary: #98989f;
        --separator: #38383a;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.status {
    text-align: center;
    color: var(--secondary);
    padding: 48px 0;
}

.status.error { color: var(--negative); }

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 24px 0 8px; }

.subtitle { color: var(--secondary); margin: 0 0 8px; }

.card {
    background: var(--card);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--separator);
}

.row:last-child { border-bottom: none; }
.row .value { color: var(--secondary); text-align: right; }
.row.negative .value { color: var(--negative); }

/* Zeile mit angehängtem Hinweis: der Hinweis bricht unter Beschriftung/Wert um
   und nimmt die volle Zeilenbreite ein */
.row.has-hint { flex-wrap: wrap; }
.row.has-hint .hint {
    flex-basis: 100%;
    /* enger an die Beginn-Zeile, mehr Luft zur Trennlinie darunter */
    margin-top: 0px;
    margin-bottom: 6px;
}

ul { list-style: none; margin: 0; padding: 0; }

.tag {
    display: inline-block;
    background: var(--bg);
    border-radius: 6px;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    font-size: 0.9rem;
}

/* Teilnehmer, der am gezeigten Termin als abwesend dokumentiert ist: die Chips
   stehen über `.row .value` ohnehin in Sekundärfarbe, daher zusätzlich per
   Deckkraft abgeschwächt (bewusst nicht kursiv). */
.tag.absent { opacity: 0.55; }

.cancelled { /* text-decoration: line-through; */ color: var(--secondary); }
.empty { color: var(--secondary); font-style: italic; }
.count { color: var(--secondary); font-weight: normal; }

/* Statussymbole der Abwesenheits- und Leistungszeilen (durchgestrichenes Auge
   bzw. Daumen); erben die Farbe über currentColor und werden per Zustandsklasse
   grün/rot getönt (wie eye.slash.fill / hand.thumbs*.fill der nativen App) */
.status-icon {
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.15em;
    margin-right: 4px;
}
.status-icon.excused { color: #34c759; }
.status-icon.unexcused { color: var(--negative); }

.hint {
    margin: 8px 0 0;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text);
}

/* „Hinweise"-Zeile mit veröffentlichten Notizen: volle Breite, linksbündig, in
   Primärfarbe – abweichend von der rechtsbündigen sekundären Standard-Wertspalte. */
.row.notes { flex-direction: column; align-items: stretch; gap: 6px; }
.row.notes .value { text-align: left; color: var(--text); }

/* Ein einzelner, aus Markdown gerenderter Notiz-Block. */
.note {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 0.95rem;
    color: var(--text);
    overflow-wrap: anywhere;
}
.note:first-child { margin-top: 0; }

.note h1, .note h2, .note h3, .note h4, .note h5, .note h6 {
    margin: 0.4em 0 0.2em;
    line-height: 1.25;
}
.note h1 { font-size: 1.3rem; }
.note h2 { font-size: 1.15rem; }
.note h3 { font-size: 1.05rem; }
.note h4, .note h5, .note h6 { font-size: 1rem; }

.note code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
    background: color-mix(in srgb, var(--secondary) 20%, transparent);
    padding: 1px 4px;
    border-radius: 4px;
}
.note mark {
    background: color-mix(in srgb, #ffcc00 45%, transparent);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}
.note a { color: var(--accent); }
