/* Heldenwerker Planung: Glas-Look nach Vorbild der Stempeluhr, nur Dunkel und Hell. */
:root {
  color-scheme: light dark;
  --accent: #2f9ee8; --ok: #8cc63f; --warn: #f0a03c; --err: #e8667e;
  --pad: 18px; --gap: 12px; --gap-s: 8px; --gap-l: 22px; --r-lg: 24px; --r-sm: 14px;
  --txt: light-dark(#1c1c1e, #f2f2f2);
  --mut: light-dark(rgba(28,28,30,.62), rgba(242,242,242,.58));
  --line: light-dark(rgba(0,0,0,.08), rgba(255,255,255,.08));
  --feld: light-dark(rgba(0,0,0,.06), rgba(255,255,255,.09));
  --bg: light-dark(#eef1f5, #0c0c0c);
  --panel: light-dark(#f4f6f9, #161616);
  /* Verläufe und Schatten kann light-dark() nicht, daher Dunkel als Standard und Hell unten als eigener Block. */
  --bgimg: none; /* Dunkel ist bewusst schlicht: kein farbiger Schimmer (Dominik, 17.11.) */
  --glas: linear-gradient(180deg, rgba(40,40,40,.62), rgba(22,22,22,.7));
  --glas-schatten: inset 0 1px 2px rgba(255,255,255,.07);
  --kante: linear-gradient(160deg, rgba(255,255,255,.42), rgba(255,255,255,.07) 30%, rgba(255,255,255,.03) 62%, rgba(255,255,255,.22));
  --leiste: linear-gradient(180deg, rgba(36,36,36,.6), rgba(16,16,16,.72));
}
:root:has(meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
:root:has(meta[name="color-scheme"][content="light"]) { color-scheme: light; }
:root:has(meta[name="color-scheme"][content="light"]) {
  --bgimg: radial-gradient(90% 45% at 70% 0%, #d3e7f8 0, transparent 70%), radial-gradient(70% 40% at 0% 60%, #e2eaf2 0, transparent 70%);
  --glas: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.68));
  --glas-schatten: 0 1px 2px rgba(0,0,0,.04);
  --kante: linear-gradient(160deg, #fff, rgba(255,255,255,.4) 40%, rgba(255,255,255,.2) 60%, #fff);
  --leiste: linear-gradient(180deg, rgba(255,255,255,.64), rgba(245,247,250,.78));
}
@media (prefers-color-scheme: light) {
  :root:has(meta[name="color-scheme"][content="light dark"]) {
    --bgimg: radial-gradient(90% 45% at 70% 0%, #d3e7f8 0, transparent 70%), radial-gradient(70% 40% at 0% 60%, #e2eaf2 0, transparent 70%);
    --glas: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.68));
    --glas-schatten: 0 1px 2px rgba(0,0,0,.04);
    --kante: linear-gradient(160deg, #fff, rgba(255,255,255,.4) 40%, rgba(255,255,255,.2) 60%, #fff);
    --leiste: linear-gradient(180deg, rgba(255,255,255,.64), rgba(245,247,250,.78));
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: var(--appH, 100%); overflow: hidden; }
body { position: relative; }
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
body { background: var(--bgimg), var(--bg); color: var(--txt); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, a, label, input, select, textarea { touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* In Textfeldern zeigt der Cursor den Fokus, kein blauer Rahmen (Dominik, 17.11.) */
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* Inhalt läuft bis ganz an den oberen Rand, ohne Streifen unter der Statusleiste (Dominik, 23.11.) */
main { position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top) + 18px) max(16px, calc(50% - 280px)) calc(env(safe-area-inset-bottom) + 94px); }
h1 { font-size: 30px; font-weight: 650; margin: 6px 0 var(--gap); letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 0 0 var(--gap); }
p { margin: 0 0 var(--gap); }
.muted { color: var(--mut); } .small { font-size: 14px; }
.kopf { display: flex; align-items: center; gap: var(--gap); margin-bottom: var(--gap); }
.kopf h1 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unter { color: var(--mut); font-size: 15px; margin: -6px 0 var(--gap-l); }

/* Glas-Karten mit Lichtkante */
.karte, .gruppe, .pill, .kachel, .segctl { position: relative; }
.karte, .gruppe, .kachel { background: var(--glas); box-shadow: var(--glas-schatten), 0 8px 24px rgba(0,0,0,.14); border-radius: var(--r-lg); margin: 0 0 var(--gap); }
.karte { padding: var(--pad); }
.gruppe { overflow: hidden; }
.karte::before, .gruppe::before, .pill::before, .kachel::before, .segctl::before, .tabs::before, .fbbtn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--kante);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.label { color: var(--mut); font-weight: 600; font-size: 15px; margin: var(--gap-l) var(--pad) var(--gap-s); }
.label:first-child { margin-top: 0; }
.hinweis { color: var(--mut); font-size: 14px; margin: calc(var(--gap-s) - var(--gap)) var(--pad) var(--gap); }

/* Zeilen in Gruppen */
.zeile { display: flex; align-items: center; gap: var(--gap); width: 100%; min-height: 56px; padding: 12px var(--pad); border-bottom: 1px solid var(--line); text-align: left; text-decoration: none; color: inherit; }
.zeile:last-child { border-bottom: 0; }
.zeile .haupt { flex: 1; min-width: 0; }
.zeile .titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .neben { color: var(--mut); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .pfeil { color: var(--mut); flex: none; }
.zeile .wert { color: var(--mut); flex: none; font-variant-numeric: tabular-nums; }
button.zeile:active, a.zeile:active { background: var(--feld); }
.leer { padding: 22px var(--pad); color: var(--mut); text-align: center; }

/* Knöpfe */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 26px; background: var(--feld); font-size: 16px; }
.pill svg { width: 20px; height: 20px; flex: none; }
.pill.akzent { background: var(--accent); color: #fff; }
.pill.akzent::before { display: none; }
.pill.rund { width: 44px; padding: 0; }
.pill:disabled { opacity: .45; }
.gross { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 64px; border-radius: 32px; font-size: 20px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); margin: 0 0 var(--gap); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 35%, transparent); }
.gross svg { width: 26px; height: 26px; }
.gross.ok { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 50%, #000)); box-shadow: 0 10px 28px color-mix(in srgb, var(--ok) 30%, transparent); }
.gross:disabled { opacity: .5; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 0 0 var(--gap); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--feld); color: var(--mut); white-space: nowrap; }
.badge.blau { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.badge.gruen { background: color-mix(in srgb, var(--ok) 25%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--txt)); }
.badge.orange { background: color-mix(in srgb, var(--warn) 25%, transparent); color: color-mix(in srgb, var(--warn) 75%, var(--txt)); }

/* Kacheln (Plus-Sheet, Home) */
.kachel { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px var(--pad); min-height: 128px; text-align: left; width: 100%; margin: 0; }
.kachel .ikon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); margin-bottom: 6px; }
.kachel .ikon svg { width: 24px; height: 24px; }
.kachel b { font-size: 18px; } .kachel span { color: var(--mut); font-size: 14px; }
.kachel:active { transform: scale(.98); }

/* Formulare */
input, select, textarea { font: inherit; font-size: 16px; color: var(--txt); background: var(--feld); border: 0; border-radius: var(--r-sm); padding: 11px 14px; min-height: 44px; width: 100%; outline: none; }
textarea { resize: vertical; line-height: 1.4; }
.suche { display: flex; align-items: center; gap: 8px; background: var(--feld); border-radius: 22px; padding: 0 14px; margin: 0 0 var(--gap); }
.suche svg { width: 20px; height: 20px; color: var(--mut); flex: none; }
.suche input { background: none; padding: 11px 0; }
.feld { display: grid; gap: 6px; padding: 10px var(--pad); border-bottom: 1px solid var(--line); }
.feld:last-child { border-bottom: 0; }
.feld > span { font-size: 14px; color: var(--mut); }
.segctl { display: flex; background: var(--feld); border-radius: 16px; padding: 4px; margin: 0 0 var(--gap); }
.segctl button { flex: 1; min-height: 40px; border-radius: 12px; font-size: 15px; color: var(--mut); }
.segctl button[aria-pressed="true"] { background: light-dark(#fff, rgba(255,255,255,.16)); color: var(--txt); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* Schwebende Tab-Leiste */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(10px, calc(env(safe-area-inset-bottom) - 14px)); width: min(calc(100% - 100px), 380px);
  display: flex; padding: 5px; border-radius: 32px; background: var(--leiste); backdrop-filter: blur(16px) saturate(1.8); -webkit-backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 5; }
.tabs button { position: relative; z-index: 1; flex: 1; height: 50px; border-radius: 26px; display: flex; align-items: center; justify-content: center; color: var(--mut); transition: color .25s, transform .2s; }
.tabs button:active { transform: scale(.88); }
.tabs button[aria-current="page"] { color: var(--accent); background: light-dark(rgba(0,0,0,.06), rgba(255,255,255,.12)); }
.tabs svg { width: 25px; height: 25px; }
.tabs .plus { color: #fff; }
.tabs .plus span { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 50%, transparent); }
.tabs .plus[aria-current="page"] { background: none; color: #fff; }
.fbbtn { position: fixed; right: max(12px, calc(50% - 190px - 72px)); bottom: max(10px, calc(env(safe-area-inset-bottom) - 14px)); z-index: 5; width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #f5c33b; background: var(--leiste); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.fbbtn svg { width: 27px; height: 27px; } .fbbtn:active { transform: scale(.88); }
@media (max-width: 480px) { .tabs { left: 12px; transform: none; width: calc(100% - 96px); } .fbbtn { right: 12px; } }

/* Bottom-Sheet als <dialog> */
dialog.sheet { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: transparent; color: var(--txt); overflow: hidden; }
dialog.sheet::backdrop { background: rgba(0,0,0,.5); }
dialog.sheet .panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: calc(100% - env(safe-area-inset-top) - 14px); overflow: auto; overscroll-behavior: contain;
  background: var(--panel); border-radius: 28px 28px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 24px); animation: hoch .25s ease-out; }
dialog.sheet.voll .panel { top: 0; max-height: none; border-radius: 0; padding-top: calc(env(safe-area-inset-top) + 10px); max-width: none; }
@keyframes hoch { from { transform: translateY(40px); opacity: 0; } }
.griff { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheetkopf { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--gap); min-height: 44px; margin-bottom: var(--gap); }
.sheetkopf h2 { grid-column: 2; margin: 0; font-size: 19px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheetkopf > :first-child:not(h2) { grid-column: 1; justify-self: start; }
.sheetkopf > :last-child:not(h2) { grid-column: 3; justify-self: end; }

/* Toast oben */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 20px;
  background: light-dark(rgba(255,255,255,.96), rgba(28,28,28,.94)); backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 15px; animation: hoch .3s ease-out; }
.toast.fehler { border-left: 4px solid var(--err); } .toast.ok { border-left: 4px solid var(--ok); }

/* Banner Testmodus / Demo */
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; margin: 0 0 var(--gap);
  background: color-mix(in srgb, var(--warn) 18%, transparent); color: color-mix(in srgb, var(--warn) 60%, var(--txt)); }
.banner.blau { background: color-mix(in srgb, var(--accent) 16%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--txt)); }
.banner button { margin-left: auto; font-weight: 600; text-decoration: underline; }

