:root {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-surface-alt: #f0f0f0;
  --color-border: #e2e2e2;
  --color-border-accent: #d0d0d0;
  --color-text-primary: #1a1a2e;
  --color-text-secondary: #4a4a5a;
  --color-text-muted: #8e8e9e;
  --color-accent: #4F46E5;
  --color-danger: #e03030;
  --color-success: #1a9e5c;
  --color-warning: #d97706;
  --color-accent-hover: #4338CA;
  --color-accent-light: #EEF2FF;
  --color-accent-surface: #E0E7FF;
  --color-danger-hover: #b82828;
  --color-success-hover: #148048;
  /* Foreground on dark, accent and status fills */
  --color-inverse: #ffffff;
  --color-black: #000000;
  --color-confirmed: #2a9d5c;
  --color-warning-surface: #fffbeb;
  /* Toast accents (on the dark toast background) */
  --color-success-on-dark: #22c55e;
  --color-danger-on-dark: #ff8a84;
  --color-warning-on-dark: #f0a500;
  /* Option chart (crew availability): text colors and pill/swatch fills */
  --color-option-1st: #3b82f6;
  --color-option-2nd: #d4860a;
  --color-option-na: #dc2626;
  --color-option-1st-fill: #4a7fc7;
  --color-option-2nd-fill: #c08a28;
  --color-option-confirmed-fill: #2d8a50;
  /* Categorical colors (timeline categories, shoot plan blocks) */
  --color-cat-green: #4CAF50;
  --color-cat-blue: #2196F3;
  --color-cat-amber: #F9A825;
  --color-cat-orange: #FF9800;
  --color-cat-deep-orange: #FF5722;
  /* Overview timeline highlights (shoot days use --color-success) */
  --color-highlight-delivery: #3b82f6;
  --color-highlight-red-day: #ff3b30;
  /* Neutral greys for component details; --color-gray-XX is #XXXXXX */
  --color-gray-0a: #0a0a0a;
  --color-gray-11: #111111;
  --color-gray-22: #222222;
  --color-gray-55: #555555;
  --color-gray-66: #666666;
  --color-gray-77: #777777;
  --color-gray-88: #888888;
  --color-gray-99: #999999;
  --color-gray-aa: #aaaaaa;
  --color-gray-bb: #bbbbbb;
  --color-gray-cc: #cccccc;
  --color-gray-ee: #eeeeee;
  /* Story page (/story) scenery */
  --color-story-sky-day: #bfdcff;
  --color-story-sky-day-low: #eef6ff;
  --color-story-sky-dusk: #ff9e7a;
  --color-story-sky-dusk-low: #ffd9a8;
  --color-story-sky-night: #141a3d;
  --color-story-sky-night-low: #3b3f78;
  --color-story-night-tint: rgba(16, 20, 56, 0.45);
  --color-story-hill-far: #c9d6ea;
  --color-story-hill-near: #a9bcd8;
  --color-story-city: #93a7c6;
  --color-story-ground: #ece5d8;
  --color-story-ground-edge: #d6ccb9;
  --color-story-sun: #ffd166;
  --color-story-moon: #f6f1dc;
  --color-story-cork: #d9b48c;
  --color-story-cork-edge: #b48a5c;
  --color-story-bulb: #ffcf5c;
  --color-story-shadow: rgba(26, 26, 46, 0.15);
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --sidebar-width: 220px;
  --top-nav-height: 56px;
  --content-max: 1400px;
  --border-radius: 6px;
  --border-radius-lg: 8px;
  --border-radius-pill: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  min-width: 1200px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* =====================
   TOP NAV
   ===================== */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--top-nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  z-index: 50;
  gap: var(--space-xl);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-accent);
  white-space: nowrap;
  text-decoration: none;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-accent);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0;
  transition: color 0.15s;
  padding: 6px 12px;
  border-radius: var(--border-radius);
}
.nav-link:hover { background: var(--color-surface-alt); }
.nav-link:hover { color: var(--color-text-primary); }
.nav-link.active { color: var(--color-accent); font-weight: 600; }

.nav-muted {
  font-size: 13px;
  color: var(--color-text-muted);
}

.nav-sep {
  color: var(--color-text-muted);
  font-size: 13px;
}

/* =====================
   SUB NAV (project pages)
   ===================== */
/* Sidebar replaces horizontal sub-nav on project pages */
.sub-nav { display: none; }

.project-sidebar {
  position: fixed;
  top: var(--top-nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  z-index: 49;
  overflow-y: auto;
  padding: var(--space-md) 0;
  display: flex;
  flex-direction: column;
}

.sidebar-back {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
  margin-bottom: var(--space-xs);
}
.sidebar-back:hover { color: var(--color-text-primary); }
.sidebar-back svg { width: 16px; height: 16px; }

.sidebar-project-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  padding: 0 var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
  word-break: break-word;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--space-sm); }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav-item:hover {
  background: var(--color-accent-light);
  color: var(--color-text-primary);
}
.sidebar-nav-item.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-weight: 600;
}
.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-nav-item.active svg { opacity: 1; }

.sub-back {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
  flex-shrink: 0;
}
.sub-back:hover { color: var(--color-text-secondary); }

.sub-nav-back {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
}
.sub-nav-back:hover { color: var(--color-text-secondary); }

.sub-project-name,
.sub-nav-project {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.sub-links,
.sub-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
}

.sub-nav-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.1s;
  white-space: nowrap;
}
.sub-nav-link:hover,
.sub-nav-link.active { color: var(--color-text-primary); }

/* =====================
   PAGE LAYOUT
   ===================== */
.page {
  padding-top: var(--top-nav-height);
}
.page--project {
  padding-top: var(--top-nav-height);
  margin-left: var(--sidebar-width);
}

.main-content {
  padding-top: var(--top-nav-height);
  max-width: var(--content-max);
  margin-left: var(--sidebar-width);
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

.page-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
  gap: var(--space-lg);
}

/* =====================
   DISPLAY HEADING
   ===================== */
.display-heading {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.9vw, 56px);
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  padding: var(--space-md) 0 var(--space-md);
  display: block;
}

.heading-lg {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.2;
  color: var(--color-text-primary);
}

.heading-md {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.heading-sm {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* =====================
   LIST / TABLE
   ===================== */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-md);
  margin-bottom: 0;
}

.table-row {
  display: grid;
  border-bottom: 1px solid var(--color-border);
  padding: 20px var(--space-md);
  align-items: center;
  transition: background 0.15s;
  border-radius: var(--border-radius);
}
.table-row:hover { background: var(--color-surface-alt); }

.table-col-year {
  font-size: 13px;
  color: var(--color-text-secondary);
  width: 80px;
}

.table-col-name {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.table-col-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.table-col-action {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: right;
  cursor: pointer;
  transition: color 0.1s;
}
.table-col-action:hover { color: var(--color-text-primary); }

/* =====================
   BUTTONS
   ===================== */
.btn {
  background: var(--color-accent);
  color: var(--color-inverse);
  border: none;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: var(--border-radius);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--color-accent-hover); box-shadow: var(--shadow-sm); }

.btn-sm {
  padding: 7px 14px;
  font-size: 11px;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-bg);
}
.btn-danger:hover { background: var(--color-danger-hover); }

.btn-success {
  background: var(--color-success);
  color: var(--color-bg);
}
.btn-success:hover { background: var(--color-success-hover); }

.btn-outline {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-accent);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: var(--border-radius);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--color-text-primary); color: var(--color-text-primary); background: var(--color-surface-alt); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--border-radius);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--color-text-primary); background: var(--color-surface-alt); }
.btn-ghost--danger, .btn-ghost--danger:hover { color: var(--color-danger); }

/* =====================
   FORM INPUTS
   ===================== */
.input {
  background: var(--color-surface);
  border: 1px solid var(--color-border-accent);
  color: var(--color-text-primary);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: var(--border-radius);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-light); }
.input::placeholder { color: var(--color-text-muted); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--border-radius);
}

select.input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
    linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px;
  background-position: right 16px center, right 10px center;
  background-repeat: no-repeat, no-repeat;
  padding-right: 32px;
}

textarea.input { resize: vertical; min-height: 80px; }

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.field-group--wide { grid-column: span 2; }

.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Two inputs side by side (e.g. from/to dates in a modal) */
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.field-sublabel {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Inline editable fields */
.inline-field {
  cursor: pointer;
  padding: 2px 4px;
  margin: -2px -4px;
  border: 1px solid transparent;
  transition: border-color 0.1s;
  min-width: 80px;
  display: inline-block;
}
.inline-field:hover { border-color: var(--color-border-accent); }
.inline-field.editing { border-color: var(--color-gray-99); background: var(--color-surface); }

.inline-input {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  width: 100%;
  outline: none;
  padding: 0;
}

/* =====================
   STATUS BADGES
   ===================== */
.badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: var(--border-radius-pill);
  display: inline-block;
  white-space: nowrap;
}
.badge--confirmed, .badge--production { color: var(--color-gray-0a); }
.badge--tentative { color: var(--color-gray-77); border-color: var(--color-gray-aa); }
.badge--pre-production { color: var(--color-gray-55); border-color: var(--color-gray-99); }
.badge--declined { color: var(--color-gray-bb); border-color: var(--color-gray-bb); }
.badge--wrap, .badge--post-production { color: var(--color-gray-99); border-color: var(--color-gray-bb); }
.badge--done { color: var(--color-text-muted); }
.badge--pending { color: var(--color-gray-88); }
.badge--development { color: var(--color-gray-88); border-color: var(--color-gray-bb); }

.demo-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--color-gray-55);
  color: var(--color-gray-88);
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

/* =====================
   MODALS
   ===================== */
.modal-overlay {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 40px;
  width: 560px;
  max-width: 95vw;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-card--vehicle { width: 400px; }
.modal-card--versions { max-width: 480px; max-height: 80vh; overflow-y: auto; }

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-xl);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  justify-content: flex-end;
}

/* Settings modal */
.settings-section { margin-bottom: var(--space-xl); }
.settings-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}
.settings-description {
  font-size: 13px; color: var(--color-text-secondary);
  line-height: 1.5; margin-bottom: var(--space-md);
}

/* =====================
   TOAST
   ===================== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--color-text-primary); color: var(--color-inverse);
  padding: 12px 20px;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.01em;
  z-index: 200;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  border-left: 3px solid var(--color-inverse);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast--success { border-left-color: var(--color-success-on-dark); }
.toast.toast--error   { border-left-color: var(--color-danger); color: var(--color-danger-on-dark); }
.toast.toast--warning { border-left-color: var(--color-warning); color: var(--color-warning-on-dark); }

/* Projects page toolbar (search, archived toggle, view toggle, new) */
.projects-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: var(--space-lg);
}
.projects-toolbar .input { width: 200px; font-size: 12px; padding: 8px 12px; }
.projects-toolbar .btn-ghost { font-size: 11px; }

/* =====================
   TOGGLE (Grid/List)
   ===================== */
.view-toggle {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.view-toggle button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
}
.view-toggle button.active { color: var(--color-accent); border-bottom: 2px solid var(--color-accent); }

