/* Bibu-Lernplaner – ruhiges, professionelles Erscheinungsbild, heller & dunkler Modus */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --border: #dfe4ea; --text: #1c2733; --muted: #607080;
  --primary: #1f5f8b; --primary-2: #2c7bb3; --primary-soft: #e3eef7; --accent: #0f8a6a;
  --green: #1e8e4e; --yellow: #c99400; --red: #c63b3b; --grey: #9aa6b2;
  --s0: #2c7bb3; --s1: #8fb8d8; --s2: #0f8a6a; --s3: #c99400;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px; --sidebar: 236px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11161c; --surface: #19212a; --surface-2: #1f2933; --border: #2d3a47; --text: #e4e9ee; --muted: #93a2b1;
  --primary: #5aa5dc; --primary-2: #7bb8e6; --primary-soft: #1d3346; --accent: #3cc199;
  --green: #3dbb72; --yellow: #e0b23a; --red: #e86363; --grey: #66727e;
  --s0: #5aa5dc; --s1: #35597a; --s2: #3cc199; --s3: #e0b23a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 14px; margin: 14px 0 6px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; }
mark { background: #ffe58a; color: #000; border-radius: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

#app { display: flex; height: 100vh; }
#sidebar { width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
#view { flex: 1; overflow-y: auto; padding: 22px 26px 60px; outline: none; }

.brand { padding: 16px 18px 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.brand img { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.nav { list-style: none; margin: 0; padding: 4px 10px 16px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--primary); color: #fff; padding: 0 6px; border-radius: 10px; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 10px; }
.side-foot { margin-top: auto; padding: 12px 18px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); }

.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding: 8px 12px 8px 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 6px; color: var(--muted); font-size: 16px; }
.topinfo { margin-left: auto; display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.saved { color: var(--accent); font-size: 12px; transition: opacity .3s; }

/* Buttons & Formulare */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; min-width: 0; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.field > span { color: var(--muted); font-weight: 600; }
.field.full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input { padding: 5px 8px; font-size: 13px; }

/* Layout-Karten */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span3 { grid-column: 1 / -1; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } }
@media (max-width: 820px) { #sidebar { width: 64px; } .nav a span.lbl, .brand div, .side-foot, .nav .count { display: none; } #view { padding: 16px; } }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .big { font-size: 28px; font-weight: 650; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 12.5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.b-orig { background: #e4f3ea; color: #17653a; border-color: #b9dfc8; }
.badge.b-ki { background: #f3e9fb; color: #6b2f93; border-color: #dcc4ee; }
.badge.b-warn { background: #fff4d6; color: #8a6400; border-color: #f0dc9d; }
.badge.b-red { background: #fde6e6; color: #9a2424; border-color: #f3c0c0; }
.badge.b-ok { background: #e4f3ea; color: #17653a; border-color: #b9dfc8; }
:root[data-theme="dark"] .badge.b-orig, :root[data-theme="dark"] .badge.b-ok { background: #173626; color: #8ad9aa; border-color: #24583c; }
:root[data-theme="dark"] .badge.b-ki { background: #2e2140; color: #cfa8ee; border-color: #4a3466; }
:root[data-theme="dark"] .badge.b-warn { background: #3a3014; color: #f0cf73; border-color: #5c4a1c; }
:root[data-theme="dark"] .badge.b-red { background: #3d1c1c; color: #f2a0a0; border-color: #632d2d; }

.ampel { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; vertical-align: middle; }
.ampel-gruen { background: var(--green); } .ampel-gelb { background: var(--yellow); } .ampel-rot { background: var(--red); } .ampel-grau { background: var(--grey); }
.progress { height: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; min-width: 60px; }
.progress > div { height: 100%; background: var(--primary-2); border-radius: 6px; }
.progress.green > div { background: var(--green); }

/* Listen & Aufgaben */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.task { display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent; }
.task:hover { background: var(--surface-2); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task .task-title { font-size: 13.5px; }
.task .task-meta { font-size: 11.5px; color: var(--muted); }
.task-actions { margin-left: auto; display: flex; gap: 2px; opacity: .2; transition: opacity .15s; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
.tt { display: inline-block; width: 4px; align-self: stretch; border-radius: 3px; flex: none; background: var(--grey); }
.t-neu { background: #2c7bb3 !important; } .t-wdh { background: #0f8a6a !important; } .t-uebung { background: #7a5bc4 !important; }
.t-test { background: #c97a00 !important; } .t-klausur { background: #b23c6a !important; } .t-schwaeche { background: #c63b3b !important; }
.t-karten { background: #3a9bb5 !important; } .t-puffer { background: #9aa6b2 !important; } .t-todo { background: #607080 !important; }
.t-webinar { background: #5a7d2a !important; } .t-frist { background: #8a4b00 !important; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px; min-height: 120px; min-width: 0; }
.day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.day.blocked { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); }
.day-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.day-head .muted { font-weight: 400; }
.chip { display: block; font-size: 11.5px; padding: 3px 6px 3px 8px; margin-bottom: 4px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.done { opacity: .5; text-decoration: line-through; }
.chip.ev { cursor: default; border-left-color: var(--accent); background: var(--primary-soft); }
.chip[class*="t-"] { background: var(--surface) !important; }
.chip.t-neu { border-left-color: #2c7bb3; } .chip.t-wdh { border-left-color: #0f8a6a; } .chip.t-uebung { border-left-color: #7a5bc4; } .chip.t-test { border-left-color: #c97a00; }
.chip.t-klausur { border-left-color: #b23c6a; } .chip.t-schwaeche { border-left-color: #c63b3b; } .chip.t-karten { border-left-color: #3a9bb5; } .chip.t-puffer { border-left-color: #9aa6b2; }
.chip.t-todo { border-left-color: #607080; } .chip.t-webinar { border-left-color: #5a7d2a; } .chip.t-frist { border-left-color: #8a4b00; }
.drop-hover { outline: 2px dashed var(--primary); outline-offset: -2px; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.month .mh { padding: 6px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.month .mc { min-height: 104px; padding: 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; }
.month .mc.other { background: var(--surface-2); color: var(--muted); }
.month .mc.today { box-shadow: inset 0 0 0 2px var(--primary); }
.month .mc .num { font-size: 12px; font-weight: 600; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.tbl, table.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td, .md-table th, .md-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th, .md-table th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; }
.clickable { cursor: pointer; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--muted); font: inherit; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs button .n { font-size: 11px; color: var(--muted); margin-left: 3px; }

/* Dokumente */
.docs-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .docs-layout { grid-template-columns: 1fr; } }
.tree { list-style: none; margin: 0; padding: 0; }
.tree .vgroup { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 12px 0 4px; font-weight: 600; }
.tree a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13px; }
.tree a:hover { background: var(--surface-2); } .tree a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tree .pg { margin-left: auto; font-size: 11px; color: var(--muted); }
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.file-ico { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--grey); flex: none; }
.fi-pdf { background: #c63b3b; } .fi-docx { background: #2b579a; } .fi-xlsx { background: #217346; } .fi-pptx { background: #d24726; } .fi-image { background: #7a5bc4; } .fi-link { background: #0f8a6a; } .fi-text { background: #607080; }

/* Inhalte / Markdown */
.prose { line-height: 1.6; max-width: 900px; }
.prose h2 { font-size: 18px; margin-top: 22px; } .prose h3 { font-size: 15.5px; } .prose h4, .prose h5 { font-size: 14px; }
.prose code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; font-size: 12.5px; }
.prose pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow-x: auto; }
.prose blockquote { border-left: 3px solid var(--primary); margin: 8px 0; padding: 4px 12px; background: var(--primary-soft); border-radius: 0 6px 6px 0; }
.prose li.sub { margin-left: 18px; }
.prose table { margin: 10px 0; }

/* Dialoge */
dialog.modal { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, 94vw); max-height: 90vh; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog.modal-wide { width: min(900px, 96vw); }
dialog.modal-full { width: 96vw; height: 94vh; max-height: 94vh; }
dialog::backdrop { background: rgba(15, 23, 32, .45); }
.modal-form { display: flex; flex-direction: column; max-height: 90vh; height: 100%; }
dialog.modal-full .modal-form { max-height: 94vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
dialog.modal-full .modal-body { padding: 0; display: flex; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pdf-frame { width: 100%; height: 100%; border: 0; flex: 1; background: #525659; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; }
.toast-error { background: var(--red); color: #fff; } .toast-ok { background: var(--green); color: #fff; }

.empty { text-align: center; padding: 24px 12px; color: var(--muted); }
.empty p { margin: 0 0 10px; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--primary-soft); border: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; }
.notice.warn { background: #fff4d6; border-color: #f0dc9d; color: #6b4e00; }
:root[data-theme="dark"] .notice.warn { background: #3a3014; border-color: #5c4a1c; color: #f0cf73; }
.loading { color: var(--muted); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Diagramme */
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 13px; }
.chart .bar.s0, .legend i.s0 { fill: var(--s0); background: var(--s0); } .chart .bar.s1, .legend i.s1 { fill: var(--s1); background: var(--s1); }
.chart .bar.s2, .legend i.s2 { fill: var(--s2); background: var(--s2); } .chart .bar.s3, .legend i.s3 { fill: var(--s3); background: var(--s3); }
.chart .line { stroke-width: 2.2; } .chart .line.s0 { stroke: var(--s0); } .chart .line.s1 { stroke: var(--s2); } .chart .line.s2 { stroke: var(--s3); }
.chart .dot.s0 { fill: var(--s0); } .chart .dot.s1 { fill: var(--s2); } .chart .dot.s2 { fill: var(--s3); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 48px; gap: 8px; align-items: center; font-size: 12.5px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--surface-2); border-radius: 4px; height: 12px; overflow: hidden; border: 1px solid var(--border); }
.hbar-fill { height: 100%; background: var(--s0); } .hbar-fill.red { background: var(--red); } .hbar-fill.green { background: var(--green); } .hbar-fill.yellow { background: var(--yellow); }
.hbar-val { text-align: right; color: var(--muted); }
.ring { width: 92px; height: 92px; } .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 8; } .ring-fg { fill: none; stroke: var(--primary-2); stroke-width: 8; stroke-linecap: round; }
.ring-text { font-size: 16px; font-weight: 650; fill: var(--text); } .ring-label { font-size: 12px; color: var(--muted); text-align: center; }

/* Countdown */
.countdown { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; }
.countdown .big { font-size: 40px; font-weight: 700; color: var(--primary); line-height: 1; }

/* Karteikarten & Tests */
.flash { max-width: 720px; margin: 0 auto; }
.flash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; min-height: 220px; box-shadow: var(--shadow); font-size: 16px; }
.flash-card .front { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.flash-card .back { border-top: 1px dashed var(--border); padding-top: 14px; }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.rate-row .btn { flex-direction: column; justify-content: center; padding: 8px; }
.rate-row .btn small { color: var(--muted); font-size: 11px; }
.r-nicht { border-color: var(--red) !important; } .r-schwer { border-color: var(--yellow) !important; } .r-gut { border-color: var(--green) !important; } .r-einfach { border-color: var(--primary) !important; }
.question { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); }
.question .qhead { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.question .qtext { font-weight: 600; margin-bottom: 10px; white-space: pre-wrap; }
.question .solution { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.question label.opt { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.timer { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 650; }
.timer.low { color: var(--red); }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 180px); }
.chat-log { flex: 1; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input textarea { flex: 1; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.suggest .btn { font-size: 12px; padding: 4px 9px; border-radius: 14px; }

/* Einrichtungsassistent */
.wizard { max-width: 860px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { font-size: 12px; padding: 4px 10px; border-radius: 14px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.steps span.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.steps span.ok { color: var(--green); }
.hours-grid { display: grid; grid-template-columns: repeat(7, minmax(70px, 1fr)); gap: 8px; }
.hours-grid label { display: flex; flex-direction: column; font-size: 12px; gap: 3px; color: var(--muted); font-weight: 600; }
.edit-table input, .edit-table select { width: 100%; padding: 5px 6px; font-size: 13px; }

/* Eigener PDF-Betrachter (iPad) */
.pdf-head { gap: 10px; flex-wrap: wrap; }
.pdf-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.pdf-tools { flex-wrap: nowrap; gap: 6px; }
.pdf-page { width: 64px; padding: 4px 6px; }
.pdf-scroll { flex: 1; overflow: auto; background: #525659; padding: 12px; -webkit-overflow-scrolling: touch; }
.pdf-pg { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pdf-pg canvas { display: block; }
.pdf-pgno { position: absolute; top: 45%; left: 0; right: 0; text-align: center; color: #999; font-size: 20px; }
.pdf-pg canvas + .pdf-pgno, .pdf-pg[data-r="1"] .pdf-pgno { display: none; }

/* iPad / Touch: größere Bedienelemente, Aktionen immer sichtbar, kein Auto-Zoom bei Eingabefeldern */
#app { height: 100dvh; }
@supports (padding: env(safe-area-inset-top)) {
  #topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  #view { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .side-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (hover: none) and (pointer: coarse) {
  .task-actions { opacity: 1; }
  .icon-btn { padding: 8px 10px; font-size: 17px; }
  .btn { padding: 9px 14px; }
  .btn-sm { padding: 6px 10px; }
  input, select, textarea { font-size: 16px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .nav a { padding: 10px 10px; }
  .chip { padding: 6px 8px 6px 10px; font-size: 13px; }
  .tabs button { padding: 10px 12px; }
  .touch-hint { display: block !important; }
}
.touch-hint { display: none; }
@media (max-width: 1000px) { .week .chip { white-space: normal; overflow-wrap: anywhere; } .week { gap: 5px; } .day { padding: 5px; } }

@media print { #sidebar, #topbar, .no-print, .toolbar { display: none !important; } #view { overflow: visible; padding: 0; } body { background: #fff; } }
