/* ============================================================================
   Yannik OS — base component vocabulary (.os-*)
   ----------------------------------------------------------------------------
   THE single component source of the „Night Desk" identity, driven entirely by
   the --os-* tokens in tokens.css. Rules stay at single-class specificity and
   use NO !important. The six legacy vocabularies (legacy, finance-, cp-,
   life-, simple-, invest-) migrate here area by area and are then deleted.
   Font sizes come from the --os-text-* scale ONLY. See docs/design.md.
   ============================================================================ */

/* ── Grundlage ──────────────────────────────────────────────────────────────
   Reset und Scrollbar lagen bis zum Night-Desk-Durchzug in legacy.css. Sie
   gehoeren zur gemeinsamen Basis, nicht zu einem Bereich. */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-size: var(--os-text-md); line-height: 1.5; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--os-line-strong); }

/* ── Icons (sprite <use>) — one line-icon style across the whole UI ───────── */
.os-btn :where(svg),
.os-icon-btn :where(svg),
.os-empty-icon :where(svg),
:where(.os-page-actions) .os-ic,
.os-ic {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Type roles ───────────────────────────────────────────────────────────── */
.os-display { font-family: var(--os-font-display); font-weight: 600; letter-spacing: -.035em; }
.os-mono    { font-family: var(--os-font-mono); }
.os-kicker  {
  font: 600 var(--os-text-xs)/1.3 var(--os-font-mono);
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--os-text-dim);
}

/* ── Page header (identical on every page: kicker / title / statusline / actions) */
.os-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-s6);
  flex-wrap: wrap;
  margin-bottom: var(--os-s6);
}
.os-page-header-copy { min-width: 0; }
.os-page-eyebrow {
  font: 600 var(--os-text-xs)/1.3 var(--os-font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--os-cat, var(--os-signal));
  margin-bottom: var(--os-s2);
}
.os-page-title {
  margin: 0;
  color: var(--os-text);
  font: 600 var(--os-text-2xl)/1.05 var(--os-font-display);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.os-page-title--display { font-size: var(--os-text-display); }
.os-page-sub {
  margin-top: var(--os-s2);
  color: var(--os-text-dim);
  font-size: var(--os-text-base);
  line-height: 1.55;
  max-width: 68ch;
}
.os-page-actions {
  display: flex;
  gap: var(--os-s2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Statusline (signature) — one-line mono state summary under the title ─── */
.os-statusline {
  display: flex;
  align-items: center;
  gap: var(--os-s3);
  flex-wrap: wrap;
  margin-top: var(--os-s3);
  font: 500 var(--os-text-xs)/1.5 var(--os-font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--os-text-muted);
}
:where(.os-statusline)::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--os-signal);
  box-shadow: 0 0 8px rgba(217, 164, 65, .55);
}
.os-statusline :where(strong),
.os-statusline :where(b) { color: var(--os-text-dim); font-weight: 600; }

/* ── Dayband (signature, Übersicht only) — 24h instrument band ────────────── */
.os-dayband { position: relative; }
.os-dayband-track {
  position: relative;
  height: 34px;
  margin: var(--os-s6) 0 var(--os-s6);
  border-top: 1px solid var(--os-line-strong);
}
.os-dayband-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 6px;
  background: var(--os-line-strong);
}
.os-dayband-hour {
  position: absolute;
  top: 9px;
  transform: translateX(-50%);
  font: 500 var(--os-text-xs)/1 var(--os-font-mono);
  color: var(--os-text-muted);
  white-space: nowrap;
}
.os-dayband-event {
  position: absolute;
  top: -4px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--os-text-dim);
  transform: translateX(-50%) rotate(45deg);
}
.os-dayband-event--task { background: var(--os-amber); border-radius: 50%; transform: translateX(-50%); }
.os-dayband-now {
  position: absolute;
  top: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--os-signal);
  box-shadow: 0 0 10px rgba(217, 164, 65, .6);
  transform: translateX(-50%);
}
.os-dayband-now-label {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font: 600 var(--os-text-xs)/1 var(--os-font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--os-signal);
  white-space: nowrap;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.os-toolbar {
  display: flex;
  gap: var(--os-s2);
  align-items: center;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--os-s2);
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--os-r-md);
  border: 1px solid transparent;
  background: rgba(243, 240, 232, .07);
  color: var(--os-text);
  font: 650 var(--os-text-sm)/1 var(--os-font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--os-t-fast) var(--os-ease),
              border-color var(--os-t-fast) var(--os-ease),
              color var(--os-t-fast) var(--os-ease),
              transform var(--os-t-fast) var(--os-ease);
}
.os-btn:where(:hover) { background: rgba(243, 240, 232, .12); transform: translateY(-1px); }
.os-btn:where(:active) { transform: translateY(0); }
.os-btn:where(:disabled) { opacity: .42; cursor: not-allowed; transform: none; }
.os-btn :where(svg) { width: 16px; height: 16px; }