/* =====================
   GRID VIEW (projects)
   ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  padding-top: var(--space-sm);
}
.project-card {
  background: var(--color-surface);
  padding: var(--space-lg);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.2s, transform 0.15s;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  padding: 0 4px;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* =====================
   CALLSHEET
   ===================== */

.cs-section {
  margin-bottom: var(--space-xl);
}
.cs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cs-section-header .heading-sm { margin-bottom: 0; }

.cs-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-md);
}

.cs-field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.cs-field-value {
  font-size: 14px;
  color: var(--color-text-primary);
  cursor: pointer;
  min-height: 22px;
  transition: background 0.1s;
}
.cs-field-value:hover { background: var(--color-surface-alt); }
.cs-field-value.empty { color: var(--color-text-muted); font-style: italic; }
.cs-field-value--notes { white-space: pre-wrap; min-height: 60px; }

/* Header bar — 4 cells */
.cs-header-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-top: 2px solid var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.cs-header-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.cs-header-value {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* Date row */
.cs-date-row {
  display: flex;
  gap: var(--space-2xl);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

/* Info grid — 2 columns */
.cs-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

/* Logo upload slot */
.cs-logo-upload {
  width: 120px;
  height: 48px;
  border: 1px dashed var(--color-border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.cs-logo-upload img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.cs-logo-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.7);
  color: var(--color-inverse);
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 1px 5px;
  line-height: 1;
}

/* Schedule rows */
.sched-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

/* Driver rows */
.driver-row {
  display: grid;
  grid-template-columns: 180px 150px 1fr auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

/* Crew sections on callsheet */
.cs-crew-section {
  margin-bottom: var(--space-xl);
}

.cs-crew-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-accent);
  margin-bottom: var(--space-xs);
}

.cs-crew-table {
  width: 100%;
  border-collapse: collapse;
}
.cs-crew-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border-accent);
  color: var(--color-text-muted);
}
.cs-crew-table td {
  font-size: 12px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}
.cs-crew-table td.cs-crew-cell {
  cursor: pointer;
}
.cs-crew-table td.cs-crew-cell:hover {
  background: var(--color-surface-alt);
}
.cs-crew-table tr[draggable="true"] {
  cursor: grab;
}
.cs-crew-table tr.dragging {
  opacity: 0.5;
}
.cs-crew-empty-drop {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 14px 8px;
  border: 1px dashed var(--color-border-accent);
  border-radius: var(--border-radius);
  margin-top: var(--space-xs);
}
.cs-crew-empty-drop.drag-over {
  border-color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}

/* Billing grid */
.cs-billing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
}

/* Location image gallery */
.cs-image-gallery {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm) 0;
}
.cs-image-thumb {
  position: relative;
  width: 140px;
  height: 95px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.cs-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-image-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.7);
  color: var(--color-inverse);
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  line-height: 1;
}
.cs-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: var(--color-inverse);
  font-size: 10px;
  padding: 2px 6px;
}
/* Large location images */
.cs-image-gallery--large {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-sm) 0;
}
.cs-image-thumb--large {
  position: relative;
  width: 280px;
  height: 200px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.cs-image-thumb--large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Version selector */
.cs-version-badge {
  display: inline-block;
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 4px 10px;
  border: 1px solid var(--color-border);
}
.cs-version-select {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
}
.cs-version-select:focus {
  outline: 1px solid var(--color-text-primary);
}

/* Inline add row */
.cs-add-inline {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed var(--color-border);
  margin-top: 4px;
}
.cs-add-inline .input {
  font-size: 12px;
  padding: 4px 6px;
}
.cs-add-inline .btn {
  font-size: 11px;
  padding: 4px 12px;
}
.cs-add-inline .btn-ghost {
  font-size: 14px;
  padding: 2px 6px;
}

/* =====================
   CREW TABLE
   ===================== */
.crew-table {
  width: 100%;
  border-collapse: collapse;
}
.crew-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--color-border);
}
.crew-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  vertical-align: middle;
}
.crew-table tr:hover td { background: var(--color-surface-alt); }

/* =====================
   FILES
   ===================== */
.files-table {
  width: 100%;
  border-collapse: collapse;
}
.files-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--color-border);
}
.files-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  vertical-align: middle;
}
.files-table tr:hover td { background: var(--color-surface-alt); }
.files-table th.col-actions { width: 80px; }
.upload-form {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  max-width: 400px;
}
.upload-filename {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* =====================
   CONTACTS
   ===================== */
.contacts-search {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.contacts-search .input { max-width: 400px; }

/* =====================
   EMPTY STATE
   ===================== */
.empty-state {
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
}
.empty-state h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  color: var(--color-text-muted);
}
.empty-state p { font-size: 13px; }

/* =====================
   MISC UTILS
   ===================== */
.hidden { display: none !important; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.justify-between { justify-content: space-between; }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.items-end { align-items: flex-end; }
.flex-none { flex: none; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }

.page-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-md) 0 var(--space-lg);
}

.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-lg) 0;
}

/* drag over row */
.drag-over { outline: 1px solid var(--color-border-accent); }
[draggable="true"] { cursor: grab; }
[draggable="true"]:active { cursor: grabbing; }

/* Editable field hint — defined in CALLSHEET section above */

/* =====================
   OVERVIEW PAGE
   ===================== */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.overview-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.overview-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.overview-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.overview-section-link {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.1s;
}
.overview-section-link:hover { color: var(--color-text-primary); }

.overview-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.overview-field:last-child { border-bottom: none; }
.overview-field-label { color: var(--color-text-muted); font-size: 11px; }
.overview-field-value { font-weight: 500; color: var(--color-text-primary); }

.progress-bar-wrap {
  background: var(--color-border);
  height: 4px;
  margin: var(--space-md) 0 var(--space-sm);
  border-radius: 2px;
}
.progress-bar-fill {
  height: 4px;
  background: var(--color-accent);
  transition: width 0.3s;
  border-radius: 2px;
}

/* =====================
   ACTUALS PAGE
   ===================== */
.actuals-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-xl);
  align-items: start;
}

.actuals-table {
  width: 100%;
  border-collapse: collapse;
}
.actuals-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.actuals-table th.right { text-align: right; }
.actuals-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  vertical-align: middle;
}
.actuals-table .section-row td {
  background: var(--color-surface-alt);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
}
.actuals-table input[type="number"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--color-border);
  color: var(--color-text-primary);
  font-size: 12px;
  padding: 3px 4px;
  text-align: right;
  outline: none;
}
.actuals-table input[type="number"]:focus {
  border-bottom-color: var(--color-text-secondary);
  border-bottom-style: solid;
  background: var(--color-surface-alt);
}
.actuals-table input[type="number"]::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
  opacity: 0.6;
}
.actuals-table input[type="text"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--color-border);
  color: var(--color-text-primary);
  font-size: 12px;
  padding: 3px 4px;
  outline: none;
}
.actuals-table input[type="text"]:focus {
  border-bottom-color: var(--color-text-secondary);
  border-bottom-style: solid;
  background: var(--color-surface-alt);
}

.var-positive { color: var(--color-success); font-weight: 600; }
.var-negative { color: var(--color-danger);  font-weight: 600; }
.var-zero     { color: var(--color-text-muted); }

.actuals-summary {
  position: sticky;
  top: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}
.actuals-summary h3 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}
.actuals-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}
.actuals-summary-row:last-child { border-bottom: none; }
.actuals-summary-row.grand {
  font-size: 15px;
  font-weight: 700;
  border-top: 2px solid var(--color-text-primary);
  border-bottom: 2px solid var(--color-text-primary);
  padding: 10px 0;
  margin-top: 4px;
}
.actuals-summary-label { color: var(--color-text-secondary); }
.actuals-summary-value { font-weight: 600; }

/* =====================
   ACTUALS PAGE
   ===================== */
.section-header-row td {
  background: var(--color-surface-alt);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 10px 10px;
  border-top: 2px solid var(--color-border);
}
.unplanned-row td { background: var(--color-warning-surface); }
.add-actual-btn {
  background: transparent;
  border: 1px dashed var(--color-border-accent);
  color: var(--color-text-muted);
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.add-actual-btn:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }
.del-btn { color: var(--color-text-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.del-btn:hover { color: var(--color-danger); }
.section-total-row td { background: var(--color-surface); font-weight: 600; font-size: 12px; }
.no-estimate-notice {
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* =====================
   CAR MATRIX PAGE
   ===================== */
.cm-day-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-md);
}
.cm-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-xl);
  align-items: start;
}
.cm-people-panel { border: 1px solid var(--color-border); border-radius: var(--border-radius); overflow: hidden; }
.cm-panel-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 8px 12px;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}
.cm-people-list {
  padding: var(--space-sm);
  min-height: 200px;
}
.cm-person {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  margin-bottom: 4px;
  cursor: grab;
  user-select: none;
  background: var(--color-surface);
  transition: background 0.1s;
  position: relative;
  border-radius: var(--border-radius);
}
.cm-person:hover { background: var(--color-surface-alt); }
.cm-person:active { cursor: grabbing; opacity: 0.7; }
.cm-person-name { font-size: 12px; font-weight: 600; color: var(--color-text-primary); }
.cm-person-role { font-size: 10px; color: var(--color-text-muted); margin-top: 1px; }
.cm-confirmed-dot {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-confirmed);
}
.cm-empty-pool {
  font-size: 11px;
  color: var(--color-text-muted);
  padding: var(--space-md);
  text-align: center;
}
.cm-vehicles-wrap { display: flex; flex-direction: column; }
.cm-vehicles-row {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  align-items: flex-start;
}
.cm-vehicle-card {
  border: 1px solid var(--color-border);
  min-width: 180px;
  flex: 0 0 auto;
  border-radius: var(--border-radius);
  overflow: hidden;
}
.cm-vehicle-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}
.cm-vehicle-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  flex: 1;
}
.cm-vehicle-seats-badge { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; }
.cm-vehicle-edit {
  font-size: 10px;
  color: var(--color-text-muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cm-vehicle-edit:hover { color: var(--color-text-primary); }
.cm-vehicle-del { font-size: 16px; color: var(--color-text-muted); cursor: pointer; line-height: 1; }
.cm-vehicle-del:hover { color: var(--color-danger); }
.cm-vehicle-notes {
  font-size: 10px;
  color: var(--color-text-muted);
  padding: 4px 12px;
  border-top: 1px solid var(--color-border);
  font-style: italic;
}
.cm-seat-list { padding: var(--space-sm); min-height: 60px; }
.cm-seat-list.drag-over { background: var(--color-surface-alt); }
.cm-seat {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 4px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  min-height: 34px;
}
.cm-seat.empty { border-style: dashed; color: var(--color-text-muted); cursor: default; }
.cm-seat.empty.drag-over { border-color: var(--color-text-secondary); background: var(--color-surface-alt); }
.cm-seat.occupied { background: var(--color-surface-alt); }
.cm-seat-num { font-size: 10px; color: var(--color-text-muted); margin-right: 6px; font-weight: 600; }
.cm-seat-person { flex: 1; font-weight: 600; color: var(--color-text-primary); }
.cm-seat-role { font-size: 10px; color: var(--color-text-muted); margin-left: 6px; }
.cm-seat-remove {
  margin-left: auto;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding-left: 8px;
}
.cm-seat-remove:hover { color: var(--color-danger); }
.cm-no-vehicles { font-size: 12px; color: var(--color-text-muted); padding: var(--space-xl) 0; }
.cm-add-vehicle-btn {
  border: 1px dashed var(--color-border-accent);
  background: transparent;
  color: var(--color-text-muted);
  padding: var(--space-md) var(--space-xl);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: var(--space-lg);
  display: inline-block;
}
.cm-add-vehicle-btn:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }
.modal-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  display: block;
}
.cm-add-day-btn {
  opacity: 0.5;
  font-size: 16px;
}

