/* Medipuff — Farben aus der Histologie: Hämatoxylin (Indigo) und Eosin (Rosa) */

@font-face {
  font-family: "Bricolage Grotesque Variable";
  src: url(fonts/bricolage.woff2) format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans Variable";
  src: url(fonts/instrument.woff2) format("woff2");
  font-weight: 400 700; font-display: swap;
}

:root {
  --bg: #0c0e1d;       --bg-2: #10132a;
  --surface: #151933;  --surface-2: #1c2142;
  --line: #2b315c;     --line-soft: #212650;
  --text: #ecebf7;     --muted: #a0a2c6;     --faint: #6f7298;
  --eosin: #ff7aa8;    --eosin-ink: #2a0615; --hema: #8b7cff;
  --ok: #6fe3b0;       --warn: #ffcf70;      --bad: #ff8585;
  --c-pdf: #ff8a8a; --c-video: #a99bff; --c-audio: #ffd27a; --c-image: #6fc8ff;
  --c-md: #6fe3b0;  --c-cards: #ff7aa8; --c-folder: #8aa4ff; --c-other: #a0a2c6;
  --label: #232952;    --label-text: #ecebf7; --label-muted: #a9abd0; --slide-edge: #353c70;
  --toast-accent: #c21d5c;
  --shadow: 0 14px 30px -14px rgba(0, 0, 0, .7);
  --font-ui: "Instrument Sans Variable", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque Variable", "Bricolage Grotesque", var(--font-ui);
  --top: 60px;
}
html[data-mode="light"] {
  --bg: #f6f3f9;       --bg-2: #eee9f4;
  --surface: #ffffff;  --surface-2: #f3eff8;
  --line: #d9d1e4;     --line-soft: #e6e0ee;
  --text: #1a1530;     --muted: #5d5678;     --faint: #8a83a3;
  --eosin: #d4306b;    --eosin-ink: #ffffff; --hema: #4c3fc9;
  --ok: #0e8f64;       --warn: #a86f00;      --bad: #c92a3a;
  --c-pdf: #d63b3b; --c-video: #6a54e6; --c-audio: #a86f00; --c-image: #0a7dc2;
  --c-md: #0e8f64;  --c-cards: #d4306b; --c-folder: #4c5fd6; --c-other: #5d5678;
  --label: #ffffff;    --label-text: #1a1530; --label-muted: #5d5678; --slide-edge: #cfc6dc;
  --toast-accent: #ff7aa8;
  --shadow: 0 14px 28px -16px rgba(40, 24, 80, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; background: var(--bg); }
html[data-mode="light"] { color-scheme: light; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--eosin); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.1; font-weight: 700; font-variation-settings: "wdth" 90; }
h2 { font-size: 1.2rem; line-height: 1.2; font-weight: 650; font-variation-settings: "wdth" 92; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--eosin); outline-offset: 2px; border-radius: 6px; }
kbd {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface-2); color: var(--muted);
  font: 600 .72rem/1.5 var(--font-ui); white-space: nowrap;
}
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.spacer { flex: 1; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 72px; }
.wrap.wide { max-width: 1560px; }

/* --- Kopfzeile ------------------------------------------------------------ */
.top { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line-soft);
       background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px); }
.top-in { max-width: 1560px; margin: 0 auto; height: var(--top); padding: 0 20px;
          display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
        background: var(--eosin); color: var(--eosin-ink); }
.mark .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.word { font: 700 1.25rem/1 var(--font-display); font-variation-settings: "wdth" 88; letter-spacing: -.01em; }
.search-btn { flex: 1 1 auto; max-width: 520px; display: flex; align-items: center; gap: 10px;
              margin-left: 14px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line);
              background: var(--surface); color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.search-btn:hover { border-color: var(--faint); color: var(--text); }
.search-ph { flex: 1; }
.streak { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px;
          color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent);
          text-decoration: none; font: 700 .92rem var(--font-ui); }
.focus { position: relative; display: flex; align-items: center; border: 1px solid var(--line);
         border-radius: 999px; background: var(--surface); }
.focus-btn { display: flex; align-items: center; gap: 7px; padding: 6px 4px 6px 12px; border: 0; background: none;
             color: var(--text); font: 600 .92rem var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer; }
.focus .focus-more { width: 30px; height: 30px; }
.focus[data-state="run"] { border-color: var(--eosin); }
.focus[data-state="run"] .focus-btn { color: var(--eosin); }
.focus[data-state="run"][data-mode="break"] { border-color: var(--ok); }
.focus[data-state="run"][data-mode="break"] .focus-btn { color: var(--ok); }
.focus-menu { top: calc(100% + 8px); right: 0; }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0;
            border-radius: 10px; background: none; color: var(--muted); cursor: pointer; text-decoration: none; font: inherit; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .ic { width: 1.3em; height: 1.3em; }
.icon-btn[aria-pressed="true"] { color: var(--eosin); }
html[data-mode="dark"] .i-moon, html[data-mode="light"] .i-sun { display: none; }
.icon-btn.danger:hover { color: var(--bad); }
.star.on { color: var(--warn); }
.star.on .fill-on, .pinmark .fill-on { fill: currentColor; }
.pinmark { color: var(--warn); display: grid; }

.menu-wrap { position: relative; }
.menu { position: absolute; z-index: 30; min-width: 220px; padding: 6px; border-radius: 13px;
        background: var(--surface); border: 1px solid var(--line);
        box-shadow: 0 22px 44px -14px rgba(0, 0, 0, .6); }
