/*
 * Tacheles – Grundgerüst (Design aus claude.ai/design, Stand 7a).
 * Gestaltet für ein Tablet quer (1180 × 820), fließend für andere Größen.
 *
 * Aufbau:
 *   Startseite  – Kopf (Logo, Uhr), Titel, Karte „Zuletzt benutzt“ und Kacheln aller Werkzeuge
 *   Werkzeug    – schmale Leiste links (Menü, Uhr), offenes Werkzeug, großes Feld in der Modulfarbe
 *
 * Bausteine für Module: .knopf (--haupt, --neben, --leise, --hell), .schalter, .regler, .platzhalter
 * Alles ist mit einem Finger bedienbar: nur Antippen und Ziehen, Tippflächen mindestens 48 × 48 px.
 */

/* ---------- Schriften (selbst eingebunden, nichts von fremden Servern) ---------- */

@font-face {
    font-family: "Saira";
    src: url("schriften/saira.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("schriften/atkinson-hyperlegible-next.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

/* ---------- Farben und Maße ---------- */

:root {
    /* Grundfarben */
    --petrol: #186380;          /* Seitenhintergrund */
    --petrol-tief: #0E4A62;     /* Menü-Knopf, Dialoge, Logo-Grund */
    --petrol-hell: #3688AF;     /* Band */
    --creme: #FFF0CF;           /* Text auf Dunkel · Modulfarbe 1 */
    --orange: #E87F1C;          /* Hauptknopf, Timer-Scheibe · Modulfarbe 2 */
    --tinte: #131723;           /* Text auf Hell · Modulfarbe 3 */
    --tuerkis: #49AEC0;         /* Modulfarbe 4, Entsperr-Ring, Fokus */

    /* Flächen auf Tinte */
    --tinte-flaeche: #1F2433;
    --tinte-knopf: #262D3D;     /* Ziffernblatt, Rand der leisen Knöpfe */
    --tinte-rand: #3A4254;      /* Rand der Nebenknöpfe, Schalter aus */
    --tinte-leise: #AEB7C4;     /* blasser Text auf Tinte */
    --tinte-leise-2: #C9D0DA;   /* Text der leisen Knöpfe */

    /* Flächen auf Creme */
    --creme-dunkel: #F2DFB5;
    --weiss: #FFFFFF;
    --petrol-leise: #D4E6EC;    /* blasser Text auf Petrol-tief */

    /* Verläufe */
    --band-waagerecht: linear-gradient(#4597BD 0%, #3688AF 14%, #2479A0 42%, #1C6A88 72%, #145670 100%);
    --band-senkrecht: linear-gradient(90deg, #134F66 0%, #2A7BA0 30%, #4597BD 44%, #3688AF 54%, #1F6E8C 78%, #155872 100%);
    --balken-fuellung: linear-gradient(#F39A45, #E87F1C 45%, #C9690F);

    /* Schatten */
    --schatten-kachel: 0 14px 28px rgba(0, 22, 32, .28), inset 0 2px 0 rgba(255, 255, 255, .22);
    --schatten-karte: 0 18px 36px rgba(0, 22, 32, .32), inset 0 2px 0 rgba(255, 255, 255, .08);
    --schatten-feld: 0 20px 40px rgba(0, 22, 32, .25);
    --schatten-menue: 0 8px 16px rgba(0, 20, 30, .25);
    --glanz-knopf: inset 0 2px 0 rgba(255, 255, 255, .3);
    --glanz-band: inset 0 2px 0 rgba(255, 255, 255, .18), inset 0 -3px 6px rgba(0, 20, 30, .25);

    /* Schrift */
    --schrift-titel: "Saira", system-ui, sans-serif;                       /* Überschriften, Knöpfe, Zahlen */
    --schrift-text: "Atkinson Hyperlegible Next", system-ui, sans-serif;   /* Fließtext, Beschriftungen */

    /* Radien */
    --radius-feld: 32px;
    --radius-karte: 44px;
    --radius-kachel: 32px;
    --radius-voll: 999px;       /* alle Knöpfe sind Pillen */

    /* Bewegung */
    --feder: cubic-bezier(.34, 1.56, .64, 1);        /* Antippen: zurückfedern */
    --feder-weich: cubic-bezier(.34, 1.35, .64, 1);  /* Werkzeug fährt in die Leiste */
    --gleiten: cubic-bezier(.2, .8, .2, 1);          /* Kachel wächst, Band rollt */

    /* Abstände */
    --abstand: 24px;            /* um das Feld herum */
    --leiste: 104px;            /* Breite der Leiste */
}

/* ---------- Grundlagen ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    font-family: var(--schrift-text);
    font-size: 1.0625rem;
    line-height: 1.4;
    color: var(--creme);
    background: var(--petrol);
    transition: background-color .6s ease;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tuerkis); outline-offset: 3px; }
[hidden] { display: none !important; }

/* Alles mit EINEM Finger: kein Zoom bei Doppeltipp, keine Verzögerung */
a, button, summary, label, input, select, textarea { touch-action: manipulation; }

/* Hintergrund im Werkzeug: Petrol, leicht in der Modulfarbe getönt */
body.modul-farbe-creme   { background: color-mix(in oklch, var(--petrol) 84%, var(--creme)); }
body.modul-farbe-orange  { background: color-mix(in oklch, var(--petrol) 84%, var(--orange)); }
body.modul-farbe-tinte   { background: color-mix(in oklch, var(--petrol) 76%, var(--tinte)); }
body.modul-farbe-tuerkis { background: color-mix(in oklch, var(--petrol) 84%, var(--tuerkis)); }

/* Modulfarben für Flächen (Kachel, Feld, offenes Werkzeug) – mit passender Schrift */
.farbe-creme,   body.modul-farbe-creme   :is(.feld, .leiste__modul) { background: var(--creme);   color: var(--tinte); }
.farbe-orange,  body.modul-farbe-orange  :is(.feld, .leiste__modul) { background: var(--orange);  color: var(--tinte); }
.farbe-tinte,   body.modul-farbe-tinte   :is(.feld, .leiste__modul) { background: var(--tinte);   color: var(--creme); }
.farbe-tuerkis, body.modul-farbe-tuerkis :is(.feld, .leiste__modul) { background: var(--tuerkis); color: var(--tinte); }

/* ---------- Logo mit Name ---------- */

.marke { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.marke__logo { width: 52px; height: 52px; flex: none; }
.marke__name { font-family: var(--schrift-titel); font-size: 30px; font-weight: 800; line-height: 1; }

/* ---------- Knöpfe: alle sind Pillen ---------- */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border: 2px solid transparent;
    border-radius: var(--radius-voll);
    background: transparent;
    color: inherit;
    font-family: var(--schrift-titel);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .45s var(--feder), background-color .25s;
}
.knopf:active { transform: scale(.95); }
.knopf__symbol { width: 1.25em; height: 1.25em; flex: none; }

.knopf--haupt { background: var(--orange); color: var(--tinte); box-shadow: var(--glanz-knopf); }   /* genau einer pro Ansicht */
.knopf--neben { border-color: var(--tinte-rand); }
.knopf--neben:active { transform: scale(.92); }
.knopf--leise { border-color: var(--tinte-knopf); color: var(--tinte-leise-2); }
.knopf--leise:active { transform: scale(.94); }
.knopf--hell { background: var(--creme); color: var(--tinte); }
.knopf--hell:active { transform: scale(.94); }

/* ---------- Schalter: ganze Zeile antippbar, rechts ein Kippschalter ---------- */

.schalter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.schalter__bahn {
    position: relative;
    flex: none;
    width: 56px;
    height: 32px;
    border-radius: var(--radius-voll);
    background: var(--tinte-rand);
    transition: background-color .25s;
}
.schalter__bahn::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tinte);
    transition: left .35s var(--feder);
}
.schalter input:checked + .schalter__bahn { background: var(--orange); }
.schalter input:checked + .schalter__bahn::after { left: 28px; }
.schalter input:focus-visible + .schalter__bahn { outline: 3px solid var(--tuerkis); outline-offset: 3px; }

/* Nur für Vorlese-Programme, unsichtbar auf dem Bildschirm */
.nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Farben für Kategorien (Talker): --kfarbe = Fläche, --kfarbe-text = Schrift darauf ---------- */

.kfarbe-creme   { --kfarbe: var(--creme);   --kfarbe-text: var(--tinte); }
.kfarbe-orange  { --kfarbe: var(--orange);  --kfarbe-text: var(--tinte); }
.kfarbe-tinte   { --kfarbe: var(--tinte);   --kfarbe-text: var(--creme); }
.kfarbe-tuerkis { --kfarbe: var(--tuerkis); --kfarbe-text: var(--tinte); }
.kfarbe-gruen   { --kfarbe: #6BAF5E;        --kfarbe-text: var(--tinte); }
.kfarbe-gelb    { --kfarbe: #F2C434;        --kfarbe-text: var(--tinte); }
.kfarbe-rot     { --kfarbe: #E2635B;        --kfarbe-text: var(--tinte); }
.kfarbe-lila    { --kfarbe: #A587D4;        --kfarbe-text: var(--tinte); }

/* Farbwahl: große runde Tupfer zum Antippen, der gewählte mit Ring und Haken */
.farbwahl { margin: 0; padding: 10px 0; border: 0; border-top: 1px solid var(--tinte-knopf); display: grid; gap: 10px; }
.farbwahl legend { float: left; width: 100%; padding: 0 0 10px; font-size: 18px; font-weight: 700; }
.farbwahl__tupfer-reihe { display: flex; flex-wrap: wrap; gap: 12px; }
.farbwahl__tupfer {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--kfarbe);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
    cursor: pointer;
    transition: transform .45s var(--feder);
}
.farbwahl__tupfer:active { transform: scale(.9); }
.farbwahl__tupfer input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.farbwahl__tupfer.kfarbe-tinte { box-shadow: inset 0 0 0 2px var(--tinte-rand); }   /* sonst auf der dunklen Karte unsichtbar */
.farbwahl__tupfer:has(input:checked) { box-shadow: 0 0 0 3px var(--tinte), 0 0 0 6px var(--creme); }
.farbwahl__tupfer:has(input:checked)::after {   /* Haken */
    content: "";
    position: absolute;
    left: 18px;
    top: 13px;
    width: 12px;
    height: 20px;
    border: solid var(--kfarbe-text);
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}
.farbwahl__tupfer:has(input:focus-visible) { outline: 3px solid var(--tuerkis); outline-offset: 6px; }

/* Rastergröße wählen (Talker-Kategorie): drei große Knöpfe nebeneinander, der gewählte creme */
.rasterwahl__reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rasterwahl__knopf {
    position: relative;
    min-height: 64px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 18px;
    box-shadow: inset 0 0 0 2px var(--tinte-rand);
    color: var(--tinte-leise-2);
    text-align: center;
    cursor: pointer;
    transition: transform .45s var(--feder);
}
.rasterwahl__knopf:active { transform: scale(.94); }
.rasterwahl__knopf input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rasterwahl__titel { font-family: var(--schrift-titel); font-size: 20px; font-weight: 700; line-height: 1; }
.rasterwahl__knopf small { font-size: 13px; }
.rasterwahl__knopf:has(input:checked) { background: var(--creme); color: var(--tinte); box-shadow: none; }
.rasterwahl__knopf:has(input:focus-visible) { outline: 3px solid var(--tuerkis); outline-offset: 3px; }
.rasterwahl__knopf:has(input:disabled) { opacity: .45; cursor: default; }
.rasterwahl__reihe--zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* Karte: Wort oder Unterseite */

/* Kästchen (Häkchen mit Text daneben) */
.kaestchen { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.kaestchen input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--orange); }

/* ---------- Schieberegler: Spur, orange Füllung (Wert in --anteil), großer creme Griff ---------- */

.regler {
    --anteil: 50%;
    width: 100%;
    height: 40px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.regler::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--orange) var(--anteil), var(--tinte-rand) var(--anteil));
}
.regler::-moz-range-track { height: 10px; border-radius: 5px; background: var(--tinte-rand); }
.regler::-moz-range-progress { height: 10px; border-radius: 5px; background: var(--orange); }
.regler::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    margin-top: -13px;
    border: 0;
    border-radius: 50%;
    background: var(--creme);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.regler::-moz-range-thumb { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--creme); }
.regler:disabled { opacity: .35; cursor: not-allowed; }
.regler:focus-visible { outline: 3px solid var(--tuerkis); outline-offset: 3px; }

/* ---------- Startseite ----------
 * Quer passt immer alles auf einen Bildschirm: Abstände, Schrift, Karte und Kacheln wachsen und
 * schrumpfen mit der Höhe (vh). Gestaltet für 820 px Höhe, passt bis ca. 360 px Höhe
 * (viele Android-Tablets melden dem Browser nur 400 px Höhe, weil sie die Pixel vergrößern).
 * Hochkant oder sehr schmal: untereinander, die Seite scrollt.
 */

.start {
    position: relative;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(12px, 4.9vh, 40px) clamp(20px, 4.7vw, 56px);
    overflow: hidden;
    animation: start-erscheinen .34s ease-out;
}
@keyframes start-erscheinen {
    from { opacity: 0; transform: scale(.985); }
}

/* Band quer über die Seite – nur in den Lücken zu sehen */
.start__band {
    position: absolute;
    left: 0;
    right: 0;
    top: 40%;
    height: 30.5%;
    background: var(--band-waagerecht);
    box-shadow: var(--glanz-band);
    pointer-events: none;
}

.start__kopf { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.start .marke__logo { width: clamp(36px, 6.3vh, 52px); height: clamp(36px, 6.3vh, 52px); }
.start .marke__name { font-size: clamp(22px, 3.7vh, 30px); }
/* Oben rechts ein Streifen: Zahnrad (Einstellungen) · Uhr · in Türkis „App installieren“ (nur wenn möglich) */
.start__streifen {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    height: clamp(48px, 6.3vh, 52px);
    border-radius: var(--radius-voll);
    background: var(--petrol-tief);
}
.start__einstellungen {
    position: relative;
    display: inline-grid;
    place-items: center;
    min-width: clamp(56px, 7vh, 64px);
    margin-right: -6px;                 /* geht nahtlos in die Uhr über */
    border-radius: var(--radius-voll);
    background: #1F6E8C;
    color: var(--creme);
    overflow: hidden;
    transition: transform .45s var(--feder);
}
.start__einstellungen:active { transform: scale(.94); }
.start__einstellungen-symbol { position: relative; width: 24px; height: 24px; }
/* Kindersicherung: beim Halten füllt sich das Zahnrad von links in Türkis */
.start__einstellungen[data-halten]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--tuerkis);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease-out;
}
.start__einstellungen.haelt::before { transform: scaleX(1); transition: transform 3s linear; }
.start__einstellungen.haelt { color: var(--tinte); }
/* Kurzer Tipp: Hinweis unter dem Streifen */
.start__halten-hinweis {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 3;
    display: none;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--tinte);
    color: var(--creme);
    font-family: var(--schrift-titel);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.start__einstellungen.zeigt-hinweis { overflow: visible; }
.start__einstellungen.zeigt-hinweis .start__halten-hinweis { display: block; }
.start__einstellungen:not(.haelt) .start__einstellungen-symbol circle { fill: #1F6E8C; }   /* Regler-Knöpfe in der Farbe des Abschnitts */
.start__uhr {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 clamp(14px, 2.7vh, 22px);
    border-radius: var(--radius-voll);
    font-family: var(--schrift-titel);
    font-size: clamp(15px, 2.2vh, 18px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.start__uhr-trenner { opacity: .6; }
.start__installieren {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: -6px;                  /* setzt den Streifen nahtlos fort */
    padding: 0 clamp(16px, 2.7vh, 22px);
    border: 0;
    border-radius: var(--radius-voll);
    background: var(--tuerkis);
    color: var(--tinte);
    font-family: var(--schrift-titel);
    font-size: clamp(15px, 2.2vh, 18px);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--glanz-knopf);
    transition: transform .45s var(--feder);
}
.start__installieren:active { transform: scale(.94); }
/* Kindersicherung auch hier: beim Halten füllt sich der Knopf von links */
.start__installieren { position: relative; }
.start__installieren > * { position: relative; }
.start__installieren[data-halten]::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--creme);
    opacity: .55;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease-out;
}
.start__installieren.haelt::before { transform: scaleX(1); transition: transform 3s linear; }
.start__installieren.zeigt-hinweis .start__halten-hinweis { display: block; }
.start__installieren .start__halten-hinweis { position: absolute; left: auto; right: 0; }
.start__installieren-symbol { width: 22px; height: 22px; flex: none; }

.start__titel {
    position: relative;
    flex: none;
    margin: clamp(6px, 4.1vh, 34px) 0 clamp(8px, 5.6vh, 46px);
    font-family: var(--schrift-titel);
    font-size: clamp(20px, min(4.1vw, 5.9vh), 48px);
    font-weight: 700;
    line-height: 1.1;
}
.start__leer { position: relative; font-size: 22px; }

.start__inhalt {
    position: relative;
    flex: 1;
    min-height: 0;
    max-height: 520px;
    display: grid;
    grid-template-columns: minmax(220px, min(420px, 36%)) minmax(0, 1fr);
    gap: clamp(14px, 3.4vh, 28px);
}

/* Karte „Zuletzt benutzt“ */
.zuletzt {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: clamp(14px, 4.4vh, 36px);
    border-radius: clamp(24px, 5.4vh, 44px);
    overflow: hidden;
    background: var(--tinte);
    color: var(--creme);
    box-shadow: var(--schatten-karte);
}
.zuletzt__beschriftung { flex: none; font-size: clamp(14px, 2.4vh, 20px); font-weight: 700; color: var(--tinte-leise); }
.zuletzt__symbol { flex: 1; min-height: 0; display: flex; align-items: center; }
.zuletzt__symbol svg { width: min(120px, 14.6vh); height: min(120px, 14.6vh); max-height: 100%; }
.zuletzt__name { flex: none; font-family: var(--schrift-titel); font-size: clamp(26px, min(5.4vw, 7.8vh), 64px); font-weight: 700; line-height: 1; }
.zuletzt__weiter { flex: none; margin-top: clamp(8px, 2.9vh, 24px); height: clamp(48px, 8.8vh, 72px); font-size: clamp(17px, 2.9vh, 24px); }
.zuletzt__weiter .knopf__symbol { width: 1.15em; height: 1.15em; }

/* Kacheln aller Werkzeuge */
.kacheln {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 2vh, 16px);
}
.kachel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(4px, 1.2vh, 10px);
    padding: 0 clamp(12px, 1.9vw, 22px);
    border-radius: clamp(22px, 3.9vh, 32px);
    box-shadow: var(--schatten-kachel);
    text-decoration: none;
    transition: transform .45s var(--feder);
}
.kachel:active { transform: scale(.94); }
.kachel__symbol { width: clamp(24px, 5.4vh, 44px); height: clamp(24px, 5.4vh, 44px); flex: none; }
.kachel__name { font-family: var(--schrift-titel); font-size: clamp(15px, 2.9vh, 24px); font-weight: 700; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Werkzeug-Seite: Leiste links, Feld rechts ---------- */

body.art-modul { height: 100vh; height: 100dvh; overflow: hidden; }

/*
 * Leiste: oben Menü, darunter alle Werkzeuge in fester Reihenfolge, unten die Uhr.
 * Zwischen Band und Feld ist derselbe Abstand wie rund ums Feld. Die Leiste ist breiter als ihr Band – so hat
 * das offene Werkzeug Platz, über den Abstand ins Feld hineinzuragen. Der durchsichtige Rand lässt Antippen zum Feld durch.
 * Das blaue Band selbst liegt UNTER dem Feld (body::before), damit dessen runde Ecken sichtbar bleiben.
 */
.leiste {
    position: fixed;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: 0;
    width: calc(var(--leiste) + var(--abstand) + 24px);   /* Platz für den Reiter des offenen Werkzeugs */
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
    pointer-events: none;
}
body.art-modul::before {                /* das senkrechte Band – unter dem Feld */
    content: "";
    position: fixed;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--leiste);
    background: var(--band-senkrecht);
    box-shadow: inset -2px 0 4px rgba(0, 20, 30, .2);
}
.leiste > * { position: relative; pointer-events: auto; }