/* =====================
   CREW PAGE
   ===================== */
.dept-section {
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
}
.dept-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
}
.dept-header-left { display: flex; align-items: center; gap: var(--space-sm); }
.dept-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.dept-count { font-size: 10px; color: var(--color-text-muted); }
.dept-toggle {
  font-size: 11px;
  color: var(--color-text-muted);
  display: inline-block;
  transition: transform 0.15s;
}
.dept-toggle.collapsed { transform: rotate(-90deg); }
.dept-body.collapsed { display: none; }
.crew-dept-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.crew-dept-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
  padding: 5px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.crew-dept-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text-primary);
}
.crew-dept-table tr:last-child td { border-bottom: none; }
.crew-dept-table tr:hover td { background: var(--color-surface-alt); }
.crew-dept-table input,
.crew-dept-table select {
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
  width: 100%;
}
.crew-dept-table input:focus { border-bottom: 1px solid var(--color-border-accent); }
.crew-dept-table input::placeholder { color: var(--color-text-muted); }
.crew-dept-table select { cursor: pointer; }
.crew-name-cell { font-weight: 600; min-width: 140px; }
/* Daily Rate cell */
.rate-header { text-align: center !important; }
.rate-cell { white-space: nowrap; text-align: center; }
.rate-cell .rate-input { width: 55px !important; text-align: right; -moz-appearance: textfield; }
.rate-input::-webkit-inner-spin-button,
.rate-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rate-cell .rate-currency-sel { width: 42px !important; font-size: 10px; padding: 2px 0; margin-left: 2px; color: var(--color-text-muted); cursor: pointer; }
/* Option Chart status colors */
.oc-1st       { color: var(--color-option-1st); font-weight: 700; }
.oc-2nd       { color: var(--color-option-2nd); font-weight: 700; }
.oc-confirmed { color: var(--color-confirmed); font-weight: 700; }
.oc-na        { color: var(--color-option-na); font-weight: 700; }
.add-member-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  cursor: pointer;
  border-top: 1px solid var(--color-border);
  display: block;
  width: 100%;
  text-align: left;
}
.add-member-btn:hover { color: var(--color-text-primary); background: var(--color-surface-alt); }
.del-crew-btn { color: var(--color-text-muted); cursor: pointer; font-size: 15px; line-height: 1; }
.del-crew-btn:hover { color: var(--color-danger); }
/* Option Chart availability cells & pills */
.avail-header { text-align: center; width: 48px; min-width: 48px; font-size: 9px; padding: 5px 2px; white-space: nowrap; }
.avail-cell {
  text-align: center;
  cursor: pointer;
  width: 48px;
  min-width: 48px;
  padding: 4px 2px;
  user-select: none;
}
.avail-pill {
  display: inline-block;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  color: var(--color-inverse);
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  line-height: 1.4;
}
.avail-pill.oc-1st       { background: var(--color-option-1st-fill); border-color: var(--color-option-1st-fill); color: var(--color-inverse); }
.avail-pill.oc-2nd       { background: var(--color-option-2nd-fill); border-color: var(--color-option-2nd-fill); color: var(--color-inverse); }
.avail-pill.oc-confirmed { background: var(--color-option-confirmed-fill); border-color: var(--color-option-confirmed-fill); color: var(--color-inverse); }
.avail-pill.oc-na        { background: var(--color-gray-55); border-color: var(--color-gray-66); color: var(--color-inverse); }
.avail-cell:hover .avail-pill { border-color: var(--color-inverse); }
.avail-placeholder { color: var(--color-gray-55); font-size: 14px; line-height: 1; }
.avail-cell:hover .avail-placeholder { color: var(--color-gray-88); }
/* Availability popover */
.avail-popover {
  position: fixed;
  z-index: 1000;
  background: var(--color-surface);
  border: 1px solid var(--color-border-accent);
  min-width: 140px;
  display: none;
  padding: 4px 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}
.avail-popover.open { display: block; }
.avail-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--color-gray-22);
  cursor: pointer;
  white-space: nowrap;
}
.avail-option:hover { background: var(--color-surface-alt); }
.avail-option.active { background: var(--color-gray-ee); border-left: 2px solid var(--color-gray-22); padding-left: 10px; }
.avail-swatch {
  width: 10px;
  height: 10px;
  display: inline-block;
  flex-shrink: 0;
}
.avail-swatch.oc-1st       { background: var(--color-option-1st-fill); }
.avail-swatch.oc-2nd       { background: var(--color-option-2nd-fill); }
.avail-swatch.oc-confirmed { background: var(--color-option-confirmed-fill); }
.avail-swatch.oc-na        { background: var(--color-gray-88); }
.avail-option-clear {
  border-top: 1px solid var(--color-border-accent);
  color: var(--color-gray-88);
  margin-top: 2px;
  padding-top: 6px;
}
.crew-summary-bar {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
}
.crew-summary-bar strong { color: var(--color-text-primary); }
/* Option Chart header */
.oc-title-row { display: flex; align-items: center; gap: var(--space-md); }
.oc-header-actions { display: flex; gap: var(--space-sm); align-items: center; }
.version-select {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}
.version-label { font-size: 12px; color: var(--color-text-muted); padding: 4px 8px; }

/* =====================
   ESTIMATE PAGE
   ===================== */
.est-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-xl); align-items: start; }
.est-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md) var(--space-xl); margin-bottom: var(--space-xl); padding-bottom: var(--space-xl); border-bottom: 1px solid var(--color-border); }
.est-meta .field-group label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 4px; }
.est-meta .field-group input,
.est-meta .field-group select { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 7px 10px; font-size: 13px; border-radius: var(--border-radius); width: 100%; outline: none; }
.est-meta .field-group input:focus,
.est-meta .field-group select:focus { border-color: var(--color-gray-55); }
.section-block { border-bottom: 1px solid var(--color-border); margin-bottom: 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; cursor: pointer; user-select: none; }
.section-header:hover { color: var(--color-text-primary); }
.section-title-col { display: flex; align-items: center; gap: var(--space-md); }
.section-num { font-size: 11px; color: var(--color-text-muted); width: 24px; flex-shrink: 0; }
.section-name { font-size: 13px; font-weight: 600; color: var(--color-text-primary); letter-spacing: 0.02em; }
.section-subtotal { font-size: 13px; font-weight: 600; color: var(--color-text-secondary); }
.section-toggle { font-size: 11px; color: var(--color-text-muted); transition: transform 0.15s; }
.section-block.open .section-toggle { transform: rotate(180deg); }
.section-body { display: none; padding-bottom: var(--space-md); }
.section-block.open .section-body { display: block; }
.lines-table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-sm); }
.lines-table th { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); padding: 6px 8px; border-bottom: 1px solid var(--color-border); text-align: left; }
.lines-table th.right { text-align: right; }
.lines-table td { padding: 5px 4px; border-bottom: 1px solid var(--color-gray-11); vertical-align: middle; }
.lines-table tr:last-child td { border-bottom: none; }
.lines-table input,
.lines-table select { background: transparent; border: none; color: var(--color-text-primary); font-size: 12px; padding: 3px 4px; width: 100%; outline: none; border-bottom: 1px solid transparent; }
.lines-table input:focus,
.lines-table select:focus { border-bottom-color: var(--color-border-accent); background: var(--color-surface-alt); }
.lines-table input[type="number"] { text-align: right; -moz-appearance: textfield; }
.lines-table input[type="number"]::-webkit-inner-spin-button,
.lines-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fin-row input[type="number"] { -moz-appearance: textfield; }
.fin-row input[type="number"]::-webkit-inner-spin-button,
.fin-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lines-table .line-total { font-size: 12px; text-align: right; color: var(--color-text-secondary); white-space: nowrap; padding-right: 8px; }
.lines-table .line-delete { color: var(--color-text-muted); cursor: pointer; font-size: 14px; text-align: center; width: 24px; }
.lines-table .line-delete:hover { color: var(--color-danger); }
.add-line-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; }
.add-line-row select { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-secondary); padding: 5px 8px; font-size: 11px; border-radius: var(--border-radius); flex: 1; }
.add-line-row button { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-muted); padding: 4px 12px; font-size: 11px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.add-line-row button:hover { border-color: var(--color-gray-66); color: var(--color-text-primary); }
.add-line-row input { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-secondary); padding: 5px 8px; font-size: 11px; border-radius: var(--border-radius); flex: 1; }
.totals-panel { position: sticky; top: var(--space-xl); background: var(--color-surface); border: 1px solid var(--color-border); padding: var(--space-lg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.totals-panel h3 { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-md); }
.total-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--color-border); font-size: 12px; }
.total-row:last-child { border-bottom: none; }
.total-row.grand { font-size: 15px; font-weight: 700; border-top: 2px solid var(--color-text-primary); border-bottom: 2px solid var(--color-text-primary); margin-top: 4px; padding: 10px 0; }
.total-row.advance { color: var(--color-text-secondary); }
.total-label { color: var(--color-text-secondary); }
.total-value { font-weight: 600; color: var(--color-text-primary); }
.fin-settings { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-border); }
.fin-settings h3 { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.fin-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fin-row label { font-size: 11px; color: var(--color-text-muted); }
.fin-row input { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 4px 6px; font-size: 11px; width: 70px; text-align: right; border-radius: var(--border-radius); outline: none; }
.fin-row input:focus { border-color: var(--color-gray-55); }
.rate-note { font-size: 9px; color: var(--color-text-muted); margin-top: 6px; font-style: italic; }
.est-toolbar { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-lg); }
.est-toolbar input { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 8px 12px; font-size: 12px; border-radius: var(--border-radius); flex: 1; max-width: 300px; outline: none; }
.est-toolbar input:focus { border-color: var(--color-gray-55); }
.expand-all-btn { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-muted); padding: 6px 14px; font-size: 11px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; }
.expand-all-btn:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }
.currency-select { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 6px 10px; font-size: 12px; border-radius: var(--border-radius); cursor: pointer; }
.version-select { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 6px 10px; font-size: 12px; border-radius: var(--border-radius); cursor: pointer; }
.version-select:focus { border-color: var(--color-gray-55); outline: none; }
.version-label { font-size: 12px; color: var(--color-text-secondary); padding: 6px 10px; }

