/* =====================================================================
   Tuca App – Design-System (Stand 29.09.2026)
   Reines CSS, kein Build-Schritt. Klassen mit Präfix t- (kollidiert nicht
   mit bestehendem app.css). Alle Farben/Masse als Variablen in :root.
   ===================================================================== */

/* ---------- Schriften (selbst gehostet, OFL-Lizenzen im Ordner) ---------- */
@font-face { font-family: "Tuca Display"; src: url("fonts/fraunces.woff") format("woff"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Tuca Display"; src: url("fonts/fraunces-italic.woff") format("woff"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-400.woff") format("woff"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-700.woff") format("woff"); font-weight: 600 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* Farben */
  --t-ink: #1A1233;        /* Text, Ränder, dunkle Flächen */
  --t-cream: #FFF4E4;      /* Flächen, Tab-Leiste */
  --t-sand: #F4EBDD;
  --t-white: #FFFFFF;
  --t-sun: #FFC72C;        /* Primär-Akzent: Senden, aktive Pills, Nummern */
  --t-orange: #FF8A1F;
  --t-pink: #D11F5C;       /* Kursiv-Hervorhebung, NEW, aktiver Tab-Punkt */
  --t-green: #0B4F43;      /* Links, aktiver Tab, Offline-Banner */
  --t-ocean: #1F6F8B;
  --t-purple: #5B2A86;
  --t-muted: #4A4060;      /* Sekundärtext (Kontrast ok auf Creme/Weiss) */
  --t-muted-2: #6A5F7E;    /* Platzhalter, inaktive Tabs */
  --t-line: #E7D5B8;       /* gestrichelte Trenner */
  /* Hintergrund: Sonnenuntergang */
  --t-sunset: linear-gradient(180deg, #FFF3D6 0%, #FFE7AE 42%, #FFC766 82%, #FF9A3D 100%);
  /* Typo */
  --t-font-display: "Tuca Display", Georgia, serif;
  --t-font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  /* Form */
  --t-border: 2px solid var(--t-ink);
  --t-radius-card: 16px;
  --t-radius-lg: 18px;
  --t-radius-sheet: 28px;
  --t-shadow: 3px 3px 0 var(--t-ink);
  --t-shadow-lg: 4px 4px 0 var(--t-ink);
  --t-shadow-cta: 4px 4px 0 var(--t-pink);
  /* Layout */
  --t-tabbar-h: 64px;      /* + env(safe-area-inset-bottom) */
  --t-gutter: 16px;
  --t-composer-h: 74px;     /* Höhe Eingabezeile im Chat */
}

/* ---------- Grundlagen ---------- */
.t-app, .t-app * { box-sizing: border-box; }
.t-app { font-family: var(--t-font-body); color: var(--t-ink); -webkit-font-smoothing: antialiased; }
.t-display { font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; }
.t-em { font-style: italic; color: var(--t-pink); }
.t-app [hidden] { display: none !important; }
.t-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.t-ico--sm { width: 18px; height: 18px; }
.t-ico--xs { width: 16px; height: 16px; stroke-width: 2.4; }

/* ---------- Bildschirm ---------- */
.t-screen {
  position: relative; min-height: 100dvh; overflow-x: hidden;
  background: var(--t-sunset); background-attachment: fixed;
  padding-bottom: calc(var(--t-tabbar-h) + env(safe-area-inset-bottom) + 120px); /* Platz für Skyline */
}
.t-screen--chat { display: flex; flex-direction: column; padding-bottom: 0; height: 100dvh; }
.t-screen--dark { background: var(--t-ink); padding-bottom: 0; }
.t-skyline {
  position: fixed; left: 0; right: 0; z-index: 0; pointer-events: none;
  bottom: calc(var(--t-tabbar-h) + env(safe-area-inset-bottom));
  height: 110px; width: 100%; object-fit: cover; object-position: 50% 100%;
}
.t-screen--notabs { padding-bottom: 140px; }
.t-screen--notabs .t-skyline { bottom: 0; }
.t-screen > *:not(.t-skyline):not(.t-tabbar):not(.t-toast):not(.t-sheet) { position: relative; z-index: 1; }
.t-wrap { padding: 18px var(--t-gutter) 0; display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 0 auto; }

/* ---------- Kopf ---------- */
.t-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.t-logo { height: 34px; width: auto; display: block; }
.t-h1 { margin: 0; font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 36px; line-height: 1; }
.t-h1--hero { font-size: 40px; }
.t-h2 { margin: 0; font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 22px; }
.t-context { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--t-muted); }
.t-context .t-ico { color: var(--t-pink); }
.t-chat-header { background: rgba(255,244,228,0.88); border-bottom: var(--t-border); padding: 16px 20px 12px; display: flex; flex-direction: column; gap: 6px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.t-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 700; font-size: 14px; color: var(--t-green); text-decoration: none; }

/* ---------- Pills, Chips, Buttons ---------- */
.t-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--t-white); border: var(--t-border); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.t-pill--sun { background: var(--t-sun); }
button.t-pill { font-family: inherit; color: var(--t-ink); min-height: 40px; font-size: 14px; cursor: pointer; }
.t-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.t-chip { font-family: inherit; font-size: 14px; font-weight: 600; color: var(--t-ink); background: var(--t-white); border: var(--t-border); border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
.t-chip[aria-pressed="true"], .t-chip--active { background: var(--t-ink); color: var(--t-sun); font-weight: 700; }
.t-chip--sun { background: var(--t-sun); }
.t-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 24px; border-radius: 999px; border: 0; background: var(--t-ink); color: var(--t-sun); font-family: inherit; font-weight: 700; font-size: 17px; text-decoration: none; box-shadow: var(--t-shadow-cta); cursor: pointer; }
.t-btn--sun { white-space: nowrap; background: var(--t-sun); color: var(--t-ink); border: var(--t-border); box-shadow: var(--t-shadow); min-height: 44px; font-size: 14px; padding: 0 16px; }
.t-icon-btn { width: 48px; height: 48px; flex: none; border-radius: 50%; border: var(--t-border); background: var(--t-white); color: var(--t-ink); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.t-icon-btn--send { background: var(--t-sun); box-shadow: 2px 2px 0 var(--t-ink); }
.t-link { font-weight: 700; font-size: 14px; color: var(--t-green); text-decoration: none; }

/* ---------- Karten ---------- */
.t-card { background: var(--t-white); border: var(--t-border); border-radius: var(--t-radius-card); box-shadow: var(--t-shadow); padding: 12px 14px; }
.t-card--cream { background: var(--t-cream); border-radius: var(--t-radius-lg); box-shadow: var(--t-shadow-lg); }
.t-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-green); }
.t-tip { font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 800; font-size: 19px; line-height: 1.25; }

