/* «Mein Jucker» – Design-System (23.11.2026)
   Marke: Jucker-Rot; Schrift = Systemschrift des Handys (iPhone SF Pro, Android Roboto) wie bei nativen Apps. Werte als Variablen, Dunkelmodus folgt dem Handy.
   Raster 4/8 px, Rundungen 12/18 px, Text mind. 16 px (Eingabefelder: kein Zoom auf dem iPhone). */


:root {
    --mj-rot: #8a0f0f;
    --mj-rot-dunkel: #6e0909;
    --mj-rot-hell: #fbeaea;
    --mj-grund: #f5f2ee;
    --mj-flaeche: #ffffff;
    --mj-flaeche-2: #f8f6f3;
    --mj-text: #1d1b19;
    --mj-text-2: #5f5a55;
    --mj-text-3: #8c867f;
    --mj-linie: #ebe6e0;
    --mj-gruen: #1f8a4c;
    --mj-gruen-hell: #e6f4ec;
    --mj-gelb: #b7791f;
    --mj-gelb-hell: #fdf3e1;
    --mj-blau: #2563eb;
    --mj-blau-hell: #e8efff;
    --mj-grau-hell: #efebe6;
    --mj-schatten: 0 1px 2px rgba(29, 27, 25, .05), 0 4px 16px rgba(29, 27, 25, .05);
    --mj-radius: 18px;
    --mj-radius-klein: 12px;
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bs-body-font-size: 1rem;
    --bs-primary: var(--mj-rot);
    --bs-link-color: var(--mj-rot);
    --bs-link-hover-color: var(--mj-rot-dunkel);
}
@media (prefers-color-scheme: dark) {
    :root {
        --mj-rot: #ef6b6b;
        --mj-rot-dunkel: #ff8a8a;
        --mj-rot-hell: #3a1d1d;
        --mj-grund: #121110;
        --mj-flaeche: #1d1b1a;
        --mj-flaeche-2: #262321;
        --mj-text: #f2efeb;
        --mj-text-2: #bdb6ae;
        --mj-text-3: #8f8880;
        --mj-linie: #2f2b28;
        --mj-gruen: #4ade80;
        --mj-gruen-hell: #16301f;
        --mj-gelb: #fbbf24;
        --mj-gelb-hell: #352a12;
        --mj-blau: #7aa2ff;
        --mj-blau-hell: #1a2440;
        --mj-grau-hell: #2a2624;
        --mj-schatten: none;
    }
}