/* Estimate ⇄ Actuals merge */
.lines-table .actual-cell { padding: 5px 4px; }
.lines-table .actual-cell input[type="number"] { width: 100%; text-align: right; }
.lines-table .line-variance { font-size: 12px; text-align: right; white-space: nowrap; padding-right: 8px; font-weight: 600; }
.lines-table .notes-btn { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-muted); padding: 3px 8px; font-size: 10px; border-radius: var(--border-radius); cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.lines-table .notes-btn:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }
.lines-table tr.unplanned-row td { background: var(--color-warning-surface); }
.lines-table tr.unplanned-row .unplanned-spacer { font-size: 10px; }
.btn-add-unplanned { background: transparent; border: 1px dashed var(--color-border-accent); color: var(--color-text-muted); padding: 4px 12px; font-size: 11px; border-radius: var(--border-radius); cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.btn-add-unplanned:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }

.bva-block { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-border); }
.bva-block h3 { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.bva-progress { width: 100%; height: 4px; background: var(--color-surface-alt); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.bva-progress-fill { height: 100%; background: var(--color-accent); border-radius: 2px; transition: width 0.25s ease, background-color 0.25s ease; width: 0; }
.var-warning { color: var(--color-warning); }

.notes-popover { position: fixed; z-index: 1000; width: 280px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-md); padding: var(--space-md); }
.notes-popover textarea { width: 100%; min-height: 80px; background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--border-radius); padding: 8px 10px; font-size: 12px; font-family: inherit; color: var(--color-text-primary); outline: none; resize: vertical; box-sizing: border-box; }
.notes-popover textarea:focus { border-color: var(--color-accent); }
.notes-popover-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-sm); }
.notes-popover-actions .btn,
.notes-popover-actions .btn-outline { padding: 5px 12px; font-size: 11px; }

/* Allow horizontal scroll on narrower viewports for the wider 12-col table */
.section-body { overflow-x: auto; }
.section-body .lines-table { min-width: 1000px; }

/* =====================
   OVERVIEW PAGE
   ===================== */
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.ov-section { background: var(--color-surface); border: 1px solid var(--color-border); padding: var(--space-lg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.ov-section.full-width { grid-column: span 2; }
.ov-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ov-title a { font-size: 10px; font-weight: 500; color: var(--color-text-muted); text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase; }
.ov-title a:hover { color: var(--color-text-primary); }
.ov-title a.ov-link-success, .ov-title a.ov-link-success:hover { color: var(--color-success); }
.ov-loading { color: var(--color-text-muted); font-size: 12px; }
.project-hero .display-heading { padding-bottom: var(--space-sm); }
.ov-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; gap: var(--space-md); }
.ov-row:last-child { border-bottom: none; }
.ov-label { color: var(--color-text-muted); font-size: 11px; flex-shrink: 0; }
.ov-value { font-weight: 500; text-align: right; }
.ov-value.big { font-size: 16px; font-weight: 700; }
.crew-mini-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-md); align-items: center; padding: 7px 0; border-bottom: 1px solid var(--color-border); font-size: 12px; }
.crew-mini-row:last-child { border-bottom: none; }
.crew-name { font-weight: 600; }
.crew-role { color: var(--color-text-secondary); font-size: 11px; }
.est-financial-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.est-financial-row:last-child { border-bottom: none; }
.est-financial-row.highlight { font-weight: 700; font-size: 15px; border-top: 2px solid var(--color-border-accent); padding-top: 10px; }
.project-hero { border-bottom: 2px solid var(--color-border); padding-bottom: var(--space-lg); margin-bottom: var(--space-xl); }
.project-meta-strip { display: flex; gap: var(--space-md) var(--space-xl); align-items: center; flex-wrap: wrap; margin-top: var(--space-sm); }
.project-meta-item { font-size: 13px; color: var(--color-text-secondary); }
.project-meta-item strong { color: var(--color-text-primary); font-weight: 600; }
.display-heading.project-meta-editable { cursor: pointer; border-bottom: 1px dashed var(--color-border); display: inline-block; }
.display-heading.project-meta-editable:hover { border-bottom-color: var(--color-text-primary); }
.display-heading.project-meta-editable .inline-input { font-size: inherit; font-weight: inherit; font-family: inherit; padding: 0; height: auto; background: transparent; border: none; border-bottom: 1px solid var(--color-text-primary); color: var(--color-text-primary); width: 100%; min-width: 200px; }
.project-meta-editable strong { cursor: pointer; border-bottom: 1px dashed var(--color-border); padding-bottom: 1px; }
.project-meta-editable strong:hover { border-bottom-color: var(--color-text-primary); }
.project-meta-editable .inline-input { font-size: 13px; padding: 2px 6px; height: auto; min-width: 80px; }
.project-meta-editable select.inline-input { min-width: 120px; }
.meta-date-range { display: inline-flex; align-items: center; gap: 4px; }
.meta-date-range input.inline-input { width: 130px; min-width: auto; }

/* =====================
   SHOOT PLAN PAGE — SHOOTING SCHEDULE
   ===================== */
.page-header-actions { display: flex; gap: var(--space-sm); align-items: center; }
.sp-table-wrap { overflow-x: auto; }

/* Day tabs */
.sp-day-tabs { display: flex; gap: var(--space-xs); margin-bottom: var(--space-md); border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-sm); flex-wrap: wrap; align-items: center; }
.sp-day-tab { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-muted); padding: 4px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; }
.sp-day-tab.active { background: var(--color-accent); color: var(--color-inverse); border-color: var(--color-accent); }
.sp-day-tab:hover:not(.active) { border-color: var(--color-text-secondary); }
.sp-day-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.plan-tab-del { font-size: 10px; color: var(--color-text-muted); cursor: pointer; line-height: 1; margin-left: 2px; }
.plan-tab-del:hover { color: var(--color-danger); }
.sp-day-tab.active .plan-tab-del { color: var(--color-bg); opacity: 0.6; }
.sp-day-tab.active .plan-tab-del:hover { opacity: 1; }
.plan-tab-input { background: transparent; border: none; border-bottom: 1px solid currentColor; color: inherit; font: inherit; outline: none; width: 80px; text-align: center; padding: 0; }

/* Day start time */
.day-start-row { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); font-size: 11px; color: var(--color-text-muted); }
.day-start-input { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 4px 20px 4px 8px; font-size: 12px; width: 100px; font-family: var(--font-body); }
.day-start-input:focus { border-color: var(--color-text-secondary); outline: none; }

/* Schedule table */
.schedule-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; margin-top: var(--space-sm); }
.schedule-table th {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-text-muted); text-align: left; padding: 6px 8px;
  border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.schedule-table td { padding: 7px 8px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.schedule-table tr:hover td { background: var(--color-surface-alt); }
.schedule-table input,
.schedule-table textarea,
.schedule-table select {
  background: transparent; border: none; color: var(--color-text-primary);
  font: inherit; font-size: 12px; outline: none; width: 100%; resize: vertical;
}
.schedule-table input::placeholder,
.schedule-table textarea::placeholder { color: var(--color-text-muted); }
.schedule-table textarea { min-height: 32px; line-height: 1.4; overflow: hidden; word-wrap: break-word; resize: none; }

/* Column widths */
.schedule-table .col-sel { width: 28px; text-align: center; }
.schedule-table .col-drag { width: 20px; text-align: center; }
.schedule-table .col-start,
.schedule-table .col-end { width: 56px; font-variant-numeric: tabular-nums; }
.schedule-table .col-dur-v,
.schedule-table .col-dur-p { width: 50px; text-align: center; }
.schedule-table .col-scene { width: 140px; min-width: 140px; }
.schedule-table .col-ref { width: 68px; text-align: center; }
.schedule-table .col-action { min-width: 100px; }
.schedule-table .col-desc { min-width: 160px; }
.schedule-table .col-framing { min-width: 100px; }
.schedule-table .col-movement { min-width: 110px; }
.schedule-table .col-location { min-width: 80px; }
.schedule-table .col-cast { min-width: 90px; }
.schedule-table .col-lens { min-width: 80px; }
.schedule-table .col-light { min-width: 80px; }
.schedule-table .col-looktext { min-width: 100px; }
.schedule-table .col-props { min-width: 80px; }
.schedule-table .col-look { min-width: 80px; }
.schedule-table .col-del { width: 24px; text-align: center; }

/* Frozen (sticky) columns */
.schedule-table .col-frozen {
  position: sticky;
  z-index: 2;
  background: var(--color-bg);
}
.schedule-table tr:hover .col-frozen { background: var(--color-surface-alt); }
.schedule-table .col-sel   { left: 0; }
.schedule-table .col-drag  { left: 28px; }
.schedule-table .col-start { left: 48px; }
.schedule-table .col-end   { left: 104px; }
.schedule-table .col-dur-v { left: 160px; }
.schedule-table .col-dur-p { left: 210px; }
.schedule-table .col-scene { left: 260px; }
.schedule-table .col-ref   { left: 400px; }
.schedule-table .col-frozen-last { border-right: 2px solid var(--color-border); }

/* Frozen header cells need higher z-index */
.schedule-table thead .col-frozen { z-index: 3; }

/* Checkbox styling */
.row-select { accent-color: var(--color-text-primary); cursor: pointer; }

/* Drag handle */
.drag-handle { cursor: grab; color: var(--color-text-muted); font-size: 14px; padding: 0 2px; user-select: none; line-height: 1; }
.drag-handle:hover { color: var(--color-text-primary); }
tr.dragging { opacity: 0.4; }
tr.drag-over td { border-top: 2px solid var(--color-text-primary); }

/* Block rows */
.schedule-row-block td { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
.block-crew-call td   { border-left: 3px solid var(--color-cat-green); }
.block-lunch td       { border-left: 3px solid var(--color-cat-green); }
.block-move td        { border-left: 3px solid var(--color-cat-orange); }
.block-touchups td    { border-left: 3px solid var(--color-cat-green); }
.block-rerig td       { border-left: 3px solid var(--color-cat-blue); }
.block-wrap td        { border-left: 3px solid var(--color-cat-deep-orange); }
.block-custom td      { border-left: 3px solid var(--color-text-muted); }

/* Block label cell */
.block-label-cell { padding-left: var(--space-md); color: var(--color-text-secondary); }

/* Day marker rows — visual section break inside a single tab */
.schedule-row-day-marker td {
  background: var(--color-surface-alt);
  border-top: 2px solid var(--color-accent);
  border-bottom: 1px solid var(--color-border);
  padding-top: 10px; padding-bottom: 10px;
}
.schedule-row-day-marker:hover td { background: var(--color-surface-alt); }
.day-marker-time {
  background: transparent; border: 1px solid var(--color-border);
  color: var(--color-text-primary); padding: 4px 8px; font-size: 12px;
  width: 70px; font-family: var(--font-body); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.day-marker-time:focus { border-color: var(--color-accent); outline: none; }
.day-marker-cell {
  display: flex; align-items: center; gap: var(--space-md); padding-left: var(--space-md);
}
.day-marker-label {
  background: transparent; border: none; color: var(--color-text-primary);
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 13px; flex: 0 0 auto; width: auto; min-width: 80px;
  padding: 4px 0;
}
.day-marker-label:focus { outline: none; border-bottom: 1px dashed var(--color-accent); }
.day-marker-date {
  font-weight: 400; font-size: 11px; color: var(--color-text-secondary);
  text-transform: none; letter-spacing: 0;
}

/* Reference image thumbnail */
.ref-thumb { width: 60px; height: 44px; object-fit: cover; cursor: pointer; border: 1px solid var(--color-border); display: block; }
.ref-thumb-empty {
  width: 60px; height: 44px; border: 1px dashed var(--color-border-accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text-muted); font-size: 16px;
}
.ref-thumb-empty:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }
.ref-thumb-wrap { position: relative; display: inline-block; }
.ref-thumb-del {
  position: absolute; top: -4px; right: -4px; width: 16px; height: 16px;
  background: var(--color-danger); color: var(--color-inverse); border: none; font-size: 10px;
  cursor: pointer; display: none; align-items: center; justify-content: center; line-height: 1;
}
.ref-thumb-wrap:hover .ref-thumb-del { display: flex; }

/* Look cell (image only) */
.look-cell { display: flex; flex-direction: column; gap: 4px; }

/* Selection toolbar */
.selection-toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
  padding: 8px 14px; margin-bottom: var(--space-sm); font-size: 12px;
}
.selection-toolbar.hidden { display: none; }
.selection-toolbar select {
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text-primary); padding: 4px 8px; font-size: 12px;
}

