/* ==========================================================================
   Bento Design-System – Dark-First, Linear/Raycast/Apple-Bento-Ästhetik
   Nur Tokens verwenden. Modul-Akzent über --accent (dezent: Icons, Fokus, Fortschritt).
   ========================================================================== */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/fraunces-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/fraunces-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/figtree-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/figtree-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

/* Hell = Papier & Tinte (Standard) */
:root,
:root[data-theme="light"] {
  --bg: #f4efe6;
  --bg-elev: #f9f5ee;
  --surface: #fffdf8;
  --surface-2: #f7f2e9;
  --surface-3: #ede6d9;
  --surface-hover: #f2ece2;
  --border: rgba(70, 52, 30, 0.11);
  --border-strong: rgba(70, 52, 30, 0.2);
  --text: #2a251f;
  --text-2: #4b4339;
  --muted: #847a6b;
  --faint: #ada393;
  --shadow: 0 1px 0 rgba(70, 52, 30, 0.04), 0 1px 3px rgba(70, 52, 30, 0.05);
  --shadow-pop: 0 18px 50px -18px rgba(60, 42, 20, 0.32), 0 0 0 1px var(--border-strong);
  --overlay: rgba(244, 239, 230, 0.7);
  --good: #4e7a46;
  --warn: #b07418;
  --bad: #b2473a;
  --info: #3d6b8a;
  --ai: #6e5d8e;
  --chart-1: #c4673d; --chart-2: #4d8697; --chart-3: #87a058; --chart-4: #cf9f38; --chart-5: #86709f; --chart-6: #c27581;
  --skeleton: rgba(70, 52, 30, 0.07);
  color-scheme: light;
}

/* Dunkel = warmes Abendlicht statt kaltem Grau */
:root[data-theme="dark"] {
  --bg: #191714;
  --bg-elev: #1d1b17;
  --surface: #221f1b;
  --surface-2: #27241f;
  --surface-3: #312d27;
  --surface-hover: #2a2722;
  --border: rgba(255, 238, 210, 0.08);
  --border-strong: rgba(255, 238, 210, 0.15);
  --text: #ece5d9;
  --text-2: #cdc4b5;
  --muted: #9a907f;
  --faint: #6c6458;
  --shadow: none;
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-strong);
  --overlay: rgba(14, 12, 10, 0.66);
  --good: #96bd85;
  --warn: #dfb361;
  --bad: #de7f6e;
  --info: #87b1cc;
  --ai: #b3a2d1;
  --chart-1: #df8c62; --chart-2: #79b0bf; --chart-3: #a9c27c; --chart-4: #e3bd63; --chart-5: #ab98c8; --chart-6: #d99aa4;
  --skeleton: rgba(255, 238, 210, 0.06);
  color-scheme: dark;
}