.os-btn--primary { background: var(--os-text); border-color: var(--os-text); color: var(--os-bg); }
.os-btn--primary:where(:hover) { background: #fffdf7; border-color: #fffdf7; }
.os-btn--accent { background: var(--os-blue); border-color: var(--os-blue); color: #071116; }
.os-btn--accent:where(:hover) { background: #68d1f7; border-color: #68d1f7; }
.os-btn--success { background: var(--os-green); border-color: var(--os-green); color: #07150e; }
.os-btn--danger { background: rgba(251,113,133,.08); border-color: rgba(251,113,133,.45); color: var(--os-red); }
.os-btn--danger:where(:hover) { background: var(--os-red); border-color: var(--os-red); color: #1a0708; }
.os-btn--ghost { background: transparent; border-color: transparent; color: var(--os-text-dim); }
.os-btn--ghost:where(:hover) { background: var(--os-surface-2); color: var(--os-text); }
.os-btn--quiet { background: transparent; border-color: var(--os-line-strong); color: var(--os-text-dim); }
.os-btn--quiet:where(:hover) { background: var(--os-surface-2); color: var(--os-text); }
.os-btn--sm { min-height: 30px; padding: 5px 10px; font-size: var(--os-text-xs); border-radius: var(--os-r-sm); }
.os-btn-row { display: flex; gap: var(--os-s2); align-items: center; flex-wrap: wrap; }

/* Icon-only button (chrome: bell, gear, close, menu) */
.os-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--os-r-md);
  background: transparent;
  color: var(--os-text-dim);
  cursor: pointer;
  transition: background var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease);
}
.os-icon-btn:where(:hover) { background: var(--os-surface-2); color: var(--os-text); }
.os-icon-btn :where(svg) { width: 18px; height: 18px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.os-card {
  min-width: 0;
  background: var(--os-surface-2);
  border-radius: var(--os-r-lg);
  box-shadow: var(--os-shadow-1);
  padding: var(--os-s6);
}
.os-card--flat { box-shadow: none; }
.os-card--interactive {
  cursor: pointer;
  transition: background var(--os-t-fast) var(--os-ease), transform var(--os-t-fast) var(--os-ease);
}
.os-card--interactive:where(:hover) { background: var(--os-surface-3); transform: translateY(-1px); }
.os-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-s4);
  margin-bottom: var(--os-s4);
}
.os-card-kicker {
  color: var(--os-cat, var(--os-text-muted));
  font: 500 var(--os-text-xs)/1.3 var(--os-font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: var(--os-s1);
}
.os-card-title { color: var(--os-text); font: 600 var(--os-text-lg) var(--os-font-display); letter-spacing: -.01em; }
.os-card-tools { display: flex; gap: var(--os-s1); align-items: center; }

/* ── Grouped list (iOS-style inset) ───────────────────────────────────────── */
.os-list {
  background: var(--os-surface-2);
  border-radius: var(--os-r-lg);
  box-shadow: var(--os-shadow-1);
  overflow: hidden;
}
.os-list-item {
  display: flex;
  align-items: center;
  gap: var(--os-s3);
  padding: var(--os-s4) var(--os-s5);
  border-bottom: 1px solid var(--os-line-soft);
  color: var(--os-text-dim);
}
.os-list-item:where(:last-child) { border-bottom: 0; }
.os-list-item--action { cursor: pointer; transition: background var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease); }
.os-list-item--action:where(:hover) { background: var(--os-surface-3); color: var(--os-text); }
.os-list-item-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.os-list-item-title { color: var(--os-text); font-size: var(--os-text-base); font-weight: 550; }
.os-list-item-sub { color: var(--os-text-muted); font-size: var(--os-text-xs); }

/* ── Segmented control ────────────────────────────────────────────────────── */
.os-segment {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--os-surface-1);
  border-radius: var(--os-r-md);
}
.os-segment-item {
  border: 0;
  border-radius: calc(var(--os-r-md) - 3px);
  background: transparent;
  color: var(--os-text-dim);
  padding: 6px 14px;
  font: 550 var(--os-text-sm) var(--os-font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease);
}
.os-segment-item:where(:hover) { color: var(--os-text); }
.os-segment-item:where(.is-active) {
  background: var(--os-surface-3);
  color: var(--os-text);
  box-shadow: var(--os-shadow-1);
}

