/* Farbschema angelehnt an das Sparkassen-Rot (HKS 13 ≈ #FF0000); kein offizielles Logo, keine Hausschrift. */
:root {
  --red: #E60000; --red-brand: #FF0000; --red-dark: #C40000; --red-soft: #FFF0F0; --ink: #1A1A1A; --text: #333333; --grey: #6B6B6B;
  --line: #E3E3E3; --bg: #F4F4F4; --card: #FFFFFF; --ok: #1E7B34; --ok-soft: #E6F4E9; --warn: #9A5B00; --warn-soft: #FFF4DC;
  --info: #1D4E89; --info-soft: #E8F0FA; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --tabbar-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
a { color: var(--red-dark); }
h1 { font-size: 1.55rem; line-height: 1.2; margin: .3rem 0 .9rem; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .7rem; color: var(--ink); }
h3 { color: var(--ink); }
p { line-height: 1.5; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--red); color: #fff; padding-top: env(safe-area-inset-top); }
.topbar-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .7rem 16px; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; }
.logo::before { content: ""; width: 12px; height: 18px; border-radius: 6px; border: 3px solid var(--red); border-bottom-width: 3px; }
.brand-text { font-weight: 700; font-size: 1.05rem; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text small { font-weight: 600; font-size: .8rem; }
.nav-top { margin-left: auto; display: flex; gap: .25rem; align-items: center; }
.nav-top a, .nav-logout { color: #fff; text-decoration: none; font-weight: 600; padding: .5rem .8rem; border-radius: 999px; background: none; border: 0; font: inherit; cursor: pointer; }
.nav-top a.active, .nav-top a:hover, .nav-logout:hover { background: rgba(255,255,255,.18); }
.netbar { background: #222; color: #fff; font-size: .82rem; text-align: center; padding: .45rem 16px; }

/* Untere Navigation (Handy) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--grey); text-decoration: none; }
.tabbar a.active { color: var(--red); }
.ti { width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.ti-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h16v2H4zm0 6h16v2H4zm0 6h10v2H4z'/%3E%3C/svg%3E"); }
.ti-doc { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8l6 6v14H6zm7 1.5V9h5.5zM8 12h8v1.6H8zm0 4h8v1.6H8z'/%3E%3C/svg%3E"); }
.tab-rec { margin-top: -26px; }
.rec-btn { width: 62px; height: 62px; border-radius: 50%; background: var(--red); display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(255,0,0,.35); border: 4px solid #fff; }
.rec-btn span { width: 20px; height: 20px; border-radius: 50%; background: #fff; }
@media (min-width: 768px) { .tabbar { display: none !important; } body { padding-bottom: 32px; } }
@media (max-width: 767px) { .nav-top a { display: none; } }

/* Layout & Karten */
main { max-width: 960px; margin: 0 auto; padding: 18px 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.click { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.card.click:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 8px 22px rgba(0,0,0,.08); }
.card.click:active { transform: scale(.99); }
.row { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--grey); font-size: .92rem; }
.small { font-size: .8rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; color: var(--grey); text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.back::before { content: "‹"; font-size: 1.4rem; line-height: 1; }

/* Startseite */
.hero { background: linear-gradient(135deg, #F00000 0%, #C40000 100%); color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: var(--shadow); }
.hero h1 { color: #fff; margin: 0 0 .25rem; font-size: 1.35rem; }
.hero p { margin: 0; opacity: .92; font-size: .95rem; }
.hero .actions { margin: 0; }
.hero .btn.primary { background: #fff; color: var(--red-dark); }
.hero .btn.ghost { background: rgba(255,255,255,.16); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.stat { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.45rem; color: var(--ink); }
.stat span { font-size: .78rem; color: var(--grey); }
.m-title { font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.m-meta { margin-top: .45rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--grey); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: #EFEFEF; color: #444; white-space: nowrap; }
.chip.l1 { background: #EFEFEF; } .chip.l2 { background: var(--red-soft); color: var(--red-dark); } .chip.l3 { background: var(--red); color: #fff; }
.chip.entwurf { background: var(--warn-soft); color: var(--warn); } .chip.freigegeben { background: var(--ok-soft); color: var(--ok); }
.chip.fehler, .chip.blockiert { background: #2B2B2B; color: #fff; } .chip.lauf { background: var(--info-soft); color: var(--info); }

/* Schaltflächen & Formulare */
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: .75rem 1.25rem; cursor: pointer; background: #ECECEC; color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; transition: background .15s ease; }
button:hover, .btn:hover { background: #E2E2E2; }
button.primary, .btn.primary { background: var(--red); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--red-dark); }
button.danger { background: #fff; color: var(--red-dark); border: 1px solid #F3C2C2; }
button.small, .btn.small { min-height: 34px; padding: .35rem .8rem; font-size: .85rem; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.actions.sticky { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); background: rgba(244,244,244,.94);
  backdrop-filter: blur(8px); padding: .6rem 0; margin-bottom: 0; z-index: 5; }
@media (min-width: 768px) { .actions.sticky { bottom: 0; } }
label { display: block; font-weight: 600; color: var(--ink); margin: 1rem 0 .4rem; font-size: .95rem; }
.field-hint { font-weight: 400; color: var(--grey); font-size: .82rem; }
input[type=text], input[type=password], textarea, select { width: 100%; font: inherit; font-size: 16px; padding: .75rem .85rem; border: 1px solid #D0D0D0;
  border-radius: 10px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,0,0,.15); }
textarea { min-height: 6rem; resize: vertical; line-height: 1.45; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; }
.check input { margin-top: .15rem; width: 1.25rem; height: 1.25rem; accent-color: var(--red); flex: none; }
.levels { display: grid; gap: .55rem; }
.level { border: 2px solid var(--line); border-radius: 12px; padding: .75rem .9rem; margin: 0; cursor: pointer; display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; }
.level:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.level input { accent-color: var(--red); margin-top: .2rem; }
.level b { display: block; color: var(--ink); }
.notice { border-radius: 10px; padding: .75rem .9rem; font-size: .9rem; margin: .8rem 0; line-height: 1.45; }
.notice.consent { background: var(--red-soft); color: var(--ink); }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.dark { background: #2B2B2B; color: #fff; }
.drop { border: 2px dashed #CFCFCF; border-radius: 12px; padding: 1.2rem; text-align: center; color: var(--grey); background: #FAFAFA; }

/* Anmeldung */
.login { max-width: 420px; margin: 6vh auto 0; }
.login .card { padding: 26px 24px; }
.login .logo-big { width: 64px; height: 64px; border-radius: 18px; background: var(--red); display: grid; place-items: center; margin-bottom: 1rem; }
.login .logo-big::before { content: ""; width: 18px; height: 28px; border-radius: 9px; border: 4px solid #fff; }

/* Aufnahme */
.recorder { text-align: center; padding: 1.6rem 1rem 1.2rem; }
.rec-ring { width: 150px; height: 150px; border-radius: 50%; margin: 1.2rem auto .8rem; display: grid; place-items: center;
  background: radial-gradient(circle, var(--red-soft) 0 60%, transparent 61%); position: relative; }
.rec-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(255,0,0,.25); transform: scale(var(--lvl, 1)); transition: transform .08s linear; }
.rec-ring span { width: 76px; height: 76px; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.88); } }
.timer { font-size: 3rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.meter { display: flex; gap: 3px; justify-content: center; align-items: flex-end; height: 36px; margin: .6rem 0; }
.meter i { width: 5px; border-radius: 3px; background: var(--red); opacity: .8; height: 4px; transition: height .08s linear; }
.stop-btn { width: 100%; max-width: 320px; min-height: 56px; font-size: 1.05rem; }
.progress { height: 6px; background: #EEE; border-radius: 3px; overflow: hidden; margin-top: .6rem; }
.progress span { display: block; height: 100%; background: var(--red); transition: width .3s; }

/* Status-Schritte */
.steps { display: flex; gap: 4px; margin: 1rem 0 .4rem; }
.steps div { flex: 1; text-align: center; font-size: .68rem; color: var(--grey); font-weight: 600; }
.steps div::before { content: ""; display: block; height: 5px; border-radius: 3px; background: #DDD; margin-bottom: .35rem; }
.steps div.done::before { background: var(--red); }
.steps div.now { color: var(--red-dark); }
.steps div.now::before { background: linear-gradient(90deg, var(--red) 0 50%, #DDD 50%); background-size: 200% 100%; animation: flow 1.2s linear infinite; }
@keyframes flow { to { background-position: -100% 0; } }

/* Tabs */
.tabs { display: flex; gap: .3rem; margin: 1.1rem 0 1rem; overflow-x: auto; background: #E9E9E9; border-radius: 999px; padding: 4px; }
.tabs button { flex: 1; min-height: 38px; background: none; padding: .45rem .9rem; color: var(--grey); white-space: nowrap; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Protokoll & Transkript */
.doc .sec { margin-bottom: 1.2rem; }
.doc .sec h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--red-dark); margin: 0 0 .4rem; }
.doc ul { margin: 0; padding-left: 1.2rem; } .doc li { margin: .25rem 0; line-height: 1.45; }
.doc p { margin: 0; }
.doc-head { border-bottom: 1px solid var(--line); padding-bottom: .8rem; margin-bottom: 1rem; }
.doc-head h2 { margin: 0 0 .2rem; font-size: 1.2rem; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: .5rem .45rem; text-align: left; vertical-align: top; }
table.grid th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--grey); }
table.grid input { width: 100%; border: 1px solid transparent; border-radius: 6px; font: inherit; padding: .35rem; background: #FAFAFA; }
table.grid input:focus { border-color: var(--red); outline: none; background: #fff; }
.ref { font-size: .7rem; font-weight: 700; background: #F0F0F0; color: #555; border-radius: 5px; padding: .05rem .35rem; text-decoration: none; vertical-align: 1px; }
a.ref:hover { background: var(--red-soft); color: var(--red-dark); }
.seg { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; padding: .7rem 0; border-bottom: 1px solid #F0F0F0; }
.seg:last-child { border-bottom: 0; }
.seg .who { font-weight: 700; color: var(--ink); }
.seg .t { grid-column: 2; line-height: 1.5; }
.seg.hl { background: var(--warn-soft); border-radius: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; grid-row: span 2; }
.speaker-row { display: grid; grid-template-columns: 32px 1fr; gap: .7rem; align-items: center; margin: .55rem 0; }
.kv { display: grid; grid-template-columns: minmax(110px, 32%) 1fr; gap: .55rem 1rem; }
.kv dt { color: var(--grey); font-size: .88rem; } .kv dd { margin: 0; color: var(--ink); }
.tpl-sections { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.sec-row { display: grid; grid-template-columns: 1fr 9.5rem 44px; gap: .5rem; margin: .45rem 0; }
@media (max-width: 480px) { .sec-row { grid-template-columns: 1fr 7.5rem 44px; } .stats { gap: 6px; } .hero { padding: 16px; } }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  background: #1F1F1F; color: #fff; padding: .85rem 1.1rem; border-radius: 12px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#print-area { display: none; }
.spinner { display: inline-block; width: .95rem; height: .95rem; border: 2px solid rgba(0,0,0,.15); border-top-color: currentColor; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff; padding: 0; } .topbar, main, #toast, .tabbar { display: none !important; }
  #print-area { display: block; font-size: 11pt; color: #000; } #print-area .ref { background: none; padding: 0; }
}
.actions.sticky { flex-wrap: nowrap; gap: .45rem; }
.actions.sticky > * { padding: .6rem .85rem; white-space: nowrap; font-size: .92rem; min-width: 0; }
.logo::before { box-shadow: 0 8px 0 -5px var(--red); }

/* Nach UX-Prüfung 23.11.2026 */
button.small, .btn.small { min-height: 44px; }
.tabs button { min-height: 44px; }
a.ref { padding: .3rem .45rem; margin: -.25rem 0; display: inline-block; }
:focus-visible { outline: 3px solid #1D4E89; outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.steps div.open { color: var(--red-dark); }
.steps div.open::before { background: #fff; box-shadow: inset 0 0 0 2px var(--red); }
.stop-btn { background: #1A1A1A; color: #fff; } .stop-btn:hover { background: #000; }
main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
body:has(#tabbar[hidden]) .actions.sticky { bottom: env(safe-area-inset-bottom); }
body:has(#tabbar[hidden]) #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }

/* Eckige Bedienelemente (Vorgabe Dirk, 23.11.2026): keine abgerundeten Buttons */
:root { --radius: 4px; }
button, .btn, .nav-top a, .nav-logout, .tabs, .tabs button, .chip, .rec-btn, .stop-btn,
.hero .btn, .actions.sticky > *, button.small, .btn.small { border-radius: 0 !important; }
input[type=text], input[type=password], textarea, select, .level, .notice, .drop, .stat, .card, .hero, #toast { border-radius: 4px; }
.tabs { padding: 0; background: none; border-bottom: 2px solid var(--line); gap: 0; }
.tabs button { border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.active { background: none; box-shadow: none; color: var(--red); border-bottom-color: var(--red); }
.rec-btn { width: 58px; height: 58px; }
.rec-btn span { border-radius: 50%; }
.login .logo-big, .logo { border-radius: 4px; }
