/* «Mein Tag» – Gestaltung. Handy zuerst, Bildschirm danach. Hell und dunkel. */

:root {
    --grund: #F4F4F1;
    --karte: #FFFFFF;
    --rand: #E3E3DE;
    --text: #1A1C1A;
    --leise: #6B6F6B;
    --akzent: #146356;
    --akzent-hell: #E4F0EC;
    --rot: #A6392F;
    --rot-hell: #FBE9E7;
    --gelb: #8A5A12;
    --gelb-hell: #FBF0DC;
    --blau: #26557F;
    --blau-hell: #E6EFF7;
    --schatten: 0 1px 2px rgba(20, 25, 20, .06), 0 4px 14px rgba(20, 25, 20, .05);
    --radius: 14px;
    --leiste: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #14161A;
        --karte: #1D2027;
        --rand: #2C313A;
        --text: #ECEDEA;
        --leise: #9AA0A0;
        --akzent: #5FBBA3;
        --akzent-hell: #17322D;
        --rot: #F0857A;
        --rot-hell: #38211F;
        --gelb: #E5B26A;
        --gelb-hell: #33291A;
        --blau: #8CB7DD;
        --blau-hell: #1B2733;
        --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .28);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    padding-bottom: calc(var(--leiste) + env(safe-area-inset-bottom));
    overscroll-behavior-y: contain;
}

a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Kopf */

.kopf {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
    background: color-mix(in srgb, var(--grund) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--rand);
}
.kopf h1 { font-size: 19px; margin: 0; letter-spacing: -.2px; }
.kopf .datum { color: var(--leise); font-size: 13px; margin: 2px 0 0; }
.kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- Inhalt */

main { padding: 16px 16px 32px; max-width: 1040px; margin: 0 auto; }

h2 { font-size: 17px; margin: 26px 0 10px; letter-spacing: -.2px; }
h2:first-child { margin-top: 4px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
p { margin: 0 0 12px; }

.karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: 16px;
    margin: 0 0 14px;
}
.karte.eng { padding: 12px 14px; }

.leer, .leerKarte {
    color: var(--leise);
    background: var(--karte);
    border: 1px dashed var(--rand);
    border-radius: var(--radius);
    padding: 22px 18px;
    text-align: center;
}
.leerKarte p { margin: 0 0 12px; }

/* ---------------------------------------------------------------- Meldungen */

.meldung, .hinweis {
    border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px;
    display: flex; gap: 10px; align-items: flex-start;
}
.meldung { background: var(--akzent-hell); color: var(--akzent); }
.hinweis { background: var(--rot-hell); color: var(--rot); }

/* ---------------------------------------------------------------- Kacheln */

.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 16px; }
@media (min-width: 700px) { .kacheln { grid-template-columns: repeat(4, 1fr); } }

.kachelLink { display: block; text-decoration: none; color: inherit; }
.kachelLink:hover { text-decoration: none; }
.kachelLink:hover .kachel { border-color: var(--akzent); }
.kachel {
    background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--schatten);
    transition: border-color .15s ease;
}
.kachel .wert { font-size: 26px; font-weight: 620; letter-spacing: -.5px; line-height: 1.1; }
.kachel .label { color: var(--leise); font-size: 13px; }
.kachel.rot .wert { color: var(--rot); }
.kachel.gelb .wert { color: var(--gelb); }
.kachel.gruen .wert { color: var(--akzent); }

/* ---------------------------------------------------------------- Listen */

.tabellenrahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--leise); font-weight: 600; padding: 0 10px 8px; white-space: nowrap;
}
td { padding: 12px 10px; border-top: 1px solid var(--rand); vertical-align: top; }
tr:hover td { background: color-mix(in srgb, var(--akzent) 4%, transparent); }

/* Auf dem Handy wird jede Zeile zu einer Karte mit Beschriftungen. */
@media (max-width: 640px) {
    table, thead, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tr { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
         margin: 0 0 10px; padding: 6px 12px; box-shadow: var(--schatten); }
    tr:hover td { background: none; }
    td { border-top: none; padding: 6px 0; display: flex; gap: 10px; }
    td + td { border-top: 1px solid var(--rand); }
    td::before {
        content: attr(data-titel); color: var(--leise); font-size: 13px;
        min-width: 96px; flex: 0 0 96px;
    }
    td:first-child { font-weight: 600; }
    td:first-child::before { display: none; }
    td:first-child { padding-top: 10px; }
}