:root {
  --accent: #a1a1aa;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --sidebar-w: 236px;
  --header-h: 56px;
  --font: Figtree, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, sans-serif;
  --serif: Fraunces, "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.018em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: 6px; }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.icon { flex-shrink: 0; display: block; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.spacer { flex: 1; }
.tone-good { --tone: var(--good); } .tone-warn { --tone: var(--warn); } .tone-bad { --tone: var(--bad); }
.tone-info { --tone: var(--info); } .tone-accent { --tone: var(--accent); } .tone-ai { --tone: var(--ai); } .tone-default { --tone: var(--muted); }
.text-good { color: var(--good); } .text-warn { color: var(--warn); } .text-bad { color: var(--bad); } .text-accent { color: var(--accent); }

/* ------------------------------------------------------------------ Boot */
.boot-splash { position: fixed; inset: 0; display: grid; place-items: center; }
.boot-logo { width: 40px; height: 40px; border-radius: 11px; background:
  linear-gradient(var(--surface-3), var(--surface-3)) 0 0 / 18px 18px no-repeat,
  linear-gradient(var(--surface-3), var(--surface-3)) 22px 0 / 18px 10px no-repeat,
  linear-gradient(var(--surface-3), var(--surface-3)) 22px 14px / 18px 26px no-repeat,
  linear-gradient(var(--surface-3), var(--surface-3)) 0 22px / 18px 18px no-repeat;
  animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }

/* ------------------------------------------------------------------ Shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 10px; border-right: 1px solid var(--border); background: var(--bg-elev); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }
.brand-mark { width: 22px; height: 22px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.brand-mark span { border-radius: 3px; background: var(--text); opacity: 0.9; }
.brand-mark span:nth-child(2) { opacity: 0.45; } .brand-mark span:nth-child(3) { opacity: 0.25; } .brand-mark span:nth-child(4) { opacity: 0.65; }
.brand-version { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 500; }
.nav-section { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px;
  color: var(--text-2); font-weight: 500; transition: background 0.15s, color 0.15s;
}
button.nav-item { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.nav-item .icon { color: var(--muted); transition: color 0.15s; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav-item.active .icon, .nav-item:hover .icon { color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; height: 18px; border-radius: 9px; font-size: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: min(420px, 100%); height: 34px; padding: 0 10px 0 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.search-trigger span { flex: 1; text-align: left; }
.kbd { display: inline-flex; align-items: center; gap: 2px; font: 500 11px var(--font); color: var(--faint); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 28px 28px 80px; max-width: 1480px; width: 100%; margin: 0 auto; }
.view-enter { animation: viewIn 0.28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Personen-Switcher */
.person-switch { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.person-switch button { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 550; cursor: pointer; }
.person-switch button:hover { color: var(--text); }
.person-switch button.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.person-switch .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--person, var(--muted)); }

/* Mic-Button */
.mic-btn { position: relative; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all 0.15s; }
.mic-btn:hover { color: var(--ai); border-color: color-mix(in srgb, var(--ai) 40%, transparent); }
.mic-fab { display: none; }