.menu.right { right: 0; top: calc(100% + 6px); }
.menu form { margin: 0; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0;
                        border-radius: 8px; background: none; color: var(--text); font: 500 .92rem var(--font-ui);
                        text-align: left; text-decoration: none; cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .danger { color: var(--bad); }

/* --- Buttons und Formulare ------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px;
       border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
       font: 600 .92rem/1.2 var(--font-ui); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--eosin); border-color: transparent; color: var(--eosin-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary kbd { background: color-mix(in srgb, var(--eosin-ink) 14%, transparent); border-color: transparent; color: inherit; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: .84rem; }
.btn.wide { width: 100%; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.field span { color: var(--muted); }
.form-error { padding: 10px 12px; border-radius: 10px; color: var(--bad);
              background: color-mix(in srgb, var(--bad) 12%, transparent); font-size: .92rem; }

/* --- Anmeldung -------------------------------------------------------------- */
.login-page .wrap { max-width: none; padding: 0; }
.login { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 20px; overflow: hidden; }
.login-ecg { position: absolute; left: 0; right: 0; top: 50%; width: 100%; height: 150px; transform: translateY(-50%); }
.ecg-base { fill: none; stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ecg-live { fill: none; stroke: var(--eosin); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
            vector-effect: non-scaling-stroke; stroke-dasharray: 16 84; animation: sweep 5.5s linear infinite; }
@keyframes sweep { from { stroke-dashoffset: 16; } to { stroke-dashoffset: -84; } }
.login-card { position: relative; width: min(380px, 100%); display: grid; gap: 14px; padding: 26px;
              border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 10px; }

/* --- Startseite ---------------------------------------------------------------- */
.hello { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); gap: 28px;
         align-items: end; padding: 14px 0 34px; }
.hello h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.02; font-weight: 750;
            font-variation-settings: "wdth" 86; letter-spacing: -.025em; }
.chips { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
            border: 1px solid var(--line); background: var(--surface); font-size: .9rem; color: var(--muted); }
.chips li .ic { color: var(--eosin); }
.chips a { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; }

.resume { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
          padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
          color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.resume:hover { border-color: var(--eosin); }
.resume-body { display: grid; gap: 4px; min-width: 0; }
.resume-name { font: 650 1.12rem/1.25 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-where { display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--muted); font-size: .88rem; }
.resume .bar { margin-top: 6px; }

.badge { --c: var(--c-other); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
         color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); flex: none; }
.badge.big { width: 52px; height: 52px; border-radius: 15px; }
.badge.big .ic { width: 1.5em; height: 1.5em; }
.k-pdf { --c: var(--c-pdf); } .k-video { --c: var(--c-video); } .k-audio { --c: var(--c-audio); }
.k-image { --c: var(--c-image); } .k-md { --c: var(--c-md); } .k-cards, .k-deck { --c: var(--c-cards); }
.k-folder { --c: var(--c-folder); } .k-text, .k-other { --c: var(--c-other); }

.bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--eosin); }
.bar.thin { height: 3px; margin-top: 7px; }

.block { margin-top: 30px; }
.block:first-child { margin-top: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 36px; }
.block-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 36px; }
.col-side .block:first-child { margin-top: 30px; }
.cols > .block:first-child { margin-top: 30px; }

/* Objektträger: der Ordner als Glasplättchen mit eigenem Präparat */
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.slide { position: relative; display: grid; grid-template-columns: minmax(124px, 41%) 1fr; min-height: 128px;
         border-radius: 8px; overflow: hidden; background: var(--label); color: var(--label-text);
         border: 1px solid var(--slide-edge); box-shadow: var(--shadow); text-decoration: none;
         transition: transform .2s ease, box-shadow .2s ease; }
.slide:hover { transform: translateY(-3px) rotate(-.35deg); }
.slide-label { display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
               padding: 14px 14px 12px; border-right: 1px solid var(--slide-edge); }
.slide-name { font: 700 1.2rem/1.12 var(--font-display); font-variation-settings: "wdth" 88; overflow-wrap: anywhere; }
.slide-count { font-size: .8rem; color: var(--label-muted); }
.slide-art { position: relative; min-height: 100%; }
.slide-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.slide-art::after { content: ""; position: absolute; inset: 9px; border-radius: 3px;
                    border: 1px solid rgba(255, 255, 255, .6);
                    background: linear-gradient(104deg, rgba(255, 255, 255, .3) 0 11%, rgba(255, 255, 255, 0) 11% 100%); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 118px; }
.day { display: flex; flex-direction: column; gap: 7px; min-height: 0; }
.day-bar { flex: 1; display: flex; align-items: flex-end; border-radius: 7px; background: var(--surface); border: 1px solid var(--line-soft); overflow: hidden; }
.day-bar i { display: block; width: 100%; background: var(--hema); border-radius: 6px 6px 0 0; }
.day.today .day-bar i { background: var(--eosin); }
.day-name { text-align: center; font-size: .78rem; color: var(--muted); }
.day.today .day-name { color: var(--text); font-weight: 700; }

.empty-card { padding: 26px; border-radius: 16px; border: 1.5px dashed var(--line); color: var(--muted);
              display: grid; gap: 14px; justify-items: start; }
.empty-page { max-width: 520px; margin: 14vh auto 0; display: grid; gap: 14px; justify-items: start; }
.empty-page p { color: var(--muted); }