.leiste__menue {
    flex: none;
    margin-left: 12px;
    width: 80px;
    height: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 26px;
    background: var(--petrol-tief);
    color: var(--creme);
    box-shadow: var(--schatten-menue);
    font-family: var(--schrift-titel);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .45s var(--feder);
}
.leiste__menue:active { transform: scale(.92); }
.leiste__menue-symbol { width: 30px; height: 30px; }

/* Werkzeuge: passen sie nicht in die Höhe, lässt sich der Bereich senkrecht wischen */
.leiste__werkzeuge {
    flex: 0 1 auto;
    min-height: 0;
    margin: 0;
    padding: 4px 0 8px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.leiste__werkzeuge::-webkit-scrollbar { display: none; }
.leiste__eintrag { flex: none; padding-left: 12px; }
/* Nur die Werkzeuge selbst fangen das Antippen – der Rand rechts daneben gehört zum Feld */
.leiste > .leiste__werkzeuge { pointer-events: none; }
.leiste__eintrag > a { pointer-events: auto; }

/* Andere Werkzeuge: klein, in ihrer Farbe, mit Symbol und Namen */
.leiste__werkzeug {
    width: 80px;
    min-height: 72px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 22px;
    box-shadow: 0 6px 12px rgba(0, 20, 30, .22), inset 0 2px 0 rgba(255, 255, 255, .18);
    font-family: var(--schrift-titel);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    overflow: hidden;
    transition: transform .45s var(--feder);
}
.leiste__werkzeug:active { transform: scale(.92); }
.leiste__werkzeug span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leiste__werkzeug-symbol { width: 26px; height: 26px; flex: none; }

/* Offenes Werkzeug: gleiche Farbe wie das Feld, reicht über den Abstand hinein und verschmilzt damit */
.leiste__modul {
    width: calc(var(--leiste) + var(--abstand) - 8px);   /* reicht nur 4 px ins Feld – genug gegen einen Spalt, verdeckt keinen Inhalt */
    height: 96px;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 32px 0 0 32px;
    font-family: var(--schrift-titel);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    animation: modul-hereinfahren .56s var(--feder-weich) .06s backwards;
}
.leiste__modul-symbol { width: 32px; height: 32px; }
@keyframes modul-hereinfahren {
    from { transform: translateX(-130px); }
}

/* Laufender Timer (in den anderen Werkzeugen): unten direkt über der Uhr. Balken läuft von oben nach unten ab, darunter die Restzeit */
.leiste__timer {
    flex: none;
    height: clamp(120px, 22vh, 200px);   /* fest – der Rest der Leiste bleibt frei */
    margin-top: auto;
    width: calc(var(--leiste) - 16px);
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0 9px;
    border-radius: 22px;
    background: rgba(14, 74, 98, .75);
    color: var(--creme);
    text-decoration: none;
    transition: transform .45s var(--feder);
}
.leiste__timer[hidden] { display: none; }
.leiste__timer:active { transform: scale(.94); }
.leiste__timer-symbol { width: 24px; height: 24px; flex: none; }
.leiste__timer-spur {
    position: relative;
    flex: 1;
    min-height: 24px;
    width: 28px;
    border-radius: 14px;
    background: var(--tinte);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45);
    overflow: hidden;
}
.leiste__timer-fuellung {                /* Höhe setzt grundgeruest.js – die Oberkante sinkt */
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 14px;
    background: var(--balken-fuellung);
    box-shadow: var(--glanz-knopf);
}
.leiste__timer-zeit { font-family: var(--schrift-titel); font-size: 17px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.leiste__timer.ist-pause .leiste__timer-fuellung { opacity: .4; }
.leiste__timer.ist-pause .leiste__timer-zeit { color: var(--petrol-leise); }
.leiste__timer:not([hidden]) + .leiste__uhr { margin-top: 0; }   /* die Uhr rückt direkt darunter */

/* Uhr unten in der Leiste */
.leiste__uhr {
    flex: none;
    width: calc(var(--leiste) - 16px);
    margin-top: auto;
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border-radius: 22px;
    background: rgba(14, 74, 98, .75);
    color: var(--creme);
    text-align: center;
}
.leiste__zeit { font-family: var(--schrift-titel); font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.leiste__datum { font-size: 13px; font-weight: 700; color: var(--petrol-leise); white-space: nowrap; }

.feld {
    position: fixed;
    z-index: 1;
    top: var(--abstand);
    right: var(--abstand);
    bottom: var(--abstand);
    left: calc(var(--leiste) + var(--abstand));   /* links derselbe Abstand wie rundherum */
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-feld);
    box-shadow: var(--schatten-feld);
    transition: left .5s var(--gleiten);
    view-transition-name: feld;            /* die angetippte Kachel wächst zu diesem Feld */
}
/* Inhalt blendet ein. Module mit Überlagerungen über den ganzen Bildschirm (z. B. der Timer) nehmen sich
   davon aus und blenden ihre Teile selbst ein – sonst würde die Bewegung die Überlagerung ins Feld sperren. */
.feld > :not(.ohne-einblenden) { animation: inhalt-einblenden .38s ease-out .08s backwards; }
@keyframes inhalt-einblenden {
    from { opacity: 0; transform: translateY(14px); }
}

/* Gesperrt (z. B. Timer): nur noch das Feld, über die ganze Breite */
body.ist-gesperrt .leiste,
body.ist-gesperrt::before { display: none; }
body.ist-gesperrt .feld { left: var(--abstand); }

/* ---------- Timer fertig: vier Streifen, Band quer darüber (auf jeder Seite, Antippen schließt) ---------- */

.fertig {
    position: fixed;
    z-index: 20;
    inset: 0;
    overflow: hidden;
    background: var(--petrol);
    color: var(--creme);
    cursor: pointer;
}
.fertig__streifen { position: absolute; inset: 0; display: flex; justify-content: center; }
.fertig__streifen span {
    width: 10.6vw;
    height: 100%;
    transform-origin: top;
    animation: fertig-streifen .62s var(--gleiten) backwards;
}
.fertig__streifen span:nth-child(2) { animation-delay: .09s; }
.fertig__streifen span:nth-child(3) { animation-delay: .18s; }
.fertig__streifen span:nth-child(4) { animation-delay: .27s; }
@keyframes fertig-streifen {
    from { transform: scaleY(0); }
}

.fertig__band {
    position: absolute;
    left: 0;
    right: 0;
    top: 30.5%;
    height: 39%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--band-waagerecht);
    box-shadow: 0 24px 48px rgba(0, 20, 30, .4), inset 0 3px 0 rgba(255, 255, 255, .2);
    animation: fertig-band .9s var(--gleiten) .32s backwards;
}
@keyframes fertig-band {
    from { transform: translateX(-105%); }
}
.fertig__text {
    display: flex;
    align-items: center;
    gap: 3vmin;
    font-family: var(--schrift-titel);
    font-size: clamp(72px, 20vmin, 170px);
    font-weight: 800;
    line-height: 1;
    animation: fertig-text .52s ease-out .9s backwards;
}
@keyframes fertig-text {
    from { opacity: 0; transform: translateX(-40px); }
}
.fertig__haken {
    width: .88em;
    height: .88em;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--creme);
    color: var(--tinte);
}
.fertig__haken svg { width: 64%; height: 64%; }
.fertig__hinweis { position: absolute; left: 0; right: 0; bottom: 56px; text-align: center; font-size: 22px; font-weight: 700; }
.fertig__hinweis span { display: inline-block; padding: 10px 22px; border-radius: 24px; background: var(--petrol-tief); }