/* ------------------------------------------------------------------ Page header */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.eyebrow { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; }
.page-title { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
.page-subtitle { color: var(--muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Bento grid & cards */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(184px, auto); grid-auto-flow: dense; gap: 14px; }
.bento.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bento.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bento.auto-rows { grid-auto-rows: auto; }
.span-2x1, .span-2 { grid-column: span 2; }
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-3 { grid-column: span 3; }
.span-full, .span-4 { grid-column: 1 / -1; }
.span-1x2 { grid-row: span 2; }

.card {
  position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.card.interactive { cursor: pointer; }
.card.interactive:hover { border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0; min-height: 40px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); min-width: 0; }
.card-title .icon { color: var(--accent); }
.card-title > span:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { color: var(--faint); font-weight: 500; }
.card-actions { display: flex; gap: 4px; align-items: center; }
.card-body { padding: 12px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.card-flat { box-shadow: none; }
.card-accent-top::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: 0.8; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }

/* Stats */
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.tone-good .stat-value, .stat.tone-warn .stat-value, .stat.tone-bad .stat-value, .stat.tone-accent .stat-value { color: var(--tone); }
.stat-unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.stat-hint { font-size: 12px; color: var(--faint); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-strip .card-body { padding: 16px; }

/* Progress */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.progress-meta span:last-child { color: var(--text-2); }
.progress-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: var(--tone, var(--accent)); transition: width 0.6s var(--ease); }

/* Lists */
.list { display: flex; flex-direction: column; margin: 0 -8px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; min-width: 0; transition: background 0.12s; }
a.list-item:hover, .list-item.clickable:hover { background: var(--surface-hover); cursor: pointer; }
.list-item + .list-item { box-shadow: 0 -1px 0 var(--border); }
.list-item:hover + .list-item, .list-item:hover { box-shadow: none; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item.done .list-title { color: var(--faint); text-decoration: line-through; }
.list-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.list-icon.accent { background: var(--accent-soft); color: var(--accent); }
.list-end { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -16px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 550; font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tr.clickable { cursor: pointer; }
.table .right, .right { text-align: right; }

/* Badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 550; white-space: nowrap;
  color: var(--tone, var(--muted)); background: color-mix(in srgb, var(--tone, var(--muted)) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--muted)) 22%, transparent);
}
.badge.tone-default { color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.person-avatar { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--person); background: color-mix(in srgb, var(--person) 16%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all 0.12s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; }
.tag button { border: 0; background: none; padding: 0; color: var(--faint); cursor: pointer; display: grid; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid transparent; font-weight: 550; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  position: relative;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon-only { padding: 0; width: 34px; }
.btn-sm.btn-icon-only { width: 28px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-subtle { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-subtle:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.btn-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.btn-accent:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-danger { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 20%, transparent); }
.btn-ai { color: var(--ai); background: color-mix(in srgb, var(--ai) 10%, transparent); border-color: color-mix(in srgb, var(--ai) 28%, transparent); }
.btn-ai:hover:not(:disabled) { background: color-mix(in srgb, var(--ai) 18%, transparent); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); border-right-color: transparent; animation: spin 0.7s linear infinite; }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: all 0.12s; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn-danger:hover { color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 550; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.tab-count { font-size: 11px; color: var(--faint); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 180px; height: 34px; }

/* Forms */
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 550; color: var(--text-2); }
.field-label .req { color: var(--bad); margin-left: 3px; }
.field-hint { font-size: 11.5px; color: var(--faint); }
.input {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg-elev);
  color: var(--text); font: inherit; font-size: 13.5px; transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"].input, input[type="month"].input { color-scheme: inherit; }
input[type="number"].input { font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { width: 36px; height: 21px; border-radius: 11px; border: 0; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; padding: 0; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: transform 0.2s var(--ease), background 0.2s; }
.switch.on { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.switch.on .switch-knob { transform: translateX(15px); background: #fff; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 16px; border-radius: 12px; border: 1.5px dashed var(--border-strong); background: var(--bg-elev); color: var(--muted); cursor: pointer; text-align: center; transition: all 0.15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text-2); }
.dropzone.has-file { border-style: solid; border-color: var(--accent-line); }
.dropzone-label { font-weight: 550; color: var(--text-2); }
.dropzone-hint { font-size: 12px; }
.dropzone-file { font-size: 12px; color: var(--accent); }
.deflist { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 13px; }
.deflist dt { color: var(--muted); }
.deflist dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Overlays */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 9vh 16px 16px; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.18s; overflow-y: auto; }
.overlay.open { opacity: 1; }
.modal { width: 100%; max-width: 560px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-pop); transform: translateY(8px) scale(0.985); transition: transform 0.22s var(--ease); display: flex; flex-direction: column; max-height: 84vh; }
.overlay.open .modal { transform: none; }
.modal.size-sm { max-width: 420px; } .modal.size-lg { max-width: 780px; } .modal.size-xl { max-width: 1040px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.modal-title { font-size: 16px; }
.modal-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-body { padding: 12px 20px 18px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.overlay-drawer { place-items: stretch end; padding: 0; }
.drawer { width: min(480px, 100vw); height: 100%; background: var(--surface); border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; transform: translateX(24px); transition: transform 0.24s var(--ease); }
.drawer.size-lg { width: min(640px, 100vw); }
.overlay.open .drawer { transform: none; }
.drawer .modal-body { flex: 1; }

.toast-root { position: fixed; z-index: 200; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-radius: 12px; background: var(--surface-3); box-shadow: var(--shadow-pop); font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(8px); transition: all 0.2s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--muted)); }
.toast-action { border: 0; background: var(--surface); color: var(--text); font-weight: 600; font-size: 12.5px; border-radius: 7px; padding: 4px 9px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--border-strong); }
.toast-close { border: 0; background: none; color: var(--faint); cursor: pointer; display: grid; padding: 2px; }

/* Command palette */
.palette { width: 100%; max-width: 640px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-pop); overflow: hidden; transform: translateY(-6px) scale(0.985); transition: transform 0.2s var(--ease); }
.overlay.open .palette { transform: none; }
.palette-input-wrap { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input { flex: 1; height: 54px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.palette-results { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.palette-item.active { background: var(--surface-3); }
.palette-item .list-icon { width: 28px; height: 28px; }
.palette-item-type { margin-left: auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.palette-footer { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--faint); }

/* Voice overlay */
.voice-panel { width: 100%; max-width: 440px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-pop); padding: 26px 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; transform: scale(0.97); transition: transform 0.2s var(--ease); --accent: var(--ai); }
.overlay.open .voice-panel { transform: none; }
.voice-orb { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: var(--ai); background: color-mix(in srgb, var(--ai) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ai) 35%, transparent); }
.voice-orb::before, .voice-orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ai); opacity: 0; }
.voice-orb.recording::before { animation: ripple 1.6s var(--ease) infinite; }
.voice-orb.recording::after { animation: ripple 1.6s var(--ease) 0.8s infinite; }
.voice-orb.thinking { animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes ripple { from { transform: scale(1); opacity: 0.55; } to { transform: scale(1.55); opacity: 0; } }
.voice-timer { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.voice-status { color: var(--muted); font-size: 13px; min-height: 20px; }
.voice-transcript { width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--border); font-size: 14px; text-align: left; color: var(--text); }
.voice-transcript::before { content: "„"; color: var(--faint); }
.voice-transcript::after { content: "“"; color: var(--faint); }
.voice-results { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.voice-result { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-align: left; }
.voice-result .list-icon { background: color-mix(in srgb, var(--mod) 15%, transparent); color: var(--mod); }
.voice-question { width: 100%; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ai) 30%, transparent); background: color-mix(in srgb, var(--ai) 7%, transparent); display: flex; flex-direction: column; gap: 12px; }
.voice-question p { font-weight: 600; }
.voice-options { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.voice-text-input { display: flex; gap: 8px; width: 100%; }
.voice-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Link-Panel */
.links { display: flex; flex-direction: column; gap: 6px; }
.link-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.link-item .list-icon { background: color-mix(in srgb, var(--mod) 14%, transparent); color: var(--mod); width: 28px; height: 28px; }
.link-item.missing { opacity: 0.6; }
.link-relation { font-size: 11px; color: var(--faint); }

/* Empty / loading */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 12px; color: var(--faint); text-align: center; font-size: 13px; flex: 1; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.7s linear infinite; margin: 18px auto; }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton-line { height: 12px; border-radius: 6px; background: var(--skeleton); animation: pulse 1s ease-in-out infinite alternate; }
.skeleton-line:nth-child(2) { width: 80%; } .skeleton-line:nth-child(3) { width: 55%; }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; font-size: 13px; color: var(--text-2); background: color-mix(in srgb, var(--tone, var(--info)) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--info)) 22%, transparent); }
.alert .icon { color: var(--tone, var(--info)); margin-top: 1px; }
.alert strong { color: var(--text); }
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* AI */
.ai-content { font-size: 13.5px; line-height: 1.6; color: var(--text-2); overflow-y: auto; }
.ai-content strong { color: var(--text); font-weight: 600; }
.md-p + .md-p, .md-p + .md-list, .md-list + .md-p { margin-top: 8px; }
.md-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.md-list li::marker { color: var(--ai); }
.ai-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); margin-top: auto; }
.ai-sheen { position: relative; }
.ai-sheen::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--ai) 9%, transparent), transparent 60%); }
.demo-pill { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--warn); }

