/* ============ Schriften (L1VE Design System) ============ */
@font-face { font-family: "GT America Condensed"; src: url("fonts/GT-America-Condensed-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "GT America Mono"; src: url("fonts/GT-America-Mono-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Variable.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ============ Design Tokens (L1VE, Dark Theme) ============ */
:root {
  /* Skala */
  --red: #e40525;
  --red-light-1: #ff746d;
  --red-dark-1: #9b0006;
  --red-dark-2: #510000;
  --red-dark-3: #280000;
  --red-light-3: #fff1ee;
  --neutral-0: #ffffff;
  --neutral-100: #f0f0f0;
  --neutral-200: #d9d9d9;
  --neutral-300: #b0b0b0;
  --neutral-400: #7a7a7a;
  --neutral-500: #5a5a5a;
  --neutral-700: #303030;
  --neutral-800: #121212;
  --neutral-900: #000000;
  --green: #55c486;

  /* Semantik */
  --surface: var(--neutral-900);
  --surface-raised: var(--neutral-800);
  --surface-strong: var(--neutral-700);
  --ink: var(--neutral-0);
  --ink-muted: var(--neutral-300);
  --ink-subtle: var(--neutral-400);
  --hairline: var(--neutral-700);
  --border-control: var(--neutral-400);
  --brand: var(--red);
  --brand-hover: var(--red-dark-1);
  --brand-active: var(--red-dark-2);
  --on-brand: var(--neutral-0);
  --brand-text: var(--red-light-1);
  --brand-tint: var(--red-dark-3);
  --focus: var(--neutral-0);
  --success: var(--green);
  --danger: var(--red-light-1);
  --scrim: rgba(0, 0, 0, 0.6);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-condensed: "GT America Condensed", "Arial Narrow", sans-serif;
  --font-mono: "GT America Mono", ui-monospace, Menlo, monospace;

  /* App-Aliasse (von app.js und älteren Regeln genutzt) */
  --bg: var(--surface);
  --text: var(--ink);
  --text-dim: var(--ink-muted);
  --text-mute: var(--ink-subtle);
  --line: var(--hairline);
  --line-soft: var(--neutral-800);
  --weekend: var(--neutral-800);
  --today: var(--brand);

  --day-w: 46px;
  --gutter-w: 172px;
  --header-h: 62px;

  /* category palette (bewusst unverändert) */
  --c-urlaub: #2dd4bf;
  --c-event: #a78bfa;
  --c-logistik: #fbbf24;
  --c-produktion: #fb7185;
  --c-lab: #38bdf8;
  --c-planung: #34d399;
  --c-sonstiges: #94a3b8;
  color-scheme: dark;
}

/* ============ Light Theme (L1VE) ============ */
:root[data-theme="light"] {
  --surface: var(--neutral-0);
  --surface-raised: var(--neutral-100);
  --surface-strong: var(--neutral-200);
  --ink: var(--neutral-900);
  --ink-muted: var(--neutral-500);
  --ink-subtle: var(--neutral-400);
  --hairline: var(--neutral-200);
  --border-control: var(--neutral-400);
  --brand-text: var(--red);
  --brand-tint: var(--red-light-3);
  --focus: var(--red);
  --danger: var(--red-dark-1);
  --line-soft: var(--neutral-100);
  --weekend: var(--neutral-100);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 1.5;
  font-optical-sizing: auto;
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ============ Header ============ */
.app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; }
/* Offizielles rotes Logo, in beiden Themes transparent.
   Bewusste Abweichung von der Guideline (die verbietet Rot direkt auf Schwarz). */
.brand-logo-wrap { display: inline-flex; flex: 0 0 auto; padding: 8px 0; }
.brand-logo { width: auto; height: 34px; fill: var(--red); stroke: none; display: block; }
.brand-text h1 {
  margin: 0; font-family: var(--font-condensed); font-weight: 700;
  font-size: 34px; line-height: 1; letter-spacing: 0; text-transform: uppercase;
}

.toolbar { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }

/* view switch */
.view-switch {
  position: relative; display: flex; padding: 4px;
  background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--radius-pill);
}
.switch-btn {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 16px; border: 0; background: transparent;
  color: var(--ink-muted); font-weight: 600; font-size: 14px; line-height: 20px;
  border-radius: var(--radius-pill); transition: color 0.12s;
}
.switch-btn:hover { color: var(--ink); }
.switch-btn.is-active { color: var(--surface); }
.switch-btn svg { width: 16px; height: 16px; }
.switch-thumb {
  position: absolute; z-index: 1; top: 4px; left: 4px;
  height: calc(100% - 8px); border-radius: var(--radius-pill);
  background: var(--ink);
  transition: transform 0.12s ease-out, width 0.12s ease-out;
}

.tools { display: flex; align-items: center; gap: 12px; }
.tools.is-hidden { display: none; }
.zoom-group { display: flex; border: 1px solid var(--border-control); border-radius: var(--radius-pill); overflow: hidden; }
.icon-btn {
  width: 44px; height: 42px; border: 0; background: transparent; color: var(--ink);
  font-size: 20px; line-height: 1; display: grid; place-items: center; transition: background-color 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--surface-strong); }