/* ── Metric tiles ─────────────────────────────────────────────────────────── */
.os-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--os-s3); }
.os-metric {
  min-width: 0;
  padding: var(--os-s5);
  background: var(--os-surface-2);
  border-radius: var(--os-r-md);
}
.os-metric-label {
  color: var(--os-text-dim);
  font: 700 var(--os-text-xs)/1.3 var(--os-font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.os-metric-value {
  margin-top: var(--os-s4);
  color: var(--os-text);
  font: 600 var(--os-text-2xl)/1 var(--os-font-display);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.os-metric-delta { margin-top: var(--os-s2); font: 600 var(--os-text-xs) var(--os-font-mono); }
.os-metric-delta:where(.is-up) { color: var(--os-green); }
.os-metric-delta:where(.is-down) { color: var(--os-red); }
.os-metric-note { margin-top: var(--os-s2); color: var(--os-text-muted); font-size: var(--os-text-xs); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.os-table-wrap { overflow: auto; border: 1px solid var(--os-line); border-radius: var(--os-r-md); }
.os-table { width: 100%; border-collapse: collapse; }
.os-table :where(th) {
  position: sticky;
  top: 0;
  z-index: var(--os-z-sticky);
  background: var(--os-surface-1);
  color: var(--os-text-dim);
  font: 600 var(--os-text-xs) var(--os-font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--os-line-strong);
}
.os-table :where(td) {
  padding: 11px 13px;
  border-bottom: 1px solid var(--os-line);
  color: var(--os-text-dim);
  font-size: var(--os-text-sm);
  vertical-align: middle;
}
.os-table :where(tr:last-child) :where(td) { border-bottom: 0; }
.os-table :where(tbody) :where(tr) { transition: background var(--os-t-fast) var(--os-ease); }
.os-table :where(tbody) :where(tr:hover) { background: rgba(243,240,232,.02); }
:where(.os-table) .os-cell-primary { color: var(--os-text); font-weight: 600; }
:where(.os-table) .os-cell-num { text-align: right; font-family: var(--os-font-mono); white-space: nowrap; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.os-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: var(--os-r-sm);
  background: var(--os-surface-3);
  color: var(--os-text-dim);
  font: 600 var(--os-text-xs) var(--os-font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.os-badge--green { background: rgba(50,213,131,.1); color: var(--os-green); }
.os-badge--blue { background: rgba(56,189,248,.1); color: var(--os-blue); }
.os-badge--amber { background: rgba(240,180,41,.12); color: var(--os-amber); }
.os-badge--red { background: rgba(251,113,133,.1); color: var(--os-red); }
.os-badge--signal { background: rgba(217,164,65,.12); color: var(--os-signal); }
.os-badge--neutral { background: var(--os-surface-3); color: var(--os-text-dim); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.os-field { display: grid; gap: 7px; }
.os-label {
  color: var(--os-text-dim);
  font: 650 var(--os-text-xs) var(--os-font-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.os-input, .os-select, .os-textarea {
  width: 100%;
  min-height: 42px;
  background: var(--os-surface-1);
  color: var(--os-text);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-md);
  padding: 10px 12px;
  font: 400 var(--os-text-md) var(--os-font-ui);
  transition: border-color var(--os-t-fast) var(--os-ease), background var(--os-t-fast) var(--os-ease);
}
:where(.os-input)::placeholder, :where(.os-textarea)::placeholder { color: var(--os-text-muted); }
.os-input:where(:hover), .os-select:where(:hover), .os-textarea:where(:hover) { border-color: var(--os-text-muted); }
.os-input:where(:focus), .os-select:where(:focus), .os-textarea:where(:focus) { outline: none; border-color: var(--os-blue); background: var(--os-bg); }
.os-textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.os-help { color: var(--os-text-muted); font-size: var(--os-text-xs); line-height: 1.5; }
.os-error { color: var(--os-red); font-size: var(--os-text-sm); line-height: 1.45; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.os-empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: var(--os-s3);
  padding: var(--os-s8) var(--os-s6);
  color: var(--os-text-dim);
}
.os-empty-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-lg);
  color: var(--os-text-dim);
}
.os-empty-icon :where(svg) { width: 22px; height: 22px; }
.os-empty-title { color: var(--os-text); font: 600 var(--os-text-lg) var(--os-font-display); letter-spacing: -.02em; }
.os-empty-copy { font-size: var(--os-text-base); line-height: 1.6; max-width: 44ch; }

/* ── Sub-navigation (segmented tabs) ──────────────────────────────────────── */
.os-tabs {
  display: flex;
  gap: var(--os-s1);
  padding: 4px;
  background: var(--os-surface-1);
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-md);
  overflow-x: auto;
  scrollbar-width: none;
}
:where(.os-tabs)::-webkit-scrollbar { display: none; }
.os-tab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--os-r-sm);
  background: transparent;
  color: var(--os-text-dim);
  padding: 8px 13px;
  font: 650 var(--os-text-sm) var(--os-font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease);
}
.os-tab:where(:hover) { color: var(--os-text); }
.os-tab:where(.active) { color: var(--os-text); background: var(--os-surface-3); border-color: var(--os-line-strong); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.os-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--os-z-modal);
  display: grid;
  place-items: center;
  padding: var(--os-s5);
  background: var(--os-overlay);
}
.os-modal-backdrop:where(:not(.is-open)) { display: none; }
.os-modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--os-material-modal);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-xl);
  box-shadow: var(--os-shadow-3);
}
@supports (backdrop-filter: blur(1px)) {
  .os-modal-backdrop { backdrop-filter: blur(6px); }
  .os-modal { backdrop-filter: var(--os-blur); }
}
@media (prefers-reduced-transparency: reduce) {
  .os-modal { background: var(--os-surface-2); backdrop-filter: none; }
}
.os-modal--wide { width: min(880px, 100%); }
.os-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-s4);
  padding: var(--os-s6) var(--os-s6) var(--os-s4);
}
.os-modal-title { color: var(--os-text); font: 600 var(--os-text-xl) var(--os-font-display); letter-spacing: -.02em; }
.os-modal-body { padding: 0 var(--os-s6) var(--os-s6); display: grid; gap: var(--os-s4); }
.os-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--os-s2);
  padding: var(--os-s4) var(--os-s6) var(--os-s6);
}

/* ── Drawer (right slide-in: notifications, panels) ───────────────────────── */
.os-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--os-z-drawer);
  background: var(--os-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--os-t-base) var(--os-ease);
}
.os-drawer-backdrop:where(.is-open) { opacity: 1; pointer-events: auto; }
.os-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--os-z-drawer);
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--os-material-chrome);
  border-left: 1px solid var(--os-line-strong);
  box-shadow: var(--os-shadow-3);
  transform: translateX(100%);
  transition: transform var(--os-t-slow) var(--os-ease);
}
.os-drawer:where(.is-open) { transform: translateX(0); }
@supports (backdrop-filter: blur(1px)) {
  .os-drawer { backdrop-filter: var(--os-blur); }
}
@media (prefers-reduced-transparency: reduce) {
  .os-drawer { background: var(--os-surface-1); backdrop-filter: none; }
}
.os-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-s3);
  padding: var(--os-s5) var(--os-s5) var(--os-s4);
  border-bottom: 1px solid var(--os-line-soft);
}
.os-drawer-title { color: var(--os-text); font: 600 var(--os-text-lg) var(--os-font-display); letter-spacing: -.01em; }
.os-drawer-body { flex: 1; overflow: auto; padding: var(--os-s4) var(--os-s5); }
.os-drawer-foot {
  display: flex;
  gap: var(--os-s2);
  align-items: center;
  padding: var(--os-s4) var(--os-s5);
  border-top: 1px solid var(--os-line-soft);
}