/* Row delete */
.row-del { color: var(--color-text-muted); cursor: pointer; font-size: 15px; }
.row-del:hover { color: var(--color-danger); }

/* Add row buttons */
.schedule-add-row { display: flex; gap: var(--space-sm); margin-top: var(--space-md); align-items: center; }
.block-dropdown { position: relative; display: inline-block; }
.block-dropdown-menu {
  display: none; position: absolute; bottom: 100%; left: 0; margin-bottom: 4px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  min-width: 220px; z-index: 50; padding: 4px 0;
  border-radius: var(--border-radius); box-shadow: var(--shadow-md);
}
.block-dropdown.open .block-dropdown-menu { display: block; }
.block-dropdown-item {
  padding: 6px 14px; font-size: 12px; cursor: pointer; color: var(--color-text-primary);
  white-space: nowrap;
}
.block-dropdown-item:hover { background: var(--color-surface-alt); }

/* Schedule summary row */
.schedule-summary { display: flex; gap: var(--space-lg); margin-top: var(--space-sm); font-size: 11px; color: var(--color-text-muted); }

/* Empty state */
.schedule-empty { padding: var(--space-xl) 0; text-align: center; color: var(--color-text-muted); font-size: 13px; }

/* =====================
   TRAVEL PAGE
   ===================== */
.travel-section { margin-bottom: var(--space-2xl); }
.travel-section-title { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); padding-bottom: var(--space-sm); border-bottom: 2px solid var(--color-border); margin-bottom: var(--space-md); }
.travel-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.travel-table th { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--color-border); }
.travel-table th.align-center { text-align: center; }
.travel-table th.align-right { text-align: right; }
.travel-table td { padding: 8px 8px; border-bottom: 1px solid var(--color-border); vertical-align: middle; color: var(--color-text-primary); }
.travel-table tr:hover td { background: var(--color-surface-alt); }
.travel-table input,
.travel-table select { background: transparent; border: none; color: var(--color-text-primary); font: inherit; font-size: 12px; width: 100%; outline: none; padding: 0; }
.travel-table input:focus,
.travel-table select:focus { border-bottom: 1px solid var(--color-border-accent); }
.travel-table input::placeholder { color: var(--color-text-muted); }
.status-cell select { font-size: 11px; font-weight: 600; }
.status--booked   { color: var(--color-confirmed); }
.status--pending  { color: var(--color-text-muted); }
.status--cancelled{ color: var(--color-danger); }
.status--done     { color: var(--color-text-secondary); }
.del-cell { width: 28px; text-align: center; color: var(--color-text-muted); cursor: pointer; font-size: 16px; }
.del-cell:hover { color: var(--color-danger); }
.add-row-btn { background: transparent; border: 1px dashed var(--color-border-accent); color: var(--color-text-muted); padding: 5px 14px; font-size: 11px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; margin-top: var(--space-sm); }
.add-row-btn:hover { border-color: var(--color-text-secondary); color: var(--color-text-primary); }
.summary-bar { display: flex; gap: var(--space-xl); padding: var(--space-md) 0; border-top: 1px solid var(--color-border); margin-top: var(--space-sm); font-size: 12px; color: var(--color-text-secondary); }
.summary-bar strong { color: var(--color-text-primary); }
.pdf-person-row { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-xl); padding: var(--space-md); border: 1px solid var(--color-border); background: var(--color-surface); }
.pdf-person-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); white-space: nowrap; }
.pdf-person-row input { background: transparent; border: 1px solid var(--color-border-accent); color: var(--color-text-primary); padding: 6px 10px; font-size: 12px; width: 220px; outline: none; flex-shrink: 0; }
.pdf-person-row input::placeholder { color: var(--color-text-muted); }
.pdf-person-row input:focus { border-color: var(--color-gray-66); }

/* Flight number lookup */
.flight-num-cell { width: 110px; }
.flight-num-wrap { display: flex; align-items: center; gap: 4px; }
.flight-num-input { flex: 1; min-width: 0; text-transform: uppercase; }
.flight-lookup-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--color-border-accent);
  color: var(--color-text-secondary);
  width: 22px; height: 22px;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.flight-lookup-btn:hover { color: var(--color-text-primary); border-color: var(--color-text-secondary); }
.flight-lookup-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.flight-lookup-loading { animation: flight-spin 0.8s linear infinite; }
@keyframes flight-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Dep / Arr time stacked */
.time-cell { width: 90px; }
.time-dep-arr { display: flex; flex-direction: column; gap: 2px; }
.time-dep-arr input { font-size: 11px; }
.arrival-time-input { color: var(--color-text-secondary) !important; font-size: 10px !important; }

/* Terminal info below location */
.terminal-info { font-size: 9px; color: var(--color-text-muted); letter-spacing: 0.04em; margin-top: 2px; }

/* =====================
   SHOTLIST PAGE (legacy)
   ===================== */
.shot-num { color: var(--color-text-muted); font-size: 12px; width: 32px; }
.shot-drag { width: 24px; }
select.inline-select { background: transparent; border: none; color: var(--color-text-primary); font: inherit; font-size: 13px; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; }
select.inline-select:hover { color: var(--color-gray-cc); }

/* =====================
   EQ LIST PAGE
   ===================== */
.eq-source-label { font-size: 11px; color: var(--color-text-muted); }
.eq-source-link { color: var(--color-text-secondary); text-decoration: none; border-bottom: 1px solid var(--color-border-accent); }
.eq-source-link:hover { color: var(--color-text-primary); border-bottom-color: var(--color-gray-66); }
.eq-price-note { font-size: 11px; color: var(--color-text-muted); line-height: 1.6; }
.eq-price-cell { display: flex; align-items: center; gap: 2px; }
.eq-est-label { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: var(--color-text-muted); text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.eq-currency-symbol { font-size: 11px; color: var(--color-text-muted); flex-shrink: 0; }
.eq-price-input { text-align: right; max-width: 70px; }

/* =====================
   FEATURE PREVIEW CARDS (empty dashboard)
   ===================== */
.feature-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); padding: var(--space-xl) 0; }
.feature-preview-card { background: var(--color-surface); border: 1px solid var(--color-border); padding: var(--space-lg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.feature-preview-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-border); }
.feature-preview-body { font-size: 13px; line-height: 1.5; color: var(--color-text-secondary); }

/* =====================
   ONBOARDING — CHECKLIST
   ===================== */
.onboarding-checklist { background: var(--color-surface); border: 1px solid var(--color-border); padding: var(--space-lg); margin-bottom: var(--space-xl); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); }
.checklist-header { display: flex; justify-content: space-between; align-items: flex-start; }
.checklist-title { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }
.checklist-progress-text { font-size: 12px; color: var(--color-text-secondary); margin-top: var(--space-xs); }
.checklist-item { display: flex; align-items: center; gap: var(--space-md); padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.checklist-item:last-child { border-bottom: none; }
.checklist-check { width: 18px; height: 18px; border: 2px solid var(--color-border-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; color: transparent; transition: border-color 0.2s, color 0.2s; }
.checklist-check.done { border-color: var(--color-success); color: var(--color-success); }
.checklist-item-label { flex: 1; color: var(--color-text-primary); }
.checklist-item.done .checklist-item-label { color: var(--color-text-muted); text-decoration: line-through; }
.checklist-item-link { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); text-decoration: none; }
.checklist-item-link:hover { color: var(--color-text-primary); }
.checklist-progress-bar { height: 2px; background: var(--color-border); margin: var(--space-sm) 0 var(--space-md); }
.checklist-progress-fill { height: 100%; background: var(--color-accent); transition: width 0.3s; }

/* =====================
   ONBOARDING — SPOTLIGHT TOUR
   ===================== */
.spotlight-overlay { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.spotlight-overlay.active { pointer-events: auto; }
.spotlight-cutout { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7); z-index: 151; transition: top 0.3s, left 0.3s, width 0.3s, height 0.3s; pointer-events: none; }
.spotlight-tooltip { position: absolute; z-index: 152; background: var(--color-surface); border: 1px solid var(--color-border); padding: var(--space-lg); max-width: 320px; min-width: 240px; border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); }
.spotlight-tooltip-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.spotlight-tooltip-body { font-size: 13px; line-height: 1.5; color: var(--color-text-secondary); margin-bottom: var(--space-lg); }
.spotlight-tooltip-footer { display: flex; justify-content: space-between; align-items: center; }
.spotlight-step-count { font-size: 11px; color: var(--color-text-muted); }
.spotlight-tooltip-actions { display: flex; gap: var(--space-sm); }

/* =====================
   PRODUCTION TIMELINE
   ===================== */

/* Header fields */
.tl-header { margin-bottom: var(--space-lg); border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-lg); }
.tl-table-wrap { overflow-x: auto; position: relative; }
.tl-header-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md) var(--space-lg);
}
.tl-field-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}
.tl-field-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 4px 0;
  width: 100%;
  outline: none;
}
.tl-field-input:focus { border-bottom-color: var(--color-text-muted); }
.tl-field-input::placeholder { color: var(--color-text-muted); }
.tl-field-value { font-size: 13px; color: var(--color-text-secondary); padding: 4px 0; display: block; }

/* Table */
.tl-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: var(--space-sm); }
.tl-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Column widths */
.tl-col-week { width: 70px; }
.tl-col-day { width: 90px; }
.tl-col-date { width: 80px; white-space: nowrap; }
.tl-col-time { width: 80px; }
.tl-col-desc { min-width: 260px; }
.tl-col-loc { min-width: 140px; }
.tl-col-conf { min-width: 160px; }
.tl-col-hl { width: 80px; }

/* Day rows */
.tl-entry-row td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: 12px;
  color: var(--color-text-primary);
}
.tl-entry-row:hover td { background: var(--color-surface-alt); }

/* Weekend muted */
.tl-weekend td { color: var(--color-text-muted); }
.tl-weekend td input { color: var(--color-text-muted); }

/* Inline inputs */
.tl-table input,
.tl-table select {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  outline: none;
  width: 100%;
  padding: 0;
}
.tl-table input:focus { border-bottom: 1px solid var(--color-border-accent); }
.tl-table input::placeholder { color: var(--color-text-muted); }
.tl-table select { cursor: pointer; color: var(--color-text-muted); font-size: 10px; }

