/* gantt.vanagabond — refined-minimal design system
   Direction: literary serif (Fraunces) paired with a tight humanist sans (IBM Plex
   Sans), mono numerals (JetBrains Mono). Warm parchment + deep ink with a confident
   rust accent. Considered motion (200ms cubic-bezier), atmospheric depth from grain
   + soft shadows rather than blunt colors. ──────────────────────────────────── */

:root {
  /* Light theme tokens */
  --surface: #F4EFE2;
  --surface-2: #FBF7EC;
  --surface-3: #FFFCF4;
  --ink: #16140F;
  --ink-2: #4A463E;
  --ink-3: #8B857A;
  --ink-4: #BCB4A1;
  --rule: #DFD7C2;
  --rule-strong: #C8BFA6;
  --rust: #C5543B;
  --rust-2: #A3402B;
  --rust-soft: #E9C3B7;
  --sage: #6B7B6E;
  --sage-soft: #C8D2C6;
  --gold: #B58A3E;
  --shadow-1: 0 1px 0 rgba(22, 20, 15, .04), 0 1px 2px rgba(22, 20, 15, .06);
  --shadow-2: 0 8px 24px -8px rgba(22, 20, 15, .12), 0 2px 6px rgba(22, 20, 15, .06);
  --shadow-pop: 0 24px 60px -24px rgba(22, 20, 15, .35), 0 4px 12px rgba(22, 20, 15, .08);
  --grain-strength: .035;

  /* Type */
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Fraunces', 'Iowan Old Style', 'Garamond', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 32px;
  --fs-3xl: 48px;
  --lh: 1.5;

  /* Geometry */
  --rail-w: 264px;
  --topbar-h: 56px;
  --zoom-bar-h: 48px;
  --row-h: 38px;
  --task-list-w: 320px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tx: 200ms;
}

[data-theme="dark"] {
  --surface: #15110D;
  --surface-2: #1B1611;
  --surface-3: #221C16;
  --ink: #EBE5D6;
  --ink-2: #B6AE9A;
  --ink-3: #7A7363;
  --ink-4: #4D483F;
  --rule: #2E2820;
  --rule-strong: #423A2E;
  --rust: #DE6A50;
  --rust-2: #F08672;
  --rust-soft: #4B2A22;
  --sage: #93A696;
  --sage-soft: #2F3A32;
  --gold: #D6A55B;
  --shadow-1: 0 1px 0 rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 12px 32px -10px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.45);
  --shadow-pop: 0 24px 60px -24px rgba(0,0,0,.85), 0 4px 12px rgba(0,0,0,.5);
  --grain-strength: .06;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
  }
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv05', 'cv11';
  overflow: hidden;
}

/* Subtle film-grain over the whole page for warmth — keeps the parchment feel
   from looking flat, especially in big surface areas. */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: var(--grain-strength);
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::before { mix-blend-mode: screen; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
em { font-style: italic; }

/* ── Type helpers ────────────────────────────────────────────────────────── */
.serif { font-family: var(--serif); font-feature-settings: 'ss01'; letter-spacing: -.01em; }
.display { font-size: var(--fs-3xl); line-height: 1.05; font-weight: 380; letter-spacing: -.02em; }
.display-sm { font-size: var(--fs-2xl); line-height: 1.1; font-weight: 380; letter-spacing: -.01em; }
.lede { color: var(--ink-2); font-size: var(--fs-md); max-width: 38ch; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Splash ──────────────────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0; display: grid; place-items: center; gap: 14px;
  background: var(--surface); z-index: 10000;
  transition: opacity 300ms var(--ease);
}
.splash.fade { opacity: 0; pointer-events: none; }
.splash-mark svg { fill: var(--rust); animation: pulse 1.6s var(--ease) infinite; }
.splash-word { font-family: var(--serif); font-size: 22px; color: var(--ink-2); letter-spacing: -.01em; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ── Auth screens ────────────────────────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 70% -10%, color-mix(in oklab, var(--rust) 14%, transparent), transparent 60%),
    radial-gradient(800px 500px at -10% 100%, color-mix(in oklab, var(--sage) 18%, transparent), transparent 60%),
    var(--surface);
  animation: fadeUp 500ms var(--ease);
}
.auth-card {
  width: min(100%, 460px);
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-pop);
}
.auth-mark .serif { display: block; font-size: var(--fs-sm); color: var(--ink-3); letter-spacing: .02em; margin-bottom: 14px; }
.auth-mark h1 { margin: 0 0 12px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.field > span em { color: var(--ink-3); font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea, .input, .select {
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: var(--fs-base);
  color: var(--ink);
  transition: border-color var(--tx) var(--ease), box-shadow var(--tx) var(--ease), background var(--tx) var(--ease);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--rust) 14%, transparent);
}
.auth-error { color: var(--rust); font-size: var(--fs-sm); margin: 0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  font-size: var(--fs-sm); font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background var(--tx) var(--ease), color var(--tx) var(--ease),
              transform var(--tx) var(--ease), border-color var(--tx) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--rust); color: #FFF7EE;
  box-shadow: 0 1px 0 color-mix(in oklab, var(--rust) 50%, black) inset;
}
.btn-primary:hover { background: var(--rust-2); }
.btn-ghost { color: var(--ink-2); border-color: var(--rule); background: var(--surface-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--rule-strong); }
.btn-danger { color: var(--rust); border-color: var(--rust-soft); background: transparent; }
.btn-danger:hover { background: var(--rust-soft); }
.btn-link { color: var(--ink-2); padding: 0; height: auto; border: 0; background: none; text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.btn-link:hover { color: var(--ink); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  color: var(--ink-2);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background var(--tx) var(--ease), color var(--tx) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--rule); }

