/*
  Noya – Designsystem
  Flache Farbblöcke auf hellem Grau, Grotesk-Typo, große Ziffern mit kleiner Einheit, feine Rasterlinien.
  Jede Blockfarbe hat genau eine Bedeutung und wird überall gleich verwendet:
    --work      Arbeit / eingestempelt / Jetzt-Linie
    --pause     Pause
    --plan      geplante Schicht, Soll
    --vacation  Urlaub
    --sick      Krank
    --ink       Aktionen (Knöpfe), Text
  Text auf Blöcken ist immer dunkel (--on-block), wie bei bedrucktem Papier.
*/
/* Inter (SIL Open Font License, siehe fonts/Inter-OFL.txt), lokal ausgeliefert, variable Stärke 100–900 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Ruhige, warme Neutraltöne: weiße Arbeitsfläche, warm-hellgraue Seitenleiste, Karten mit feinem Rand. */
:root {
  --page: #ffffff;
  --sidebar: #f5f4ef;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #efede6;
  --line: #e6e3da;
  --text: #1f1e1d;
  --muted: #6f6d66;
  --ink: #1f1e1d;
  --on-ink: #ffffff;
  --on-block: #1f1e1d;
  --link: #2563b0;
  --warn-bg: #fcefd5;
  --warn-line: #e9b44c;
  --warn-text: #5e430e;

  --work: #d97757;
  --pause: #b2b7a2;
  /* Plan wird nie gefüllt, sondern als Umriss mit leichtem Farbhauch gezeigt: geplant = Linie, erledigt = Fläche. */
  --plan: #6a6e5d;
  --plan-tint: rgba(106, 110, 93, .08);
  --vacation: #eda7d8;
  --sick: #a65a50;
  --neutral-block: #f5f5f3;

  --pos: #4b5a1f;
  --neg: #b2341a;

  --radius: 8px;
  --radius-lg: 12px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #262624;
    --sidebar: #1f1e1d;
    --bg: #1f1e1d;
    --surface: #30302e;
    --surface-2: #3b3b38;
    --line: #44433f;
    --text: #f5f4ee;
    --muted: #a8a59c;
    --ink: #f5f4ee;
    --on-ink: #1f1e1d;
    --link: #86b5f5;
    --warn-bg: #3b2f17;
    --warn-line: #b8893a;
    --warn-text: #f3d9a6;
    --neutral-block: #3b3b38;
    --plan: #a9ae95;
    --plan-tint: rgba(169, 174, 149, .1);
    --pos: #c3cb93;
    --neg: #ff7f5c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* Platz für die Laufleiste immer freihalten: kurze und lange Seiten stehen exakt gleich. */
html { scrollbar-gutter: stable; }
body {
  background: var(--page);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; font-weight: 600; letter-spacing: -.01em; }
/* Seitentitel in Serifenschrift, alles andere in Inter. */
h1 { font-family: var(--serif); font-weight: 400; font-size: 1.85rem; letter-spacing: -.015em; }
h2 { font-size: 1rem; }
h3 { font-size: .92rem; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--work); outline-offset: 2px; }
[hidden] { display: none !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.boot { padding: 40px; color: var(--muted); text-align: center; }

/* ---------- Ziffern ---------- */
.fig {
  font-weight: 500; letter-spacing: -.045em; line-height: .92;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.unit {
  font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  vertical-align: top; margin-left: .3em; line-height: 1; opacity: .75;
  display: inline-block; transform: translateY(.25em);
}
.table .unit, .list .unit { font-size: .7em; transform: none; vertical-align: baseline; margin-left: .2em; }
.day-num { display: inline-flex; align-items: flex-start; gap: 4px; }
.day-num .fig { font-size: 1.35rem; }
.day-num .wd { font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.day-num.today .wd { color: var(--work); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .22s cubic-bezier(.2, .7, .2, 1); }
.sidebar {
  background: var(--sidebar); padding: 14px 12px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); overflow: hidden;
}
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
.side-scroll::-webkit-scrollbar, .subnav::-webkit-scrollbar { display: none; }
.subnav { scrollbar-width: none; overflow-y: auto; }
.side-bottom { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); margin-inline: -12px; padding: 10px 12px 0; }
.shell.collapsed .side-bottom { margin-inline: -10px; padding-inline: 10px; align-items: center; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 10px 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.brand img { width: 26px; height: 26px; flex: none; }
/* Schriftzug „noya“ als Maske: übernimmt die Textfarbe, in Hell und Dunkel. */
.brand-name { display: block; flex: none; width: 46px; height: 27px; background-color: currentColor;
  -webkit-mask: url("/wortmarke.svg") center / contain no-repeat; mask: url("/wortmarke.svg") center / contain no-repeat; }
.brand-company { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border: 0; background: none; border-radius: var(--radius); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.company-block, .search-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); color: var(--text); cursor: pointer; text-decoration: none;
}
.company-block:hover, .search-btn:hover { border-color: var(--muted); }
.company-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--work); flex: none; }
.company-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-btn { color: var(--muted); margin-bottom: 8px; }
.search-btn .label { flex: 1; }
kbd {
  font: 600 .7rem var(--font); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; background: var(--surface);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-group-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500;
  border: 0; background: none; cursor: pointer; text-align: left; font-size: .95rem;
}
.nav a .label, .nav-group-btn .label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a .icon, .nav-group-btn .icon { color: var(--muted); }
.nav a:hover, .nav-group-btn:hover { background: var(--surface-2); }
.nav a.active { background: var(--surface-2); font-weight: 600; }
.nav a.active .icon { color: var(--text); }
.nav-group-btn .chev { transition: transform .15s; }
.nav-group.closed .nav-group-btn .chev { transform: rotate(-90deg); }
.nav-group.closed .nav-sub { display: none; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding-left: 30px; }
.nav-sub a { padding-block: 7px; }
.nav-sep { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 10px 4px; font-weight: 600; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--work); color: #fff; font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.side-spacer { flex: 1; }
.side-notice {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text);
  border-radius: var(--radius-lg); padding: 10px 12px; font-size: .86rem; display: flex; gap: 8px; margin: 6px 0;
}
.side-notice a, .side-notice button { color: inherit; font-weight: 600; }
.side-notice button { border: 0; background: none; padding: 0; text-decoration: underline; cursor: pointer; font: inherit; font-weight: 600; }
.side-sep { border-top: 1px solid var(--line); margin: 6px 0; }
.account {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none;
  border-radius: var(--radius); cursor: pointer; text-align: left; color: var(--text); position: relative;
}
.account:hover { background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: var(--radius); flex: none; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .8rem;
}
.account-text { flex: 1; min-width: 0; line-height: 1.25; }
.account-text strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-text span { font-size: .8rem; color: var(--muted); }
.account-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12); padding: 6px; display: flex; flex-direction: column;
}
.account-menu a, .account-menu button {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); border: 0; background: none;
  color: var(--text); text-decoration: none; font: inherit; cursor: pointer; text-align: left;
}
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }

.account-wrap, .company-wrap { position: relative; }
.company-block .chev { color: var(--muted); }
.company-block.static { cursor: default; }
.company-block.static:hover { border-color: var(--line); }
.company-menu {
  position: fixed; z-index: 30; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.company-menu .menu-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 6px 10px 4px; }
.company-menu button, .company-menu a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); border: 0; background: none;
  color: var(--text); text-decoration: none; font: inherit; cursor: pointer; text-align: left;
}
.company-menu button:hover, .company-menu a:hover { background: var(--surface-2); }
.company-menu .current { font-weight: 600; }
.company-menu .label { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.company-menu .label small { color: var(--muted); font-weight: 400; font-size: .78rem; }
.company-menu .icon { color: var(--muted); }
.menu-sep { border-top: 1px solid var(--line); margin: 4px 0; }
.btn .icon { width: 16px; height: 16px; }

/* Mitarbeiterauswahl mit Suche */
.picker { position: relative; }
.picker-btn {
  display: inline-flex; align-items: center; gap: 8px; min-width: 210px; max-width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; text-align: left;
}
.picker-btn:hover { border-color: var(--muted); }
.picker-btn .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn .icon { color: var(--muted); }
.picker-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: max(100%, 280px); max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.picker-pop .palette-list { max-height: 360px; }
.picker-group-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 10px 4px; }
.picker-pop .palette-item { padding-block: 7px; }