html, body { background: var(--mj-grund); color: var(--mj-text); }
body { font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
main { max-width: 34rem; }
a { color: var(--mj-rot); }
.text-muted { color: var(--mj-text-2) !important; }
.form-control, .form-select { font-size: 1rem; min-height: 2.9rem; border-radius: var(--mj-radius-klein);
    background-color: var(--mj-flaeche); color: var(--mj-text); border-color: var(--mj-linie); }
.form-control:focus, .form-select:focus { border-color: var(--mj-rot); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--mj-rot) 20%, transparent); }
.btn { border-radius: var(--mj-radius-klein); min-height: 2.75rem; font-weight: bold; }
.btn-sm { min-height: 2.25rem; }
.btn-jucker, .btn-primary { background: var(--mj-rot); border-color: var(--mj-rot); color: #fff; }
.btn-jucker:hover, .btn-jucker:focus, .btn-primary:hover { background: var(--mj-rot-dunkel); border-color: var(--mj-rot-dunkel); color: #fff; }

/* ── Kopf: grosser Seitentitel statt Logo-Balken ── */
.mj-kopf { padding: calc(.9rem + env(safe-area-inset-top)) 0 .3rem; }
.mj-kopf .container { max-width: 34rem; }
.mj-titel { font-size: 2.05rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
.mj-untertitel { color: var(--mj-text-2); font-size: .95rem; margin-top: .15rem; }

/* ── Flächen, Gruppen, Zeilen (wie iPhone-Einstellungen) ── */
.card, .mj-karte { background: var(--mj-flaeche); border: 0; border-radius: var(--mj-radius); box-shadow: var(--mj-schatten); color: var(--mj-text); }
.mj-abschnitt { font-size: .8rem; font-weight: bold; text-transform: uppercase; letter-spacing: .06em;
    color: var(--mj-text-3); margin: 1.4rem .25rem .5rem; }
.mj-gruppe { background: var(--mj-flaeche); border-radius: var(--mj-radius); box-shadow: var(--mj-schatten); overflow: hidden; }
.mj-zeile { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; color: var(--mj-text);
    text-decoration: none; min-height: 3.5rem; position: relative; }
.mj-zeile + .mj-zeile::before { content: ''; position: absolute; top: 0; left: 3.9rem; right: 0; border-top: 1px solid var(--mj-linie); }
a.mj-zeile:active { background: var(--mj-flaeche-2); }
.mj-zeile .mj-haupt { flex: 1; min-width: 0; }
.mj-zeile .mj-haupt .t { font-weight: bold; }
.mj-zeile .mj-haupt .u { color: var(--mj-text-2); font-size: .9rem; }
.mj-zeile .mj-pfeil { color: var(--mj-text-3); }
.mj-icon { width: 2.1rem; height: 2.1rem; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
    font-size: 1.1rem; background: var(--mj-rot-hell); color: var(--mj-rot); }
.mj-icon.gruen { background: var(--mj-gruen-hell); color: var(--mj-gruen); }
.mj-icon.gelb { background: var(--mj-gelb-hell); color: var(--mj-gelb); }
.mj-icon.blau { background: var(--mj-blau-hell); color: var(--mj-blau); }
.mj-icon.grau { background: var(--mj-grau-hell); color: var(--mj-text-2); }

/* ── Kacheln mit grossen Zahlen ── */
.mj-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mj-kachel { background: var(--mj-flaeche); border-radius: var(--mj-radius); box-shadow: var(--mj-schatten); padding: 1rem;
    text-decoration: none; color: var(--mj-text); display: block; }
.mj-kachel .l { color: var(--mj-text-2); font-size: .85rem; display: flex; align-items: center; gap: .35rem; }
.mj-kachel .z { font-size: 1.9rem; font-weight: bold; letter-spacing: -.02em; line-height: 1.15; margin-top: .35rem;
    font-variant-numeric: tabular-nums; }
.mj-kachel .e { color: var(--mj-text-3); font-size: .8rem; }
.mj-plus { color: var(--mj-gruen); }
.mj-minus { color: var(--mj-rot); }

/* ── Status-Karte (Stempel) ── */
.mj-status { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; }
.mj-puls { width: .8rem; height: .8rem; border-radius: 50%; background: var(--mj-gruen); flex-shrink: 0;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--mj-gruen) 60%, transparent); animation: mj-puls 2s infinite; }
@keyframes mj-puls { 70% { box-shadow: 0 0 0 .55rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .mj-puls { animation: none; } }

/* ── Einsätze ── */
.mj-tag { width: 3.1rem; text-align: center; flex-shrink: 0; line-height: 1.1; }
.mj-tag .wt { font-size: .72rem; text-transform: uppercase; color: var(--mj-text-3); font-weight: bold; }
.mj-tag .dt { font-size: 1.15rem; font-weight: bold; }
.mj-tag.heute .wt, .mj-tag.heute .dt { color: var(--mj-rot); }
.mj-chip { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; font-weight: bold;
    background: var(--mj-grau-hell); color: var(--mj-text-2); }
.mj-chip.rot { background: var(--mj-rot-hell); color: var(--mj-rot); }

/* ── Leerer Zustand ── */
.mj-leer { text-align: center; padding: 1.6rem 1rem; color: var(--mj-text-2); }
.mj-leer .bi { font-size: 2rem; color: var(--mj-gruen); display: block; margin-bottom: .3rem; }

/* ── Navigation unten mit «Pille» ── */
body.mit-nav { padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
.unten-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--mj-flaeche) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--mj-linie); }
.unten-nav .container { display: flex; max-width: 34rem; padding: .35rem .5rem .4rem; }
.unten-nav a { flex: 1; text-align: center; color: var(--mj-text-3); text-decoration: none; font-size: .72rem;
    font-weight: bold; position: relative; min-height: 3.4rem; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: .15rem; }