/* ── App shell ───────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: 'topbar topbar' 'rail canvas';
  height: 100vh;
  animation: fadeUp 320ms var(--ease);
}

.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  position: relative; z-index: 10;
}
.rail-toggle { display: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { fill: var(--rust); flex-shrink: 0; }
.brand-word { font-family: var(--serif); font-size: 17px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.brand-word em { color: var(--ink-2); font-style: italic; font-weight: 400; }
.brand-dot { color: var(--ink-4); padding: 0 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule);
  background: var(--surface-3);
  position: relative;
}
.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--rust);
  color: #FFF7EE;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: .03em;
}
.user-name { font-size: var(--fs-sm); font-weight: 500; }

.rail {
  grid-area: rail;
  background: var(--surface-2);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
  padding: 14px 12px 80px;
  display: flex; flex-direction: column; gap: 24px;
}
.rail-section { display: flex; flex-direction: column; gap: 6px; }
.rail-h {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: var(--fs-md); color: var(--ink-2); margin: 4px 6px 6px;
  letter-spacing: -.01em;
}

.project-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.project-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--tx) var(--ease);
  min-width: 0;
}
.project-item:hover { background: var(--surface-3); }
.project-item.is-active { background: color-mix(in oklab, var(--rust) 8%, var(--surface-3)); }
.project-item .swatch {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}
.project-item .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 500; }
.project-item .pmeta { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

.filter-group { display: flex; flex-direction: column; gap: 4px; padding: 0 6px; }
.filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

.canvas {
  grid-area: canvas;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background: var(--surface);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  margin: auto;
  display: grid; place-items: center; gap: 18px;
  text-align: center;
  max-width: 460px; padding: 60px 24px;
}
.empty-art svg { fill: var(--ink-4); }
.empty-state h2 { margin: 0; }
.empty-state .lede { margin: 0 auto; }

/* ── Canvas header + zoom bar ────────────────────────────────────────────── */
.gantt-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.canvas-header {
  display: flex; align-items: flex-end; gap: 14px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.canvas-title h1 { margin: 0; }
.canvas-title { flex: 1; min-width: 0; }
.canvas-meta { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 4px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.canvas-meta .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink-2); }
.canvas-meta .chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.canvas-actions { display: flex; gap: 8px; align-items: center; }

.zoom-bar {
  display: flex; align-items: center; gap: 16px;
  height: var(--zoom-bar-h);
  padding: 0 24px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
}
.zoom-label {
  font-family: var(--serif); font-style: italic; font-size: var(--fs-sm); color: var(--ink-3);
}
.zoom-slider-wrap { flex: 1; max-width: 520px; position: relative; }
.zoom-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: linear-gradient(to right, var(--rule) 0, var(--rule) 100%);
  border-radius: var(--r-pill);
  outline: none;
}
.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--surface-3);
  border: 1.5px solid var(--rust);
  border-radius: 50%;
  cursor: grab;
  box-shadow: var(--shadow-1);
  transition: transform var(--tx) var(--ease);
}
.zoom-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.08); }
.zoom-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--surface-3);
  border: 1.5px solid var(--rust);
  border-radius: 50%;
  cursor: grab;
}
.zoom-detents {
  display: flex; justify-content: space-between;
  margin-top: 6px; padding: 0 2px;
}
.detent {
  font-size: 11px; color: var(--ink-3); letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  transition: color var(--tx) var(--ease), background var(--tx) var(--ease);
}
.detent:hover { color: var(--ink); background: var(--surface-3); }
.detent.is-active { color: var(--rust); }