/* ---------------------------------------------------------------- Merkzeichen */

.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px;
    font-weight: 600; background: var(--blau-hell); color: var(--blau); white-space: nowrap;
}
.badge.rot { background: var(--rot-hell); color: var(--rot); }
.badge.gelb { background: var(--gelb-hell); color: var(--gelb); }
.badge.gruen { background: var(--akzent-hell); color: var(--akzent); }
.badge.grau { background: color-mix(in srgb, var(--leise) 14%, transparent); color: var(--leise); }

.bereich { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--leise); }
.bereich i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: 0 0 9px; }

.balken { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--leise) 18%, transparent); overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--akzent); border-radius: 999px; }
.balken.gelb i { background: var(--gelb); }
.balken.rot i { background: var(--rot); }

/* ---------------------------------------------------------------- Formulare */

label { display: block; font-size: 13px; color: var(--leise); margin: 0 0 5px; font-weight: 500; }

input[type=text], input[type=password], input[type=date], input[type=time], input[type=number],
input[type=email], input[type=search], select, textarea {
    width: 100%; padding: 11px 12px; font: inherit; font-size: 16px;
    color: var(--text); background: var(--karte);
    border: 1px solid var(--rand); border-radius: 10px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%);
         background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent; }

.feldgruppe { display: grid; gap: 12px; margin: 0 0 14px; }
@media (min-width: 700px) { .feldgruppe.zwei { grid-template-columns: 1fr 1fr; } .feldgruppe.drei { grid-template-columns: repeat(3, 1fr); } }

.zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.zeile > * { flex: 0 0 auto; }
.zeile .weit { flex: 1 1 160px; min-width: 0; }

.ankreuz { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); font-weight: 400; }
.ankreuz input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--akzent); flex: 0 0 22px; }

button, .knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; padding: 11px 17px; font: inherit; font-size: 15px; font-weight: 600;
    color: #fff; background: var(--akzent); border: 1px solid transparent; border-radius: 11px;
    cursor: pointer; text-decoration: none; -webkit-appearance: none;
}
button:hover, .knopf:hover { filter: brightness(1.08); text-decoration: none; }
button.zweit, .knopf.zweit { background: var(--karte); color: var(--text); border-color: var(--rand); }
button.gefahr, .knopf.gefahr { background: var(--rot); }
button.klein, .knopf.klein { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 9px; }
button.blank { background: none; color: var(--leise); border: none; min-height: 34px; padding: 4px 8px; }
button.blank:hover { color: var(--text); filter: none; }

/* ---------------------------------------------------------------- Reiter und Filter */

.reiter { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.reiter::-webkit-scrollbar { display: none; }
.reiter a {
    padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
    color: var(--leise); background: var(--karte); border: 1px solid var(--rand);
}
.reiter a.aktiv { background: var(--akzent); color: #fff; border-color: transparent; }
.reiter a:hover { text-decoration: none; }

/* ---------------------------------------------------------------- Aufgabenzeile */

.aufgabe { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rand); }
.aufgabe:first-child { border-top: none; }
.aufgabe form.haken { margin: 0; flex: 0 0 auto; }
.haken button {
    width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 8px;
    background: var(--karte); border: 2px solid color-mix(in srgb, var(--leise) 45%, transparent); color: transparent;
}
.haken button:hover { border-color: var(--akzent); filter: none; }
.aufgabe.fertig .haken button { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.aufgabe .inhalt { flex: 1 1 auto; min-width: 0; }
.aufgabe .titel { font-weight: 560; word-break: break-word; }
.aufgabe.fertig .titel { text-decoration: line-through; color: var(--leise); }
.aufgabe .unter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--leise); }
.aufgabe .werkzeug { flex: 0 0 auto; display: flex; gap: 4px; }

/* ---------------------------------------------------------------- Tagesplan */