.unten-nav a .bi { font-size: 1.3rem; line-height: 1; padding: .3rem 1.1rem; border-radius: 999px; transition: background .2s; }
.unten-nav a.aktiv { color: var(--mj-rot); }
.unten-nav a.aktiv .bi { background: var(--mj-rot-hell); }
.unten-nav .punkt { position: absolute; top: .25rem; left: calc(50% + .65rem); width: .6rem; height: .6rem;
    border-radius: 50%; background: #dc3545; border: 2px solid var(--mj-flaeche); }

/* ── Kurze Einblendung statt Balken (Erfolg) ── */
.mj-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(5.8rem + env(safe-area-inset-bottom));
    z-index: 1040; background: var(--mj-text); color: var(--mj-grund); border-radius: 999px; padding: .7rem 1.1rem;
    font-weight: bold; box-shadow: 0 6px 24px rgba(0,0,0,.18); max-width: calc(100% - 2rem); animation: mj-ein .25s ease-out; }
@keyframes mj-ein { from { opacity: 0; transform: translate(-50%, .6rem); } }

/* ── Bestehende Seiten (bis zur Umstellung) passend einfärben ── */
.zahl { font-size: 1.6rem; font-weight: bold; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tag-zeile { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--mj-linie); }
.tag-zeile:last-child { border-bottom: 0; }
.tag-datum { width: 3.4rem; flex-shrink: 0; line-height: 1.15; }
.tag-datum .wt { font-size: .75rem; color: var(--mj-text-3); text-transform: uppercase; }
.tag-datum .dt { font-weight: bold; }
.stempel { display: inline-block; background: var(--mj-flaeche-2); border-radius: .4rem; padding: 0 .4rem;
    margin: 0 .2rem .2rem 0; font-variant-numeric: tabular-nums; font-size: .9rem; }
.tag-ist { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.alert { border-radius: var(--mj-radius-klein); border: 0; }
hr { border-color: var(--mj-linie); opacity: 1; }
.mj-logo-klein { height: 26px; }
@media (prefers-color-scheme: dark) { .mj-logo-hell { filter: brightness(0) invert(1); opacity: .9; } }

/* ── Runde Knöpfe (Monat vor/zurück) ── */
.mj-rund { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--mj-flaeche);
    box-shadow: var(--mj-schatten); color: var(--mj-text); text-decoration: none; font-size: 1.05rem; }
.mj-rund.aus { opacity: .35; }

/* ── Aufklappbare Zeilen (Formulare erst auf Antippen) ── */
details.mj-auf > summary { list-style: none; cursor: pointer; }
details.mj-auf > summary::-webkit-details-marker { display: none; }
details.mj-auf > summary .mj-pfeil { transition: transform .2s; }
details.mj-auf[open] > summary .mj-pfeil { transform: rotate(180deg); }
.mj-gruppe > div:not(.mj-zeile) + div:not(.mj-zeile) { border-top: 1px solid var(--mj-linie); }
.mj-gruppe > * + details > summary.mj-zeile::before { content: ''; position: absolute; top: 0; left: 3.9rem; right: 0;
    border-top: 1px solid var(--mj-linie); }
/* Auswahlknöpfe (z.B. Ferien / Unbezahlt): gewählt = Jucker-Rot */
.btn-check:checked + .btn-outline-secondary { background: var(--mj-rot); border-color: var(--mj-rot); color: #fff; }
.btn-outline-secondary { color: var(--mj-text-2); border-color: var(--mj-linie); background: var(--mj-flaeche); }
.btn-check + .btn { min-height: 2.75rem; }

/* ── Sofortige Rückmeldung beim Seitenwechsel (Internetweg kann 0.5 s dauern) ── */
@view-transition { navigation: auto; }            /* sanfter Übergang statt weissem Blitz (iOS 18+, Chrome) */
.mj-laden { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: var(--mj-rot);
    transition: width 6s cubic-bezier(.08, .8, .1, 1); }
.mj-laden.an { width: 88%; }
.unten-nav a:active .bi { background: var(--mj-rot-hell); }