/* Week header row */
.tl-week-header-row td {
  padding: 14px 8px 8px;
  border-bottom: 1px solid var(--color-border-accent);
  background: var(--color-surface);
}
.tl-week-num-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  margin-right: var(--space-md);
}
.tl-week-phase {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-right: var(--space-md);
}
.tl-week-range {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Highlight types */
.tl-row-shoot td { border-left: 3px solid var(--color-cat-green); background: rgba(76,175,80,0.07); }
.tl-row-shoot:hover td { background: rgba(76,175,80,0.12); }
.tl-row-delivery td { border-left: 3px solid var(--color-cat-blue); background: rgba(33,150,243,0.07); }
.tl-row-delivery:hover td { background: rgba(33,150,243,0.12); }
.tl-row-red_day td { border-left: 3px solid var(--color-danger); background: rgba(224,48,48,0.07); }
.tl-row-red_day:hover td { background: rgba(224,48,48,0.12); }

/* Category colors */
.tl-row-pre_production td { border-left: 3px solid var(--color-cat-green); background: rgba(76,175,80,0.07); }
.tl-row-pre_production:hover td { background: rgba(76,175,80,0.12); }
.tl-row-production td { border-left: 3px solid var(--color-cat-blue); background: rgba(33,150,243,0.07); }
.tl-row-production:hover td { background: rgba(33,150,243,0.12); }
.tl-row-post_production td { border-left: 3px solid var(--color-cat-amber); background: rgba(249,168,37,0.07); }
.tl-row-post_production:hover td { background: rgba(249,168,37,0.12); }
.tl-row-final_delivery td { border-left: 3px solid var(--color-danger); background: rgba(224,48,48,0.07); }
.tl-row-final_delivery:hover td { background: rgba(224,48,48,0.12); }

/* Category dot indicator */
.tl-cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  vertical-align: middle;
}
.tl-cat-dot.cat-pre_production { background: var(--color-cat-green); }
.tl-cat-dot.cat-production { background: var(--color-cat-blue); }
.tl-cat-dot.cat-post_production { background: var(--color-cat-amber); }
.tl-cat-dot.cat-final_delivery { background: var(--color-danger); }

/* Drag handle column */
.tl-col-drag { width: 30px; text-align: center; }
.tl-col-drag .drag-handle { cursor: grab; color: var(--color-text-muted); user-select: none; font-size: 14px; }
.tl-col-drag .drag-handle:active { cursor: grabbing; }

/* Checkbox column */
.tl-col-check { width: 28px; text-align: center; }
.tl-col-check input[type="checkbox"] { accent-color: var(--color-text-muted); cursor: pointer; }

/* Drag states */
.tl-entry-row[draggable="true"] { cursor: grab; }
.tl-entry-row[draggable="true"]:active { cursor: grabbing; }
.tl-entry-row.dragging { opacity: 0.4; }
.tl-entry-row.drag-over td { border-top: 2px solid var(--color-text-primary); }

/* Filter bar */
.tl-filter-bar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.tl-filter-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 11px;
  font-family: var(--font-body);
  padding: 4px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tl-filter-btn:hover { color: var(--color-text-primary); border-color: var(--color-text-muted); }
.tl-filter-btn.active { color: var(--color-text-primary); border-color: var(--color-text-primary); }
.tl-filter-btn.cat-pre_production.active { border-color: var(--color-cat-green); color: var(--color-cat-green); }
.tl-filter-btn.cat-production.active { border-color: var(--color-cat-blue); color: var(--color-cat-blue); }
.tl-filter-btn.cat-post_production.active { border-color: var(--color-cat-amber); color: var(--color-cat-amber); }
.tl-filter-btn.cat-final_delivery.active { border-color: var(--color-danger); color: var(--color-danger); }

/* Selection action bar */
.tl-selection-bar {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.tl-selection-bar.visible { display: flex; }
.tl-selection-bar .sel-count {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-right: var(--space-sm);
  white-space: nowrap;
}
.tl-selection-bar .sel-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 10px;
  font-family: var(--font-body);
  padding: 3px 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tl-selection-bar .sel-btn:hover { color: var(--color-text-primary); border-color: var(--color-text-muted); }
.tl-selection-bar .sel-btn.cat-pre_production { border-color: var(--color-cat-green); color: var(--color-cat-green); }
.tl-selection-bar .sel-btn.cat-production { border-color: var(--color-cat-blue); color: var(--color-cat-blue); }
.tl-selection-bar .sel-btn.cat-post_production { border-color: var(--color-cat-amber); color: var(--color-cat-amber); }
.tl-selection-bar .sel-btn.cat-final_delivery { border-color: var(--color-danger); color: var(--color-danger); }

/* Autocomplete dropdown */
.tl-autocomplete {
  position: absolute;
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  min-width: 260px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}
.tl-autocomplete.open { display: block; }
.tl-autocomplete-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-autocomplete-item:hover,
.tl-autocomplete-item.active {
  background: var(--color-surface-alt);
}

/* Row selected state */
.tl-entry-row.selected td { background: rgba(255,255,255,0.04); }

/* Filtered-out rows */
.tl-entry-row.tl-filtered { display: none; }
.tl-week-header-row.tl-filtered { display: none; }

/* ── Travel: Hotel Registry ──────────────────────────────────── */
.hotel-registry { margin-bottom: var(--space-lg); }
.hotel-registry .travel-table th:first-child,
.hotel-registry .travel-table td:first-child { width: 35%; }

/* ── Travel: Hotel dropdown ─────────────────────────────────── */
.hotel-dropdown { width: 100%; background: transparent; border: none; color: var(--color-text-primary); font: inherit; font-size: 12px; outline: none; padding: 0; cursor: pointer; }
.hotel-dropdown:focus { border-bottom: 1px solid var(--color-border-accent); }

/* ── Travel: Duplicate cell ─────────────────────────────────── */
.dup-cell { width: 28px; text-align: center; color: var(--color-text-muted); cursor: pointer; font-size: 14px; }
.dup-cell:hover { color: var(--color-text-primary); }

/* ── Travel: Person picker dropdown ─────────────────────────── */
.person-picker-dropdown { position: absolute; left: 0; top: 100%; z-index: 100; background: var(--color-surface); border: 1px solid var(--color-gray-cc); max-height: 300px; overflow-y: auto; min-width: 260px; border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.person-picker-item { padding: 6px 12px; cursor: pointer; font-size: 12px; color: var(--color-black); }
.person-picker-item:hover { background: var(--color-gray-ee); }
.person-picker-group { padding: 6px 12px; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-gray-88); border-top: 1px solid var(--color-gray-cc); margin-top: 4px; }
.person-picker-group:first-child { border-top: none; margin-top: 0; }
.person-picker-role { color: var(--color-text-muted); font-size: 10px; margin-left: 8px; }

/* ── Travel: Totals currency select ─────────────────────────── */
#totals-currency-select { background: transparent; border: 1px solid var(--color-border-accent); color: var(--color-text-primary); font-size: 11px; padding: 2px 6px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════════════════
   NOTES
   ═══════════════════════════════════════════════════════════════════════════ */
.notes-layout {
  display: flex;
  height: calc(100vh - var(--top-nav-height));
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.notes-sidebar {
  width: 300px;
  min-width: 300px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notes-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}
.notes-sidebar-header .btn { width: 100%; }
.notes-list {
  flex: 1;
  overflow-y: auto;
}
.notes-list-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
.notes-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.notes-list-item:hover { background: var(--color-surface-alt); }
.notes-list-item.active { background: var(--color-accent-light); border-left: 2px solid var(--color-accent); }
.notes-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.notes-list-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.notes-list-date { white-space: nowrap; }
.notes-list-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Editor ───────────────────────────────────────────────────────────── */
.notes-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notes-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-muted);
}
.notes-editor-empty h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.notes-editor-empty p { font-size: 13px; }
.notes-editor-active { display: flex; flex-direction: column; height: 100%; }
.notes-editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
}
.notes-title-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  outline: none;
}
.notes-title-input::placeholder { color: var(--color-text-muted); }

/* ── Toolbar ──────────────────────────────────────────────────────────── */
.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--color-border);
}
.notes-toolbar button {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.notes-toolbar button:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-secondary);
}
.notes-toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 6px;
}

/* ── Body (contenteditable) ───────────────────────────────────────────── */
.notes-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.7;
  outline: none;
}
.notes-body:empty::before {
  content: 'Start writing…';
  color: var(--color-text-muted);
}
.notes-body h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 16px 0 8px;
}
.notes-body blockquote {
  border-left: 2px solid var(--color-text-muted);
  padding-left: 16px;
  color: var(--color-text-secondary);
  margin: 8px 0;
}
.notes-body ul, .notes-body ol {
  padding-left: 24px;
  margin: 8px 0;
}
.notes-body li { margin: 4px 0; }
.notes-body img {
  max-width: 100%;
  margin: 8px 0;
  display: block;
}

/* ── Rate staleness (estimate page) ────────────────────────── */
.rate-staleness-warning {
  color: var(--color-warning);
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--color-warning);
  margin: 8px 0;
}
.rate-staleness-info {
  color: var(--color-text-secondary);
  font-size: 11px;
  margin: 4px 0;
}

/* Load More pagination button */
.btn-load-more {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 16px 0;
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.01em;
  border-radius: var(--border-radius);
  transition: background 0.15s;
}
.btn-load-more:hover {
  background: var(--color-surface-alt);
}

/* =====================
   FILE VERSION HISTORY
   ===================== */
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}
.version-row:last-child { border-bottom: none; }
.version-row-info { display: flex; align-items: center; gap: var(--space-sm); }
.version-row-actions { display: flex; align-items: center; gap: var(--space-sm); }
.version-num { font-weight: 600; }
.version-date { color: var(--color-text-muted); font-size: 12px; }

/* =====================
   LOGIN PAGE
   ===================== */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-width: auto; }
.login-wrap { width: 100%; max-width: 420px; padding: var(--space-xl) var(--space-xl) var(--space-2xl); background: var(--color-surface); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); }
.login-logo { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--color-accent); margin-bottom: var(--space-2xl); text-align: center; }
.login-form { display: flex; flex-direction: column; gap: var(--space-md); }
.login-page .field-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--color-text-muted); margin-bottom: var(--space-xs); display: block; }
.login-form .input { width: 100%; box-sizing: border-box; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-primary); padding: 12px var(--space-md); font-size: 14px; outline: none; border-radius: var(--border-radius); }
.login-form .input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-light); }
.login-btn { background: var(--color-accent); color: var(--color-inverse); border: none; padding: 14px var(--space-xl); font-size: 14px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; margin-top: var(--space-sm); width: 100%; border-radius: var(--border-radius); transition: background 0.15s; }
.login-btn:hover { background: var(--color-accent-hover); }
.login-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.login-error { font-size: 12px; color: var(--color-danger); padding: var(--space-sm) 0; min-height: 20px; }