/* Charts */
.chart-wrap { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.chart { width: 100%; height: auto; overflow: visible; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-zero { stroke: var(--border-strong); stroke-width: 1; }
.chart-target { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-line.dashed { stroke-dasharray: 5 5; }
.chart-area { opacity: 0.1; }
.chart-dot { opacity: 0; transition: opacity 0.15s; }
.chart:hover .chart-dot { opacity: 1; }
.chart-bar { transition: opacity 0.15s; }
.chart-bar:hover { opacity: 0.8; }
.chart-empty { color: var(--faint); font-size: 12.5px; padding: 18px 0; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-figure { position: relative; flex-shrink: 0; }
.donut-track, .ring-track { stroke: var(--surface-3); }
.donut-center, .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-value, .ring-value { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.donut-label, .ring-sub { font-size: 11px; color: var(--muted); }
.donut-wrap .legend { flex-direction: column; }
.ring-wrap { position: relative; flex-shrink: 0; }
.ring-fill { stroke: var(--accent); transition: stroke-dasharray 0.8s var(--ease); }
.ring-fill.over { stroke: var(--bad); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-meta { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; gap: 8px; }
.hbar-track { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width 0.6s var(--ease); }
.sparkline { display: block; overflow: visible; }

/* Dashboard (Pulse) */
.widget { min-height: 184px; }
.widget .card-body { overflow: hidden; }
.widget-edit-bar { position: absolute; inset: 8px 8px auto auto; display: none; gap: 4px; z-index: 2; padding: 3px; border-radius: 9px; background: var(--surface-3); box-shadow: var(--shadow-pop); }
.editing .widget-edit-bar { display: flex; }
.editing .widget { outline: 1.5px dashed var(--border-strong); outline-offset: -1px; cursor: grab; }
.editing .widget.dragging { opacity: 0.4; }
.editing .widget.drop-target { outline-color: var(--accent); }
.widget.is-hidden { opacity: 0.35; }
.greeting { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.widget-blocks { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.widget-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* Detail layout */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.detail-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.preview-frame { width: 100%; height: 70vh; min-height: 420px; border: 0; border-radius: 12px; background: var(--bg-elev); }
.preview-img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: var(--bg-elev); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.back-link:hover { color: var(--text); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.module-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.module-row:last-child { border-bottom: 0; }
.module-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--mod); background: color-mix(in srgb, var(--mod) 14%, transparent); flex-shrink: 0; }
.secret { font-family: var(--mono); font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--bg-elev); border: 1px solid var(--border); overflow-wrap: anywhere; }

/* Inbox */
.inbox-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; }
.inbox-item + .inbox-item { border-top: 1px solid var(--border); }
.suggestion { margin-top: 10px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--ai) 6%, transparent); border: 1px solid color-mix(in srgb, var(--ai) 22%, transparent); display: flex; flex-direction: column; gap: 10px; }
.quick-note { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: 1 / -1; }
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main, .content { min-width: 0; max-width: 100vw; }
  .topbar-right { flex-shrink: 0; }
  .sidebar { position: fixed; z-index: 90; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform 0.25s var(--ease); box-shadow: var(--shadow-pop); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 80; background: var(--overlay); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search-trigger { width: auto; flex: 1; }
  .search-trigger .kbd, .search-trigger span { display: none; }
  .search-trigger { flex: 0 0 34px; padding: 0; justify-content: center; }
  .content { padding: 18px 16px 110px; }
  .settings-grid, .form-grid.cols-2, .form-grid.cols-3, .detail { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .mic-btn.header-mic { display: none; }
  .mic-fab { display: grid; place-items: center; position: fixed; z-index: 60; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 20px; border: 0; color: #fff; background: var(--ai); box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--ai) 70%, transparent); cursor: pointer; }
  .page-title { font-size: 21px; }
}
@media (max-width: 560px) {
  .bento, .bento.cols-2, .bento.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .stats-row { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
  .span-2x1, .span-2x2, .span-2, .span-3 { grid-column: auto; }
  .span-2x2 { grid-row: auto; }
  .person-switch button span.plabel { display: none; }
  .person-switch button { padding: 0 8px; }
  .modal { max-height: 92vh; }
  .overlay { padding-top: 4vh; }
  .stat-value { font-size: 23px; }
  .table-wrap { margin: 0 -16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Gestaltungsschicht: redaktionell & warm statt "KI-Dashboard"
   ========================================================================== */
body { font-size: 14.5px; letter-spacing: 0; font-feature-settings: normal; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }
.page-title, .greeting, .modal-title, .brand, .stat-value, .donut-value, .ring-value, .voice-timer, .login-card .brand {
  font-family: var(--serif); font-weight: 560; letter-spacing: -0.015em; font-optical-sizing: auto;
}
.page-title { font-size: 30px; line-height: 1.15; }
.stat-value { font-size: 28px; font-weight: 520; }
.stat-value .stat-unit { font-family: var(--font); }
.modal-title { font-size: 19px; }
.brand { font-size: 19px; font-weight: 600; }
.eyebrow { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.nav-section, .palette-group, .table th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.page-subtitle { font-size: 14.5px; }

/* Ruhigere Flächen: keine Glows, keine Verlaufslinien */
.card { box-shadow: var(--shadow); }
.card-accent-top::after, .ai-sheen::before { display: none; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.card-title .icon { color: var(--muted); }
.card:hover .card-title .icon { color: var(--accent); }
.page-icon { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--accent); border-radius: 12px; }
.nav-item.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), var(--shadow); }
.nav-item.active::before { width: 3px; top: 10px; bottom: 10px; }
.sidebar { background: var(--bg); }
.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* Badges: dezente Textmarker statt Neon-Pillen */
.badge { box-shadow: none; background: color-mix(in srgb, var(--tone, var(--muted)) 11%, transparent); font-weight: 600; border-radius: 5px; }
.chip.active { background: var(--surface); border-color: var(--text-2); color: var(--text); }

/* KI zurückhaltend: Tinte statt Lila-Glow */
.btn-ai { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.btn-ai .icon { color: var(--ai); }
.btn-ai:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-2); }
.btn-primary { background: var(--text); color: var(--surface); }
.mic-btn:hover { color: var(--text); border-color: var(--text-2); }
.mic-fab { background: var(--text); color: var(--surface); box-shadow: 0 10px 24px -10px rgba(40, 30, 15, 0.5); }
.voice-orb { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.voice-orb::before, .voice-orb::after { border-color: var(--accent); }
.voice-question, .suggestion { background: var(--surface-2); border-color: var(--border-strong); }
.md-list li::marker { color: var(--muted); }
.ai-content { font-size: 14px; }
.demo-pill { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 600; }

/* Fortschritt & Diagramme etwas feiner */
.progress-track, .hbar-track { height: 5px; }
.alert { box-shadow: none; border-left: 3px solid var(--tone, var(--info)); border-radius: 8px; background: color-mix(in srgb, var(--tone, var(--info)) 7%, var(--surface)); }
.kbd { font-family: var(--font); }
.search-trigger { background: var(--surface); }
.person-switch, .tabs { background: var(--surface-2); }
.person-switch button.active, .tab.active { background: var(--surface); box-shadow: 0 1px 2px rgba(60, 42, 20, 0.08), inset 0 0 0 1px var(--border); }
::selection { background: color-mix(in srgb, var(--chart-4) 35%, transparent); }

/* Sortierbare Navigation */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-row { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.nav-section-btn { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font: 500 11.5px var(--font); cursor: pointer; opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.sidebar:hover .nav-section-btn, .nav-section-btn:focus-visible, .nav-section-btn[aria-pressed="true"] { opacity: 1; }
.nav-section-btn:hover { background: var(--surface-hover); color: var(--text); }
.nav-section-btn[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav.sorting .nav-item { cursor: grab; box-shadow: inset 0 0 0 1px var(--border); background: var(--surface); }
.nav.sorting .nav-item::before { display: none; }
.nav.sorting .nav-item.dragging { opacity: 0.45; cursor: grabbing; }
.nav-sort-ctl { margin-left: auto; display: inline-flex; gap: 1px; }
.nav-sort-btn { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.nav-sort-btn:hover { background: var(--surface-3); color: var(--text); }
.nav-sort-btn .flip { transform: rotate(180deg); }
.nav.sorting .nav-item:first-child .nav-sort-btn:first-child, .nav.sorting .nav-item:last-child .nav-sort-btn:last-child { visibility: hidden; }
@media (hover: none) { .nav-section-btn { opacity: 1; } }

/* Burger: Desktop klappt die Seitenleiste ein, Mobil öffnet das Overlay */
.icon-btn.menu-btn { display: inline-grid; }
.shell { transition: grid-template-columns 0.22s var(--ease); }
@media (min-width: 861px) {
  .shell.nav-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .shell.nav-collapsed .sidebar { visibility: hidden; padding-left: 0; padding-right: 0; border-right: 0; overflow: hidden; }
}
@media (max-width: 860px) {
  .shell.nav-open .sidebar { z-index: 95; }
  .shell.nav-open::after { z-index: 85; }
}