/* ── Gantt grid ──────────────────────────────────────────────────────────── */
.gantt-grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: var(--task-list-w) 1fr;
}

.task-list-pane {
  background: var(--surface-2);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  min-height: 0;
}
.task-list-header {
  display: flex; align-items: center;
  height: 56px; padding: 0 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 2;
}
.task-list-h { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); flex: 1; }
.task-list-h:last-child { flex: 0 0 auto; text-align: right; }
.task-list-body { overflow-y: auto; flex: 1; }

.task-row {
  display: flex; align-items: center; gap: 10px;
  height: var(--row-h);
  padding: 0 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--rule) 60%, transparent);
  cursor: pointer;
  transition: background var(--tx) var(--ease);
  position: relative;
}
.task-row:hover { background: var(--surface-3); }
.task-row.is-selected { background: color-mix(in oklab, var(--rust) 6%, var(--surface-3)); }
.task-row .marker {
  width: 12px; height: 12px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  color: var(--rust);
}
.task-row .marker.is-milestone svg { transform: rotate(45deg); }
.task-row .tname {
  flex: 1; min-width: 0;
  font-size: var(--fs-sm); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-row .tdates {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  margin-left: auto;
}
.task-row .tassignees {
  display: flex; gap: -4px;
  flex-shrink: 0;
}
.assignee-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink-4);
  color: #fff;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 600;
  margin-left: -6px;
  border: 1.5px solid var(--surface-2);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.06);
}
.assignee-dot:first-child { margin-left: 0; }

.timeline-pane {
  position: relative;
  overflow: auto;
  background:
    repeating-linear-gradient(to right, transparent 0 calc(var(--col-w, 100px) - 1px), color-mix(in oklab, var(--rule) 50%, transparent) calc(var(--col-w, 100px) - 1px) var(--col-w, 100px)),
    var(--surface);
}
.timeline-inner { position: relative; min-height: 100%; }
.timeline-inner svg { display: block; }

/* Gantt bar styling (applied via SVG inline class names) */
.gantt-bar { fill: var(--rust); transition: filter var(--tx) var(--ease); }
.gantt-bar:hover { filter: brightness(1.08); }
.gantt-bar-stroke { stroke: color-mix(in oklab, var(--rust) 70%, black); stroke-width: 1; }
.gantt-bar-progress { fill: color-mix(in oklab, var(--rust) 80%, black); }
.gantt-milestone { fill: var(--sage); }
.gantt-milestone-stroke { stroke: color-mix(in oklab, var(--sage) 60%, black); }
.gantt-dep { stroke: var(--ink-3); stroke-width: 1.25; fill: none; opacity: .6; }
.gantt-dep:hover { opacity: 1; }
.gantt-dep-arrow { fill: var(--ink-3); opacity: .6; }
.gantt-today-line { stroke: var(--rust); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .7; }
.gantt-row-band { fill: var(--surface-3); }
.gantt-row-band-alt { fill: transparent; }
.gantt-month-header { fill: var(--surface-2); }
.gantt-month-header-text { fill: var(--ink-2); font-family: var(--serif); font-style: italic; font-size: 12px; }
.gantt-day-header-text { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.gantt-grid-line { stroke: color-mix(in oklab, var(--rule) 50%, transparent); stroke-width: 1; }
.gantt-grid-line-strong { stroke: var(--rule); stroke-width: 1; }
.gantt-weekend { fill: color-mix(in oklab, var(--ink-4) 6%, transparent); }
.gantt-bar-label { fill: #FFF7EE; font-size: 11px; font-weight: 500; pointer-events: none; }
.gantt-bar-handle { fill: rgba(255,247,238,.0); cursor: ew-resize; }
.gantt-bar-handle:hover { fill: rgba(255,247,238,.2); }
.gantt-link-handle { fill: var(--rust); opacity: 0; transition: opacity var(--tx) var(--ease); cursor: crosshair; }
.gantt-bar-group:hover .gantt-link-handle { opacity: .9; }
.gantt-bar-group { cursor: grab; }
.gantt-bar-group.is-dragging { cursor: grabbing; }
.gantt-temp-link { stroke: var(--rust); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklab, var(--ink) 40%, transparent);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn 200ms var(--ease);
  padding: 20px;
}
.modal {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  animation: modalIn 240ms var(--ease);
}
.modal.wide { width: min(100%, 760px); }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--rule);
}
.modal-head h2 { font-family: var(--serif); font-weight: 380; font-size: 22px; margin: 0; letter-spacing: -.01em; }
.modal-head .close-btn { margin-left: auto; }
.modal-body { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: flex-end; gap: 8px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field textarea { min-height: 80px; resize: vertical; }
.color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--tx) var(--ease), border-color var(--tx) var(--ease);
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.is-active { border-color: var(--ink); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  transition: background var(--tx) var(--ease), border-color var(--tx) var(--ease);
  cursor: pointer;
}
.tag-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.tag-chip:hover { border-color: var(--rule-strong); }
.tag-chip.is-active { background: color-mix(in oklab, var(--rust) 12%, var(--surface-3)); border-color: var(--rust); color: var(--ink); }