/* Solange „Fertig“ zu sehen ist, liegt nichts darüber */
body.hat-ueberlagerung .leiste { visibility: hidden; }

/* ---------- Platzhalter für Werkzeuge, die es noch nicht gibt ---------- */

.platzhalter {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px;
    text-align: center;
}
.platzhalter__symbol { width: 110px; height: 110px; }
.platzhalter__titel { font-family: var(--schrift-titel); font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; line-height: 1.1; }
.platzhalter__text { font-size: 21px; }

/* ---------- Einfache Seiten (z. B. Fehler) ---------- */

.einfach {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    padding: 40px 56px;
}
.einfach__karte {
    display: grid;
    gap: 18px;
    width: min(100%, 680px);
    padding: 36px;
    border-radius: var(--radius-karte);
    background: var(--tinte);
    box-shadow: var(--schatten-karte);
}
.einfach__titel { font-family: var(--schrift-titel); font-size: 40px; font-weight: 700; line-height: 1.1; }
.einfach__text { font-size: 20px; color: var(--tinte-leise); }

/* ---------- Konto ---------- */

.konto { display: grid; gap: 18px; }
.meldung { padding: 12px 16px; border-radius: 16px; background: rgba(73, 174, 192, .18); color: var(--creme); font-weight: 700; }
.meldung--fehler { background: rgba(232, 127, 28, .2); }
.konto__status { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.konto__status-symbol { width: 34px; height: 34px; flex: none; padding: 6px; border-radius: 50%; background: var(--creme); color: var(--tinte); }
.konto__ueberschrift { font-family: var(--schrift-titel); font-size: 22px; font-weight: 700; margin-top: 6px; }
.konto__geraete { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.konto__geraet { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--tinte-knopf); }
.konto__geraet-name { display: grid; font-weight: 700; }
.konto__geraet-name em { font-style: normal; color: var(--tuerkis); }
.konto__geraet-name small { font-weight: 400; color: var(--tinte-leise); }
.konto__formular { display: grid; gap: 8px; }
.konto__beschriftung { font-weight: 700; color: var(--tinte-leise); }
.konto__zeile { display: flex; flex-wrap: wrap; gap: 10px; }
.konto__zeile .eingabe { flex: 1 1 240px; }
.konto__zeile .knopf { height: 56px; font-size: 20px; }
.konto__klein { font-size: 15px; color: var(--tinte-leise); }
.konto__anderes summary { cursor: pointer; font-weight: 700; color: var(--tinte-leise-2); min-height: 48px; display: flex; align-items: center; }
.konto__anderes[open] summary { margin-bottom: 8px; }
.konto__gross { height: 64px; font-size: 22px; padding: 0 32px; }
.konto__warten { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--tuerkis); }
.konto__punkt { width: 14px; height: 14px; border-radius: 50%; background: var(--tuerkis); animation: konto-pulsieren 1.6s ease-in-out infinite; }
@keyframes konto-pulsieren {
    50% { opacity: .3; }
}