/* --- Listen ----------------------------------------------------------------------- */
.rows { display: grid; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.row { position: relative; display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; }
.row + .row { border-top: 1px solid var(--line-soft); }
.row:first-child { border-radius: 15px 15px 0 0; } .row:last-child { border-radius: 0 0 15px 15px; }
.row:only-child { border-radius: 15px; }
.row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.row-main { display: flex; align-items: center; gap: 13px; flex: 1; min-width: 0; padding: 9px 8px; color: inherit; text-decoration: none; }
.row-main.static { cursor: default; }
.row-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.row-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.row-sub { display: flex; flex-wrap: wrap; font-size: .82rem; color: var(--muted); row-gap: 2px; }
.row-sub > span + span { margin-left: 9px; padding-left: 9px; border-left: 1px solid var(--line); }
.row-snippet { font-size: .85rem; color: var(--muted); font-style: italic; }
.row-actions { display: flex; gap: 6px; align-items: center; padding-right: 6px; }
.rows .menu-wrap { opacity: .0; transition: opacity .15s; }
.rows .row:hover .menu-wrap, .rows .row:focus-within .menu-wrap, .rows .menu-wrap:has(.menu:not([hidden])) { opacity: 1; }
@media (hover: none) { .rows .menu-wrap { opacity: 1; } }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; font-size: .9rem; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.crumbs a:hover { color: var(--text); background: var(--surface-2); }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 18px; }
.page-head h1 { overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.sortbar { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line-soft); }
.sortbar a { padding: 5px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; }
.sortbar a.on { background: var(--surface-2); color: var(--text); }

.dropzone { margin-top: 22px; display: grid; justify-items: center; gap: 4px; padding: 28px 18px; border-radius: 16px;
            border: 1.5px dashed var(--line); color: var(--muted); text-align: center; cursor: pointer; }
.dropzone .ic { width: 1.8em; height: 1.8em; margin-bottom: 4px; }
.dropzone p { color: var(--text); font-weight: 600; }
.dropzone:hover, .dropzone.over { border-color: var(--eosin); color: var(--text); }
.upload-progress { margin-top: 14px; display: grid; gap: 8px; font-size: .9rem; color: var(--muted); }
.drop-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
                background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(5px); }
.drop-overlay span { display: inline-flex; align-items: center; gap: 12px; padding: 22px 30px; border-radius: 20px;
                     border: 2px dashed var(--eosin); font: 700 1.5rem var(--font-display); }
.inline-search { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; max-width: 640px; }
.inline-search .ic { margin-right: -34px; z-index: 1; margin-left: 12px; color: var(--faint); }
.inline-search input { padding-left: 38px; }