/* Home: Frage-Feld (Link in den Chat) */
.t-askbox { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 7px 0 18px; background: var(--t-white); border: var(--t-border); border-radius: 999px; box-shadow: var(--t-shadow-lg); color: var(--t-muted-2); font-size: 15px; text-decoration: none; }
.t-askbox span:first-child { flex-grow: 1; }
.t-askbox .t-icon-btn { width: 40px; height: 40px; background: var(--t-sun); }

/* Home: Kachel-Raster */
.t-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.t-tile { display: flex; flex-direction: column; gap: 8px; min-height: 96px; padding: 14px; border: var(--t-border); border-radius: var(--t-radius-lg); background: var(--t-white); color: var(--t-ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.t-tile .t-ico { width: 26px; height: 26px; }
.t-tile--green { background: var(--t-green); color: var(--t-cream); } .t-tile--green .t-ico { color: var(--t-sun); }
.t-tile--pink { background: var(--t-pink); color: var(--t-white); } .t-tile--pink .t-ico { color: var(--t-sun); }

/* Liste (Guide-Einträge, «Up next») */
.t-row { display: flex; align-items: center; gap: 12px; background: var(--t-white); border: var(--t-border); border-radius: var(--t-radius-card); box-shadow: var(--t-shadow); padding: 12px; color: var(--t-ink); text-decoration: none; }
.t-row__body { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-row__title { font-weight: 700; font-size: 16px; }
.t-row__sub { font-size: 13px; color: var(--t-muted); }
.t-badge-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; border: var(--t-border); display: flex; align-items: center; justify-content: center; background: var(--t-sun); color: var(--t-ink); }
.t-badge-ico--sm { width: 38px; height: 38px; border-radius: 11px; }
.t-badge-ico--orange { background: var(--t-orange); }
.t-badge-ico--ocean { background: var(--t-ocean); color: var(--t-cream); }
.t-badge-ico--green { background: var(--t-green); color: var(--t-cream); }
.t-badge-ico--purple { background: var(--t-purple); color: var(--t-cream); }
.t-badge-ico--pink { background: var(--t-pink); color: var(--t-cream); }
.t-badge-ico--cream { background: var(--t-cream); }
.t-badge-ico--white { background: var(--t-white); }

/* Guide: Themen-Raster */
.t-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.t-topic { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px; background: var(--t-white); border: var(--t-border); border-radius: var(--t-radius-card); box-shadow: var(--t-shadow); color: var(--t-ink); font-weight: 700; font-size: 14px; line-height: 1.2; text-decoration: none; }

/* Guide: Ort/Eintrag mit Tipp */
a.t-card { color: var(--t-ink); text-decoration: none; }
.t-place { display: flex; flex-direction: column; gap: 6px; }
.t-place__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.t-tag { font-size: 12px; font-weight: 700; border: var(--t-border); border-radius: 999px; padding: 2px 10px; background: var(--t-orange); flex: none; }
.t-tag--green { background: var(--t-green); color: var(--t-cream); }
.t-tag--purple { background: var(--t-purple); color: var(--t-cream); }
.t-tag--ocean { background: var(--t-ocean); color: var(--t-cream); }
.t-place__tip { font-size: 13px; line-height: 1.4; border-top: 2px dashed var(--t-line); padding-top: 6px; }
.t-place__tip b { color: var(--t-pink); }

/* Suchfeld */
.t-search { position: relative; }
.t-search .t-ico { position: absolute; left: 16px; top: 14px; width: 20px; height: 20px; }
.t-input { width: 100%; height: 48px; border: var(--t-border); border-radius: 999px; background: var(--t-white); padding: 0 18px; font-family: inherit; font-size: 16px; color: var(--t-ink); }
.t-search .t-input { padding-left: 46px; }
.t-input::placeholder { color: var(--t-muted-2); }

/* Offline-Banner */
.t-banner { display: flex; align-items: center; gap: 12px; background: var(--t-green); color: var(--t-cream); border: var(--t-border); border-radius: var(--t-radius-lg); box-shadow: var(--t-shadow-lg); padding: 12px 12px 12px 14px; }
.t-banner .t-ico { width: 28px; height: 28px; color: var(--t-sun); }
.t-banner__body { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.t-banner__body b { font-size: 15px; }

/* ---------- Chat ---------- */
.t-thread { flex-grow: 1; overflow-y: auto; padding: 18px var(--t-gutter) 24px; display: flex; flex-direction: column; gap: 14px; }
.t-msg { display: flex; gap: 8px; align-items: flex-end; }
.t-msg__avatar { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.t-bubble { max-width: 82%; padding: 12px 14px; font-size: 15px; line-height: 1.45; border-radius: 18px; }
.t-bubble--bot { background: var(--t-white); border: var(--t-border); border-radius: 18px 18px 18px 4px; box-shadow: var(--t-shadow); display: flex; flex-direction: column; gap: 10px; }
.t-bubble--me { align-self: flex-end; background: var(--t-ink); color: var(--t-cream); border-radius: 18px 18px 4px 18px; }
.t-bubble__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 2px dashed var(--t-line); padding-top: 8px; }
.t-share { display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--t-ink); background: var(--t-white); border: 1.5px solid var(--t-ink); border-radius: 999px; padding: 4px 10px; min-height: 32px; cursor: pointer; }
.t-typing { letter-spacing: 0.2em; font-weight: 700; }
.t-suggest { padding-left: 38px; }
.t-composer { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 14px; background: var(--t-cream); border-top: var(--t-border); }
.t-composer .t-input { flex-grow: 1; min-width: 0; }
.t-screen--chat .t-skyline { position: absolute; bottom: calc(var(--t-tabbar-h) + var(--t-composer-h) + env(safe-area-inset-bottom)); }

/* Chat-Karten (Ereignis card.kind) */
.t-cardmsg { margin-left: 38px; display: flex; flex-direction: column; gap: 10px; }
.t-cardmsg--sos { background: var(--t-pink); color: var(--t-white); }
.t-cardmsg--sos .t-btn { background: var(--t-white); color: var(--t-ink); box-shadow: var(--t-shadow); }
.t-plans { display: grid; gap: 8px; }
.t-plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--t-cream); border: var(--t-border); border-radius: 14px; padding: 10px 12px; color: var(--t-ink); text-decoration: none; font-weight: 700; }
.t-plan small { display: block; font-weight: 500; font-size: 12px; color: var(--t-muted); }
.t-price { font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 22px; }

