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

:root {
    --gruen:      #2d6a2d;
    --gruen-hell: #4a9e4a;
    --gruen-bg:   #f0f7f0;
    --text:       #1a1a1a;
    --text-leise: #666;
    --rand:       #dde8dd;
    --weiss:      #ffffff;
    --radius:     10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gruen-bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
}

/* ── Header ── */
header {
    background: var(--gruen);
    color: var(--weiss);
    text-align: center;
    padding: calc(env(safe-area-inset-top, 0px) + .9rem) 1rem .8rem;
}
header h1   { font-size: 1.3rem; font-weight: 700; }
.schule     { font-size: .8rem; opacity: .75; margin-top: .15rem; }

/* ── Main ── */
main {
    flex: 1;
    padding: 1rem;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* ── Wochen-Block ── */
.woche-block h2 {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gruen);
    margin-bottom: .5rem;
    padding-left: .2rem;
}

/* ── Tabelle ── */
.plan-tabelle {
    background: var(--weiss);
    border-radius: var(--radius);
    border: 1px solid var(--rand);
    overflow: hidden;
}

.plan-zeile {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    border-bottom: 1px solid var(--rand);
    min-height: 2.8rem;
}
.plan-zeile:last-child { border-bottom: none; }
.plan-zeile.heute { background: #edf6ed; }

.tag-zelle {
    padding: .55rem .7rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gruen);
    border-right: 1px solid var(--rand);
    display: flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}
.heute-dot {
    width: 6px; height: 6px;
    background: var(--gruen);
    border-radius: 50%;
    flex-shrink: 0;
}

.gericht-zelle {
    padding: .55rem .75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .15rem;
}
.gericht-name {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
}
.gericht-beilage {
    font-size: .75rem;
    color: var(--text-leise);
}
.geschlossen {
    font-size: .82rem;
    color: #999;
    font-style: italic;
}
.gericht-buffet {
    font-size: .72rem;
    color: var(--gruen-hell);
    margin-top: .1rem;
}
.gericht-buffet--leer {
    color: #bbb;
}

/* ── Lade / Leer ── */
.lade-anzeige {
    text-align: center;
    color: var(--text-leise);
    padding: 3rem 0;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}
.btn-refresh {
    background: none;
    border: 1px solid var(--rand);
    border-radius: 8px;
    color: var(--text-leise);
    font-size: .75rem;
    padding: .3rem .9rem;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.btn-refresh:hover    { color: var(--gruen); border-color: var(--gruen); }
.btn-refresh:disabled { opacity: .4; cursor: not-allowed; }
.refresh-status { font-size: .72rem; color: var(--text-leise); min-height: .9rem; }
.refresh-status.ok     { color: var(--gruen); }
.refresh-status.fehler { color: #c0392b; }
.quelle { font-size: .7rem; color: #aaa; }
.quelle a { color: #aaa; text-decoration: none; }

/* ── Plan-Container ── */
.plan { display: flex; flex-direction: column; gap: 1.2rem; }

/* ── Karte (Push-Einstellungen) ── */
.karte {
    background: var(--weiss);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.karte[hidden], .karte [hidden] { display: none !important; }
.karte--aktiv { border-color: var(--gruen-hell); }
.karte-titel  { font-size: 1rem; font-weight: 700; color: var(--gruen); }
.karte-text   { font-size: .82rem; color: var(--text-leise); line-height: 1.45; }

.hinweis {
    background: #f6faf6;
    border: 1px dashed var(--rand);
    border-radius: 8px;
    padding: .75rem .85rem;
    font-size: .82rem;
    line-height: 1.5;
}
.hinweis ol { margin: .4rem 0 0 1.2rem; display: flex; flex-direction: column; gap: .25rem; }
.ios-icon   { width: 1.05em; height: 1.05em; vertical-align: -.15em; color: #0a7aff; }

.feld-label { font-size: .75rem; font-weight: 600; color: var(--text); margin-top: .2rem; }

.tage-auswahl {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .4rem;
    margin-top: .35rem;
}
.tag-chip {
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    min-height: 2.75rem;
    border-radius: 999px;
    border: 1.5px solid var(--rand);
    background: var(--weiss);
    color: var(--text-leise);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
}
.tag-chip[aria-pressed="true"] {
    background: var(--gruen);
    border-color: var(--gruen);
    color: var(--weiss);
}
.tag-chip:focus-visible,
.btn-primaer:focus-visible,
.btn-link:focus-visible { outline: 2px solid var(--gruen-hell); outline-offset: 2px; }
.tag-chip:disabled { opacity: .6; cursor: wait; }

.schnellwahl { display: flex; justify-content: flex-end; min-height: 1.2rem; }

.push-aktionen { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; }
.btn-primaer {
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    background: var(--gruen);
    color: var(--weiss);
    border: none;
    border-radius: 8px;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-primaer:hover    { background: var(--gruen-hell); }
.btn-primaer:disabled { opacity: .45; cursor: not-allowed; background: var(--gruen); }

.btn-link {
    font: inherit;
    font-size: .78rem;
    background: none;
    border: none;
    color: var(--gruen);
    cursor: pointer;
    padding: .2rem 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-link--leise { color: var(--text-leise); align-self: center; }
.btn-link:disabled { opacity: .5; cursor: not-allowed; }

.push-status { font-size: .78rem; color: var(--text-leise); line-height: 1.4; min-height: 1.1rem; }
.push-status.ok     { color: var(--gruen); }
.push-status.fehler { color: #c0392b; }

/* ── Uhrzeit ── */
.uhrzeit-zeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .2rem;
}
.uhrzeit-zeile .feld-label { margin-top: 0; }
.uhrzeit-auswahl {
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    color: var(--gruen);
    background: var(--weiss);
    border: 1.5px solid var(--rand);
    border-radius: 8px;
    padding: .5rem .7rem;
    min-height: 2.75rem;
    min-width: 7.5rem;
    cursor: pointer;
}
.uhrzeit-auswahl:focus-visible { outline: 2px solid var(--gruen-hell); outline-offset: 2px; }
.uhrzeit-auswahl:disabled { opacity: .6; cursor: wait; }