/* ── Switch (boolean settings toggle) ─────────────────────────────────────── */
.os-switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.os-switch :where(input) { position: absolute; opacity: 0; width: 0; height: 0; }
.os-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: var(--os-r-full);
  background: var(--os-line-strong);
  transition: background var(--os-t-fast) var(--os-ease);
}
:where(.os-switch-slider)::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--os-text-muted);
  transition: transform var(--os-t-fast) var(--os-ease), background var(--os-t-fast) var(--os-ease);
}
:where(.os-switch) :where(input:checked) + .os-switch-slider { background: var(--os-green); }
:where(:where(.os-switch) :where(input:checked) + .os-switch-slider)::before { transform: translateX(18px); background: var(--os-text); }
:where(.os-switch) :where(input:focus-visible) + .os-switch-slider { outline: 2px solid var(--os-blue); outline-offset: 2px; }

/* ── Chart frame ──────────────────────────────────────────────────────────── */
.os-chart-frame {
  position: relative;
  background: var(--os-surface-2);
  border-radius: var(--os-r-lg);
  box-shadow: var(--os-shadow-1);
  padding: var(--os-s5);
}
.os-chart-frame > :where(canvas) { max-width: 100%; }

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .os-btn,
.os-icon-btn,
.os-tab,
.os-table :where(tbody) :where(tr),
.os-input,
.os-select,
.os-textarea,
.os-list-item--action,
.os-segment-item,
.os-card--interactive,
.os-drawer,
.os-drawer-backdrop,
.os-switch-slider {
    transition-duration: .01ms;
  }
  .os-btn:where(:hover), .os-icon-btn:where(:hover), .os-card--interactive:where(:hover) { transform: none; }
}

/* ── Inline icon sizing (sprite <use> inside text and chips) ───────────────── */
.os-ic { width: 16px; height: 16px; flex: none; }
.os-ic--sm { width: 13px; height: 13px; }
/* .os-ic sitzt mal auf dem svg selbst, mal auf einem span darum. Im zweiten
   Fall braucht das Kind-svg die Groesse des Wrappers, sonst laeuft es ueber. */
.os-ic :where(svg) { display: block; width: 100%; height: 100%; }

/* ── Timestamp (mono state line, right of a page header) ──────────────────── */
.os-timestamp {
  padding-bottom: 3px;
  color: var(--os-text-dim);
  font-family: var(--os-font-mono);
  font-size: var(--os-text-xs);
  letter-spacing: .035em;
  white-space: nowrap;
}

/* ── Loading / neutral placeholder ────────────────────────────────────────── */
.os-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--os-text-dim);
  font: 500 var(--os-text-sm)/1.4 var(--os-font-mono);
  letter-spacing: .06em;
  text-align: center;
}
.os-clear-state {
  padding: var(--os-s6) 0;
  text-align: center;
  color: var(--os-text-muted);
  font-size: var(--os-text-sm);
}
.os-section-label {
  color: var(--os-text-muted);
  font: 600 var(--os-text-xs) var(--os-font-mono);
  text-transform: uppercase;
  letter-spacing: .09em;
}

/* ── Empty-state body (kicker / title / copy / action) ────────────────────── */
.os-empty-body { max-width: 52ch; display: grid; gap: var(--os-s2); justify-items: center; }
.os-empty--framed {
  min-height: 340px;
  border: 1px dashed var(--os-line-strong);
  border-radius: var(--os-r-lg);
}

/* ── Rows (settings, entities, accounts: label left, control right) ───────── */
.os-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-s4);
  padding: var(--os-s3) 0;
  border-bottom: 1px solid var(--os-line-soft);
}
.os-row:where(:last-child) { border-bottom: 0; }
.os-row-title { color: var(--os-text); font-size: var(--os-text-sm); font-weight: 600; }
.os-row-meta { margin-top: var(--os-s1); color: var(--os-text-muted); font-size: var(--os-text-xs); }
.os-row-control { min-width: 160px; max-width: 260px; }

/* ── Money (tabular, direction-coded) ─────────────────────────────────────── */
.os-money {
  font: 600 var(--os-text-sm) var(--os-font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.os-money--in { color: var(--os-green); }
.os-money--out { color: var(--os-red); }

/* ── Forms: grid, intro, unit suffix, checkbox card ───────────────────────── */
.os-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--os-s3); }
.os-span-full { grid-column: 1 / -1; }
.os-form-intro {
  margin-bottom: var(--os-s4);
  padding: 11px 12px;
  border-radius: var(--os-r-md);
  background: var(--os-surface-3);
  color: var(--os-text-dim);
  font-size: var(--os-text-xs);
  line-height: 1.55;
}
.os-input-suffix { position: relative; }
.os-input--suffixed { padding-right: 50px; }
.os-input-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--os-text-muted);
  font-size: var(--os-text-xs);
}
.os-check-card {
  display: flex;
  align-items: flex-start;
  gap: var(--os-s2);
  padding: var(--os-s3);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-md);
  background: var(--os-surface-1);
  cursor: pointer;
}
.os-check-card :where(input) { margin-top: 2px; accent-color: var(--os-green); }
.os-check-card :where(b) { display: block; color: var(--os-text); font-size: var(--os-text-sm); }
.os-check-card :where(small) {
  display: block;
  margin-top: var(--os-s1);
  color: var(--os-text-muted);
  font-size: var(--os-text-xs);
  line-height: 1.4;
}

/* ── Suggestion chip (system proposal, click to apply) ────────────────────── */
.os-suggestion {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-sm);
  background: var(--os-surface-3);
  color: var(--os-text-dim);
  text-align: left;
  cursor: pointer;
}
.os-suggestion :where(svg) { width: 13px; height: 13px; margin-top: 1px; flex: none; }
.os-suggestion :where(b) { display: block; color: var(--os-text); font-size: var(--os-text-xs); }
.os-suggestion :where(small) {
  display: block;
  margin-top: 2px;
  color: var(--os-text-muted);
  font-size: var(--os-text-xs);
  line-height: 1.35;
}