/* Feste Bedienleiste in „Zeiten“: gleiche Reihenfolge, Breite und Höhe in jeder Ansicht */
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.viewbar .seg, .viewbar .picker-btn, .viewbar .month-nav, .viewbar .btn { height: 38px; min-height: 0; }
.viewbar .seg button { display: inline-flex; align-items: center; }
.viewbar .picker-btn { width: 15rem; min-width: 0; padding-block: 0; }
.viewbar .period { display: inline-flex; align-items: center; gap: 8px; }
.viewbar .month-nav .btn { height: 100%; }
.viewbar .month-nav .label { width: 13.5rem; min-width: 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewbar .period .btn:disabled { opacity: .4; cursor: default; background: var(--surface); }
.viewbar-actions { display: flex; gap: 8px; margin-left: auto; }
.picker-pop { animation: pop-in .14s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .shell, .btn, .seg button, .picker-btn, .tlx-tip { transition: none; }
  .picker-pop { animation: none; }
}

/* Abwesenheiten, Monat: je Mitarbeiter und Tag eine Kachel */
table.ac { width: 100%; min-width: 820px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.ac col.ac-name-col { width: 168px; }
.ac col.ac-sum-col { width: 76px; }
.ac th { padding: 0 1px 8px; text-align: center; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.ac th.name { text-align: left; font-size: .84rem; font-weight: 500; vertical-align: bottom; }
.ac th.ac-sum { font-size: .84rem; font-weight: 500; vertical-align: bottom; }
.ac th .d { display: block; font-size: .8rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ac th .wd { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }
.ac th.we .d { color: var(--muted); }
.ac th.today .d { color: var(--work); }
.ac th.today .wd { color: var(--work); }
.ac td { padding: 4px 1.5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ac tbody tr:last-child td { border-bottom: 0; }
.ac td.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 12px 4px 0; }
.ac td.today { background: color-mix(in srgb, var(--work) 7%, transparent); }
.ac .group-row td { padding: 14px 0 6px; }
.ac-tile {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 26px; padding: 0; border: 0; border-radius: 5px;
  background: var(--bg); color: var(--on-block); font: inherit; font-size: .66rem; font-weight: 700; line-height: 1; letter-spacing: .02em;
}
.ac-tile.planned { background: var(--plan-tint); box-shadow: inset 0 0 0 1.5px var(--plan); }
.ac-tile.work { background: var(--work); }
.ac-tile.work.open { background: repeating-linear-gradient(135deg, var(--work) 0 5px, color-mix(in srgb, var(--work) 78%, white) 5px 10px); }
button.ac-tile.work:hover { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--text); }
/* Gearbeitet an einem geplanten Tag: orange mit dunkelgrauem Plan-Rand */
.ac-tile.work.planned { box-shadow: inset 0 0 0 1.5px var(--plan); }
button.ac-tile.work.planned:hover { box-shadow: inset 0 0 0 1.5px var(--plan), 0 0 0 1.5px var(--surface), 0 0 0 3px var(--text); }
.ac-tile.vacation { background: var(--vacation); box-shadow: none; }
.ac-tile.sick { background: var(--sick); box-shadow: none; }
.ac-tile.vacation.off, .ac-tile.sick.off { opacity: .35; }
.ac-tile.pending { background: color-mix(in srgb, var(--vacation) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--vacation); color: color-mix(in srgb, var(--vacation) 55%, var(--text)); }
button.ac-tile { cursor: pointer; transition: box-shadow .12s ease, transform .12s ease, opacity .12s ease; }
button.ac-tile:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
button.ac-tile.vacation:hover, button.ac-tile.sick:hover { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--text); }
button.ac-tile:focus-visible { outline: 2px solid var(--work); outline-offset: 1px; }
.ac .ac-sum { text-align: right; white-space: nowrap; font-size: .74rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 8px; }
.ac td.ac-sum span + span { margin-left: 8px; }
.ac-sw-pending { background: color-mix(in srgb, var(--vacation) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--vacation); }

/* Schlichte Liste direkt auf der Seite (wie Tabellen in der Console): Titel mit Zähler, ruhige Zeilen */
.list-section { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.list-section-head { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.list-section-head h2 { font-size: 1.08rem; font-weight: 600; }
.list-section-head .count {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.list-section-head .meta { margin-left: auto; font-size: .82rem; color: var(--muted); }
.list-section .table-wrap { margin: 0; padding: 0; }
table.table-plain { font-size: .92rem; }
table.table-plain th {
  text-transform: none; letter-spacing: 0; font-size: .84rem; font-weight: 500; color: var(--muted);
  padding: 12px 12px 10px; border-bottom: 1px solid var(--line);
}
table.table-plain td { padding: 13px 12px; border-bottom: 1px solid var(--line); }
table.table-plain tbody tr:last-child td { border-bottom: 1px solid var(--line); }
table.table-plain tbody tr { transition: background-color .12s ease; }
table.table-plain tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.table-plain th:first-child, table.table-plain td:first-child { padding-left: 2px; }
table.table-plain .actions { width: 48px; text-align: right; padding-right: 2px; }
.person { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; white-space: nowrap; }
.avatar.sm { width: 26px; height: 26px; border-radius: 50%; font-size: .66rem; background: var(--surface-2); border: 0; color: var(--text); }
.kind { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.kind .swatch { width: 11px; height: 11px; border-radius: 3px; }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--plan); }
.status.st-approved { color: var(--text); }
.status.st-approved::before { background: var(--pause); }
.status.st-pending { color: var(--warn-text); padding: 2px 9px; border-radius: 11px; background: var(--warn-bg); font-size: .84rem; font-weight: 500; }
.status.st-pending::before { background: var(--warn-line); }
.status.st-rejected { color: var(--neg); }
.status.st-rejected::before { background: var(--neg); }
.status.st-running::before { background: var(--work); box-shadow: 0 0 0 3px color-mix(in srgb, var(--work) 22%, transparent); }
.status.st-break::before { background: var(--pause); }
.status.st-idle { color: var(--muted); }
.status.st-idle::before { background: var(--line); }
.list-section-actions { display: flex; gap: 8px; margin-left: auto; }
.list-section-head .meta + .list-section-actions { margin-left: 12px; }
h1.with-count { display: flex; align-items: center; gap: 12px; }
.card-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.card-head h2 .h2-meta { color: var(--muted); font-weight: 400; }
table.table .actions { width: 48px; text-align: right; }
table.table-plain th.num, table.table-plain td.num { padding-inline: 8px; }
table.table-plain td.tabular, .role { white-space: nowrap; }
table.table .actions.wide { width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 6px; vertical-align: middle; margin-right: 4px; }
.list-section .empty { text-align: left; padding: 14px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h1.with-count .count, .list-section-head .count {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--surface-2); color: var(--muted); font: 600 .76rem var(--font); letter-spacing: 0; font-variant-numeric: tabular-nums;
}
h1.with-count .count { height: 24px; min-width: 26px; font-size: .8rem; }
/* Gruppenzeilen (Abteilungen) in schlichten Tabellen */
table.table-plain tr.group-row td { padding: 18px 2px 6px; background: none; }
table.table-plain tbody tr.group-row:hover td { background: none; }

/* Protokoll */
.audit-seal { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.audit-seal svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.audit-seal strong { display: block; font-weight: 600; }
.audit-seal span { color: var(--muted); font-size: .88rem; }
.audit-seal.ok svg { color: var(--pos); }
.audit-seal.bad { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.audit-seal.bad span { color: inherit; }
.audit-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.audit-search { flex: 1 1 220px; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
.audit-search:focus { outline: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); outline-offset: 1px; }
table.audit-table td { vertical-align: top; padding-block: 10px; }
table.audit-table tr.audit-day td { padding: 20px 2px 6px; font-weight: 600; font-size: .86rem; color: var(--muted); background: none; border-bottom: 1px solid var(--line); }
table.audit-table tbody tr.audit-day:hover td { background: none; }
.audit-who { display: grid; gap: 3px; }
.audit-channel { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .78rem; padding-left: 34px; white-space: nowrap; }
.audit-channel.ki { color: var(--work); }
.audit-channel svg { width: 12px; height: 12px; }
.audit-area { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--surface-2); font-size: .78rem; white-space: nowrap; }
.audit-action { white-space: nowrap; font-weight: 500; }
.audit-detail { font-size: .86rem; line-height: 1.45; min-width: 260px; }
.audit-detail .was { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.audit-detail .arrow { color: var(--muted); }
.audit-reason { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.audit-more { display: flex; justify-content: center; margin-top: 14px; }
/* Schmal (Handy): jede Zeile als kleiner Block – Zeit links, rechts Wer, Bereich/Aktion und Details untereinander. */
@media (max-width: 760px) {
  .table-wrap.audit-wrap { margin: 0; padding: 0; overflow: visible; }
  table.audit-table, table.audit-table tbody { display: block; }
  table.audit-table thead { display: none; }
  table.audit-table tr.audit-day { display: block; }
  table.audit-table tr.audit-day td { display: block; padding: 18px 0 6px; }
  table.audit-table tr.audit-row { display: grid; grid-template-columns: 62px auto 1fr; grid-template-areas: "time who who" "time area act" "time det det";
    gap: 4px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.audit-table tr.audit-row td { display: block; padding: 0; border: 0; min-width: 0; }
  table.audit-table tr.audit-row:hover td { background: none; }
  table.audit-table td:nth-child(1) { grid-area: time; align-self: start; padding-top: 4px; }
  table.audit-table td:nth-child(2) { grid-area: who; }
  table.audit-table td:nth-child(3) { grid-area: area; }
  table.audit-table td:nth-child(4) { grid-area: act; }
  table.audit-table td:nth-child(5) { grid-area: det; min-width: 0; overflow-wrap: anywhere; }
  .audit-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .audit-channel { padding-left: 0; }
}
.audit-more .btn[hidden] { display: none; }
/* Kurze Kachel-Abschnitte (z. B. „Gerade anwesend“) */
.presence { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 6px 2px 2px; }
.presence .person { font-weight: 500; }
.presence .status { font-size: .84rem; color: var(--muted); }
.row-menu { display: inline-flex; }
.account-menu button.danger { color: var(--neg); }
.account-menu button.danger .icon { color: var(--neg); }

/* Gliederung nach Abteilungen in Tag, Woche und Monat */
.group-row td { padding: 14px 10px 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
.roster tr.group-row td { border-left: 0; padding: 14px 6px 6px; }
.group-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.group-title .count { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.tlx-group { padding: 14px 8px 6px; border-bottom: 1px solid var(--line); }
.inline-add { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; max-width: 520px; }
.inline-add .field { flex: 1; }

/* Schnellsuche */
dialog.palette { width: min(580px, calc(100vw - 32px)); margin: 12vh auto auto; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
input.palette-input { border: 0; padding: 0; min-height: 30px; font-size: 1rem; background: transparent; color: var(--text); }
input.palette-input:focus { outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; background: none; border-radius: var(--radius); text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.palette-item .icon { color: var(--muted); }
.palette-item.sel { background: var(--surface-2); }
.palette-item .label { flex: 1; }
.palette-item .hint { font-size: .8rem; color: var(--muted); }

/* Eingeklappte Seitenleiste: nur Symbole */
.shell.collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.shell.collapsed .sidebar { padding-inline: 10px; align-items: center; }
/* Nur in der Seitenleiste ausblenden – die Inhaltsseite behält ihre Beschriftungen. */
.shell.collapsed .sidebar :is(.brand-name, .label, .company-name, kbd, .chev, .side-notice, .account-text, .nav-sep),
.shell.collapsed .nav a .badge { display: none; }
.shell.collapsed .side-top { flex-direction: column; padding: 4px 0 8px; }
.shell.collapsed .company-block, .shell.collapsed .search-btn { width: 44px; justify-content: center; padding: 10px; }
.shell.collapsed .nav a, .shell.collapsed .nav-group-btn { justify-content: center; padding: 10px; }
.shell.collapsed .nav-sub { padding-left: 0; }
.shell.collapsed .nav-group.closed .nav-sub { display: flex; }
.shell.collapsed .nav-group-btn { display: none; }
.shell.collapsed .account { justify-content: center; }

.main { min-width: 0; padding-block: 36px 64px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 4px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar select { width: auto; min-width: 180px; max-width: 100%; }
.topbar { display: none; }

/* Zweite Leiste (z. B. Einstellungen): sitzt direkt neben der Hauptnavigation, Inhalt rechts daneben. */
.main.main-split { padding: 0; }
.page.page-split { max-width: none; margin: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 0; min-height: 100vh; align-items: start; }
.subnav {
  position: sticky; top: 0; height: 100vh; padding: 22px 12px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; background: var(--page);
}
.subnav-title { font-family: var(--serif); font-size: 1.15rem; color: var(--text); padding: 6px 10px 14px; }
.subnav a { padding: 8px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500; }
.subnav a:hover { background: var(--surface-2); }
.subnav a.active { background: var(--surface-2); font-weight: 600; }
.split-content {
  min-width: 0; max-width: 920px; display: flex; flex-direction: column; gap: 16px;
  padding-block: 30px 64px; padding-left: 32px; padding-right: max(32px, env(safe-area-inset-right, 0px));
}
.split-content.wide { max-width: 1280px; }
.subnav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 16px 10px 4px; }
.subnav .subnav-link.disabled { padding: 8px 10px; color: var(--muted); opacity: .55; cursor: not-allowed; font-weight: 500; }

/* Personalakte: Kopf in der zweiten Leiste */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 6px 10px; text-align: center; }
.profile-head .back-link { align-self: flex-start; font-size: .84rem; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.profile-head .back-link:hover { color: var(--text); }
.avatar.lg { width: 84px; height: 84px; border-radius: 50%; font-size: 1.5rem; font-weight: 600; background: var(--surface-2); border: 0; }
.avatar.marked { color: var(--on-block); border: 0; }
.profile-name { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
.profile-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; align-items: center; }
.badge-soft { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

/* Waagerechtes Formular: Abschnitt mit Symbol und Linie, Beschriftung links, Feld rechts */
.hform { display: flex; flex-direction: column; gap: 26px; }
.hform-section { display: flex; flex-direction: column; gap: 12px; }
.hform-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.hform-title .icon { color: var(--muted); }
.hrow { display: grid; grid-template-columns: 190px minmax(0, 520px); gap: 6px 22px; align-items: start; }
.hrow-control > .picker, .hrow-control > input, .hrow-control > .form-picker { max-width: 440px; }
.hrow-label { font-weight: 500; font-size: .92rem; padding-top: 10px; color: var(--text); }
.hrow-control { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hrow-control > .hint { font-size: .78rem; color: var(--muted); }
.hrow-control > span:not(.hint) { padding-top: 9px; }
.hform-section textarea { max-width: 652px; }
.hform-actions { display: flex; gap: 8px; justify-content: flex-start; padding-left: 212px; }
.hform-actions.flush { padding-left: 0; margin-top: 14px; }
table.table-plain td > strong:first-child, table.table-plain td .check strong { white-space: nowrap; }
@media (max-width: 720px) {
  .hrow { grid-template-columns: minmax(0, 1fr); }
  .hrow-label { padding-top: 0; }
  .hform-actions { padding-left: 0; }
}
.seg-input .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-input .seg button { white-space: nowrap; }
.color-pick { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 4px; }
.swatch-btn { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .12s ease, box-shadow .12s ease; }
.swatch-btn:hover { transform: scale(1.08); }
.swatch-btn.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch-btn.none { background: var(--surface) linear-gradient(135deg, transparent 46%, var(--muted) 47%, var(--muted) 53%, transparent 54%); box-shadow: inset 0 0 0 1px var(--line); }
.swatch-btn.none.active { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

/* Hinweisbox (Warnungen in Lohnstammdaten, abgeschlossener Monat) */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: .9rem; }
.notice > div { display: flex; flex-direction: column; gap: 4px; }
.notice a { color: inherit; font-weight: 600; }
.notice.soft { background: var(--surface-2); border-color: var(--line); color: var(--text); }

/* Lohn: Prüfung, Übersicht, Tagesdetail */
.check-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.check-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.check-ok { padding: 12px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.check.ack { margin-top: 10px; font-size: .88rem; }
table.payroll td.num.unmapped { color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
table.payroll tr.open td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.payroll tr.total-row td { border-top: 1px solid var(--text); background: none; }
table.payroll tbody tr.detail-row:hover td, table.payroll tr.detail-row td { background: var(--bg); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 24px; padding: 6px 4px 10px; }
.detail-title { font-weight: 600; font-size: .84rem; color: var(--muted); margin-bottom: 6px; }
table.table-plain.mini { font-size: .82rem; }
table.table-plain.mini td, table.table-plain.mini th { padding: 6px 8px; }
.item-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.item-list .item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: .88rem; }
.neg-text { color: var(--neg); font-weight: 600; }
.neg-soft { color: var(--neg); }
.rule-pick { display: flex; flex-direction: column; gap: 8px; }
.rule-pick .radio-card > span { gap: 4px; }
.person .rule-tag { font-weight: 400; margin-left: 2px; }
.cell-input { width: 96px; min-height: 34px; padding: 5px 8px; }
.cell-input.sm { width: 64px; }
.cell-select { width: auto; min-height: 34px; padding-block: 5px; }
.inline-unit { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.checklist { display: flex; flex-direction: column; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row:last-child { border-bottom: 0; }
.check-row input { accent-color: var(--work); width: 17px; height: 17px; margin-top: 2px; }
.check-row.done span { color: var(--muted); text-decoration: line-through; }

@media (max-width: 900px) {
  .page.page-split { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .profile-head { display: none; }
  .subnav-group { display: none; }
  .subnav {
    position: static; height: auto; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding-block: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .subnav-title { display: none; }
  .subnav a { white-space: nowrap; padding: 6px 10px; }
  .split-content { padding-block: 18px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* Demo-Hinweis: am Desktop in der Seitenleiste, am Handy oben auf der Seite. */
.demo-banner {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: var(--radius-lg); padding: 10px 14px;
  display: none; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: .88rem;
}

@media (max-width: 900px) {
  .demo-banner { display: flex; }
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar {
    display: block; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    background: var(--sidebar); border-bottom: 1px solid var(--line);
  }
  .topbar .nav a.active { background: var(--surface); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--sidebar); }
  .topbar-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .topbar .nav {
    flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none;
    padding-block: 0 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .topbar .nav a { white-space: nowrap; padding: 6px 10px; }
  .main { padding-block: 18px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  h1 { font-size: 1.5rem; }
}

/* ---------- Flächen ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Kennzahl-Kacheln */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px; min-height: 118px; color: var(--text);
}
.stat .label { font-size: .92rem; font-weight: 400; color: var(--muted); }
.stat .value { margin-top: auto; }
.stat .value .fig, .stat .value > span { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.stat .hint { font-size: .76rem; color: var(--muted); line-height: 1.3; }
/* Kacheln bleiben neutral; die Bedeutung zeigt ein kleines Farbquadrat vor dem Titel. */
.stat[class*="tone-"] .label::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px;
}
.stat.tone-work .label::before { background: var(--work); }
.stat.tone-pause .label::before { background: var(--pause); }
.stat.tone-vacation .label::before { background: var(--vacation); }
.stat.tone-plan .label::before { background: var(--plan-tint); box-shadow: inset 0 0 0 1.5px var(--plan); }

/* Legende */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-work { background: var(--work); } .sw-pause { background: var(--pause); }
.sw-plan { background: var(--plan-tint); box-shadow: inset 0 0 0 1.5px var(--plan); }
.sw-vacation { background: var(--vacation); } .sw-sick { background: var(--sick); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius); font-weight: 500; cursor: pointer;
  text-decoration: none; line-height: 1.25; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn, .seg button, .picker-btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink); opacity: .86; }
.btn-danger { color: var(--neg); }
.btn-ok { color: var(--pos); }
.btn-ghost { border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: .84rem; }
.btn-lg { padding: 16px 22px; font-size: 1.05rem; }
.btn-link { border: 0; background: none; color: var(--link); padding: 0; cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
/* Stempel-Aktionen: Farbe = Bedeutung */
.btn-in { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-out { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-in:hover, .btn-out:hover { background: var(--ink); opacity: .86; }
.btn-on-block { background: rgba(17, 17, 16, .9); border-color: transparent; color: #f5f5f3; }
.btn-on-block:hover { background: #111110; }
.btn-on-block.secondary { background: transparent; border-color: rgba(17, 17, 16, .35); color: #111110; }
.btn-on-block.secondary:hover { background: rgba(17, 17, 16, .08); }

/* ---------- Chips ---------- */
/* Chips wie Schlagworte: hell hinterlegt, ohne harte Kanten. */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px;
  font-size: .78rem; font-weight: 500; white-space: nowrap; border: 1px solid transparent; background: var(--surface-2); color: var(--text);
}
.chip-work { background: var(--work); border-color: var(--work); color: var(--on-block); }
.chip-pause { background: var(--pause); border-color: var(--pause); color: var(--on-block); }
.chip-plan { background: var(--plan-tint); border-color: var(--plan); color: var(--text); }
.chip-vacation { background: var(--vacation); border-color: var(--vacation); color: var(--on-block); }
.chip-sick { background: var(--sick); border-color: var(--sick); color: var(--on-block); }
.chip-ok { background: var(--surface-2); }
.chip-pending { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.chip-alert { background: transparent; color: var(--neg); border-color: var(--neg); }
.chip-ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip-neutral { color: var(--muted); }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 600; }
.field .hint { font-size: .76rem; color: var(--muted); font-weight: 400; }
/* Eingabefelder im selben Stil wie die Auswahlfelder: gleiche Höhe, Linie, Rundung und Hover */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; min-height: 40px;
  transition: border-color .15s ease;
}
:is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea):not(.palette-input):hover { border-color: var(--muted); }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6d66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
}
@media (prefers-color-scheme: dark) {
  select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a59c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[type=date], input[type=time] { font-variant-numeric: tabular-nums; }
input::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; transition: opacity .15s ease; }
input::-webkit-calendar-picker-indicator:hover { opacity: .8; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .picker-btn:focus-visible { outline: 2px solid var(--work); outline-offset: -1px; border-color: transparent; }
/* Auswahlfeld im Formular füllt die Spalte */
.form-picker .picker, .form-picker .picker-btn { width: 100%; min-width: 0; }
.form-picker .picker-btn .swatch { flex: none; }
.picker-pop.no-search .palette-search { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; opacity: 0; }
.picker-pop .palette-item .swatch { flex: none; margin-inline: 2px; }
.sw-other { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.inline-add.wide { max-width: none; margin-top: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--ink); }
.radio-card input { accent-color: var(--ink); margin-top: 3px; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.check input { accent-color: var(--work); width: 16px; height: 16px; }
.days-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.days-pick label {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: .86rem;
}
.days-pick input { position: absolute; opacity: 0; pointer-events: none; }
.days-pick label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.days-pick label:has(input:focus-visible) { outline: 2px solid var(--work); }
.form-error { color: var(--neg); border-left: 4px solid var(--neg); padding: 6px 12px; font-size: .9rem; background: transparent; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-size: .84rem; color: var(--muted);
  font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.off td { color: var(--muted); }
.table tr.today td { box-shadow: inset 0 -2px 0 var(--work); }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.entry-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.entry-line + .entry-line { margin-top: 4px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* Tagesbalken (0–24 Uhr) in der Monatsliste */
.daybar { position: relative; height: 14px; min-width: 160px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.daybar::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, transparent calc(25% - 1px), var(--line) 25%, transparent calc(25% + 1px),
    transparent calc(50% - 1px), var(--line) 50%, transparent calc(50% + 1px),
    transparent calc(75% - 1px), var(--line) 75%, transparent calc(75% + 1px));
}
.daybar i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.daybar .seg-work { background: var(--work); }
.daybar .seg-vacation { background: var(--vacation); left: 0; right: 0; }
.daybar .seg-sick { background: var(--sick); left: 0; right: 0; }
.daybar .seg-other { background: var(--surface-2); left: 0; right: 0; }
.daybar-scale { display: flex; justify-content: space-between; font-size: .64rem; color: var(--muted); min-width: 160px; }
.daybar .seg-pause { background: var(--pause); z-index: 1; }
.daybar.mini { height: 8px; min-width: 84px; border-radius: 2px; }

/* Umschalter Tag / Woche / Monat */
.seg { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 4px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--ink); color: var(--on-ink); }

/* Tagesansicht: Zeitachse waagerecht, je Mitarbeiter eine Zeile */
.tlx { min-width: 760px; }
.tlx-row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) 64px; column-gap: 14px; row-gap: 4px; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 4px;
}
.tlx-row:last-child { border-bottom: 0; }
.tlx-row.tlx-head { padding-block: 0 6px; border-bottom-color: var(--line); border-radius: 0; }
.tlx-row.focus { background: var(--bg); box-shadow: inset 3px 0 0 var(--work); }
.tlx-name { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlx-name:hover { text-decoration: underline; }
.tlx-axis { position: relative; height: 16px; }
.tlx-axis span { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tlx-axis span:first-child { transform: none; }
.tlx-axis span:last-child { transform: translateX(-100%); }
.tlx-track {
  position: relative; height: 28px; border-radius: 4px; background-color: var(--bg);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
}
.tlx-plan { position: absolute; top: 0; bottom: 0; border: 1.5px solid var(--plan); background: var(--plan-tint); border-radius: 4px; }
.tlx-work { position: absolute; top: 6px; bottom: 6px; background: var(--work); border-radius: 3px; cursor: default; }
.tlx-work:hover { z-index: 3; }

/* Uhrzeiten beim Überfahren eines Balkens: klein, dunkel, direkt an der Kante */
.tlx-tip {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; pointer-events: none;
  padding: 2px 6px; border-radius: 4px; background: var(--ink); color: var(--on-ink);
  font-size: .7rem; font-weight: 600; font-style: normal; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transition: opacity .12s ease;
}
.tlx-work:hover .tlx-tip { opacity: 1; }
.tlx-tip.start { right: 100%; margin-right: 6px; }
.tlx-tip.end { left: 100%; margin-left: 6px; }
.tlx-tip.start.in { right: auto; left: 4px; margin: 0; }
.tlx-tip.end.in { left: auto; right: 4px; margin: 0; }
.tlx-tip.pause {
  top: auto; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.tlx-tip.pause::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pause); }
.tlx-work.open { background: repeating-linear-gradient(135deg, var(--work) 0 8px, color-mix(in srgb, var(--work) 80%, white) 8px 16px); }
.tlx-work.stale { background: none; border: 1.5px dashed var(--neg); }
.tlx-break { position: absolute; top: 0; bottom: 0; background: var(--pause); }
.tlx-abs { position: absolute; inset: 6px 0; border-radius: 3px; font-size: .74rem; font-weight: 600; padding: 0 8px; display: flex; align-items: center; color: var(--on-block); }
.tlx-abs.vacation { background: var(--vacation); }
.tlx-abs.sick { background: var(--sick); }
.tlx-abs.other { background: var(--surface-2); color: var(--text); }
.tlx-now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--work); z-index: 2; }
.tlx-total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tlx-info { grid-column: 2 / 4; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Wochenansicht */
.roster.week td.name { vertical-align: middle; }
.wk-cell { cursor: pointer; min-width: 96px; }
.wk-cell:hover, .wk-cell:focus-visible { background: var(--bg); }
.wk-cell.today { box-shadow: inset 0 -2px 0 var(--work); }
.wk-time { font-size: .74rem; color: var(--muted); margin-top: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wk-sum { font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wk-total { vertical-align: middle; }
.wk-scale { max-width: 260px; }
@media (max-width: 700px) { .col-bar { display: none; } }

/* Monatsnavigation */
.month-nav { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.month-nav .label { min-width: 150px; text-align: center; font-weight: 600; }
.month-nav .btn { border: 0; padding: 6px 10px; }

/* ---------- Stempeln ---------- */
.today-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.today-date { display: flex; align-items: flex-start; gap: 6px; }
.today-date .fig { font-size: clamp(4rem, 9vw, 6rem); }
.today-date .wd { color: var(--work); font-weight: 700; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; margin-top: .5em; }
.today-date .mo { color: var(--muted); font-size: .9rem; margin-top: .5em; }
.today-clock { text-align: right; }
.today-clock .fig { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.today-clock .muted { font-size: .84rem; }

.state-block {
  border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 18px;
  background: var(--neutral-block); color: var(--text); min-height: 230px;
}
.state-block.st-in { background: var(--work); color: var(--on-block); }
.state-block.st-break { background: var(--pause); color: var(--on-block); }
.state-block .st-title { font-weight: 700; font-size: 1rem; }
.state-block .st-sub { opacity: .7; font-weight: 500; }
.state-block .st-fig .fig { font-size: clamp(3.4rem, 8vw, 5rem); }
.state-block .st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.state-block .st-actions .btn { flex: 1 1 150px; padding: 15px 18px; font-size: 1.05rem; }
.state-block .st-note { margin-top: auto; font-weight: 600; border-top: 1px solid currentColor; padding-top: 12px; opacity: .8; }
.state-block .warn { font-weight: 600; border-left: 3px solid currentColor; padding-left: 10px; }

/* Tagesraster: Stunden links, Spalten Plan und Ist, rote Jetzt-Linie */
.tl { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); column-gap: 6px; }
.tl-head { display: contents; }
.tl-head span { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-bottom: 6px; }
.tl-body { position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); column-gap: 6px; }
.tl-hours { position: relative; }
.tl-hours span { position: absolute; left: 0; font-size: .7rem; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.tl-col { position: relative; }
.tl-grid { position: absolute; inset: 0 0 0 44px; pointer-events: none; }
.tl-grid i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tl-block {
  position: absolute; left: 0; right: 0; border-radius: 5px; padding: 6px 8px; overflow: hidden;
  color: var(--on-block); display: flex; flex-direction: column; justify-content: space-between;
  border: 2px solid var(--surface);
}
.tl-block .t { font-weight: 700; font-size: .78rem; line-height: 1.15; }
.tl-block .s { font-size: .74rem; opacity: .7; font-variant-numeric: tabular-nums; }
.tl-block .fig { font-size: 1.9rem; }
.tl-block.b-work { background: var(--work); }
.tl-block.b-plan { background: var(--plan-tint); border: 1.5px solid var(--plan); color: var(--text); }
.tl-block.b-plan .s { color: var(--muted); opacity: 1; }
.tl-block.b-vacation { background: var(--vacation); }
.tl-block.b-sick { background: var(--sick); }
.tl-block.b-open { background: repeating-linear-gradient(135deg, var(--work) 0 10px, color-mix(in srgb, var(--work) 82%, white) 10px 20px); }
.tl-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--work); z-index: 3; pointer-events: none; }
.tl-now span { position: absolute; left: 0; top: -9px; background: var(--work); color: var(--on-block); font-size: .66rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; }

.tiles-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.progress > div { height: 100%; background: var(--work); }

/* ---------- Dienstplan ---------- */
.roster { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; font-size: .86rem; }
.roster th, .roster td { border-bottom: 1px solid var(--line); padding: 6px; vertical-align: top; }
.roster td + td, .roster th + th { border-left: 1px solid var(--line); }
.roster th { text-align: left; font-weight: 600; background: var(--surface); border-bottom-color: var(--line); }
.roster th .hol { display: block; font-weight: 600; color: var(--muted); font-size: .7rem; margin-top: 2px; }
.roster td.name { font-weight: 600; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; vertical-align: middle; }
.roster tr.me td.name::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--work); margin-right: 6px; vertical-align: middle; }
.roster td.cell { min-width: 108px; height: 62px; }
.roster td.cell.can-edit { cursor: pointer; }
.roster td.cell.can-edit:hover { background: var(--bg); }
.shift {
  display: block; width: 100%; text-align: left; cursor: default;
  background: var(--plan-tint); border: 1px solid var(--plan); color: var(--text); border-radius: 4px; padding: 4px 7px;
  font-weight: 600; font-variant-numeric: tabular-nums; font-size: .8rem;
}
.shift + .shift { margin-top: 3px; }
.shift small { display: block; font-weight: 500; color: var(--muted); }
.can-edit .shift { cursor: pointer; }
.can-edit .shift:hover { border-color: var(--ink); }
.roster .abs { display: block; margin-top: 3px; border-radius: 4px; padding: 4px 7px; font-size: .8rem; }

/* ---------- Dialog ---------- */
dialog {
  border: 0; border-radius: 8px; padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(17, 17, 16, .5); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 80px); overflow-y: auto; }
.dialog-body h2 { font-size: 1.3rem; letter-spacing: -.02em; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dialog-actions .spacer { flex: 1; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: var(--radius);
  max-width: 360px; font-size: .9rem; font-weight: 500; animation: toast-in .18s ease-out;
}
.toast.error { background: var(--neg); color: #fff; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }
body.has-ai .toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* ---------- KI-Assistent: Knopf unten rechts, öffnet sich beim Überfahren ---------- */
.ai-widget { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ai-fab {
  width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .12);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ai-fab .icon { width: 22px; height: 22px; }
.ai-fab:hover, .ai-widget.open .ai-fab { transform: scale(1.06); box-shadow: 0 12px 30px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .12); }
.ai-fab:focus-visible { outline: 2px solid var(--work); outline-offset: 3px; }
.ai-panel {
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .06);
  overflow: hidden; transform-origin: bottom right; transform: translateY(10px) scale(.96); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .2s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .2s;
}
.ai-widget.open .ai-panel { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .18s ease, transform .2s cubic-bezier(.2, .7, .2, 1), visibility 0s; }
.ai-panel.drop { box-shadow: 0 0 0 2px var(--work), 0 24px 60px rgba(0, 0, 0, .18); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.ai-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-title > div { display: flex; flex-direction: column; line-height: 1.25; }
.ai-title strong { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; }
.ai-title span:not(.ai-mark) { font-size: .74rem; color: var(--muted); }
.ai-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--work) 16%, transparent); color: var(--work); flex: none; }
.ai-mark .icon { width: 17px; height: 17px; }
.ai-head-actions { display: flex; gap: 2px; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; font-size: .92rem; }
.ai-empty { margin: auto 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 2px; }
.ai-hello { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .84rem; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.ai-chip:hover { background: var(--surface-2); border-color: var(--muted); }
.ai-msg { max-width: 100%; line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg p { margin: 0 0 6px; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul, .ai-msg ol { margin: 4px 0 6px; padding-left: 20px; }
.ai-msg li + li { margin-top: 2px; }
.ai-msg code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.ai-msg .ai-h { font-weight: 600; }
.ai-msg.user { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 86%; }
.ai-msg.user .bubble { background: var(--surface-2); padding: 8px 12px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.ai-msg-files { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ai-msg.bot { align-self: stretch; }
.ai-msg.error { display: flex; gap: 8px; color: var(--neg); font-size: .86rem; align-items: flex-start; }
.ai-table-wrap { overflow-x: auto; margin: 4px 0 8px; }
.ai-table { border-collapse: collapse; font-size: .84rem; width: 100%; }
.ai-table th, .ai-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ai-table th { color: var(--muted); font-weight: 500; }
.ai-activity { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.ai-activity .dots { display: inline-flex; gap: 3px; }
.ai-activity .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--work); animation: ai-dot 1.1s infinite ease-in-out; }
.ai-activity .dots i:nth-child(2) { animation-delay: .15s; }
.ai-activity .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.ai-actions { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--page); }
.ai-actions-head { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ai-actions-head .icon { width: 15px; height: 15px; }
.ai-action { display: flex; flex-direction: column; gap: 4px; }
.ai-action + .ai-action { border-top: 1px solid var(--line); padding-top: 10px; }
.ai-action-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-action-title input { accent-color: var(--work); }
.ai-action-title .status { margin-left: auto; font-size: .8rem; }
.ai-action ul { margin: 0; padding-left: 18px; font-size: .84rem; color: var(--text); }
.ai-action li { margin-top: 2px; }
.ai-action.st-declined, .ai-action.st-skipped { opacity: .6; }
.ai-err { color: var(--neg); }
.ai-actions-buttons { display: flex; justify-content: flex-end; gap: 6px; }
.ai-warn { display: flex; gap: 7px; align-items: flex-start; margin-top: 7px; padding: 7px 9px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); line-height: 1.4; }
.ai-warn svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.ai-sure { display: grid; gap: 8px; }
.ai-sure-check { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; line-height: 1.4; cursor: pointer; }
.ai-sure-check input { margin-top: 2px; flex: none; }
.ai-sure .btn:disabled { opacity: .4; cursor: not-allowed; }
.ai-input { border-top: 1px solid var(--line); padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 8px; }
.ai-input-row { display: flex; align-items: flex-end; gap: 6px; }
textarea.ai-text { flex: 1; min-height: 40px; max-height: 160px; resize: none; padding: 9px 12px; border-radius: 12px; line-height: 1.4; }
.ai-send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: opacity .15s ease; }
.ai-send:disabled { opacity: .35; cursor: default; }
.ai-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 8px; border-radius: 8px; background: var(--surface-2); font-size: .8rem; }
.ai-file .icon { width: 14px; height: 14px; color: var(--muted); }
.ai-file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ai-file .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 2px; }
.ai-foot { display: flex; justify-content: space-between; gap: 10px; padding: 0 14px 10px; font-size: .7rem; color: var(--muted); }
.ai-foot .usage { white-space: nowrap; }
/* Verlauf im Assistenten */
.ai-panel.history .ai-history-btn { background: var(--surface-2); color: var(--text); }
.ai-panel.history .ai-input { display: none; }
.ai-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-hist-head strong { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; }
.ai-hist { display: flex; flex-direction: column; }
.ai-hist-group { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 4px 4px; }
.ai-hist-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.ai-hist-item:hover, .ai-hist-item.current { background: var(--surface-2); }
.ai-hist-open { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ai-hist-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-hist-meta { flex: none; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-hist-item .row-menu { opacity: 0; transition: opacity .12s ease; }
.ai-hist-item:hover .row-menu, .ai-hist-item:focus-within .row-menu { opacity: 1; }
.ai-hist-empty { padding: 20px 4px; }
.ai-hist-note { margin-top: auto; padding-top: 14px; }

/* Spracheingabe */
.ai-mic.off { opacity: .45; }
.ai-mic.recording { background: var(--neg); color: #fff; animation: ai-pulse 1.4s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--neg) 40%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.ai-rec { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--page); border: 1px solid var(--line); font-size: .84rem; }
.ai-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neg); animation: ai-dot 1.1s infinite; flex: none; }
.ai-rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.ai-rec-bars { display: inline-flex; align-items: center; gap: 2px; height: 18px; }
.ai-rec-bars i { width: 3px; height: 18px; border-radius: 2px; background: var(--work); transform: scaleY(.15); transition: transform .12s ease; }
.ai-rec-hint { flex: 1; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-rec .dots { display: inline-flex; gap: 3px; }
.ai-rec .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--work); animation: ai-dot 1.1s infinite ease-in-out; }
.ai-rec .dots i:nth-child(2) { animation-delay: .15s; }
.ai-rec .dots i:nth-child(3) { animation-delay: .3s; }

@media (max-width: 560px) {
  .ai-widget { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ai-panel { width: calc(100vw - 24px); height: calc(100vh - 96px); }
}
@media (prefers-reduced-motion: reduce) { .ai-panel, .ai-fab { transition: none; } .ai-activity .dots i { animation: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- Terminal ---------- */
.term {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center;
  max-width: 1150px; margin: 0 auto;
  padding-block: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
}
.term-left { display: flex; flex-direction: column; gap: 6px; }
.term-name { font-weight: 700; }
.term-left > .fig { font-size: clamp(5rem, 14vw, 9rem); }
.term-date { font-size: 1.15rem; color: var(--muted); }
.term-hint { color: var(--muted); max-width: 36ch; margin-top: 10px; }
.term-panel { background: var(--surface); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.pin-title { font-weight: 600; }
.pin-dots { display: flex; justify-content: center; gap: 12px; min-height: 20px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 3px; border: 2px solid var(--text); }
.pin-dots span.on { background: var(--text); }
.pin-msg { text-align: center; min-height: 1.4em; color: var(--neg); font-weight: 600; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pin-pad button {
  height: 76px; border-radius: 6px; border: 0; background: var(--bg); cursor: pointer;
  font-size: 2rem; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.pin-pad button:hover { background: var(--surface-2); }
.pin-pad button:active { transform: scale(.98); }
.pin-pad .ok { background: var(--ink); color: var(--on-ink); font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }
.pin-pad .ok:hover { background: var(--ink); opacity: .86; }
.pin-pad .del { font-size: 1.3rem; color: var(--muted); }
@media (max-width: 760px) {
  .term { grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
  .term-left > .fig { font-size: 4.5rem; }
  .pin-pad button { height: 64px; }
}
.term-bar {
  background: var(--ink); color: var(--on-ink); border-radius: var(--radius); padding: 10px 14px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem;
}
.term-bar-right { display: inline-flex; align-items: center; gap: 12px; opacity: .9; }
.btn-on-ink { border-color: var(--on-ink); color: var(--on-ink); }
.btn-on-ink:hover { background: var(--on-ink); color: var(--ink); }
.setup-name {
  background: var(--work); color: var(--on-block); border-radius: var(--radius); padding: 18px;
  font-size: 1.6rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; word-break: break-word;
}
.code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 600; font-size: 1.2rem; text-align: center; }
.code-box { background: var(--bg); color: var(--text); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.code-fig { font-size: 2.6rem; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; line-height: 1; }
.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.pw { min-width: 9ch; display: inline-block; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-side { padding: 44px max(32px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--line); }
.auth-pitch h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 400; letter-spacing: -.02em; max-width: 16ch; line-height: 1.08; }
.auth-pitch p { margin-top: 14px; max-width: 46ch; color: var(--muted); font-size: 1rem; }
.auth-demo-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 54px; gap: 6px; max-width: 520px; }
.auth-demo-board div { border-radius: 5px; padding: 8px 10px; color: var(--on-block); display: flex; flex-direction: column; justify-content: space-between; }
.auth-demo-board .t { font-weight: 700; font-size: .78rem; }
.auth-demo-board .fig { font-size: 1.9rem; }
.auth-demo-caption { font-size: .76rem; color: var(--muted); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.tabs { display: flex; gap: 2px; border: 1px solid var(--line); padding: 2px; border-radius: var(--radius); }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 4px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--ink); color: var(--on-ink); }
.demo-box { border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-left: 6px solid var(--vacation); }
.demo-box .row { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-box .row .btn { flex: 1; }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.auth-links a { color: var(--muted); }
.auth-standalone { min-height: 100vh; }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 16px; padding-top: calc(28px + env(safe-area-inset-top, 0px)); border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-demo-board { display: none; }
}