.zoom-group .icon-btn + .icon-btn { border-left: 1px solid var(--border-control); }

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 24px;
  border: 1px solid var(--border-control); background: transparent; color: var(--ink);
  border-radius: var(--radius-pill); font-weight: 600; font-size: 14px; line-height: 20px;
  transition: background-color 0.12s, border-color 0.12s;
}
.ghost-btn:hover { background: var(--surface-strong); border-color: var(--ink); }

.user-btn { text-decoration: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 42px; }

.theme-btn {
  width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid var(--border-control); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink); transition: background-color 0.12s, border-color 0.12s;
}
.theme-btn:hover { background: var(--surface-strong); border-color: var(--ink); }
.theme-btn .icon-moon { display: none; }
:root[data-theme="light"] .theme-btn .icon-sun { display: none; }
:root[data-theme="light"] .theme-btn .icon-moon { display: block; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--ink-subtle); pointer-events: none; }
#search {
  width: 220px; height: 44px; padding: 0 16px 0 38px;
  background: var(--surface-raised); border: 1px solid var(--border-control); border-radius: var(--radius-sm);
  color: var(--ink); font: 400 14px/20px var(--font); transition: border-color 0.12s;
}
#search::placeholder { color: var(--ink-subtle); }
#search:hover { border-color: var(--ink-muted); }
#search:focus { outline: none; }
#search:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--ink); }

.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px; border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: 14px; line-height: 20px;
  white-space: nowrap; transition: background-color 0.12s, box-shadow 0.12s;
  box-shadow: 0 6px 18px rgba(228, 5, 37, 0.4);
}
.primary-btn:hover { background: var(--brand-hover); box-shadow: 0 8px 24px rgba(228, 5, 37, 0.5); }
.primary-btn:active { background: var(--brand-active); }
.primary-btn svg { width: 17px; height: 17px; }

/* ============ Legend ============ */
.legend { display: flex; gap: 8px; padding: 16px 24px 4px; flex-wrap: wrap; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 0 16px; border-radius: var(--radius-pill);
  background: transparent; border: 1px solid var(--border-control);
  color: var(--ink); font: 500 14px/20px var(--font);
  cursor: pointer; user-select: none; transition: background-color 0.12s, border-color 0.12s, opacity 0.12s;
}
.legend-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chip); box-shadow: 0 0 8px 0 var(--chip); }
.legend-chip.is-off .dot { box-shadow: none; }
.legend-chip:hover { background: var(--surface-strong); }
.legend-chip.is-off { opacity: 0.4; }
.legend-count { color: var(--ink-muted); font-weight: 500; }

/* ============ Stage ============ */
.stage { padding: 16px 24px 48px; }
.view.is-hidden { display: none; }

/* ============ Timeline ============ */
.timeline {
  display: flex; position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  overflow: hidden;
}
.tl-gutter { width: var(--gutter-w); flex: 0 0 var(--gutter-w); border-right: 1px solid var(--hairline); background: var(--surface-raised); z-index: 3; }
.gutter-spacer { height: var(--header-h); border-bottom: 1px solid var(--hairline); }
.gutter-lane {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-bottom: 1px solid var(--hairline);
  font-family: var(--font-condensed); font-weight: 700; font-size: 17px; line-height: 1;
  text-transform: uppercase; color: var(--ink);
}
.gutter-lane .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lane-color); box-shadow: 0 0 8px 0 var(--lane-color); flex: 0 0 auto; }
.gutter-lane .lane-count {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 700; line-height: 16px;
  color: var(--ink-muted); background: var(--surface-strong); padding: 1px 8px; border-radius: var(--radius-pill);
}

.tl-viewport { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: pan-y; }
.tl-viewport.dragging { cursor: grabbing; }
.tl-canvas { position: relative; will-change: transform; width: max-content; }