/* ---------- Tab-Leiste ---------- */
.t-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; align-items: flex-start; background: var(--t-cream); border-top: var(--t-border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); min-height: var(--t-tabbar-h); }
.t-tab { width: 96px; min-height: 52px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--t-muted-2); text-decoration: none; }
.t-tab .t-ico { width: 26px; height: 26px; }
.t-tab::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.t-tab[aria-current="page"] { color: var(--t-green); }
.t-tab[aria-current="page"]::after { background: var(--t-pink); }
.t-screen--chat .t-tabbar { position: static; }

/* ---------- Homescreen-Hinweis (nur im Browser, nicht installiert) ---------- */
.t-install-grid { padding: 72px 28px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.t-install-app { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; color: var(--t-cream); font-size: 12px; font-weight: 700; }
.t-install-app img, .t-install-app span.t-ghost { width: 62px; height: 62px; border-radius: 16px; display: block; }
.t-install-app img { outline: 3px solid var(--t-sun); outline-offset: 3px; }
.t-ghost { background: rgba(255,244,228,0.14); }
.t-new { position: absolute; top: -10px; right: -8px; background: var(--t-pink); color: var(--t-white); font-size: 10px; letter-spacing: 0.08em; padding: 3px 7px; border-radius: 999px; border: 2px solid var(--t-ink); }
.t-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--t-cream); border-top: var(--t-border); border-radius: var(--t-radius-sheet) var(--t-radius-sheet) 0 0; padding: 12px 24px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; }
.t-sheet__grab { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: #D9CBB3; }
.t-sheet__title { margin: 4px 0 0; font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 28px; line-height: 1.1; }
.t-sheet p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--t-muted); }
.t-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.t-step { display: flex; align-items: center; gap: 12px; background: var(--t-white); border: var(--t-border); border-radius: var(--t-radius-card); padding: 12px 14px; font-size: 15px; font-weight: 600; }
.t-step span:nth-child(2) { flex-grow: 1; }
.t-step__num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--t-sun); border: var(--t-border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

/* ---------- Hinweise ---------- */
/* Toast: Willkommen (?welcome=1), abgemeldet (signedOut), neue Version (Service Worker) */
.t-toast { position: fixed; left: var(--t-gutter); right: var(--t-gutter); z-index: 30; top: calc(12px + env(safe-area-inset-top)); max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 10px; background: var(--t-ink); color: var(--t-cream); border-radius: var(--t-radius-card); box-shadow: var(--t-shadow-cta); padding: 12px 12px 12px 16px; font-size: 14px; line-height: 1.35; }
.t-toast span { flex-grow: 1; }
.t-toast .t-btn--sun { min-height: 36px; font-size: 13px; padding: 0 12px; }
/* Leise Systemnachricht im Chat (z. B. HTTP 429, Fehler) */
.t-note { align-self: center; max-width: 90%; text-align: center; font-size: 13px; line-height: 1.4; color: var(--t-muted); background: rgba(255,244,228,0.9); border: 2px dashed var(--t-muted-2); border-radius: 12px; padding: 8px 12px; }
.t-cardmsg__title { margin: 0; font-family: var(--t-font-display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 20px; line-height: 1.15; }
.t-cardmsg p { margin: 0; font-size: 14px; line-height: 1.45; }
.t-sosnums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.t-sosnum { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--t-white); color: var(--t-ink); border: var(--t-border); border-radius: 12px; padding: 8px 4px; text-decoration: none; font-size: 12px; font-weight: 700; }
.t-sosnum b { font-family: var(--t-font-display); font-size: 22px; font-weight: 900; }

/* ---------- Login ---------- */
.t-form { display: flex; flex-direction: column; gap: 12px; }
.t-label { font-weight: 700; font-size: 14px; }
.t-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; color: var(--t-muted); }
.t-check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--t-green); }
.t-small { font-size: 13px; line-height: 1.45; color: var(--t-muted); margin: 0; }