/* ---------- Einstellungen und Verwaltung ---------- */

.einfach__karte:has(.verwaltung, .einstellungen) { width: min(100%, 860px); }
.einstellungen, .verwaltung { display: grid; gap: 18px; }
.verwaltung__kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.verwaltung__abschnitt { display: grid; gap: 10px; padding-top: 18px; border-top: 2px solid var(--tinte-knopf); scroll-margin-top: 24px; }
.verwaltung__zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.verwaltung__zahlen p { padding: 14px 16px; border-radius: 20px; background: var(--tinte-flaeche); color: var(--tinte-leise); }
.verwaltung__zahlen strong { display: block; font-family: var(--schrift-titel); font-size: 32px; line-height: 1.1; color: var(--creme); }
.verwaltung__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.verwaltung__werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.verwaltung__werkzeug-name {
    flex: 1 1 180px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 20px;
    font-family: var(--schrift-titel);
    font-size: 20px;
    font-weight: 700;
}
.verwaltung__werkzeug-name.farbe-tinte { box-shadow: inset 0 0 0 2px var(--tinte-rand); }   /* sonst auf der dunklen Karte unsichtbar */
.verwaltung__symbol { width: 28px; height: 28px; flex: none; }
.verwaltung__schalter { min-height: 56px; gap: 10px; color: var(--tinte-leise); }
.verwaltung__auswahl { min-height: 56px; padding: 0 16px; font-size: 17px; }
.verwaltung__pfeile { display: inline-flex; gap: 6px; }
.verwaltung__pfeile .knopf { width: 56px; height: 56px; padding: 0; font-size: 18px; }
.verwaltung__pfeile .knopf:disabled { opacity: .3; }
.verwaltung__zahl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.verwaltung__eingabe { width: 110px; padding: 0 14px; text-align: center; }
/* Reiter oben: jedes Werkzeug, Module, Konto, Sonstiges – der offene in seiner Farbe; je drei in einer Reihe (Handy: zwei) */
.reiter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reiter__knopf {
    min-width: 0;
    min-height: 64px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 20px;
    background: var(--tinte-flaeche);
    box-shadow: inset 0 0 0 2px var(--tinte-knopf);
    color: var(--tinte-leise-2);
    font-family: var(--schrift-titel);
    font-size: 19px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .45s var(--feder);
}
.reiter__knopf:active { transform: scale(.94); }
.reiter__symbol { width: 28px; height: 28px; flex: none; }
.reiter__knopf.ist-offen { box-shadow: var(--glanz-knopf); }
.reiter__knopf.farbe-creme   { background: var(--creme);   color: var(--tinte); }
.reiter__knopf.farbe-orange  { background: var(--orange);  color: var(--tinte); }
.reiter__knopf.farbe-tinte   { background: var(--tinte);   color: var(--creme); box-shadow: inset 0 0 0 2px var(--creme); }   /* sonst auf der dunklen Karte unsichtbar */
.reiter__knopf.farbe-tuerkis { background: var(--tuerkis); color: var(--tinte); }
.reiter__knopf--petrol { background: var(--petrol); color: var(--creme); }
/* Untermenü eines Werkzeugs (z. B. Talker → Einstellen) – kleiner als die Reiter, der offene Punkt creme */
.unterreiter { display: flex; flex-wrap: wrap; gap: 8px; }
.unterreiter__knopf {
    min-height: 52px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-voll);
    box-shadow: inset 0 0 0 2px var(--tinte-knopf);
    color: var(--tinte-leise-2);
    font-family: var(--schrift-titel);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .45s var(--feder);
}
.unterreiter__knopf:active { transform: scale(.94); }
.unterreiter__knopf.ist-offen { background: var(--creme); color: var(--tinte); box-shadow: none; }
.einstellungen__inhalt { display: grid; gap: 18px; padding-top: 4px; }