.tl-header { position: relative; height: var(--header-h); border-bottom: 1px solid var(--hairline); background: var(--surface); }
.month-row { display: flex; height: 26px; }
.month-cell {
  display: flex; align-items: center; padding: 0 12px;
  font-family: var(--font-condensed); font-weight: 700; font-size: 15px; line-height: 1;
  color: var(--ink); text-transform: uppercase;
  border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  white-space: nowrap; overflow: hidden;
}
.day-row { display: flex; height: 36px; }
.day-cell {
  width: var(--day-w); flex: 0 0 var(--day-w);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-right: 1px solid var(--hairline); gap: 2px;
}
.day-cell .dow { color: var(--ink-subtle); font: 500 10px/12px var(--font); text-transform: uppercase; letter-spacing: 0.04em; }
.day-cell .dom { color: var(--ink-muted); font-family: var(--font-mono); font-weight: 700; font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
.day-cell.weekend { background: var(--weekend); }
.day-cell.weekend .dom { color: var(--ink-subtle); }
.day-cell.today { background: var(--brand-tint); }
.day-cell.today .dom, .day-cell.today .dow { color: var(--brand-text); }

.tl-body { position: relative; }
.tl-lane { position: relative; border-bottom: 1px solid var(--hairline); }
.lane-bg { position: absolute; inset: 0; display: flex; pointer-events: none; }
.lane-bg .col { width: var(--day-w); flex: 0 0 var(--day-w); border-right: 1px solid var(--line-soft); }
.lane-bg .col.weekend { background: var(--weekend); }

/* Heute-Linie als Tally-Light: rot, mit Pill-Label */
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); z-index: 5; pointer-events: none; box-shadow: 0 0 10px 0 rgba(228, 5, 37, 0.6); }
.today-line::before {
  content: attr(data-label); position: absolute; top: 4px; left: 6px;
  padding: 0 8px; height: 20px; display: flex; align-items: center;
  border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand);
  font: 500 10px/12px var(--font); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}

/* event bar (Kategoriefarben unverändert) */
.event-bar {
  position: absolute; height: 40px; border-radius: var(--radius-sm);
  padding: 5px 10px; display: flex; flex-direction: column; justify-content: center;
  overflow: hidden; cursor: pointer; z-index: 2;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bar) 92%, #000 0%), color-mix(in srgb, var(--bar) 72%, #000 20%));
  border: 1px solid color-mix(in srgb, var(--bar) 80%, #fff 10%);
  transition: filter 0.12s;
}
.event-bar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: color-mix(in srgb, var(--bar) 100%, #fff 25%); }
.event-bar:hover { filter: brightness(1.12); z-index: 4; }
.event-bar .ev-title { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.event-bar .ev-people { font-size: 10px; color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.event-bar.compact { padding: 4px 7px; }
.event-bar.compact .ev-people { display: none; }

.edge-fade { position: absolute; top: 0; bottom: 0; width: 40px; pointer-events: none; z-index: 6; opacity: 0; transition: opacity 0.12s; }
.edge-left { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.edge-right { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.tl-viewport.can-left ~ .edge-left, .edge-left.show { opacity: 1; }

.hint { text-align: center; color: var(--ink-muted); font-size: 12px; line-height: 16px; margin: 16px 0 0; }

/* ============ List View ============ */
.table-wrap { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; padding: 16px; font: 500 10px/12px var(--font);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted);
  background: var(--surface-raised); border-bottom: 1px solid var(--hairline); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.data-table th.sortable { cursor: pointer; user-select: none; transition: color 0.12s; }
.data-table th.sortable:hover { color: var(--ink); }
.data-table th.sortable::after { content: "⇅"; margin-left: 6px; opacity: 0.35; font-size: 11px; }
.data-table th.sort-asc::after { content: "↑"; opacity: 1; color: var(--ink); }
.data-table th.sort-desc::after { content: "↓"; opacity: 1; color: var(--ink); }
.data-table th.sort-asc, .data-table th.sort-desc { color: var(--ink); }
.data-table tbody tr { border-bottom: 1px solid var(--hairline); transition: background-color 0.12s; }
.data-table tbody tr:last-child { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-raised); }
.data-table td { padding: 12px 16px; font-size: 14px; color: var(--ink-muted); vertical-align: middle; }
.data-table td.cell-title { color: var(--ink); font-weight: 600; }
.cat-tag { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--tag) 24%, transparent); border: 1px solid color-mix(in srgb, var(--tag) 45%, transparent); }
.cat-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tag); }
.col-actions { width: 96px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions button { width: 32px; height: 32px; border-radius: var(--radius-pill); border: 1px solid var(--border-control); background: transparent; color: var(--ink); display: grid; place-items: center; transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
.row-actions button:hover { background: var(--surface-strong); border-color: var(--ink); }
.row-actions button.del:hover { color: var(--danger); border-color: var(--danger); background: transparent; }
.row-actions svg { width: 15px; height: 15px; }
.dur-badge { font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; padding: 64px 24px; color: var(--ink-muted); font-size: 14px; }
.is-hidden { display: none !important; }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: var(--scrim);
}
.modal-card {
  width: 100%; max-width: 480px; background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 16px; }
.modal-head h2 { margin: 0; font-family: var(--font-condensed); font-weight: 700; font-size: 34px; line-height: 1; text-transform: uppercase; }
.icon-btn.close { font-size: 26px; border-radius: var(--radius-pill); width: 44px; height: 44px; }
.modal-body { padding: 8px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font: 500 10px/12px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.field input, .field textarea {
  padding: 0 16px; height: 44px; background: var(--surface); border: 1px solid var(--border-control);
  border-radius: var(--radius-sm); color: var(--ink); font: 400 14px/20px var(--font); transition: border-color 0.12s; width: 100%;
}
.field textarea { height: auto; min-height: 64px; padding: 12px 16px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-subtle); }
.field input:hover, .field textarea:hover { border-color: var(--ink-muted); }
.field input:focus, .field textarea:focus { outline: none; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--ink); }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }

