/* LeadDesk App-Oberfläche */
body.app { min-height: 100vh; }

/* ---------- Anmeldung ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 15% -10%, var(--accent-soft), transparent 60%), radial-gradient(700px 500px at 110% 110%, var(--blue-soft), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); padding: 32px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card p { color: var(--muted); margin-bottom: 22px; }

/* ---------- Grundgerüst ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--bg-tint); }
.brand { display: flex; align-items: center; gap: 11px; font: 700 17px/1.1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.brand small { display: block; font: 500 11.5px/1.3 var(--font); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.sidebar .brand { padding: 4px 8px 16px; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px; cursor: pointer; box-shadow: var(--shadow-1); }
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-2); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger .kbd { margin-left: auto; }
.nav { display: grid; gap: 2px; }
.nav-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-weight: 550; font-size: 14px; transition: background .12s, color .12s; }
.nav a svg { width: 18px; height: 18px; color: var(--muted); flex: none; transition: color .12s; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav a[aria-current="page"] svg { color: var(--accent); }
.nav .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav .count.alert { background: var(--red-soft); color: var(--red); }
.sidebar-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-foot .status-line { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); flex: none; }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.crumbs strong { color: var(--text); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar .mobile-brand { display: none; }
.page { padding: 8px 28px 64px; max-width: 1320px; width: 100%; margin: 0 auto; animation: page-in .28s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 24px; }
.page-head h1 { font-size: 30px; line-height: 1.15; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 640px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Bausteine ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.section-head h2 { font-size: 15.5px; letter-spacing: -.01em; }
.section-head .sub { font-size: 13px; color: var(--muted); }
.section-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 16px 18px; text-decoration: none; color: inherit; transition: transform .15s var(--ease), box-shadow .15s; overflow: hidden; }
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.kpi .label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 550; }
.kpi .label svg { width: 16px; height: 16px; }
.kpi .value { margin-top: 10px; font: 700 32px/1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi .hint { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.kpi .hint.up { color: var(--green); }
.kpi .hint.alert { color: var(--red); }
.kpi .spark { position: absolute; right: 14px; top: 16px; width: 76px; height: 28px; color: var(--accent); opacity: .9; }

.hero { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 55%, var(--accent-soft) 100%); }
.hero h1 { font-size: 28px; }
.hero p { color: var(--muted); margin-top: 4px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); min-width: 0; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .actions { display: flex; gap: 6px; flex: none; align-items: center; }
.list li.clickable { cursor: pointer; transition: background .12s; }
.list li.clickable:hover { background: var(--surface-2); }
.icon-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.icon-tile svg { width: 18px; height: 18px; }
.icon-tile.accent { background: var(--accent-soft); color: var(--accent); }
.icon-tile.red { background: var(--red-soft); color: var(--red); }
.icon-tile.amber { background: var(--amber-soft); color: var(--amber); }
.icon-tile.blue { background: var(--blue-soft); color: var(--blue); }
.icon-tile.violet { background: var(--violet-soft); color: var(--violet); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; letter-spacing: .02em; color: #fff; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }

.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 4px; }
.empty strong { color: var(--text); font-size: 15px; }
.empty p { max-width: 380px; font-size: 14px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--text); font-size: 14px; }
.notice svg { width: 18px; height: 18px; color: var(--amber); flex: none; margin-top: 2px; }
.notice.info { background: var(--blue-soft); } .notice.info svg { color: var(--blue); }
.notice.error { background: var(--red-soft); } .notice.error svg { color: var(--red); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .input { max-width: 320px; }
.search-input { position: relative; flex: 1 1 240px; max-width: 360px; }
.search-input svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-input input { padding-left: 36px !important; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); }
.segmented button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button svg { width: 15px; height: 15px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .n { font-weight: 700; opacity: .7; }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .person { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.table .person strong { display: block; font-weight: 600; }
.table .person small { display: block; color: var(--muted); font-size: 12.5px; }
.next { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.next svg { width: 14px; height: 14px; color: var(--accent); }

/* Pipeline-Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.column { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-l); display: flex; flex-direction: column; min-height: 300px; scroll-snap-align: start; transition: background .15s, border-color .15s; }
.column.drop { background: var(--accent-soft); border-color: var(--accent); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; font-weight: 650; font-size: 14px; }
.column-head .n { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }
.column-body { display: grid; gap: 8px; padding: 0 10px 12px; align-content: start; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: grab; box-shadow: var(--shadow-1); transition: box-shadow .15s, transform .15s; }
.deal:hover { box-shadow: var(--shadow-2); }
.deal.dragging { opacity: .5; transform: rotate(1.5deg); }
.deal strong { display: block; font-size: 14px; }
.deal small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.deal .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }

/* Pipeline-Leiste im Dashboard */
.funnel { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin: 4px 18px 0; }
.funnel span { height: 100%; transition: width .4s var(--ease); }
.funnel-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 14px 18px 18px; }
.funnel-legend a { text-decoration: none; color: inherit; padding: 8px 10px; border-radius: 10px; }
.funnel-legend a:hover { background: var(--surface-2); }
.funnel-legend .v { font: 700 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.funnel-legend .l { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.funnel-legend .l i { width: 8px; height: 8px; border-radius: 50%; }

/* Agenda */
.agenda-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.agenda-item:first-child { border-top: 0; }
.agenda-time { font: 650 14px/1.2 var(--font); font-variant-numeric: tabular-nums; }
.agenda-time small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.agenda-bar { border-left: 3px solid var(--accent); padding-left: 12px; min-width: 0; }
.agenda-bar strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-bar small { color: var(--muted); }
.day-label { padding: 14px 18px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 1px solid var(--line); }
.day-label:first-child { border-top: 0; }

/* Zeitachse */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 8px 0; }
.timeline .tl-icon { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.timeline .tl-icon svg { width: 16px; height: 16px; }
.timeline .tl-body { min-width: 0; padding-top: 6px; }
.timeline .tl-body strong { font-size: 14px; font-weight: 600; }
.timeline .tl-body time { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.timeline .tl-body p { margin-top: 4px; color: var(--text-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .tl-body dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 6px 0 0; font-size: 13px; }
.timeline .tl-body dt { color: var(--muted); }
.timeline .tl-body dd { margin: 0; color: var(--text-2); }

/* Detail-Panel */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(9, 14, 22, .32); z-index: 40; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 41; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide .28s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-head p { color: var(--muted); font-size: 13.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.drawer-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.drawer-tabs button { border: 0; background: none; height: 42px; padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.drawer-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.next-action { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 18px; }
.next-action svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.next-action strong { font-size: 14px; }
.next-action span { color: var(--muted); font-size: 13px; display: block; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.stage-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.stage-picker button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.stage-picker button[aria-pressed="true"] { border-color: transparent; color: #fff; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-bottom: 18px; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.tag button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }

/* Dialoge */
dialog.modal { padding: 0; border: 1px solid var(--line); border-radius: var(--radius-l); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(9, 14, 22, .42); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 10px 20px 20px; overflow-y: auto; max-height: calc(100vh - 160px); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-l) var(--radius-l); flex-wrap: wrap; }
.mail-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mail-preview header { padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 13px; display: grid; gap: 3px; }
.mail-preview header b { color: var(--muted); font-weight: 600; display: inline-block; min-width: 56px; }
.mail-preview pre { margin: 0; padding: 14px; white-space: pre-wrap; font: 14px/1.6 var(--font); max-height: 320px; overflow: auto; }

/* Befehlspalette */
.palette { position: fixed; inset: 0; z-index: 60; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(9, 14, 22, .38); backdrop-filter: blur(3px); animation: fade .15s; }
.palette-box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; animation: pop .18s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 18px; height: 18px; color: var(--muted); }
.palette-input input { flex: 1; height: 56px; border: 0; background: transparent; font-size: 16px; outline: none; color: var(--text); }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; list-style: none; margin: 0; }
.palette-group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.palette-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.palette-item small { color: var(--muted); margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-item[aria-selected="true"] svg { color: var(--accent); }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* Einstellungen */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 76px; }
.settings-nav a { padding: 8px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-weight: 550; font-size: 14px; }
.settings-nav a:hover { background: var(--surface-3); }
.settings-nav a[aria-current="page"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--text); }
.panel-pad { padding: 20px; }
.panel-pad > h2 { font-size: 16px; margin-bottom: 4px; }
.panel-pad > p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.code { font: 13px/1.5 var(--mono); background: var(--surface-3); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre.block { font: 12.5px/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-family: var(--mono); font-size: 13px; }
.hours-grid { display: grid; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.hours-row .times { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hours-row input[type="time"] { width: 120px; min-height: 36px; }
.rule-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--surface-2); }
.rule-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rule-line { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
.rule-summary { font-size: 14px; color: var(--text-2); }
.rule-summary b { color: var(--text); }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .18s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* Mobile Navigation */
.tabbar { display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-3); animation: sheet-up .25s var(--ease); }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 2px auto 12px; }
.sheet .nav a { height: 48px; font-size: 15.5px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar .mobile-brand { display: flex; }
  .topbar .crumbs { display: none; }
  .page { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 25px; }
  .page-head { margin: 6px 0 18px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 10px; position: relative; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--accent); }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; display: grid; place-items: center; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .settings-nav a { white-space: nowrap; }
  .funnel-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100vw; border-left: 0; }
  .rule-line { grid-template-columns: 1fr; }
  .toast-region { bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; }
  .table .hide-m { display: none; }
  .list > li { padding: 12px 14px; }
  .hours-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 26px; }
  .kpi .spark { display: none; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 23px; }
  .list .actions .btn-label { display: none; }
}

/* Korrekturen nach visueller Prüfung */
#view:focus, #view:focus-visible { outline: none; box-shadow: none; }
.search-trigger { justify-content: flex-start; text-align: left; white-space: nowrap; overflow: hidden; }
.search-trigger span:not(.kbd) { overflow: hidden; text-overflow: ellipsis; }
.kpi .spark { top: auto; bottom: 16px; }
.grid-2, .grid-3 { align-items: start; }
.agenda-bar small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .palette-foot span:last-child { display: none; } .palette { padding-top: 8vh; } }