/* Kalender */
.woche { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 var(--gap); }
.woche button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 16px; background: var(--feld); font-variant-numeric: tabular-nums; position: relative; }
.woche button small { font-size: 12px; color: var(--mut); }
.woche button b { font-size: 18px; font-weight: 600; }
.woche button[aria-pressed="true"] { background: var(--accent); color: #fff; } .woche button[aria-pressed="true"] small { color: rgba(255,255,255,.8); }
.woche button.heute:not([aria-pressed="true"]) b { color: var(--accent); }
.woche .punkt { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.zeit { font-variant-numeric: tabular-nums; font-weight: 600; width: 52px; flex: none; font-size: 15px; line-height: 1.2; }

/* Chat */
.chatseite { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, var(--appH, 100%)); z-index: 4; background: var(--bgimg), var(--bg); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 8px) max(12px, calc(50% - 320px)) 0; }
.chatkopf { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.chatkopf .haupt { flex: 1; min-width: 0; } .chatkopf .titel { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatkopf .neben { color: var(--mut); font-size: 13px; }
.verlauf { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 14px; }
.blase { max-width: 84%; padding: 11px 15px; border-radius: 22px; line-height: 1.45; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.blase.claude { align-self: flex-start; background: var(--glas); box-shadow: var(--glas-schatten); border-bottom-left-radius: 6px; }
.blase.planer { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.blase.tippt::after { content: "▍"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.anhaenge { align-self: flex-end; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 84%; }
.anhang { width: 92px; height: 92px; border-radius: 16px; overflow: hidden; background: var(--feld); display: flex; align-items: center; justify-content: center; position: relative; font-size: 12px; color: var(--mut); text-align: center; padding: 0; }
.anhang img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anhang .art { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.55); color: #fff; border-radius: 8px; padding: 2px 6px; font-size: 11px; font-weight: 600; }
.anhang .weg { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 26px; }
.anhang .fortschritt { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); transition: width .2s; }
.vorschau { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.vorschau .anhang { flex: none; width: 76px; height: 76px; }
.anhangbox { position: relative; flex: none; }
.anhangbox .weg { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; line-height: 28px; text-align: center; }
.chatleiste { display: flex; gap: 8px; align-items: flex-end; padding: 6px 0 max(8px, calc(env(safe-area-inset-bottom) - 10px)); }
body.tastatur .chatleiste { padding-bottom: 8px; }

.chatleiste .pill { flex: none; }
.sendbtn { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.sendbtn svg { width: 22px; height: 22px; } .sendbtn:disabled { opacity: .4; }
.start-hilfe { margin: auto 0; text-align: center; color: var(--mut); padding: 20px; }
.start-hilfe b { display: block; color: var(--txt); font-size: 19px; margin-bottom: 6px; }

/* Zeichnen */
.zeichnen { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; color: #fff; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } /* langes Halten soll kein Kontextmenü oder Markieren auslösen */
.zeichnen .flaeche { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; touch-action: none; overflow: hidden; }
.zeichnen canvas { max-width: 100%; max-height: 100%; touch-action: none; border-radius: 6px; transform-origin: 0 0; }
.zeichnen .textleiste, .zeichnen .produktleiste { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.zeichnen .textleiste[hidden], .zeichnen .produktleiste[hidden] { display: none; }
.zeichnen .flaeche { position: relative; }
.zeichnen model-viewer.modell3d { position: absolute; background: transparent; --poster-color: transparent; outline: 1px dashed rgba(255,255,255,.45); border-radius: 8px; }
.zeichnen .modellleiste { display: none; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.zeichnen .modellleiste span { width: 100%; text-align: center; font-size: 14px; opacity: .8; }
.zeichnen.im3d .modellleiste { display: flex; }
.zeichnen.im3d .werkzeuge > :not(.modellleiste), .zeichnen.im3d .oben { display: none; }
.zeichnen .werkzeuge { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 12px calc(env(safe-area-inset-bottom) + 12px); flex-wrap: wrap; }
.zeichnen .oben { display: flex; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 10px) 12px 4px; }
/* Editor wie WhatsApp (27.11.): runde Glasknöpfe oben, Farbregler rechts, unten Abbrechen und Speichern */
.zeichnen .oben .gruppe { display: flex; gap: 10px; }
.zeichnen .rund { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(60,60,64,.72); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 17px; }
.zeichnen .rund[aria-pressed="true"] { background: var(--accent); }
.zeichnen .rund:disabled { opacity: .4; }
.zeichnen .farbregler { position: absolute; right: 18px; top: calc(env(safe-area-inset-top) + 74px); width: 14px; height: min(42vh, 320px); border-radius: 7px; border: 2px solid #fff; touch-action: none; z-index: 2;
  background: linear-gradient(#ffffff 0%, #8e8e93 7%, #000000 14%, #ff3b30 20%, #ffcc00 33%, #34c759 46%, #00c7be 59%, #0a84ff 72%, #bf5af2 86%, #ff2d78 100%); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.zeichnen .farbregler::before { content: ""; position: absolute; inset: -6px -16px; } /* größere Trefferfläche */
.zeichnen .farbregler[hidden] { display: none; }
.zeichnen .farbregler .knopf { position: absolute; left: 50%; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 6px rgba(0,0,0,.5); transition: width .12s, height .12s; }
.zeichnen .farbregler.aktiv .knopf { width: 38px; height: 38px; transform: translate(-150%, -50%); }
.zeichnen .unten { display: flex; justify-content: space-between; gap: 12px; width: 100%; }
.zeichnen .unten .pill { flex: 1; min-height: 50px; font-size: 17px; }
.zeichnen .pill.hell { background: #fff; color: #000; font-weight: 600; }
.zeichnen.im3d .farbregler, .zeichnen.blattoffen .farbregler { display: none; }
.zeichnen .produktblatt { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72%; display: flex; flex-direction: column; z-index: 5; color: #fff;
  background: rgba(28,28,30,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.5); animation: blattHoch .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
.zeichnen .produktblatt[hidden] { display: none; }
@keyframes blattHoch { from { transform: translateY(100%); } to { transform: none; } }
.zeichnen .blattkopf { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; font-size: 18px; }
.zeichnen .blattliste { overflow-y: auto; padding: 0 12px 14px; -webkit-overflow-scrolling: touch; }
.zeichnen .blattgruppe { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; margin: 14px 4px 6px; }
.zeichnen .produktzeile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.06); margin-bottom: 6px; color: #fff; }
.zeichnen .produktzeile img { width: 56px; height: 56px; object-fit: contain; flex: none; background: rgba(255,255,255,.9); border-radius: 10px; padding: 4px; }
.zeichnen .produktzeile .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zeichnen .produktzeile .text span { font-size: 13px; opacity: .7; line-height: 1.3; }
.zeichnen .badge3d { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent); }
.zeichnen .pill { background: rgba(255,255,255,.14); color: #fff; }
.zeichnen .pill[aria-pressed="true"] { background: #fff; color: #000; }

/* Prüfansicht */
.abschnitt textarea { min-height: 44px; resize: none; overflow: hidden; }
.abschnitt textarea[readonly] { cursor: default; }
.abschnitt textarea:not([readonly]) { box-shadow: 0 0 0 2px var(--accent); }
.abschnittkopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.abschnittkopf > span { font-size: 14px; color: var(--mut); }
.stiftknopf { width: 36px; height: 36px; margin: -6px -6px -6px 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--mut); }
.stiftknopf svg { width: 20px; height: 20px; }
.stiftknopf[aria-pressed="true"] { color: var(--accent); }
.fehlt { border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); }
.fotoraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fotoraster figure { margin: 0; display: grid; gap: 6px; }
.fotoraster img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; background: var(--feld); }
.fotoraster select { font-size: 14px; padding: 8px 10px; min-height: 40px; }
details.bereich { border-bottom: 1px solid var(--line); }
details.bereich:last-child { border-bottom: 0; }
details.bereich summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px var(--pad); cursor: pointer; font-weight: 600; min-height: 52px; }
details.bereich summary::-webkit-details-marker { display: none; }
details.bereich summary .wert { margin-left: auto; color: var(--mut); font-weight: 400; font-size: 14px; }
details.bereich[open] summary { border-bottom: 1px solid var(--line); }
.ergebnis .zeile { min-height: 44px; }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
.fbbtn.ungelesen::after { content: ""; position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--err); box-shadow: 0 0 0 2px var(--panel); }

/* Sprache: Diktieren im Feld, Aufnahme-Leiste, Sprachblasen */



.diktat[aria-pressed="true"] { color: #fff; background: var(--err); animation: puls 1.2s ease-in-out infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--err) 30%, transparent); } }
.chatleiste.aufnahme { align-items: center; }
.aufnahmeanzeige { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; font-variant-numeric: tabular-nums; font-size: 18px; }
.rotpunkt { width: 12px; height: 12px; border-radius: 50%; background: var(--err); animation: blink 1s steps(2) infinite; }
.sprachblase { align-self: flex-end; max-width: 84%; display: grid; gap: 6px; padding: 8px; border-radius: 22px; border-bottom-right-radius: 6px; background: var(--accent); color: #fff; }
.sprachblase audio { width: min(260px, 70vw); height: 40px; }
.sprachblase .transkript { font-size: 15px; padding: 0 8px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Eingabe wie in der Claude-App: eine runde Box, oben Text, unten die Knöpfe */
.eingabebox { flex: 1; min-width: 0; display: grid; gap: 6px; padding: 10px 10px 8px 14px; border-radius: 26px; background: light-dark(#fff, #2a2a2a); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 20px rgba(0,0,0,.25); }
.eingabebox textarea { background: none; border-radius: 0; padding: 4px 2px; min-height: 28px; max-height: 160px; resize: none; }
.eingabezeile { display: flex; align-items: center; gap: 8px; }
.eingabezeile .platz { flex: 1; }
.rundknopf { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--txt); background: light-dark(rgba(0,0,0,.06), rgba(255,255,255,.08)); cursor: pointer; flex: none; }
.rundknopf svg { width: 20px; height: 20px; }
.diktat[aria-pressed="true"] { color: #fff; background: var(--err); animation: puls 1.2s ease-in-out infinite; }
.eingabezeile .sendbtn { width: 38px; height: 38px; }
#peek { visibility: hidden; pointer-events: none; }
#peek.an { visibility: visible; }
body.wischt main { overflow: hidden; }

/* Fester Ablauf: Fortschritt, Antwortblasen, Knöpfe für die aktuelle Frage */
.chatseite > .fortschritt { height: 4px; border-radius: 2px; background: var(--feld); overflow: hidden; margin-bottom: 4px; }
.chatseite > .fortschritt span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.frageblase.aktiv { box-shadow: var(--glas-schatten), 0 0 0 2px color-mix(in srgb, var(--txt) 25%, transparent); }
.frageblase .badge { margin-left: 8px; }
.antwortblase { display: grid; gap: 6px; text-align: left; font: inherit; cursor: pointer; }
.antwortblase .muted { color: rgba(255,255,255,.75); }
.antwortblase .klein { font-size: 14px; opacity: .9; }
.daumen { display: flex; gap: 6px; flex-wrap: wrap; }
/* Fotos im Chat wie Telegram (27.11.): ein Foto groß, mehrere je zwei nebeneinander, ein übriges über die ganze Breite */
.antwortblase.mitalbum { padding: 4px; width: min(78vw, 340px); }
.antwortblase.mitalbum > :not(.album) { padding: 2px 10px; }
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 18px; overflow: hidden; }
.album:not(.einzeln) img { aspect-ratio: 3 / 4; }
.album img { width: 100%; object-fit: cover; display: block; background: rgba(0,0,0,.15); }
.album:not(.einzeln) img:last-child:nth-child(odd) { grid-column: span 2; aspect-ratio: 3 / 2; }
.album.einzeln { grid-template-columns: 1fr; }
.album.einzeln img { max-height: 420px; grid-column: auto; } /* Seitenverhältnis steht am Bild (chat.js) */
.daumen img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; display: block; }
.zeile .daumen img { width: 40px; height: 40px; }
.steuerung { display: grid; gap: 10px; padding: 12px 12px max(10px, calc(env(safe-area-inset-bottom) - 6px)); margin: 0 -2px 6px; border-radius: 26px; background: light-dark(#fff, #2a2a2a); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
body.tastatur .steuerung { padding-bottom: 10px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; max-height: 38vh; overflow-y: auto; }
.knoepfe.zwei { display: grid; grid-template-columns: 1fr 1fr; }
.wahl { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 23px; background: var(--feld); font-size: 16px; font-weight: 550; }
.wahl svg { width: 20px; height: 20px; }
.wahl.gewaehlt { background: var(--txt); color: var(--bg); }
.feldzeile { display: flex; align-items: flex-end; gap: 8px; }
.feldzeile input, .feldzeile select, .feldzeile textarea { flex: 1; min-width: 0; }
.feldzeile textarea { resize: none; max-height: 140px; }
.einheit { align-self: center; color: var(--mut); font-weight: 600; }
.zusatz { display: flex; align-items: center; gap: 8px; }
.zusatz .platz { flex: 1; }
.zusatz .pill { min-height: 38px; padding: 0 14px; font-size: 15px; }
a.pill { color: inherit; text-decoration: none; }
.halter { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; font-size: 16px; border: 0; padding: 0; pointer-events: none; }
.chatkopf .sync { color: var(--warn); font-size: 12px; font-weight: 600; }
.zusatz { flex-wrap: wrap; }
.zusatz .notizknopf { padding: 0 12px; }
.antwortblase .quelle { font-size: 12px; opacity: .85; }
.badge.rot { background: color-mix(in srgb, var(--err) 22%, transparent); color: color-mix(in srgb, var(--err) 80%, var(--txt)); }

/* Android: Optik wie Googles eigene Apps. Abläufe bleiben gleich, nur die Optik ändert sich. */
.tabs .tl { display: none; }
:root[data-os="android"] {
  --r-lg: 16px; --r-sm: 12px;
  --bg: light-dark(#f4f5f8, #111214);
  --panel: light-dark(#f7f8fb, #1d1e21);
  --karte: light-dark(#ffffff, #1f2023);
  --navbg: light-dark(#eceef3, #1b1c1f);
  --snack: light-dark(#313033, #e6e1e5);
  --snacktxt: light-dark(#f4eff4, #313033);
}
[data-os="android"] body { background: var(--bg); font-family: Roboto, "Google Sans Text", system-ui, sans-serif; }
[data-os="android"] main { padding-bottom: calc(env(safe-area-inset-bottom) + 180px); }
[data-os="android"] h1 { font-size: 24px; font-weight: 500; letter-spacing: 0; }
[data-os="android"] h2 { font-weight: 500; }
[data-os="android"] :is(.karte, .gruppe, .kachel) { background: var(--karte); box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 1px 3px 1px rgba(0,0,0,.07); }
[data-os="android"] :is(.karte, .gruppe, .pill, .kachel, .segctl, .tabs, .fbbtn)::before { display: none; }
[data-os="android"] .kachel { min-height: 120px; }
[data-os="android"] .kachel .ikon { border-radius: 12px; }
[data-os="android"] .kachel b { font-weight: 500; }
[data-os="android"] .pill { border-radius: 20px; font-weight: 500; }
[data-os="android"] .gross { height: 56px; border-radius: 16px; font-weight: 500; background: var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.22); }
[data-os="android"] .gross.ok { background: var(--ok); }
[data-os="android"] .blase.claude { background: var(--karte); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Menüleiste unten über die ganze Breite, mit Beschriftung und Markierung hinter dem Symbol */
[data-os="android"] .tabs { left: 0; right: 0; bottom: 0; transform: none; width: auto; border-radius: 0; padding: 12px 0 calc(env(safe-area-inset-bottom) + 14px);
  background: var(--navbg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
[data-os="android"] .tabs button { flex-direction: column; gap: 4px; height: auto; border-radius: 0; background: none; font-size: 12px; font-weight: 500; color: var(--mut); }
[data-os="android"] .tabs button:active { transform: none; }
[data-os="android"] .tabs .tl { display: block; }
[data-os="android"] .tabs button:not(.plus) svg { box-sizing: content-box; width: 24px; height: 24px; padding: 4px 20px; border-radius: 16px; transition: background .2s; }
[data-os="android"] .tabs button[aria-current="page"] { background: none; color: var(--txt); font-weight: 700; }
[data-os="android"] .tabs button[aria-current="page"] svg { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent); }
/* Plus als runder Knopf unten rechts über der Leiste, Feedback klein darüber (wie bei Gmail) */
[data-os="android"] .tabs .plus { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 96px); width: 56px; height: 56px; flex: none; }
[data-os="android"] .tabs .plus span { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
[data-os="android"] .fbbtn { right: 24px; bottom: calc(env(safe-area-inset-bottom) + 166px); width: 40px; height: 40px; border-radius: 12px;
  background: var(--karte); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
[data-os="android"] .fbbtn svg { width: 22px; height: 22px; }
[data-os="android"] .fbbtn.ungelesen::after { top: -3px; right: -3px; }

/* Fenster von unten und Meldungen */
[data-os="android"] .griff { width: 32px; height: 4px; margin-bottom: 16px; background: color-mix(in srgb, var(--txt) 35%, transparent); }
[data-os="android"] .sheetkopf h2 { font-size: 20px; font-weight: 500; }
[data-os="android"] .toast { top: auto; bottom: calc(env(safe-area-inset-bottom) + 96px); left: 16px; right: 88px; transform: none; max-width: none; border-radius: 8px;
  background: var(--snack); color: var(--snacktxt); backdrop-filter: none; box-shadow: 0 3px 8px rgba(0,0,0,.3); }

/* Baustellenabschluss (27.11.): zweiter großer Knopf auf der Projektseite, Unterschriftsfeld im Ablauf */
.gross.zweit { background: var(--feld); color: inherit; box-shadow: none; }
[data-os="android"] .gross.zweit { background: var(--feld); }
.unterschriftfeld { display: block; width: 100%; height: 180px; background: #fff; border-radius: 14px; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); touch-action: none; margin: 8px 0 10px; }
.abnahmetext { margin: 0 0 8px; line-height: 1.35; }
a.karte.fehlt { display: block; color: inherit; text-decoration: none; }
a.karte.fehlt .nachholen { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-weight: 600; color: var(--accent); }
a.karte.fehlt .nachholen svg { width: 16px; height: 16px; }