/* --- Anzeige ------------------------------------------------------------------------ */
.view-page .wrap, .edit-page .wrap { padding-top: 12px; padding-bottom: 0; }
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; }
.vhead-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vtitle { min-width: 0; }
.vtitle h1 { font-size: 1.25rem; line-height: 1.2; overflow-wrap: anywhere; font-variation-settings: "wdth" 94; }
.vsub { display: flex; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.vsub > span + span { margin-left: 9px; padding-left: 9px; border-left: 1px solid var(--line); }
.vactions { display: flex; align-items: center; gap: 6px; flex: none; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; height: calc(100dvh - var(--top) - 84px); min-height: 420px; }
.stage.side-off { grid-template-columns: minmax(0, 1fr); }
.stage.side-off .side { display: none; }
.stage-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.k-page-pdf .stage-main { overflow: hidden; }

.side { min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px;
        background: var(--surface); overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tabs button { padding: 7px 12px; border: 0; border-radius: 9px; background: none; color: var(--muted);
               font: 600 .88rem var(--font-ui); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.panel { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
#note, #snote { flex: 1; min-height: 160px; resize: none; line-height: 1.6; }
.hint { font-size: .8rem; color: var(--faint); min-height: 1.2em; }
.marks, .outline, .finds { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.marks li { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.marks li:hover { background: var(--surface-2); }
.marks .go { flex: 1; display: grid; gap: 1px; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--text);
             font: 500 .92rem var(--font-ui); cursor: pointer; }
.marks .go b { color: var(--eosin); font-variant-numeric: tabular-nums; }
.marks .rm { opacity: 0; } .marks li:hover .rm, .marks li:focus-within .rm { opacity: 1; }
.outline button, .finds button { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 9px; background: none;
                                 color: var(--text); text-align: left; font: 500 .9rem/1.35 var(--font-ui); cursor: pointer; }
.outline button:hover, .finds button:hover { background: var(--surface-2); }
.finds button b { color: var(--eosin); margin-right: 8px; font-variant-numeric: tabular-nums; }
.finds mark { background: color-mix(in srgb, var(--warn) 40%, transparent); color: inherit; border-radius: 3px; }

.pdfbar { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; align-items: center; padding: 6px 8px;
          margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.grp { display: flex; align-items: center; gap: 4px; }
.pg { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.pg input { width: 64px; padding: 6px 8px; text-align: center; border-radius: 9px; }
.pdf-scroll { flex: 1; min-height: 0; overflow: auto; padding: 18px 0; border-radius: 14px; background: var(--bg-2);
              border: 1px solid var(--line-soft); outline: none; scroll-behavior: auto; }
.pdf-pages { width: max-content; min-width: 100%; }
.pdf-page { position: relative; margin: 0 auto 18px; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.pdf-page canvas { display: block; }
.pdf-dark .pdf-page { background: #181818; }
.pdf-dark .pdf-page canvas { filter: invert(.9) hue-rotate(180deg); }
.pdf-status { text-align: center; color: var(--muted); padding: 30px 0; }
.textLayer { position: absolute; inset: 0; overflow: clip; line-height: 1; text-align: initial; transform-origin: 0 0;
             -webkit-text-size-adjust: none; forced-color-adjust: none; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: rgba(80, 120, 255, .35); }
.textLayer span.hit { background: rgba(255, 210, 40, .5); border-radius: 2px; }
.pdf-fullscreen { background: var(--bg); padding: 12px; }

.player { width: 100%; max-height: calc(100dvh - var(--top) - 190px); border-radius: 16px; background: #000; }
.player.audio { height: 56px; background: none; }
.speeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.speeds button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
                 color: var(--muted); font: 600 .86rem var(--font-ui); cursor: pointer; font-variant-numeric: tabular-nums; }
.speeds button.on { background: var(--eosin); border-color: transparent; color: var(--eosin-ink); }
.imgwrap { display: grid; place-items: center; }
.full { max-width: 100%; max-height: calc(100dvh - var(--top) - 120px); border-radius: 14px; }

.prose { max-width: 74ch; line-height: 1.75; font-size: 1.04rem; padding: 6px 4px 40px; }
.prose h1, .prose h2, .prose h3 { margin: 1.5em 0 .5em; line-height: 1.2; }
.prose h1 { font-size: 1.9rem; } .prose h2 { font-size: 1.4rem; } .prose h3 { font-size: 1.15rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin: 0 0 1em; }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: .92em; }
.prose pre { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { padding: 2px 16px; border-left: 3px solid var(--eosin); color: var(--muted); }
.prose table { border-collapse: collapse; } .prose th, .prose td { border: 1px solid var(--line); padding: 7px 12px; }
.prose th { background: var(--surface); }
.prose-pre { margin: 0; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 14px; background: var(--surface);
             border: 1px solid var(--line); font: 400 .95rem/1.65 var(--font-ui); }

/* --- Bearbeiten --------------------------------------------------------------------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; height: calc(100dvh - var(--top) - 96px); }
.editor.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#ed { height: 100%; resize: none; padding: 18px; line-height: 1.7; border-radius: 14px; }
.preview { overflow: auto; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); max-width: none; }
.hint-card { margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--muted); font-size: .9rem; }
.edit-page .editor { height: calc(100dvh - var(--top) - 100px); }

/* --- Karteikarten ---------------------------------------------------------------------- */
.trainer { display: grid; justify-items: center; align-content: start; gap: 18px; padding: 10px 0 40px; }
.t-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.t-stats span { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; color: var(--muted); }
.t-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.t-progress { width: min(640px, 100%); }
.flip { width: min(640px, 100%); min-height: 300px; display: grid; place-items: center; gap: 16px; padding: 34px;
        border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
        font: 600 clamp(1.25rem, 2.6vw, 1.7rem)/1.4 var(--font-display); text-align: center; cursor: pointer;
        box-shadow: var(--shadow); white-space: pre-wrap; overflow-wrap: anywhere; }
.flip.back { background: var(--surface-2); border-color: var(--eosin); }
.flip .extra { font: 400 .95rem/1.5 var(--font-ui); color: var(--muted); }
.grades { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.grades .btn { min-width: 128px; padding: 12px 18px; }
.grades .again { color: var(--bad); } .grades .hard { color: var(--warn); } .grades .good { color: var(--ok); }
.grades .btn kbd { margin-left: 4px; }
.t-done { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 30px 0; }
.t-done h2 { font-size: 1.6rem; }

/* --- Suche, Dialoge, Toasts ---------------------------------------------------------------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(6, 7, 18, .62); backdrop-filter: blur(3px); }
.palette { width: min(660px, calc(100vw - 24px)); margin: 11vh auto auto; padding: 0; border-radius: 18px;
           border: 1px solid var(--line); background: var(--surface); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7); overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.pal-in input { border: 0; background: none; padding: 4px 0; font-size: 1.05rem; color: var(--text); outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 420px); overflow: auto; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 11px; cursor: pointer; }
.pal-item .badge { width: 32px; height: 32px; border-radius: 9px; }
.pal-item[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--eosin); }
.pal-item .nm { font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.pal-item .pth { font-size: .8rem; color: var(--muted); }
.pal-item mark { background: none; color: var(--eosin); }
.pal-empty { padding: 22px; text-align: center; color: var(--muted); }
.pal-head { padding: 8px 12px 4px; font-size: .8rem; color: var(--faint); font-weight: 600; }
.pal-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--line-soft); font-size: .8rem; color: var(--faint); }
.dlg { width: min(460px, calc(100vw - 24px)); padding: 22px; border-radius: 18px; border: 1px solid var(--line);
       background: var(--surface); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7); }
.dlg form { display: grid; gap: 14px; }
.dlg p { color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg .copyrow { display: flex; gap: 8px; }
.keys { margin: 14px 0 0; display: grid; gap: 8px; }
.keys div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: baseline; }
.keys dt { white-space: nowrap; } .keys dd { margin: 0; color: var(--muted); font-size: .92rem; }
.share-url { margin-top: 6px; padding: 7px 10px; font-size: .85rem; color: var(--muted); }

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px;
          width: min(92vw, 440px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px;
         border-radius: 13px; background: var(--text); color: var(--bg); font: 500 .94rem/1.35 var(--font-ui);
         box-shadow: 0 16px 36px -10px rgba(0, 0, 0, .5); animation: toast-in .22s ease-out; }
.toast.err { background: var(--bad); color: #fff; }
.toast button { border: 0; background: none; color: var(--toast-accent); font: 700 .92rem var(--font-ui); cursor: pointer; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Schmale Bildschirme ------------------------------------------------------------------------ */
@media (max-width: 1000px) {
  .hello { grid-template-columns: 1fr; align-items: start; }
  .cols { grid-template-columns: 1fr; gap: 0; }
  .stage { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .k-page-pdf .stage { height: calc(100dvh - var(--top) - 84px); }
  .side { position: fixed; inset: auto 0 0 0; height: 62dvh; z-index: 25; border-radius: 20px 20px 0 0;
          box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .6); }
  .stage.side-off .side { display: none; }
  .editor.split { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr 1fr; }
  .lbl { display: none; }
}
@media (max-width: 700px) {
  .wrap { padding: 18px 14px 64px; }
  .top-in { padding: 0 12px; gap: 6px; }
  .search-btn { flex: none; margin-left: auto; width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 10px; }
  .search-ph, .search-btn kbd { display: none; }
  .spacer { display: none; }
  .word { display: none; }
  .streak { padding: 6px 9px; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .slides { grid-template-columns: 1fr; }
  .resume { grid-template-columns: auto minmax(0, 1fr); }
  .resume .btn { grid-column: 1 / -1; }
  .vhead { align-items: flex-start; }
  .vactions { flex-wrap: wrap; justify-content: flex-end; }
  .keys div { grid-template-columns: 1fr; gap: 2px; }
  .pdfbar { gap: 6px; }
  .rows .menu-wrap { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ecg-live { animation: none; stroke-dasharray: none; opacity: .55; }
  .slide, .toast { transition: none; animation: none; }
  .slide:hover { transform: none; }
}
.stage-main:fullscreen { background: var(--bg); padding: 12px; overflow: hidden; }

.resume-where { align-items: center; }
.resume-where > span::before { content: ""; display: inline-block; width: 1px; height: .9em; background: var(--line); margin: 0 9px; vertical-align: -.1em; }
@media (max-width: 640px) {
  .row .sub { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
}

.flip.html { white-space: normal; font: 500 clamp(1.05rem, 2.2vw, 1.3rem)/1.55 var(--font-ui); align-content: center; }
.flip.html img { max-width: 100%; max-height: 46vh; border-radius: 8px; }
.flip.html ul, .flip.html ol { text-align: left; }
.flip.html hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.flip.html table { margin: 0 auto; border-collapse: collapse; } .flip.html td, .flip.html th { border: 1px solid var(--line); padding: 4px 10px; }
.flip .cloze { color: var(--eosin); font-weight: 700; }
.flip.html audio { width: min(320px, 100%); margin-top: 8px; }
.flip.html .extra { display: block; }
.flip.html { display: block; text-align: center; padding: 30px 34px; }
.flip.html .q { color: var(--muted); font-size: .92rem; }
.flip.html .q img { max-height: 22vh; }
.flip.html > .q + hr { margin: 14px 0; }
.flip.html audio { display: block; margin: 10px auto 0; }

.import-status { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(420px, calc(100vw - 24px));
  display: grid; gap: 8px; padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.import-status small { color: var(--muted); }
.import-status .bar > i { transition: width .6s ease; width: 0; }

/* Mehrbenutzer */
.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.seg button { padding: 5px 14px; border-radius: 999px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: .86rem; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.menu-who { margin: 0; padding: 8px 12px 6px; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line-soft); }
.menu-who b { color: var(--text); }
.form-card { display: grid; gap: 14px; max-width: 460px; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.form-card h2 { font-size: 1.1rem; }
.users { display: grid; gap: 10px; margin: 14px 0 26px; }
.user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.user-row h3 { margin: 0; font-size: 1.05rem; } .user-row .muted { margin: 2px 0 0; font-size: .86rem; }
.user-row form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-row input[type="password"] { width: 190px; padding: 7px 10px; }
.pill { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 600; vertical-align: 2px; }
@media (max-width: 720px) { .user-row { grid-template-columns: minmax(0, 1fr); } .user-row input[type="password"] { width: 100%; } }

/* --- Kalender und Stundenplan ------------------------------------------------------- */
.f-an { --fc: #ff7aa8; } .f-bi { --fc: #6fe3b0; } .f-ch { --fc: #ffcf70; } .f-ph { --fc: #6fc8ff; }
.f-ps { --fc: #b9a4ff; } .f-so { --fc: #ff9c6e; } .f-te { --fc: #8aa4ff; } .f-cm { --fc: #6fd8d0; }
.f-wi { --fc: #c4b5a0; } .f-sn { --fc: #a0a2c6; } .f-me { --fc: #e9e2ff; }
html[data-mode="light"] .f-an { --fc: #d4306b; } html[data-mode="light"] .f-bi { --fc: #0e8f64; }
html[data-mode="light"] .f-ch { --fc: #a86f00; } html[data-mode="light"] .f-ph { --fc: #0a7dc2; }
html[data-mode="light"] .f-ps { --fc: #6a54e6; } html[data-mode="light"] .f-so { --fc: #c4551d; }
html[data-mode="light"] .f-te { --fc: #4c5fd6; } html[data-mode="light"] .f-cm { --fc: #0d8a84; }
html[data-mode="light"] .f-wi { --fc: #8a6d3b; } html[data-mode="light"] .f-sn { --fc: #5d5678; }
html[data-mode="light"] .f-me { --fc: #1a1530; }

.chip-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
            background: var(--surface); color: var(--text); font: 600 .88rem var(--font-ui); cursor: pointer; }
.chip-btn:hover { border-color: var(--faint); }
.chip-btn .ic { color: var(--eosin); }
.notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft);
          color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.cal-nav .icon-btn { text-decoration: none; color: var(--muted); }
.cal-week { margin: 0 8px; font-size: 1.15rem; }
.cal-scroll { max-height: calc(100dvh - var(--top) - 190px); min-height: 420px; overflow: auto; border: 1px solid var(--line);
              border-radius: 16px; background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: 48px repeat(7, minmax(112px, 1fr)); min-width: 860px; position: relative; }
.cal-corner, .cal-dayhead { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-dayhead { display: flex; align-items: baseline; justify-content: center; gap: 7px; padding: 9px 4px; color: var(--muted);
               font-weight: 600; font-size: .86rem; border-left: 1px solid var(--line-soft); }
.cal-dayhead b { font: 700 1.05rem var(--font-display); color: var(--text); }
.cal-dayhead.today b { background: var(--eosin); color: var(--eosin-ink); border-radius: 999px; padding: 1px 9px; }
.cal-hours { position: relative; height: var(--grid-h); }
.cal-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.cal-hours span:first-child { transform: none; }
.cal-col { position: relative; height: var(--grid-h); border-left: 1px solid var(--line-soft);
           background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line-soft) calc(var(--hour) - 1px), var(--line-soft) var(--hour)); }
.cal-col.today { background-color: color-mix(in srgb, var(--eosin) 5%, transparent); }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--eosin); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--eosin); }

.ev { position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; text-align: left;
      padding: 4px 7px 4px 8px; border: 0; border-left: 3px solid var(--fc); border-radius: 8px; cursor: pointer;
      background: color-mix(in srgb, var(--fc) 17%, var(--surface)); color: var(--text); font: 500 .76rem/1.25 var(--font-ui); }
.ev:hover { background: color-mix(in srgb, var(--fc) 27%, var(--surface)); z-index: 2; }
.ev-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-title { font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ev-ort { color: var(--muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.short { flex-direction: row; gap: 6px; align-items: baseline; padding-top: 3px; }
.ev.short .ev-title { -webkit-line-clamp: 1; }
.ev.past { opacity: .55; }
.ev.ca { border-left-style: dashed; background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--fc) 9%, transparent) 6px 12px); }
.ev.opt { opacity: .7; border-left-style: dotted; }
.ev.a-pruefung { background: var(--fc); color: var(--bg); border-left-color: var(--fc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--fc) 35%, transparent); }
.ev.a-pruefung .ev-time, .ev.a-pruefung .ev-ort { color: color-mix(in srgb, var(--bg) 78%, transparent); }
html[data-mode="light"] .ev.a-pruefung { color: #fff; }
html[data-mode="light"] .ev.a-pruefung .ev-time, html[data-mode="light"] .ev.a-pruefung .ev-ort { color: rgba(255, 255, 255, .85); }
.cal-foot { margin-top: 10px; }

.cal-agenda { display: none; }
.ag-day { margin: 20px 0 8px; font-size: 1rem; color: var(--muted); }
.ag-day.today { color: var(--eosin); }
.ag-list { display: grid; gap: 8px; }
.ag-ev { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: start; width: 100%; text-align: left; padding: 11px 13px;
         border: 0; border-left: 3px solid var(--fc); border-radius: 12px; background: color-mix(in srgb, var(--fc) 14%, var(--surface));
         color: var(--text); font: inherit; cursor: pointer; }
.ag-ev.past { opacity: .55; } .ag-ev.ca { border-left-style: dashed; }
.ag-time { display: grid; font: 700 .95rem var(--font-display); font-variant-numeric: tabular-nums; }
.ag-time small { font: 500 .74rem var(--font-ui); color: var(--muted); }
.ag-body { display: grid; gap: 2px; min-width: 0; }
.ag-body span { color: var(--muted); font-size: .84rem; }

.exams { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.exam { display: grid; grid-template-columns: 72px 1fr; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
        border: 1px solid var(--line); border-left: 3px solid var(--fc); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.exam:hover { border-color: var(--faint); border-left-color: var(--fc); }
.exam-date { color: var(--muted); font-size: .82rem; font-weight: 600; }
.exam-body { display: grid; gap: 1px; min-width: 0; }
.exam-body b { font-size: .92rem; line-height: 1.3; }
.exam-body span { font-size: .8rem; color: var(--fc); font-weight: 600; }
.opt-exams { margin-top: 14px; }
.opt-exams summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .88rem; color: var(--muted); }
.legend-list li { display: flex; align-items: center; gap: 9px; }
.legend-list i { width: 11px; height: 11px; border-radius: 4px; background: var(--fc); }

.ev-dlg { width: min(480px, calc(100vw - 24px)); }
.ev-dlg-head { display: flex; gap: 12px; align-items: flex-start; }
.ev-dot { width: 6px; align-self: stretch; border-radius: 4px; background: var(--fc, var(--faint)); flex: none; }
.ev-dlg-head h2 { font-size: 1.25rem; line-height: 1.25; } .ev-dlg-head p { margin-top: 3px; }
.ev-facts { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin: 0; font-size: .94rem; }
.ev-facts dt { color: var(--faint); } .ev-facts dd { margin: 0; overflow-wrap: anywhere; }
.ev-note { white-space: pre-line; font-size: .9rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.add-dlg { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scope { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.scope legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.scope label { display: flex; align-items: center; gap: 8px; }

.sched { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 26px; }
.sched-card { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.sched-card h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sched-card h2 a { font: 600 .84rem var(--font-ui); }
.s-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.s-ev { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: baseline; padding: 8px 10px; border-left: 3px solid var(--fc); border-radius: 8px;
        background: color-mix(in srgb, var(--fc) 13%, var(--surface)); }
.s-ev.past { opacity: .5; }
.s-ev.now { box-shadow: 0 0 0 2px color-mix(in srgb, var(--fc) 60%, transparent); }
.s-time { font: 700 .88rem var(--font-display); font-variant-numeric: tabular-nums; }
.s-body { display: grid; min-width: 0; } .s-body b { font-size: .92rem; line-height: 1.3; }
.s-body span { font-size: .8rem; color: var(--muted); }
.s-more { margin: 14px 0 6px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.s-exam { display: grid; gap: 4px; }
.s-count { font: 750 2.6rem/1 var(--font-display); color: var(--fc); font-variation-settings: "wdth" 88; }
.s-count small { font: 600 .95rem var(--font-ui); color: var(--muted); margin-left: 6px; }
.s-exam b { font-size: 1rem; }
.s-exam span { color: var(--muted); font-size: .86rem; }

@media (max-width: 1060px) { .cal-layout { grid-template-columns: 1fr; } .sched { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cal-scroll { display: none; }
  .cal-agenda { display: block; }
  .grid2 { grid-template-columns: 1fr; }
}
@media print { .cal-side, .cal-nav, .cal-head { display: none; } .cal-scroll { max-height: none; } }
.ev.short .ev-time { flex: none; }

/* --- Volltextsuche, Karten aus PDF, Statistik ------------------------------------------ */
.content-hits { display: grid; gap: 12px; }
.chit { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.chit-name { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.chit-name b { display: block; overflow-wrap: anywhere; }
.chit-name small { color: var(--muted); font-size: .82rem; }
.chit ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.chit li a { display: block; padding: 7px 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.chit li a:hover { background: var(--surface-2); color: var(--text); }
.chit li b { color: var(--text); margin-right: 10px; font-variant-numeric: tabular-nums; }
.chit mark { background: color-mix(in srgb, #ffd23c 45%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.idx-state { margin-top: 26px; }

.sel-card { position: fixed; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; border-radius: 999px;
            background: var(--eosin); color: var(--eosin-ink); font: 650 .88rem var(--font-ui); cursor: pointer; box-shadow: var(--shadow); }
.sel-card[hidden] { display: none; }
.sel-card kbd { background: color-mix(in srgb, var(--eosin-ink) 14%, transparent); border-color: transparent; color: inherit; }
.card-dlg { width: min(520px, calc(100vw - 24px)); }
.card-dlg textarea { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }

.stat-chips { margin-bottom: 8px; }
.bars30 { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; height: 120px; align-items: end; }
.b30 { height: 100%; display: flex; align-items: flex-end; }
.b30 span { display: flex; align-items: flex-end; width: 100%; height: 100%; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.b30 i { display: block; width: 100%; border-radius: 6px; background: var(--hema); }
.b30.today i { background: var(--eosin); }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.area { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.area header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; }
.area h3 { font-size: 1.1rem; } .area h3 a { color: var(--text); text-decoration: none; } .area h3 a:hover { color: var(--eosin); }
.exam-chip { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 600; }
.exam-chip.soon { background: color-mix(in srgb, var(--eosin) 18%, transparent); color: var(--eosin); }
.area dl { display: grid; gap: 8px; margin: 0; }
.area dl > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; font-size: .9rem; }
.area dt { color: var(--muted); } .area dd { margin: 0; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.area .bar { display: block; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.area .bar i { display: block; height: 100%; background: var(--ok); }
.due-pill { align-self: center; margin-right: 14px; background: color-mix(in srgb, var(--eosin) 18%, transparent); color: var(--eosin); }
@media (max-width: 760px) { .areas { grid-template-columns: 1fr; } .bars30 { gap: 2px; } }

/* --- Anatomie 3D --------------------------------------------------------------------------- */
.wrap.anat-main { max-width: none; padding: 0; }
.anat { display: grid; grid-template-columns: minmax(0, 1fr) 372px; height: calc(100dvh - var(--top)); min-height: 520px; }
.anat-stage { position: relative; overflow: hidden; touch-action: none;
  background: radial-gradient(120% 90% at 50% 30%, color-mix(in srgb, var(--surface-2) 90%, var(--hema) 10%) 0%, var(--bg) 78%); }
.anat-stage #gl { position: absolute; inset: 0; display: block; outline: none; cursor: grab; }
.anat-stage #gl:active { cursor: grabbing; }
.anat-boot { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); margin: 0; pointer-events: none; }
.anat-load { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 3; display: grid; gap: 6px; min-width: min(300px, 80%);
  padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; color: var(--muted); box-shadow: var(--shadow); }
.anat-load i { display: block; height: 4px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.anat-load b { display: block; height: 100%; width: 0; background: var(--eosin); transition: width .2s; }
.anat-views { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; pointer-events: none; }
.anat-views .chip-btn { pointer-events: auto; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); }
.panel-btn { display: none !important; margin-left: auto; }
.anat-help { position: absolute; left: 12px; bottom: 8px; margin: 0; font-size: .75rem; color: var(--faint); pointer-events: none; max-width: calc(100% - 24px); }
.anat-tip { position: absolute; z-index: 4; padding: 4px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: .82rem; font-weight: 600; pointer-events: none; white-space: nowrap; }

.anat-info { position: absolute; left: 12px; bottom: 34px; z-index: 3; width: min(440px, calc(100% - 24px)); display: grid; gap: 9px; padding: 14px 14px 12px;
  border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 56%; overflow: auto; }
.ai-head { display: flex; align-items: flex-start; gap: 8px; }
.ai-title { flex: 1; display: grid; gap: 1px; min-width: 0; }
.ai-title b { font: 650 1.15rem/1.25 var(--font-display); overflow-wrap: anywhere; }
.ai-title span { color: var(--muted); font-size: .92rem; }
.ai-title .ai-note { font-size: .8rem; color: var(--faint); }
.ai-x { width: 32px; height: 32px; flex: none; }
.ai-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: .8rem; color: var(--faint); }
.ai-path .crumb { padding: 1px 4px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.ai-path .crumb:hover { background: var(--surface-2); color: var(--text); }
.ai-path i { font-style: normal; }
.ai-meta { color: var(--muted); font-size: .86rem; }
.ai-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-acts .btn { text-decoration: none; }
.ai-legend { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ai-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.ai-legend .dot.o { background: #dc1a1a; } .ai-legend .dot.e { background: #1f59f2; }

.anat-qbar { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 3; width: min(620px, calc(100% - 24px)); display: grid; gap: 9px;
  padding: 13px 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.qb-top { display: flex; align-items: center; gap: 12px; font-size: .86rem; color: var(--muted); }
.qb-score { color: var(--ok); font-weight: 650; }
.qb-ask { font-size: 1.05rem; }
.qb-ask b { font: 650 1.2rem var(--font-display); color: var(--text); }
.qb-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qb-opt { justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.3; }
.qb-opt.right { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); border-color: var(--ok); }
.qb-opt.wrong { background: color-mix(in srgb, var(--bad) 28%, var(--surface)); border-color: var(--bad); }
.qb-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 12px; border-radius: 12px; font-size: .94rem; }
.qb-fb.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.qb-fb.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.qb-fb .btn { margin-left: auto; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }

/* Seitenleiste */
.anat-panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-left: 1px solid var(--line-soft); background: var(--bg-2); }
.anat-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; background: var(--bg-2); }
.anat-panel-head .tabs { flex: 1; }
.panel-x { display: none; }
.anat-sec { display: grid; gap: 14px; padding: 16px; align-content: start; }
.sys-list { display: grid; gap: 6px; }
.sys-row { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; overflow: hidden;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); cursor: pointer; }
.sys-row:hover { border-color: var(--line); }
.sys-row input { width: 18px; height: 18px; accent-color: var(--eosin); }
.sys-dot { width: 12px; height: 12px; border-radius: 50%; }
.sys-name { font-weight: 600; }
.sys-sub { color: var(--faint); font-size: .78rem; }
.sys-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--eosin); transition: width .2s; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.anat-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.anat-search input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: none; color: var(--text); font: inherit; outline: none; }
.anat-search:focus-within { border-color: var(--eosin); }
.anat-results { display: grid; gap: 4px; }
.res { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.res:hover { background: var(--surface-2); }
.res-main { display: grid; min-width: 0; }
.res-main small, .res-sys { color: var(--faint); font-size: .78rem; }
.res-sys { text-align: right; flex: none; }
.pad { padding: 8px 4px; }
.tn-root, .tn-kids { list-style: none; margin: 0; padding: 0; }
.tn-row { display: flex; align-items: center; gap: 2px; border-radius: 9px; }
.tn-row:hover { background: var(--surface-2); }
.tn-tg, .tn-eye { display: grid; place-items: center; width: 28px; height: 30px; flex: none; padding: 0; border: 0; background: none; color: var(--faint); cursor: pointer; }
.tn-tg:disabled { opacity: 0; cursor: default; }
.tn-tg .ic { transition: transform .12s; }
.tn.open > .tn-row .tn-tg .ic { transform: rotate(90deg); }
.tn-eye:hover { color: var(--text); }
.tn-eye.part { color: var(--warn); }
.tn.off > .tn-row .tn-name { opacity: .45; }
.tn-name { flex: 1; display: grid; min-width: 0; padding: 4px 4px; border: 0; background: none; color: var(--text); text-align: left; font: inherit; font-size: .9rem; cursor: pointer; }
.tn-name b { font-weight: 600; overflow-wrap: anywhere; }
.tn-name small { color: var(--faint); font-size: .76rem; }
.tn.flash > .tn-row { background: color-mix(in srgb, var(--eosin) 22%, transparent); }
.q-result { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); display: grid; gap: 10px; }
.q-result h3 { font-size: 1.15rem; }
.q-wrong { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.q-wrong small { color: var(--faint); }
.linklike { padding: 0; border: 0; background: none; color: var(--eosin); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.anat-credit { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line-soft); font-size: .76rem; color: var(--faint); display: grid; gap: 6px; }

@media (max-width: 860px) {
  .anat { grid-template-columns: 1fr; }
  .panel-btn { display: inline-flex !important; }
  .anat-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: min(66dvh, 560px); border: 1px solid var(--line); border-bottom: 0;
    border-radius: 20px 20px 0 0; box-shadow: 0 -18px 40px -12px rgba(0, 0, 0, .55); transform: translateY(105%); transition: transform .22s ease; }
  .anat.panel-open .anat-panel { transform: none; }
  .panel-x { display: inline-grid; }
  .anat-help { display: none; }
  .anat-info { bottom: 10px; max-height: 46%; }
  .anat-qbar { top: 50px; }
  .qb-opts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .anat-panel, .sys-bar, .anat-load b { transition: none; } }
.fas-dot { background: #d6cdbd; }
.fas-row { margin-top: 6px; }
@media (max-width: 860px) {
  .anat-qbar { top: auto; bottom: 10px; max-height: 50%; overflow: auto; gap: 7px; padding: 11px 12px; }
  .qb-opts { gap: 6px; }
  .qb-opt { padding: 8px 12px; font-size: .9rem; }
  .qb-ask { font-size: .98rem; }
}