.cat-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-opt {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-control); background: transparent; color: var(--ink);
  font: 500 13px/20px var(--font); transition: background-color 0.12s, border-color 0.12s;
}
.cat-opt:hover { background: var(--surface-strong); }
.cat-opt .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--opt); }
.cat-opt.is-active { border-color: var(--opt); color: var(--ink); background: color-mix(in srgb, var(--opt) 20%, var(--surface-raised)); }

.form-error { margin: 0; padding: 12px 16px; background: var(--brand-tint); border: 1px solid var(--danger); border-radius: var(--radius-sm); color: var(--danger); font-size: 14px; }
.modal-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.modal-actions .spacer { flex: 1; }
.danger-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--danger); background: transparent; color: var(--danger);
  border-radius: var(--radius-pill); font-weight: 600; font-size: 14px; line-height: 20px; transition: background-color 0.12s;
}
.danger-btn:hover { background: var(--brand-tint); }

/* ============ Tooltip (schnell) ============ */
.tooltip {
  position: fixed; z-index: 150; top: 0; left: 0; max-width: 300px;
  padding: 10px 12px; background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  pointer-events: none; opacity: 0;
  transition: opacity 0.07s ease; transition-delay: 0s;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-cat { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/12px var(--font); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); margin-bottom: 4px; }
.tooltip .tt-cat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tt); }
.tooltip .tt-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.tooltip .tt-row svg { width: 13px; height: 13px; color: var(--ink-subtle); flex: 0 0 auto; }

/* ============ Detail-Popover ============ */
.popover {
  position: fixed; z-index: 160; top: 0; left: 0; width: 320px;
  background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  overflow: hidden; opacity: 0;
  transition: opacity 0.12s ease;
}
.popover.show { opacity: 1; }
.popover .pop-accent { height: 4px; background: var(--pc); }
.popover .pop-body { padding: 16px 20px 16px; }
.popover .pop-cat { display: inline-flex; align-items: center; gap: 8px; font: 500 10px/12px var(--font); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.popover .pop-cat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px 0 var(--pc); }
.popover .pop-title { margin: 8px 0 12px; font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.popover .pop-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink-muted); margin-top: 8px; }
.popover .pop-row svg { width: 15px; height: 15px; color: var(--ink-subtle); flex: 0 0 auto; margin-top: 2px; }
.popover .pop-note { margin-top: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-muted); line-height: 1.5; white-space: pre-wrap; }
.popover .pop-meta { margin-top: 12px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.popover .pop-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.popover .pop-actions .spacer { flex: 1; }
.popover .pop-actions button { min-height: 36px; padding: 0 16px; font-size: 14px; }
.popover .icon-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: var(--radius-pill); }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200; min-height: 44px; padding: 0 20px; background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); color: var(--ink); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; animation: toastIn 0.12s ease-out;
}
.toast .tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
@keyframes toastIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .app-header { gap: 12px; padding: 12px 16px; }
  .brand-text h1 { font-size: 26px; }
  .brand-logo { height: 26px; }
  .toolbar { width: 100%; margin-left: 0; }
  .search-wrap { order: 5; flex: 1 1 100%; }
  #search, #search:focus { width: 100%; }
  .stage { padding: 12px 16px 48px; }
  :root { --gutter-w: 116px; }
  .gutter-lane { font-size: 15px; padding: 0 10px; }
  .gutter-lane .lane-count { display: none; }
  #btnNew span { display: none; }
  #btnNew { padding: 0; width: 44px; }
  .legend { padding: 12px 16px 2px; }
  .data-table td.cell-people, .data-table th:nth-child(3) { display: none; }
}
@media (max-width: 560px) {
  .data-table td.cell-cat, .data-table th:nth-child(2) { display: none; }
  .tools-timeline { display: none; }
}