/* ── Note panel (explanation, not actionable) ─────────────────────────────── */
.os-note-panel {
  display: flex;
  align-items: flex-start;
  gap: var(--os-s2);
  padding: var(--os-s3);
  border-radius: var(--os-r-md);
  background: var(--os-surface-3);
  color: var(--os-text-dim);
  font-size: var(--os-text-xs);
}
.os-note-panel :where(svg) { width: 16px; height: 16px; flex: none; }
.os-note-panel :where(b) { display: block; color: var(--os-text); font-size: var(--os-text-sm); }
.os-note-panel :where(small) {
  display: block;
  margin-top: var(--os-s1);
  color: var(--os-text-muted);
  font-size: var(--os-text-xs);
  line-height: 1.45;
}

/* ── Code block (recovery key, checksums) ─────────────────────────────────── */
.os-code-block {
  padding: var(--os-s4);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-md);
  background: var(--os-surface-1);
  color: var(--os-text);
  font: 600 var(--os-text-md)/1.6 var(--os-font-mono);
  word-break: break-word;
}

/* ── Card note (fine print under a card) ──────────────────────────────────── */
.os-card-note {
  margin: var(--os-s3) 0 0;
  color: var(--os-text-muted);
  font-size: var(--os-text-xs);
  line-height: 1.55;
}

/* ── Metric head row (label plus tone-coded icon) ─────────────────────────── */
.os-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-s2);
  color: var(--os-metric-tone, var(--os-text-dim));
}
.os-metric-top :where(svg) { width: 18px; height: 18px; flex: none; }
.os-metric--blue { --os-metric-tone: var(--os-blue); }
.os-metric--green { --os-metric-tone: var(--os-green); }
.os-metric--red { --os-metric-tone: var(--os-red); }
.os-metric--amber { --os-metric-tone: var(--os-amber); }
.os-metric--orchid { --os-metric-tone: var(--os-orchid); }
.os-metric--signal { --os-metric-tone: var(--os-signal); }

/* ── Toasts ───────────────────────────────────────────────────────────────── */
.os-toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--os-z-toast);
  display: grid;
  gap: var(--os-s2);
}
.os-toast {
  width: min(360px, calc(100vw - 44px));
  padding: var(--os-s3) var(--os-s4);
  border: 1px solid var(--os-line-strong);
  border-top: 2px solid var(--os-green);
  border-radius: var(--os-r-md);
  background: var(--os-surface-3);
  color: var(--os-text);
  font-size: var(--os-text-sm);
  box-shadow: var(--os-shadow-2);
  animation: os-toast-in var(--os-t-base) var(--os-ease) both;
}
.os-toast--error { border-top-color: var(--os-red); }
@keyframes os-toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

/* ── Table in card mode below 720px (opt-in via .os-table--cards) ─────────── */
@media (max-width: 720px) {
  .os-table--cards { min-width: 0; display: block; }
  .os-table--cards :where(thead) { display: none; }
  .os-table--cards :where(tbody, tr, td) { display: block; width: 100%; }
  .os-table--cards :where(tr) {
    margin-bottom: 9px;
    padding: var(--os-s3);
    border-radius: var(--os-r-md);
    background: var(--os-surface-2);
  }
  .os-table--cards :where(td) { border: 0; padding: var(--os-s1) 0; }
  :where(.os-table--cards :where(td[data-label]))::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 95px;
    color: var(--os-text-muted);
    font: 600 var(--os-text-xs) var(--os-font-mono);
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .os-table-wrap--cards { border: 0; overflow: visible; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Bestandskomponenten (aus legacy.css uebernommen, auf --os-*-Tokens gestellt)
   ----------------------------------------------------------------------------
   legacy.css ist mit dem Night-Desk-Durchzug entfallen. Was dort noch genutzt
   wurde, steht hier generisch: keine Bereichsnamen, keine ID-Selektoren, keine
   Spezifitaet ueber 0-1-0.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Aufgabenliste ───────────────────────────────────────────────────────── */
.todo-list { margin: 0; padding: 0; list-style: none; }
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: var(--os-s3);
  padding: 9px 0;
  border-bottom: 1px solid var(--os-line-soft);
}
.todo-item:where(:last-child) { border-bottom: 0; }
.todo-item:where(.is-done) { opacity: .55; }
.todo-item-main { flex: 1; min-width: 0; }
.todo-item-actions { display: flex; flex: none; gap: var(--os-s2); align-items: center; }
.todo-check {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-r-sm);
  color: var(--os-bg);
  transition: background var(--os-t-fast) var(--os-ease), border-color var(--os-t-fast) var(--os-ease);
}
.todo-check:where(.is-action) { cursor: pointer; }
.todo-check:where(:hover) { border-color: var(--os-text-muted); background: var(--os-surface-3); }
.todo-check:where(.is-checked) { background: var(--os-text); border-color: var(--os-text); }
.todo-text { flex: 1; color: var(--os-text); font-size: var(--os-text-base); }
.todo-text:where(.is-done) { color: var(--os-text-muted); text-decoration: line-through; }
.todo-empty { padding: var(--os-s2) 0; color: var(--os-text-muted); font-size: var(--os-text-base); list-style: none; }
.todo-del-btn {
  flex: none;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--os-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease);
}
:where(.todo-item:hover) .todo-del-btn,
.todo-del-btn:where(:focus-visible) { opacity: 1; }
.todo-del-btn:where(:hover) { color: var(--os-red); }
.todo-check-anim { transition: opacity var(--os-t-slow) var(--os-ease), transform var(--os-t-slow) var(--os-ease); }
.todo-check-anim:where(.completing) { opacity: .5; transform: translateX(10px); }