/* Auth tabs */
.auth-tabs { display: flex; gap: 0; margin-bottom: var(--space-xl); border-bottom: 1px solid var(--color-border); }
.auth-tab { flex: 1; background: none; border: none; border-bottom: 2px solid transparent; color: var(--color-text-muted); font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; padding: var(--space-md) 0; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.auth-tab:hover { color: var(--color-text-secondary); }
.auth-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

/* Confirmation message */
.confirm-msg { text-align: center; padding: var(--space-xl) 0; }
.confirm-icon { font-size: 48px; color: var(--color-accent); margin-bottom: var(--space-lg); }
.confirm-heading { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--color-text-primary); margin-bottom: var(--space-md); letter-spacing: -0.02em; }
.confirm-text { font-size: 14px; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: var(--space-xl); }
.confirm-text strong { color: var(--color-text-primary); }

.login-link-row { text-align: center; margin-top: var(--space-md); }
.login-link { background: none; border: none; color: var(--color-text-secondary); font-size: 12px; cursor: pointer; text-decoration: underline; }
.login-intro { font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; margin: 0 0 var(--space-md); }
.login-title { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--color-text-primary); margin: 0 0 var(--space-md); letter-spacing: -0.02em; }

/* =====================
   PUBLIC LANDING + DEMO
   ===================== */
/* The app is desktop-only (min-width 1200px on body); the public landing page
   is fluid so prospects can open it on a phone */
html:has(body.landing-page), body.landing-page { min-width: 0; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: var(--space-lg); }
.landing-nav a { text-decoration: none; }
.landing-main { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-lg) var(--space-3xl); }
.landing-hero { text-align: center; max-width: 720px; margin: 0 auto; padding: var(--space-3xl) 0 var(--space-2xl); }
.landing-title { font-family: var(--font-display); font-size: clamp(30px, 6vw, 44px); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--color-text-primary); margin-bottom: var(--space-lg); }
.landing-lead { font-size: 17px; line-height: 1.6; color: var(--color-text-secondary); margin-bottom: var(--space-xl); }
.landing-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md); }
.landing-btn-lg { padding: 14px 28px; font-size: 15px; text-decoration: none; }
.landing-btn-lg:disabled { opacity: 0.6; cursor: wait; }
.landing-error { margin-top: var(--space-md); font-size: 13px; color: var(--color-danger); }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-lg); }
.landing-bottom { text-align: center; padding-top: var(--space-3xl); }
.landing-subtitle { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-lg); }

.demo-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); background: var(--color-accent-light); border-radius: var(--border-radius-pill); padding: 3px 10px; }
.nav-right a.btn { text-decoration: none; }
.modal-actions a.btn { text-decoration: none; }
.landing-story-link { display: inline-block; margin-top: var(--space-lg); font-size: 14px; font-weight: 600; color: var(--color-accent); text-decoration: none; }
.landing-story-link:hover { text-decoration: underline; }

/* =====================
   STORY (/story) — scroll-along usage story
   ===================== */
/* Vertical scroll drives a sticky 100vh stage; story.js slides the track
   (8 stations, each one stage wide) and the parallax layers. Station padding
   uses cqw (stage width): % would resolve against the 8x-wide track. */
html:has(body.story-page) { overflow-x: clip; }
body.story-page { background: var(--color-story-sky-night); }
.story { position: relative; height: 800vh; --ground-h: 120px; }
.story-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; container-type: inline-size; }

/* Header */
.story-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); padding: var(--space-md) var(--space-lg); pointer-events: none; }
.story-nav > * { pointer-events: auto; }
.story-brand { font-size: 20px; transition: color 0.4s; }
.story-nav-cta { text-decoration: none; }
.story-dots { position: relative; flex: 0 1 420px; height: 20px; }
.story-dots-track { position: absolute; left: 0; right: 0; top: 9px; height: 2px; border-radius: 2px; background: var(--color-story-shadow); overflow: hidden; }
.story-dots-fill { height: 100%; background: var(--color-accent); transform: scaleX(0); transform-origin: left; }
.story-dot { position: absolute; top: 3px; width: 14px; height: 14px; margin-left: -7px; padding: 0; border-radius: 50%; border: 2px solid var(--color-accent); background: var(--color-surface); cursor: pointer; transition: transform 0.2s, background 0.2s; }
.story-dot:hover { transform: scale(1.3); }
.story-dot.is-done { background: var(--color-accent); }
.story-dot.is-current { background: var(--color-accent); transform: scale(1.35); box-shadow: 0 0 0 4px var(--color-accent-surface); }
.story-dot:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.story-night .story-brand { color: var(--color-inverse); }
.story-night .story-dots-track { background: var(--color-story-night-tint); }

/* Sky */
.story-sky { position: absolute; inset: 0; }
.story-sky--day { background: linear-gradient(var(--color-story-sky-day), var(--color-story-sky-day-low)); }
.story-sky--dusk { background: linear-gradient(var(--color-story-sky-dusk), var(--color-story-sky-dusk-low)); opacity: 0; }
.story-sky--night { background: linear-gradient(var(--color-story-sky-night), var(--color-story-sky-night-low)); opacity: 0; }
.story-sun { position: absolute; left: 52%; top: 12%; width: 84px; height: 84px; border-radius: 50%; background: var(--color-story-sun); box-shadow: 0 0 60px 20px var(--color-story-sun); }
.story-moon { position: absolute; right: 12%; top: 14%; width: 56px; height: 56px; border-radius: 50%; background: var(--color-story-moon); box-shadow: 0 0 40px 6px var(--color-story-moon); opacity: 0; }
.story-stars { position: absolute; inset: 0; opacity: 0; }
.story-stars span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--color-inverse); animation: story-twinkle 2.8s ease-in-out infinite; }
@keyframes story-twinkle { 50% { opacity: 0.25; } }

/* Parallax hills */
.story-layer { position: absolute; left: 0; bottom: calc(var(--ground-h) - 4px); height: 34%; }
.story-layer svg { width: 100%; height: 100%; display: block; }
.story-layer--far { width: 140%; }
.story-layer--near { width: 220%; height: 28%; }
.hill-far { fill: var(--color-story-hill-far); }
.hill-near { fill: var(--color-story-hill-near); }
.city { fill: var(--color-story-city); }
.story-night-tint { position: absolute; inset: 0; background: var(--color-story-night-tint); opacity: 0; pointer-events: none; }

/* Track + stations */
.story-track { position: absolute; top: 0; bottom: 0; left: 0; width: 800%; display: flex; will-change: transform; }
.story-ground { position: absolute; left: 0; right: 0; bottom: 0; height: var(--ground-h); background: repeating-linear-gradient(90deg, var(--color-story-ground) 0 120px, var(--color-story-ground-edge) 120px 122px); border-top: 4px solid var(--color-story-ground-edge); transition: filter 0.6s; }
.story-night .story-ground { filter: brightness(0.55) saturate(0.7); }
.station { position: relative; flex: 0 0 12.5%; height: 100%; display: flex; align-items: center; justify-content: center; gap: var(--space-xl); padding: 80px 5cqw calc(var(--ground-h) + 24px) 25cqw; }
.station-prop, .station-card { opacity: 0; transform: translateY(28px) scale(0.96); transition: opacity 0.5s, transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
.station-card { transition-delay: 0.12s; }
.station.is-active .station-prop, .station.is-active .station-card { opacity: 1; transform: none; }
.station-card { flex: 0 1 380px; background: var(--color-surface); border-radius: 14px; padding: var(--space-lg); box-shadow: var(--shadow-lg); }
.station-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); margin-bottom: var(--space-sm); }
.station-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--color-text-primary); margin: 0 0 var(--space-md); }
.station-text { font-size: 15px; line-height: 1.55; color: var(--color-text-secondary); margin: var(--space-sm) 0 0; }
.stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.stat .stat-num { font-family: var(--font-display); font-size: clamp(44px, 6vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.stat .stat-unit { font-size: 15px; font-weight: 600; color: var(--color-text-secondary); }
.stat--small { margin-top: var(--space-sm); }
.stat--small .stat-num { font-size: 22px; letter-spacing: -0.02em; color: var(--color-accent); }
.stat--small .stat-unit { font-size: 13px; }
.stat-sep { color: var(--color-text-muted); }
.scroll-hint { display: inline-flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-lg); font-size: 13px; font-weight: 700; color: var(--color-accent); }
.scroll-hint-arrow { display: inline-block; animation: story-nudge 1.2s ease-in-out infinite; }
@keyframes story-nudge { 50% { transform: translateX(8px); } }

/* 1. Clapperboard */
.clapper { width: 240px; }
.clapper-arm { height: 34px; border-radius: 6px 6px 0 0; background: repeating-linear-gradient(-45deg, var(--color-gray-22) 0 20px, var(--color-inverse) 20px 40px); transform-origin: 4px 100%; transform: rotate(-28deg); }
.station.is-active .clapper-arm { animation: story-clap 0.9s 0.5s ease-in both; }
@keyframes story-clap { 0% { transform: rotate(-28deg); } 55% { transform: rotate(0); } 70% { transform: rotate(-6deg); } 100% { transform: rotate(0); } }
.clapper-board { background: var(--color-gray-22); color: var(--color-inverse); padding: 14px 16px; border-radius: 0 0 8px 8px; box-shadow: var(--shadow-lg); }
.clapper-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--color-gray-55); font-size: 10px; letter-spacing: 0.08em; }
.clapper-row:last-child { border-bottom: none; }
.clapper-row span { color: var(--color-gray-aa); }
.clapper-row b { font-size: 16px; font-weight: 800; margin-right: auto; }

/* 2. Billboard + bar charts */
.billboard { position: relative; width: 300px; padding: 18px 18px 12px; background: var(--color-surface); border: 6px solid var(--color-gray-22); border-radius: 10px; }
.billboard-title, .calendar-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.billboard-legs { position: absolute; left: 0; right: 0; top: 100%; display: flex; justify-content: space-around; }
.billboard-legs span { width: 8px; height: 60px; background: var(--color-gray-22); }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 18px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar { position: relative; width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; background: var(--color-accent-surface); transform: scaleY(0); transform-origin: bottom; transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.bar--peak { background: var(--color-accent); }
.bar--weekend { background: var(--color-cat-orange); }
.bar-chart--week .bar:not(.bar--weekend) { background: var(--color-accent); }
.station.is-active .bar { transform: scaleY(1); }
.bar-value { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 700; color: var(--color-text-secondary); }
.bar-label { margin-top: 6px; font-size: 10px; font-weight: 600; color: var(--color-text-muted); }

/* 3. Estimate sheet */
.sheet { width: 300px; background: var(--color-surface); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow-lg); transform: rotate(-2deg); font-size: 13px; }
.sheet-head, .sheet-line, .sheet-total { display: flex; justify-content: space-between; padding: 7px 0; }
.sheet-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); border-bottom: 2px solid var(--color-accent-surface); }
.sheet-line { border-bottom: 1px dashed var(--color-border); color: var(--color-text-secondary); opacity: 0; transform: translateY(-40px); transition: opacity 0.3s, transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }
.sheet-line span:last-child, .sheet-total span:last-child { font-variant-numeric: tabular-nums; }
.sheet-total { font-weight: 800; color: var(--color-text-primary); opacity: 0; transition: opacity 0.4s 1.4s; }
.station.is-active .sheet-line, .station.is-active .sheet-total { opacity: 1; transform: none; }
.sheet-line:nth-child(2) { transition-delay: 0.3s; }
.sheet-line:nth-child(3) { transition-delay: 0.45s; }
.sheet-line:nth-child(4) { transition-delay: 0.6s; }
.sheet-line:nth-child(5) { transition-delay: 0.75s; }
.sheet-line:nth-child(6) { transition-delay: 0.9s; }
.sheet-line:nth-child(7) { transition-delay: 1.05s; }