/* Menus / dropdowns */
.menu-pop {
  position: absolute;
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  min-width: 200px;
  padding: 6px;
  z-index: 200;
  animation: fadeUp 160ms var(--ease);
}
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; font-size: var(--fs-sm); font-weight: 500;
  border-radius: var(--r-sm);
  transition: background var(--tx) var(--ease);
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.is-danger { color: var(--rust); }
.menu-sep { height: 1px; background: var(--rule); margin: 4px 0; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
#toast-root {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--surface);
  padding: 10px 16px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-pop);
  animation: toastIn 200ms var(--ease);
}
.toast.is-error { background: var(--rust); color: #FFF7EE; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Directory tabs ──────────────────────────────────────────────────────── */
.dir-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.dir-tab {
  padding: 8px 12px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent;
  transition: color var(--tx) var(--ease), border-color var(--tx) var(--ease);
}
.dir-tab:hover { color: var(--ink-2); }
.dir-tab.is-active { color: var(--ink); border-color: var(--rust); }

.dir-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.dir-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  transition: background var(--tx) var(--ease);
}
.dir-row:hover { background: var(--surface-3); }
.dir-row .swatch { width: 10px; height: 10px; border-radius: 3px; }
.dir-row .name { flex: 1; font-size: var(--fs-sm); font-weight: 500; }
.dir-row .sub { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.dir-row .row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--tx) var(--ease); }
.dir-row:hover .row-actions { opacity: 1; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
.hide-narrow { display: inline; }

@media (max-width: 780px) {
  :root { --rail-w: 0px; --task-list-w: 200px; --topbar-h: 52px; --zoom-bar-h: 44px; }
  .rail-toggle { display: inline-grid; }
  .app { grid-template-columns: 1fr; grid-template-areas: 'topbar' 'canvas'; }
  .rail {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: 280px;
    transform: translateX(-100%); transition: transform var(--tx) var(--ease);
    z-index: 50; box-shadow: var(--shadow-pop);
    grid-area: unset;
  }
  .rail.is-open { transform: translateX(0); }
  .topbar-right .btn-ghost, .topbar-right .user-name { display: none; }
  .brand-word { font-size: 15px; }
  .canvas-header { padding: 14px 16px 10px; flex-wrap: wrap; }
  .display-sm { font-size: 22px; }
  .zoom-bar { padding: 0 16px; gap: 10px; }
  .zoom-label { display: none; }
  .hide-narrow { display: none; }
  .task-row { padding: 0 10px; }
  .modal { border-radius: var(--r-lg); }
  .field-row { grid-template-columns: 1fr; }
}

/* Scrollbar — minimal, themed */
.task-list-body::-webkit-scrollbar,
.timeline-pane::-webkit-scrollbar,
.rail::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.dir-list::-webkit-scrollbar { width: 10px; height: 10px; }
.task-list-body::-webkit-scrollbar-thumb,
.timeline-pane::-webkit-scrollbar-thumb,
.rail::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.dir-list::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: var(--r-pill); border: 2px solid var(--surface); }
.task-list-body::-webkit-scrollbar-track,
.timeline-pane::-webkit-scrollbar-track,
.rail::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track { background: transparent; }