/* ── Inline-Bearbeitung ──────────────────────────────────────────────────── */
.editable {
  padding: 1px 3px;
  margin: -1px -3px;
  border-bottom: 1px solid transparent;
  border-radius: 2px;
  outline: none;
  color: var(--os-text);
  font-size: var(--os-text-md);
  cursor: text;
  transition: border-color var(--os-t-fast) var(--os-ease), background var(--os-t-fast) var(--os-ease);
}
.editable:where(:hover) { border-bottom-color: var(--os-line-strong); }
.editable:where(:focus) { border-bottom-color: var(--os-blue); background: rgba(56, 189, 248, .07); }

/* ── Info-Zeilen ─────────────────────────────────────────────────────────── */
.info-row {
  display: flex;
  gap: var(--os-s3);
  padding: 9px 0;
  border-bottom: 1px solid var(--os-line-soft);
  font-size: var(--os-text-base);
}
.info-row:where(:last-child) { border-bottom: 0; }
.info-key { min-width: 156px; flex: none; color: var(--os-text-dim); }
.info-val { color: var(--os-text); font-weight: 600; }

/* ── Merkzettel (Ideen) ──────────────────────────────────────────────────── */
.sticky-card {
  position: relative;
  min-height: 180px;
  padding: var(--os-s4);
  display: flex;
  flex-direction: column;
  gap: var(--os-s2);
  border-top: 2px solid var(--os-line-strong);
  border-radius: var(--os-r-lg);
  background: var(--os-surface-2);
  box-shadow: var(--os-shadow-1);
  transition: transform var(--os-t-fast) var(--os-ease), box-shadow var(--os-t-fast) var(--os-ease);
}
.sticky-card:where(:hover) { transform: translateY(-3px); box-shadow: var(--os-shadow-2); }
.sticky-card:where(.color-blue)   { border-top-color: var(--os-blue); }
.sticky-card:where(.color-green)  { border-top-color: var(--os-green); }
.sticky-card:where(.color-amber)  { border-top-color: var(--os-amber); }
.sticky-card:where(.color-red)    { border-top-color: var(--os-red); }
.sticky-card:where(.color-purple) { border-top-color: var(--os-orchid); }
.sticky-card:where(.color-pink)   { border-top-color: var(--os-red); }
.sticky-card:where(.color-cyan)   { border-top-color: var(--os-cyan); }
.sticky-card:where(.color-white)  { border-top-color: var(--os-text); }
.sticky-card-title { padding-right: 60px; color: var(--os-text); font-size: var(--os-text-md); font-weight: 600; line-height: 1.4; }
.sticky-card-body { flex: 1; color: var(--os-text-dim); font-size: var(--os-text-sm); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.sticky-card-meta {
  margin-top: auto;
  padding-top: var(--os-s2);
  display: flex;
  gap: var(--os-s2);
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--os-line-soft);
  color: var(--os-text-muted);
  font-size: var(--os-text-xs);
}
.sticky-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: var(--os-s1);
  opacity: 0;
  transition: opacity var(--os-t-fast) var(--os-ease);
}
:where(.sticky-card:hover, .sticky-card:focus-within) .sticky-card-actions { opacity: 1; }
.sticky-action-btn {
  padding: 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-sm);
  background: var(--os-surface-1);
  color: var(--os-text-dim);
  cursor: pointer;
  transition: background var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease);
}
.sticky-action-btn:where(:hover) { background: var(--os-surface-3); color: var(--os-text); }
.sticky-action-btn:where(.sticky-action-btn--danger):where(:hover) { color: var(--os-red); }