/* Fokus sichtbar */
.t-app :focus-visible { outline: 3px solid var(--t-ocean); outline-offset: 2px; }

/* --- Ergänzungen Web-App (Claude): Chips/Karten als Links ------------------------------ */
a.t-chip, a.t-plan, a.t-topic, a.t-tile, a.t-btn { text-decoration: none; }
a.t-chip { display: inline-flex; align-items: center; gap: 6px; }

/* --- Guide nach Kapiteln (Claude, 29.09.2026): Brotkrumen, «Inhalt», Seitenleiste, Eintragsseite ---- */
.t-guidebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.t-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; font-weight: 600; }
.t-crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.t-crumbs li + li::before { content: "›"; color: var(--t-muted-2); }
.t-crumbs a { color: var(--t-green); text-decoration: none; }
.t-crumbs a:hover { text-decoration: underline; }
.t-crumbs [aria-current] { color: var(--t-muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-tocbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: var(--t-border); border-radius: 999px; background: var(--t-white); color: var(--t-ink); font-weight: 700; font-size: 13px; text-decoration: none; box-shadow: var(--t-shadow); }
.t-entries { display: flex; flex-direction: column; gap: 10px; }
.t-section { display: flex; flex-direction: column; gap: 10px; }
.t-row .t-ico--sm { flex-shrink: 0; color: var(--t-muted-2); }
.t-entry { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.t-entry .t-tag { align-self: flex-start; }
.t-entry__title { font-family: var(--t-font-display); font-weight: 800; font-size: 26px; line-height: 1.12; margin: 0; text-wrap: balance; }
.t-entry p { margin: 0; line-height: 1.55; }
.t-facts { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 2px dashed var(--t-line); }
.t-facts .t-tag { align-self: flex-start; }
.t-fact { font-size: 14px; }
.t-entry__src { margin: 0; }

.t-toc { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--t-cream); border-right: var(--t-border); padding: calc(14px + env(safe-area-inset-top)) 16px 24px;
  transform: translateX(-105%); transition: transform .22s ease; }
.t-toc:target, .t-toc[data-open] { transform: none; }
.t-toc__backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(26, 18, 51, .38); display: none; }
.t-toc:target + .t-toc__backdrop, .t-toc[data-open] + .t-toc__backdrop { display: block; }
.t-toc__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.t-toc__home { font-family: var(--t-font-display); font-weight: 900; font-size: 24px; color: var(--t-ink); text-decoration: none; }
.t-toc__close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: var(--t-border); border-radius: 50%; background: var(--t-white); color: var(--t-ink); font-size: 22px; line-height: 1; text-decoration: none; }
.t-toc__list, .t-toc ul { list-style: none; margin: 0; padding: 0; }
.t-toc__list > li { border-bottom: 2px dashed var(--t-line); padding: 6px 0; }
.t-toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.t-toc summary::-webkit-details-marker { display: none; }
.t-toc summary::after { content: "▾"; margin-left: auto; padding-left: 8px; color: var(--t-muted-2); transition: transform .15s; }
.t-toc details:not([open]) summary::after { transform: rotate(-90deg); }
.t-toc__chapter { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 700; font-size: 15px; color: var(--t-ink); text-decoration: none; }
.t-toc__sec { padding: 4px 0 6px 10px; }
.t-toc__sec > span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t-green); margin: 4px 0; }
.t-toc__sec a { display: block; padding: 5px 8px; border-radius: 10px; font-size: 14px; line-height: 1.3; color: var(--t-ink); text-decoration: none; }
.t-toc__sec a:hover { background: var(--t-white); }
.t-toc a[aria-current] { background: var(--t-sun); border-radius: 10px; }
.t-toc__chapter[aria-current] { padding: 0 8px; }

/* Computer: Seitenleiste fest links, Inhalt daneben */
@media (min-width: 1024px) {
  .t-screen--toc { padding-left: 320px; }
  .t-screen--toc .t-toc { width: 320px; transform: none; bottom: var(--t-tabbar-h); padding-top: 22px; }
  .t-screen--toc .t-toc__close, .t-screen--toc .t-tocbtn, .t-screen--toc .t-toc__backdrop { display: none !important; }
  .t-screen--toc .t-wrap { max-width: 680px; }
}
@media (prefers-reduced-motion: reduce) { .t-toc { transition: none; } }
/* «.t-screen > *» setzt position: relative (hohe Spezifität) – Seitenleiste und Abdunkelung bleiben fixiert */
.t-screen > .t-toc { position: fixed !important; z-index: 40 !important; }
.t-screen > .t-toc__backdrop { position: fixed !important; z-index: 39 !important; }