.plan { display: flex; flex-direction: column; gap: 8px; }
.block {
    display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px;
    background: var(--karte); border: 1px solid var(--rand); border-left: 4px solid var(--akzent);
}
.block.termin { border-left-color: var(--blau); }
.block.pause { border-left-color: var(--gelb); }
.block.puffer { border-left-color: var(--leise); }
.block .zeit { flex: 0 0 58px; font-variant-numeric: tabular-nums; font-weight: 620; font-size: 14px; }
.block .was { flex: 1 1 auto; min-width: 0; }
.block .was small { display: block; color: var(--leise); }

/* ---------------------------------------------------------------- Fakten */

dl.fakten { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
dl.fakten dt { color: var(--leise); font-size: 13px; }
dl.fakten dd { margin: 0; }

/* ---------------------------------------------------------------- Untere Leiste */

.leiste {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: color-mix(in srgb, var(--karte) 92%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--rand);
    padding-bottom: env(safe-area-inset-bottom);
}
.leiste a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 9px 2px; font-size: 11px; font-weight: 600; color: var(--leise); text-decoration: none;
    min-height: var(--leiste);
}
.leiste a.aktiv { color: var(--akzent); }
.leiste a:hover { text-decoration: none; }
.leiste svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 860px) {
    body { padding-bottom: 24px; }
    .leiste {
        position: sticky; top: 0; bottom: auto; grid-template-columns: none;
        display: flex; gap: 4px; justify-content: center; border-top: none; border-bottom: 1px solid var(--rand);
    }
    .leiste a { flex-direction: row; gap: 8px; font-size: 14px; padding: 12px 16px; min-height: 0; }
}

/* ---------------------------------------------------------------- Anmelden */

.anmeldung { max-width: 380px; margin: 12vh auto; padding: 0 20px; }
.anmeldung .karte { padding: 26px 24px; }
.anmeldung h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.4px; }
.anmeldung .unterzeile { color: var(--leise); margin: 0 0 22px; }
.anmeldung button { width: 100%; margin-top: 6px; }

/* ---------------------------------------------------------------- Kleinkram */

.leisetext { color: var(--leise); font-size: 13px; }
.rechtsbuendig { text-align: right; }
.abstand { margin-top: 18px; }
.trenner { height: 1px; background: var(--rand); border: none; margin: 18px 0; }
.reihe { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.streifen { display: flex; gap: 6px; flex-wrap: wrap; }

@media print {
    .leiste, .kopf .rechts, button, .knopf { display: none !important; }
    body { background: #fff; padding: 0; }
    .karte { box-shadow: none; border-color: #ccc; }
}

/* ---------------------------------------------------------------- Aufklappbares */

details { margin: 0 0 12px; }
details > summary {
    cursor: pointer; list-style: none; padding: 11px 14px; border-radius: 11px;
    background: var(--karte); border: 1px solid var(--rand);
    font-size: 14px; font-weight: 600; color: var(--leise);
    display: flex; align-items: center; gap: 8px; min-height: 44px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '›'; margin-left: auto; font-size: 18px; transition: transform .15s ease; }
details[open] > summary::after { transform: rotate(90deg); }
details > summary:hover { color: var(--text); border-color: var(--akzent); }
details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details > summary + * { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

.knopf.blank { background: none; color: var(--leise); border: none; min-height: 34px; padding: 4px 8px; font-weight: 500; }
.knopf.blank:hover { color: var(--text); filter: none; }

/* Der Block, der gerade läuft, und der Satz, der heute zählt. */
.block.jetzt {
    border-color: var(--akzent);
    background: var(--akzent-hell);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--akzent) 22%, transparent);
}
.grossersatz {
    font-size: 20px; line-height: 1.35; font-weight: 560; letter-spacing: -.3px;
    margin: 0 0 10px; word-break: break-word;
}
@media (min-width: 700px) { .grossersatz { font-size: 23px; } }

/* Symbole überall gleich – nicht nur in der unteren Leiste. */
.kopf svg, button svg, .knopf svg, .reiter svg, .aufgabe svg {
    width: 20px; height: 20px; stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto;
}