/* ── Farbwahl (Kalender, Ideen) ──────────────────────────────────────────── */
.cal-color-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.cal-color-dot {
  width: 22px;
  height: 22px;
  flex: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--os-t-fast) var(--os-ease), border-color var(--os-t-fast) var(--os-ease);
}
.cal-color-dot:where(:hover) { transform: scale(1.2); }
.cal-color-dot:where(.selected) { border-color: var(--os-text); transform: scale(1.15); }
.cal-color-dot:where([data-color="blue"])   { background: var(--os-blue); }
.cal-color-dot:where([data-color="green"])  { background: var(--os-green); }
.cal-color-dot:where([data-color="amber"])  { background: var(--os-amber); }
.cal-color-dot:where([data-color="red"])    { background: var(--os-red); }
.cal-color-dot:where([data-color="purple"]) { background: var(--os-orchid); }
.cal-color-dot:where([data-color="pink"])   { background: #ec4899; }
.cal-color-dot:where([data-color="cyan"])   { background: var(--os-cyan); }
.cal-color-dot:where([data-color="white"])  { background: var(--os-text); }

/* ── Chat-Blasen (Ideen-Sparring, Brainstorm) ────────────────────────────── */
.chat-bubble {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: var(--os-r-md);
  font-size: var(--os-text-base);
  line-height: 1.65;
  word-break: break-word;
}
.chat-bubble:where(.user) { align-self: flex-end; background: var(--os-surface-3); color: var(--os-text); }
.chat-bubble:where(.assistant) {
  align-self: flex-start;
  border: 1px solid var(--os-line);
  background: var(--os-surface-2);
  color: var(--os-text);
  white-space: pre-wrap;
}
.chat-bubble:where(.is-brainstorm) { border-left: 2px solid var(--os-amber); }
.chat-bubble-step { color: var(--os-amber); font-weight: 600; }

/* ── Recherche-Ausgabe ───────────────────────────────────────────────────── */
.research-output {
  min-height: 200px;
  max-height: 600px;
  margin-top: var(--os-s3);
  padding: var(--os-s5);
  overflow-y: auto;
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-md);
  background: var(--os-bg);
  color: var(--os-text-dim);
  font-size: var(--os-text-base);
  line-height: 1.75;
}
.research-output :where(h1, h2, h3) { margin: var(--os-s4) 0 var(--os-s2); color: var(--os-text); }
.research-output :where(h2) { font-size: var(--os-text-lg); border-bottom: 1px solid var(--os-line); padding-bottom: 6px; }
.research-output :where(h3) { font-size: var(--os-text-md); }
.research-output :where(ul, ol) { margin: var(--os-s2) 0; padding-left: var(--os-s5); }
.research-output :where(li) { margin: var(--os-s1) 0; }
.research-output :where(strong) { color: var(--os-text); }
.research-output :where(table) { width: 100%; margin: var(--os-s3) 0; border-collapse: collapse; font-size: var(--os-text-sm); }
.research-output :where(th, td) { padding: 6px 10px; border: 1px solid var(--os-line); text-align: left; }
.research-output :where(th) { background: var(--os-surface-2); color: var(--os-text); font-weight: 600; }
.research-history-chips { display: flex; gap: var(--os-s2); flex-wrap: wrap; margin-bottom: var(--os-s3); }
.research-chip,
.os-chip {
  padding: 4px 10px;
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-full);
  background: var(--os-surface-2);
  color: var(--os-text-dim);
  font-size: var(--os-text-xs);
  cursor: pointer;
  transition: background var(--os-t-fast) var(--os-ease), color var(--os-t-fast) var(--os-ease), border-color var(--os-t-fast) var(--os-ease);
}
.research-chip:where(:hover),
.os-chip:where(:hover) { background: var(--os-surface-3); border-color: var(--os-line-strong); color: var(--os-text); }
.os-chip :where(strong) { color: var(--os-text); font-weight: 650; }
.os-chip :where(span) { color: var(--os-text-muted); }
.os-chip-row { display: flex; gap: var(--os-s2); flex-wrap: wrap; margin-top: var(--os-s3); }
.os-report-body {
  padding: var(--os-s4);
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-md);
  background: var(--os-surface-2);
  color: var(--os-text);
  font-size: var(--os-text-base);
  line-height: 1.7;
  white-space: pre-wrap;
}
.os-report-copy { margin-top: var(--os-s2); }

/* ── Hinweisbanner (fehlender API-Schluessel) ────────────────────────────── */
.api-key-banner {
  margin-bottom: var(--os-s4);
  padding: var(--os-s4) var(--os-s5);
  display: flex;
  gap: var(--os-s3);
  align-items: flex-start;
  border: 1px solid rgba(240, 180, 41, .25);
  border-radius: var(--os-r-md);
  background: rgba(240, 180, 41, .08);
  color: var(--os-amber);
  font-size: var(--os-text-sm);
}
.api-key-banner :where(a) { color: var(--os-blue); }
.dismiss-btn {
  margin-left: auto;
  padding: 0 var(--os-s1);
  border: 0;
  background: none;
  color: var(--os-text-muted);
  cursor: pointer;
}

/* ── Balken (Score, Breakdown, Trend) ────────────────────────────────────── */
.score-bar-row { display: flex; gap: var(--os-s3); align-items: center; }
.score-bar-label { width: 150px; flex: none; color: var(--os-text-dim); font-size: var(--os-text-sm); }
.score-bar-track { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: var(--os-surface-3); }
.score-bar-fill { width: var(--os-bar-width, 0%); height: 100%; border-radius: 3px; background: var(--os-text-muted); transition: width var(--os-t-slow) var(--os-ease); }
.score-bar-fill:where(.green) { background: var(--os-green); }
.score-bar-fill:where(.amber) { background: var(--os-amber); }
.score-bar-fill:where(.red)   { background: var(--os-red); }
.score-bar-value { width: 46px; flex: none; color: var(--os-tone, var(--os-text)); font-family: var(--os-font-mono); font-size: var(--os-text-sm); font-weight: 600; text-align: right; }

.breakdown-row { display: flex; gap: var(--os-s2); align-items: center; margin-bottom: var(--os-s3); }
.breakdown-name { min-width: 80px; flex: none; color: var(--os-text-dim); font-size: var(--os-text-sm); }
.breakdown-bar-bg { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: var(--os-surface-3); }
.breakdown-bar-fill { width: var(--os-bar-width, 0%); height: 100%; border-radius: 3px; background: var(--os-text); transition: width var(--os-t-slow) var(--os-ease); }
.breakdown-pct { min-width: 36px; color: var(--os-text-muted); font-family: var(--os-font-mono); font-size: var(--os-text-xs); text-align: right; }

.os-trend-list { display: grid; gap: var(--os-s1); margin-bottom: var(--os-s3); }
.os-trend-row { display: flex; gap: var(--os-s2); align-items: center; }
.os-trend-date { width: 80px; flex: none; color: var(--os-text-muted); font-size: var(--os-text-xs); }
.os-trend-track { flex: 1; height: 14px; overflow: hidden; border-radius: var(--os-r-sm); background: var(--os-surface-3); }
.os-trend-fill { width: var(--os-bar-width, 0%); height: 100%; border-radius: var(--os-r-sm); background: var(--os-text); }
.os-trend-value { width: 28px; flex: none; color: var(--os-text-dim); font-family: var(--os-font-mono); font-size: var(--os-text-xs); text-align: right; }