/* 4. Corkboard */
.corkboard { width: 300px; height: 240px; padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--color-story-cork); border: 8px solid var(--color-story-cork-edge); border-radius: 8px; box-shadow: var(--shadow-lg); }
.polaroid { position: relative; background: var(--color-surface); padding: 5px 5px 14px; box-shadow: var(--shadow-md); transform: scale(0) rotate(-30deg); transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.polaroid::before { content: ''; display: block; height: 100%; border-radius: 2px; background: var(--color-cat-blue); }
.polaroid::after { content: ''; position: absolute; top: -4px; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: var(--color-danger); }
.polaroid--2::before, .polaroid--7::before { background: var(--color-cat-green); }
.polaroid--3::before, .polaroid--8::before { background: var(--color-cat-amber); }
.polaroid--4::before, .polaroid--9::before { background: var(--color-cat-deep-orange); }
.polaroid--5::before { background: var(--color-accent); }
.station.is-active .polaroid { transform: rotate(var(--tilt, 0deg)); }
.polaroid--1 { --tilt: -4deg; transition-delay: 0.2s; }
.polaroid--2 { --tilt: 3deg; transition-delay: 0.3s; }
.polaroid--3 { --tilt: -2deg; transition-delay: 0.4s; }
.polaroid--4 { --tilt: 5deg; transition-delay: 0.5s; }
.polaroid--5 { --tilt: -3deg; transition-delay: 0.6s; }
.polaroid--6 { --tilt: 2deg; transition-delay: 0.7s; }
.polaroid--7 { --tilt: -5deg; transition-delay: 0.8s; }
.polaroid--8 { --tilt: 4deg; transition-delay: 0.9s; }
.polaroid--9 { --tilt: -1deg; transition-delay: 1s; }
.station.is-active .polaroid--5 { animation: story-swap 1.6s 1.6s ease-in-out both; }
@keyframes story-swap { 0%, 100% { transform: rotate(-3deg); } 40%, 60% { transform: translate(0, -120%) rotate(8deg) scale(1.1); } }

/* 5. Timeline road */
.road { position: relative; width: 320px; height: 200px; }
.road-line { position: absolute; left: 0; right: 0; bottom: 30px; height: 10px; border-radius: 5px; background: repeating-linear-gradient(90deg, var(--color-gray-55) 0 24px, var(--color-gray-88) 24px 36px); }
.flag { position: absolute; bottom: 40px; width: 2px; height: 70px; background: var(--color-gray-22); transform: scaleY(0); transform-origin: bottom; transition: transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
.flag span { position: absolute; top: 0; left: 2px; padding: 3px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; color: var(--color-inverse); background: var(--color-accent); border-radius: 0 4px 4px 0; }
.flag--1 { left: 4%; transition-delay: 0.2s; }
.flag--2 { left: 20%; height: 100px; transition-delay: 0.35s; }
.flag--3 { left: 37%; transition-delay: 0.5s; }
.flag--4 { left: 54%; height: 120px; transition-delay: 0.65s; }
.flag--5 { left: 70%; height: 90px; transition-delay: 0.8s; }
.flag--6 { left: 84%; height: 110px; transition-delay: 0.95s; }
.flag--shoot span { background: var(--color-cat-deep-orange); }
.flag--6 span { background: var(--color-success); }
.station.is-active .flag { transform: none; }
.station.is-active .flag--shoot { animation: story-reschedule 1.4s 1.5s ease-in-out both; }
@keyframes story-reschedule { 0% { transform: none; } 40% { transform: translateY(-30px); } 100% { transform: translateX(14px); } }

/* 6. Printer */
.printer { position: relative; width: 260px; height: 230px; display: flex; flex-direction: column; justify-content: flex-end; }
.printer-papers { position: relative; height: 120px; margin: 0 40px; }
.paper { position: absolute; left: 0; right: 0; bottom: -40px; height: 110px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 3px; box-shadow: var(--shadow-sm); background-image: repeating-linear-gradient(var(--color-surface) 0 14px, var(--color-border) 14px 15px); background-position: 0 14px; opacity: 0; transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1), opacity 0.2s; }
.station.is-active .paper { opacity: 1; }
.station.is-active .paper--1 { transform: translate(-24px, -40px) rotate(-8deg); transition-delay: 0.3s; }
.station.is-active .paper--2 { transform: translate(18px, -52px) rotate(6deg); transition-delay: 0.55s; }
.station.is-active .paper--3 { transform: translate(-8px, -66px) rotate(-3deg); transition-delay: 0.8s; }
.station.is-active .paper--4 { transform: translate(12px, -78px) rotate(4deg); transition-delay: 1.05s; }
.station.is-active .paper--5 { transform: translate(0, -92px); transition-delay: 1.3s; }
.printer-body { position: relative; z-index: 1; height: 90px; border-radius: 14px; background: var(--color-gray-22); box-shadow: var(--shadow-lg); }
.printer-body::before { content: ''; position: absolute; left: 30px; right: 30px; top: 18px; height: 8px; border-radius: 4px; background: var(--color-gray-0a); }
.printer-light { position: absolute; right: 20px; bottom: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--color-success-on-dark); animation: story-twinkle 0.8s ease-in-out infinite; }
.pdf-list { list-style: none; margin: var(--space-md) 0 0; padding: 0; }
.pdf-list li { display: grid; grid-template-columns: 80px 1fr 34px; align-items: center; gap: 10px; padding: 3px 0; font-size: 12px; color: var(--color-text-secondary); }
.pdf-list b { text-align: right; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.pdf-bar { display: block; height: 8px; border-radius: 4px; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.8s ease-out; }
.station.is-active .pdf-bar { transform: scaleX(1); }
.pdf-bar--1 { width: 100%; }
.pdf-bar--2 { width: 30%; transition-delay: 0.1s; }
.pdf-bar--3 { width: 25%; transition-delay: 0.2s; }
.pdf-bar--4 { width: 22%; transition-delay: 0.3s; }
.pdf-bar--5 { width: 4%; transition-delay: 0.4s; }

/* 7. Calendar */
.calendar { position: relative; width: 300px; padding: 26px 18px 14px; background: var(--color-surface); border-radius: 10px; border-top: 22px solid var(--color-danger); box-shadow: var(--shadow-lg); }
.calendar-rings { position: absolute; top: -34px; left: 0; right: 0; display: flex; justify-content: space-around; }
.calendar-rings span { width: 10px; height: 24px; border-radius: 5px; background: var(--color-gray-55); }

/* 8. Wrap */
.station--wrap .station-prop { position: absolute; top: 70px; left: 8cqw; right: 8cqw; }
.string-lights { position: relative; height: 70px; border-top: 2px solid var(--color-gray-55); border-radius: 50% 50% 0 0 / 30px 30px 0 0; display: flex; justify-content: space-around; }
.string-lights span { width: 14px; height: 20px; margin-top: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--color-story-bulb); box-shadow: 0 0 18px 4px var(--color-story-bulb); animation: story-twinkle 1.6s ease-in-out infinite; }
.string-lights span:nth-child(even) { margin-top: 22px; animation-delay: 0.8s; }
.story-cta { justify-content: flex-start; flex-wrap: nowrap; gap: var(--space-sm); margin-top: var(--space-lg); }
.story-cta .landing-btn-lg { padding: 12px 18px; }
.story-footnote { margin: var(--space-md) 0 0; font-size: 11px; color: var(--color-text-muted); }

/* Mascot: a film camera on legs */
.mascot { position: absolute; z-index: 5; left: 11%; bottom: calc(var(--ground-h) - 12px); width: 130px; pointer-events: none; }
.mascot svg { display: block; width: 100%; overflow: visible; transition: transform 0.25s; }
.mascot.is-backwards svg { transform: scaleX(-1); }
.mascot-shadow { fill: var(--color-story-shadow); }
.mascot-leg line { stroke: var(--color-gray-22); stroke-width: 7; stroke-linecap: round; }
.mascot-leg { transform-box: view-box; }
.mascot-leg--a { transform-origin: 44px 100px; }
.mascot-leg--b { transform-origin: 76px 100px; }
.mascot-body { transform-box: view-box; transform-origin: 60px 140px; transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); animation: story-breathe 2.4s ease-in-out infinite; }
.mascot-reel circle { fill: var(--color-gray-22); }
.mascot-reel line { stroke: var(--color-gray-55); stroke-width: 3; }
.mascot-reel .mascot-hub { fill: var(--color-accent-surface); }
.mascot-reel { transform-box: fill-box; transform-origin: center; }
.mascot-box { fill: var(--color-accent); }
.mascot-lens-tube { fill: var(--color-gray-22); }
.mascot-lens { fill: var(--color-gray-55); stroke: var(--color-gray-22); stroke-width: 3; }
.mascot-eye { fill: var(--color-inverse); }
.mascot-pupil { fill: var(--color-text-primary); }
.mascot-smile { fill: none; stroke: var(--color-inverse); stroke-width: 3; stroke-linecap: round; }
.mascot-tally { fill: var(--color-danger); animation: story-twinkle 1.4s ease-in-out infinite; }
.mascot.is-walking .mascot-leg--a { animation: story-step 0.42s ease-in-out infinite alternate; }
.mascot.is-walking .mascot-leg--b { animation: story-step 0.42s ease-in-out infinite alternate-reverse; }
.mascot.is-walking .mascot-reel { animation: story-spin 0.9s linear infinite; }
.mascot.is-walking .mascot-body { animation: story-bob 0.21s ease-in-out infinite alternate; }
.mascot.is-bowing .mascot-body { animation: none; transform: rotate(24deg); }
@keyframes story-step { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes story-spin { to { transform: rotate(360deg); } }
@keyframes story-bob { to { transform: translateY(-4px); } }
@keyframes story-breathe { 50% { transform: translateY(-2px); } }

/* Phones: prop above card, smaller mascot on the left */
@media (max-width: 760px) {
  .story { --ground-h: 90px; }
  .story-nav { padding: var(--space-sm) var(--space-md); gap: var(--space-md); }
  .story-nav-cta { display: none; }
  .station { flex-direction: column; justify-content: center; gap: var(--space-md); padding: 64px var(--space-md) calc(var(--ground-h) + 70px); }
  .station-prop { transform-origin: bottom center; zoom: 0.72; }
  .station-card { flex: 0 0 auto; width: 100%; padding: var(--space-md); }
  .station-text { font-size: 14px; }
  .station--wrap .station-prop { top: 56px; }
  .mascot { width: 80px; left: var(--space-md); }
}
@media (max-height: 640px) and (min-width: 761px) {
  .station-prop { zoom: 0.8; }
}

/* Reduced motion: scenes still reveal, nothing bounces, walks or spins */
@media (prefers-reduced-motion: reduce) {
  .story-page *, .story-page *::before, .story-page *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