/* Kategorien (Talker → Karten): Name in seiner Farbe, zeigen, ▲▼, „Ändern“ klappt Name/Farbe/Löschen auf */
.kategorie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; scroll-margin-top: 24px; }
.kategorie__name { background: var(--kfarbe); color: var(--kfarbe-text); text-decoration: none; }
.kategorie__raster { margin-left: auto; padding-left: 12px; font-size: 14px; font-weight: 700; opacity: .75; }
.kategorie__name.kfarbe-tinte { box-shadow: inset 0 0 0 2px var(--tinte-rand); }
.kategorie__zeile { display: flex; align-items: center; gap: 12px; }
.kategorie__bearbeiten summary { min-height: 56px; list-style: none; cursor: pointer; }
.kategorie__bearbeiten summary::-webkit-details-marker { display: none; }
.kategorie__bearbeiten[open] {
    flex-basis: 100%;
    display: grid;
    gap: 12px;
    padding: 14px 16px 16px;
    border-radius: 20px;
    background: var(--tinte-flaeche);
}
.kategorie__bearbeiten[open] summary { justify-self: start; }
.kategorie__formular { display: grid; gap: 4px; }

/* ---------- Karten (Talker → Karten) ---------- */

/* Kategorie wählen: Knöpfe in ihrer Farbe, die offene mit Ring */
.kartenwahl { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px; }
.kartenwahl__knopf {
    min-height: 48px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-voll);
    background: var(--kfarbe);
    color: var(--kfarbe-text);
    font-family: var(--schrift-titel);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .45s var(--feder);
}
.kartenwahl__knopf:active { transform: scale(.94); }
.kartenwahl__knopf.kfarbe-tinte { box-shadow: inset 0 0 0 2px var(--tinte-rand); }
.kartenwahl__knopf.ist-offen { box-shadow: 0 0 0 3px var(--tinte), 0 0 0 6px var(--creme); }