/* ── Szenario-Karten ─────────────────────────────────────────────────────── */
.scenario-card { padding: var(--os-s4); border: 1px solid var(--os-line); border-radius: var(--os-r-md); }
.scenario-card:where(.bull) { border-color: rgba(50, 213, 131, .3); background: rgba(50, 213, 131, .04); }
.scenario-card:where(.bear) { border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .04); }
.scenario-card-head { display: flex; justify-content: space-between; margin-bottom: var(--os-s2); color: var(--os-text); font-size: var(--os-text-sm); font-weight: 700; }
.scenario-card-upside { margin-bottom: var(--os-s3); color: var(--os-tone, var(--os-text)); font-family: var(--os-font-mono); font-size: var(--os-text-sm); font-weight: 700; }
.scenario-card-factors { margin: 0; padding-left: var(--os-s4); color: var(--os-text-dim); font-size: var(--os-text-xs); line-height: 1.6; }

/* ── Tabellenzellen-Varianten ────────────────────────────────────────────── */
.os-cell-sub { color: var(--os-text-muted); font-size: var(--os-text-xs); }
.os-cell-sub-tone { font-size: var(--os-text-xs); }
.os-cell-muted { color: var(--os-text-muted); font-size: var(--os-text-sm); }
.os-cell-tone { color: var(--os-tone, var(--os-text)); font-weight: 600; }
.os-cell-clip { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-cell-alloc { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.os-cell-alloc-track { width: 44px; height: 4px; overflow: hidden; border-radius: 2px; background: var(--os-surface-3); }
.os-cell-alloc-fill { width: var(--os-bar-width, 0%); height: 100%; border-radius: 2px; background: var(--os-text); }

/* ── Formulare, Fortschritt, Details ─────────────────────────────────────── */
.os-inline-form { display: flex; gap: var(--os-s3); flex-wrap: wrap; align-items: center; margin: var(--os-s3) 0; }
.os-inline-form-grow { flex: 2 1 220px; }
.os-form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.os-modal-foot--split { justify-content: space-between; }

.os-progress-panel {
  margin-top: var(--os-s3);
  padding: var(--os-s4);
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-md);
  background: var(--os-surface-2);
}
.os-progress-head { display: flex; justify-content: space-between; margin-bottom: var(--os-s2); color: var(--os-text-dim); font-size: var(--os-text-sm); }
.os-progress-track { height: 3px; overflow: hidden; border-radius: 3px; background: var(--os-surface-3); }
.os-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--os-signal);
  transform: scaleX(var(--os-progress, 0));
  transform-origin: left;
  transition: transform var(--os-t-slow) var(--os-ease);
}

.os-details-summary { color: var(--os-text-muted); font-size: var(--os-text-xs); cursor: pointer; list-style: none; }
.os-sort-btn { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.os-sort-btn:where(:hover) { color: var(--os-text); }

.os-dropzone {
  margin-bottom: var(--os-s4);
  padding: var(--os-s7) var(--os-s6);
  display: grid;
  gap: var(--os-s2);
  justify-items: center;
  border: 2px dashed var(--os-line);
  border-radius: var(--os-r-lg);
  text-align: center;
  cursor: pointer;
  transition: background var(--os-t-base) var(--os-ease), border-color var(--os-t-base) var(--os-ease);
}
.os-dropzone:where(.is-over) { border-color: var(--os-signal); background: var(--os-surface-2); }
.os-dropzone-title { color: var(--os-text); font-size: var(--os-text-base); font-weight: 600; }

/* ── Arbeitsflaeche der Geschaeftsbereiche ───────────────────────────────────
   Offene Aufgaben je Bereich, gefilterte Sicht auf den zentralen Bestand.
   Bewusst in der gemeinsamen Sprache gehalten: keine eigene Signalfarbe,
   Farbe nur fuer Handlungsbedarf. */
.biz-tasks { grid-column: 1 / -1; }
.biz-task-head {
  margin-bottom: var(--os-s3);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--os-s4);
}
.biz-task-count { color: var(--os-text-muted); font: 600 var(--os-text-xs)/1 var(--os-font-mono); letter-spacing: .06em; white-space: nowrap; }
.biz-task-list { margin: 0; padding: 0; list-style: none; }
.biz-task {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid var(--os-line-soft);
  font-size: var(--os-text-base);
}
.biz-task:where(:first-child) { border-top: 0; }
.biz-task-check {
  width: 16px;
  height: 16px;
  flex: none;
  padding: 0;
  border: 1px solid var(--os-line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--os-t-fast) var(--os-ease), background var(--os-t-fast) var(--os-ease);
}
.biz-task-check:where(:hover) { border-color: var(--os-text); background: var(--os-surface-3); }
.biz-task-text { flex: 1; min-width: 0; overflow: hidden; color: var(--os-text); text-overflow: ellipsis; white-space: nowrap; }
.biz-task-meta { flex: none; color: var(--os-text-muted); font: 600 var(--os-text-xs)/1 var(--os-font-mono); }
:where(.biz-task.is-overdue) .biz-task-meta { color: var(--os-red); }
.biz-task-empty { padding: 9px 0; color: var(--os-text-muted); font-size: var(--os-text-sm); }
.biz-task-form {
  margin-top: var(--os-s4);
  padding-top: var(--os-s3);
  display: flex;
  gap: var(--os-s2);
  border-top: 1px solid var(--os-line-soft);
}
.biz-task-form :where(input) {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 var(--os-s3);
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-md);
  background: var(--os-surface-1);
  color: var(--os-text);
  font: 400 var(--os-text-base)/1 var(--os-font-ui);
  outline: none;
}
.biz-task-form :where(input:focus) { border-color: var(--os-line-strong); }
.biz-task-form :where(input::placeholder) { color: var(--os-text-muted); }

/* Zwei Karten nebeneinander auf den Bereichsseiten (CSA, KI-Einzelunternehmen). */
.os-biz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--os-s4); }
@media (max-width: 900px) {
  .os-biz-grid { grid-template-columns: minmax(0, 1fr); }
}