/*
 * Übersicht: aufgebaut wie im Talker – gleiche Spalten und Seitenverhältnis je Rastergröße (6×4, 8×6, 12×8),
 * ganze Seiten mit gestrichelten freien Plätzen, Rand in der Kategoriefarbe.
 */
.kartenraster {
    --spalten: 6;
    --rand: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(var(--spalten), minmax(0, 1fr));
    gap: 8px;
}
.kartenraster > li { aspect-ratio: 127 / 100; min-width: 0; }
.kartenraster.raster-8x6 { --spalten: 8; --rand: 3px; gap: 6px; }
.kartenraster.raster-8x6 > li { aspect-ratio: 145 / 100; }
.kartenraster.raster-12x8 { --spalten: 12; --rand: 2px; gap: 4px; }
.kartenraster.raster-12x8 > li { aspect-ratio: 128 / 100; }
.kartenraster.raster-kern { --spalten: 1; --rand: 3px; --ecke: 24px; max-width: 84px; gap: 6px; }   /* Kernwörter: im Talker eine Spalte links, kleine quadratische Karten */
.kartenraster.raster-kern > li { aspect-ratio: 1; }
.kartenkachel {
    height: 100%;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: inset 0 0 0 var(--rand) var(--kfarbe);
    color: var(--tinte);
    text-decoration: none;
    transition: transform .45s var(--feder);
}
.kartenraster.kfarbe-creme .kartenkachel { box-shadow: inset 0 0 0 var(--rand) var(--creme-dunkel); }
.kartenkachel:active { transform: scale(.94); }
.kartenkachel__bild { flex: 1; min-height: 0; width: 100%; object-fit: contain; border-radius: 8px; }
.kartenkachel__bild--leer, .karteneditor__bild--leer, .kartensuche__vorschau--leer {
    background: repeating-linear-gradient(135deg, #F3E7CB 0 8px, #FBF5E6 8px 16px);
}
.kartenkachel__wort { font-family: var(--schrift-titel); font-size: 15px; font-weight: 700; line-height: 1.1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartenkachel--neu { align-items: center; justify-content: center; background: transparent; box-shadow: inset 0 0 0 2px var(--creme); color: var(--creme); }
.kartenkachel__plus { font-family: var(--schrift-titel); font-size: 36px; font-weight: 700; line-height: 1; }
.kartenraster__frei { border: 2px dashed var(--tinte-rand); border-radius: 14px; }
/* Kleinere Raster: weniger Innenabstand, kleinere Schrift, beim kleinsten nur noch das „+“ */
.kartenraster.raster-8x6 .kartenkachel { padding: 5px; gap: 2px; border-radius: 10px; }
.kartenraster.raster-8x6 .kartenkachel__wort { font-size: 12px; }
.kartenraster.raster-8x6 .kartenkachel__plus { font-size: 28px; }
.kartenraster.raster-12x8 .kartenkachel { padding: 3px; gap: 1px; border-radius: 7px; }
.kartenraster.raster-12x8 .kartenkachel__wort { font-size: 9px; }
.kartenraster.raster-12x8 .kartenkachel__plus { font-size: 22px; }
.kartenraster.raster-12x8 .kartenkachel--neu .kartenkachel__wort { display: none; }
.kartenraster.raster-kern .kartenkachel { padding: 4px; gap: 1px; border-radius: 10px; }
.kartenraster.raster-kern .kartenkachel__wort { font-size: 12px; }
.kartenraster.raster-kern .kartenkachel__plus { font-size: 26px; }
.kartenraster.raster-kern .kartenkachel--neu .kartenkachel__wort { display: none; }
.kartenraster.raster-8x6 .kartenraster__frei, .kartenraster.raster-12x8 .kartenraster__frei { border-width: 1px; border-radius: 8px; }
/* Unterseite (wie im Talker): Karte hell in der Kategoriefarbe, große Ecke mit Pfeil „›“ oben rechts */
.kartenkachel { position: relative; }
.kartenkachel--seite { background: color-mix(in srgb, var(--kfarbe) 30%, #FFFFFF); }
.kartenraster.kfarbe-creme .kartenkachel--seite { background: color-mix(in srgb, var(--creme-dunkel) 45%, #FFFFFF); }
/* Kernwörter: ganz leicht in der Kategoriefarbe (wie im Talker links) */
.kartenraster.raster-kern .kartenkachel:not(.kartenkachel--seite):not(.kartenkachel--neu) { background: color-mix(in srgb, var(--kfarbe) 13%, #FFFFFF); }
.kartenraster.raster-kern.kfarbe-creme .kartenkachel:not(.kartenkachel--seite):not(.kartenkachel--neu) { background: color-mix(in srgb, var(--creme-dunkel) 25%, #FFFFFF); }
.kartenkachel--seite::before,
.kartenkachel--seite::after { position: absolute; top: 0; right: 0; }
.kartenkachel--seite::before {
    content: "";
    width: var(--ecke, 34px);
    height: var(--ecke, 34px);
    border-top-right-radius: inherit;
    background: var(--kfarbe);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.kartenkachel--seite::after {
    content: "›";
    width: calc(var(--ecke, 34px) * .6);
    height: calc(var(--ecke, 34px) * .54);
    display: grid;
    place-items: center;
    font-family: var(--schrift-titel);
    font-size: calc(var(--ecke, 34px) * .9);
    font-weight: 700;
    line-height: 1;
    color: var(--kfarbe-text);
}
.kartenraster.kfarbe-creme .kartenkachel--seite::before { background: var(--creme-dunkel); }
.kartenraster.raster-8x6 { --ecke: 26px; }
.kartenraster.raster-12x8 { --ecke: 18px; }

/* Weg zur Unterseite: Zurück, „Essen › Obst“, Unterseite bearbeiten */
.kartenweg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.kartenweg__text { flex: 1; min-width: 12em; margin: 0; font-family: var(--schrift-titel); font-size: 19px; font-weight: 700; }
.kartenweg__text a { color: inherit; }

/* Neue Karten schnell anlegen: Feld über dem Raster, Treffer zum Antippen; das „+“ im Raster leuchtet dabei */
.schnellkarte { display: grid; gap: 12px; padding: 16px; border-radius: 22px; background: var(--tinte-flaeche); scroll-margin-top: 24px; }
.schnellkarte__zeile { display: flex; gap: 10px; }
.schnellkarte__zeile .eingabe { flex: 1; min-width: 0; }
.schnellkarte.laedt { opacity: .7; pointer-events: none; }
.schnellkarte__art { min-height: 40px; font-weight: 700; }
.kartenkachel--neu.ist-offen { background: var(--creme); color: var(--tinte); }
.kartenkachel.ist-neu { animation: karte-neu .5s var(--feder); }
@keyframes karte-neu {
    from { transform: scale(.6); opacity: 0; }
}

/* Karte bearbeiten */
.karteneditor { display: grid; gap: 14px; scroll-margin-top: 24px; }
.karteneditor__oben { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.karteneditor__bild { width: 160px; height: 160px; padding: 10px; border-radius: 22px; background: #FFFFFF; object-fit: contain; }
.karteneditor__bildknoepfe { display: grid; gap: 10px; }
.karteneditor__bildknoepfe .knopf { width: 100%; }
.karteneditor__foto { position: relative; cursor: pointer; }
form[data-foto].laedt .karteneditor__foto { opacity: .5; }
.karteneditor__mehr { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--tinte-knopf); }
.karteneditor__kopieren { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.karteneditor__kopieren-text { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tinte-leise); }
.karteneditor__kopieren select { min-width: 150px; }

/* ARASAAC-Suche: Treffer zum Antippen */
.kartensuche { display: grid; gap: 14px; scroll-margin-top: 24px; }
.kartensuche__formular { display: flex; gap: 10px; }
.kartensuche__formular .eingabe { flex: 1; min-width: 0; }
.kartensuche__treffer { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.kartensuche__bild {
    width: 100%;
    aspect-ratio: 1;
    padding: 8px;
    border: 0;
    border-radius: 18px;
    background: #FFFFFF;
    cursor: pointer;
    transition: transform .45s var(--feder);
}
.kartensuche__bild:active { transform: scale(.92); }
.kartensuche__vorschau { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.arasaac-hinweis { font-size: 13px; }

/* ---------- Schreiben → Sätze: je Satz ein Textfeld mit Speichern, Pfeilen und Löschen ---------- */

.satzliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.satzliste__eintrag { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--tinte-knopf); scroll-margin-top: 24px; }
.satzliste__formular { flex: 1 1 320px; display: flex; gap: 8px; }
.satzliste__formular .eingabe { flex: 1; min-width: 0; }
.satzliste__loeschen { width: 56px; height: 56px; padding: 0; }

/* ---------- Wochenplan → Woche: Raster wie im Wochenplan (Tage oben, Tageszeiten links), je Feld bis zu 3 Karten ---------- */

.wochenraster { display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr)); gap: 6px; }
.wochenraster__tag { padding: 6px 0; border-radius: 12px; background: var(--tinte-flaeche); font-family: var(--schrift-titel); font-weight: 700; text-align: center; }
.wochenraster__zeit { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; text-align: center; }
.wochenraster__zeit-bild { width: 38px; height: 38px; border-radius: 8px; background: #FFFFFF; }
.wochenraster__feld { min-width: 0; min-height: 96px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tinte-flaeche); scroll-margin-top: 24px; }
.wochenkachel { --rand: 0px; height: 64px; flex: none; padding: 4px; gap: 1px; border-radius: 10px; }
.wochenkachel .kartenkachel__wort { font-size: 11px; }
.wochenkachel--neu { height: 34px; box-shadow: inset 0 0 0 2px var(--tinte-knopf); color: var(--tinte-leise); }
.wochenkachel--neu .kartenkachel__plus { font-size: 24px; }

/* Karte bearbeiten: Tag und Tageszeit nebeneinander; an andere Tage kopieren */
.wochenwahl { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.wochenwahl__teil { display: grid; gap: 8px; }
.wochenkopie { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--tinte-knopf); }
.wochenkopie p { margin: 0; }
.wochenkopie__tage { display: flex; flex-wrap: wrap; gap: 8px; }
.wochenkopie__tag { position: relative; cursor: pointer; }
.wochenkopie__tag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wochenkopie__tag span {
    display: grid;
    place-items: center;
    width: 56px;
    height: 48px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 2px var(--tinte-rand);
    font-family: var(--schrift-titel);
    font-size: 18px;
    font-weight: 700;
    color: var(--tinte-leise-2);
    transition: transform .45s var(--feder);
}
.wochenkopie__tag:active span { transform: scale(.92); }
.wochenkopie__tag input:checked + span { background: var(--creme); color: var(--tinte); box-shadow: none; }
.wochenkopie__tag input:focus-visible + span { outline: 3px solid var(--tuerkis); outline-offset: 3px; }
.wochenkopie__tag.ist-voll { cursor: default; opacity: .4; }
.wochenkopie__tag.ist-da { cursor: default; opacity: .55; }      /* steht dort schon – angehakt, nicht änderbar */

/* Zeilen mit Regler oder Auswahl (z. B. Stimme, Tempo) */
.einstellungen__zeile { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--tinte-knopf); font-size: 18px; font-weight: 700; }
.einstellungen__zeile.schalter { display: flex; }
.einstellungen__zeile-kopf { display: flex; justify-content: space-between; gap: 12px; }
.einstellungen__wert { color: var(--orange); }
.einstellungen__hinweis { display: block; font-size: 15px; font-weight: 400; color: var(--tinte-leise); }
.einstellungen__knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 6px; }
.einstellungen__sprache select { width: 100%; }

/* Eingabefelder */
.eingabe {
    min-height: 56px;
    padding: 0 20px;
    border: 2px solid var(--tinte-rand);
    border-radius: var(--radius-voll);
    background: var(--tinte-flaeche);
    color: var(--creme);
    font: inherit;
    font-size: 20px;
}
.eingabe::placeholder { color: var(--tinte-leise); opacity: .7; }
.eingabe:focus { outline: none; border-color: var(--tuerkis); }
.eingabe--code { font-family: var(--schrift-titel); font-size: 26px; letter-spacing: .15em; font-variant-numeric: tabular-nums; }

/* ---------- Übergänge zwischen Seiten ---------- */

@view-transition { navigation: auto; }
::view-transition-group(feld) { animation-duration: .54s; animation-timing-function: var(--gleiten); }
::view-transition-old(feld), ::view-transition-new(feld) { height: 100%; }

/* ---------- Andere Größen ---------- */

/* Hochkant oder sehr schmal: Startseite untereinander, sie darf scrollen */
@media (orientation: portrait), (max-width: 599px) {
    .start { height: auto; min-height: 100vh; min-height: 100dvh; padding: 28px 24px; overflow: visible; }
    .start__titel { margin: 24px 0 28px; font-size: clamp(26px, 6vw, 44px); }
    .start__inhalt { max-height: none; grid-template-columns: minmax(0, 1fr); }
    .zuletzt__symbol svg { width: 88px; height: 88px; margin: 16px 0; }
    .zuletzt__name { font-size: clamp(36px, 8vw, 56px); }
    .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 140px; }
}

/* Hochkant auf Tablet oder Handy: Hinweis „Bitte quer halten“ über allem (als installierte App ist das Querformat
   ohnehin fest, siehe tacheles.webmanifest). Nur Touch-Geräte – ein schmales Fenster am Computer bleibt frei. */
.drehen { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
    .drehen {
        position: fixed;
        z-index: 30;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 28px;
        padding: 32px;
        background: var(--petrol);
        color: var(--creme);
        text-align: center;
    }
}
.drehen__symbol { width: 120px; height: 120px; animation: drehen 2.6s var(--gleiten) infinite; }
@keyframes drehen {
    0%, 30% { transform: rotate(0deg); }
    60%, 100% { transform: rotate(-90deg); }
}
.drehen__text { font-family: var(--schrift-titel); font-size: clamp(28px, 7vw, 44px); font-weight: 800; line-height: 1.1; }

/* Schmal: einfache Seiten (Einstellungen, Konto …) mit weniger Rand, damit Überschrift und Reiter hineinpassen */
@media (max-width: 599px) {
    .einfach { gap: 20px; padding: 20px 12px; }
    .einfach__karte { padding: 22px 16px; }
    .einfach__titel { font-size: 32px; }
    .reiter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reiter__knopf { padding: 8px 10px; font-size: 17px; }
}

/* Niedrig (z. B. kleines Tablet quer): Leiste enger, damit neben dem Timer-Balken noch Werkzeuge zu sehen sind */
@media (max-height: 560px) {
    .leiste { gap: 10px; padding: 12px 0; }
    .leiste__menue { height: 72px; }
    .leiste__timer { height: max(84px, 30vh); gap: 4px; padding: 8px 0 7px; }
    .leiste__timer-symbol { width: 20px; height: 20px; }
    .leiste:has(.leiste__timer:not([hidden])) .leiste__uhr { display: none; }   /* solange der Timer läuft, hat er Vorrang */
}

@media (max-width: 720px) {
    :root { --abstand: 12px; --leiste: 92px; }
    .leiste__menue { margin-left: 8px; width: 76px; }
    .leiste__eintrag { padding-left: 8px; }
    .leiste__werkzeug { width: 76px; }
    .leiste__modul { width: calc(var(--leiste) + var(--abstand) - 4px); }
}

/* Bewegung aus: Systemeinstellung „weniger Bewegung“ (später auch eigene Einstellung html.bewegung-aus) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    @view-transition { navigation: none; }
}
html.bewegung-aus *, html.bewegung-aus *::before, html.bewegung-aus *::after { transition: none !important; animation: none !important; }
