  :root {
    /* ===== Brand ===== */
    --sky: #00AEEF;
    --sky-hover: #0196D0;
    --sky-tint: #E0F4FC;
    --navy: #0A3542;
    --navy-deep: #052028;

    /* ===== Neutral scale ===== */
    --n-0: #FFFFFF;
    --n-50: #F8FAFC;
    --n-100: #F1F5F9;
    --n-200: #E2E8F0;
    --n-300: #CBD5E1;
    --n-400: #94A3B8;
    --n-500: #64748B;
    --n-600: #475569;
    --n-700: #334155;
    --n-800: #1E293B;
    --n-900: #0F172A;

    /* ===== Semantic tokens ===== */
    --bg: var(--n-50);
    --paper: var(--n-0);
    --surface-alt: var(--n-100);
    --surface-hover: var(--n-100);
    --line: var(--n-200);
    --line-strong: var(--n-300);
    --ink: var(--n-900);
    --ink-subtle: var(--n-700);
    --muted: var(--n-500);
    --heading: var(--navy);
    --soft: var(--n-100);
    --softer: var(--n-50);

    /* ===== Categories — refined ===== */
    --cat-budget: #C2681C;
    --cat-budget-tint: #FEF3E2;
    --cat-veterans: #4A5968;
    --cat-veterans-tint: #ECEFF3;
    --cat-community: #0D8560;
    --cat-community-tint: #D6F3E7;
    --cat-influencers: #8B3A77;
    --cat-influencers-tint: #F5E8F1;
    --cat-media: #00AEEF;
    --cat-media-tint: #E0F4FC;

    /* ===== Shadows ===== */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.14), 0 6px 12px rgba(15, 23, 42, 0.06);

    /* ===== Overlay ===== */
    --overlay: rgba(15, 23, 42, 0.5);

    /* ===== Layout ===== */
    --label-col: 190px;
    --bar-height: 26px;
    --bar-gap: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 14px;
  }

  body.dark-mode {
    --n-0: #17202D;
    --n-50: #0C1722;
    --n-100: #131E2B;
    --n-200: #283544;
    --n-300: #3D4C5E;
    --n-400: #5F6F82;
    --n-500: #8290A2;
    --n-600: #A1ADBD;
    --n-700: #C4CEDB;
    --n-800: #DFE5EE;
    --n-900: #EEF3F8;

    --bg: #08121C;
    --paper: #17202D;
    --surface-alt: #131E2B;
    --surface-hover: #1B2736;
    --line: #243245;
    --line-strong: #3D4C5E;
    --ink: #EEF3F8;
    --ink-subtle: #C4CEDB;
    --muted: #8290A2;
    --heading: #EEF3F8;
    --soft: #131E2B;
    --softer: #0C1722;
    --navy: #030C15;
    --navy-deep: #02070E;

    --sky: #3BC2FF;
    --sky-hover: #00AEEF;
    --sky-tint: #0E2A39;

    --cat-budget: #E4935A;
    --cat-budget-tint: #3A2817;
    --cat-veterans: #7C8A9B;
    --cat-veterans-tint: #222C39;
    --cat-community: #22B07E;
    --cat-community-tint: #10382A;
    --cat-influencers: #B96BA5;
    --cat-influencers-tint: #2E1F2A;
    --cat-media: #3BC2FF;
    --cat-media-tint: #0E2A39;

    --overlay: rgba(0, 0, 0, 0.65);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.55);
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    /* Modern system UI stack — professional, highly readable, renders cleanly everywhere */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI',
                 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
  }

  /* Brand font reserved for these brand moments only */
  .brand-font,
  header h1,
  .detail-header h2,
  .day-panel-title {
    font-family: 'Century Gothic', 'Futura', 'Trebuchet MS', -apple-system, sans-serif;
    letter-spacing: 0.01em;
  }

  /* ========== Header (minimal brand bar) ========== */
  header {
    background: var(--navy);
    color: #FFFFFF;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 174, 239, 0.6);
  }
  header h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
  }
  header h1 .accent {
    color: var(--sky);
    font-weight: 500;
    letter-spacing: 0.08em;
  }

  .header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.15s ease;
    line-height: 1.2;
  }
  button:active { transform: scale(0.98); }

  .btn-primary {
    background: var(--sky);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
  }
  .btn-primary:hover { background: var(--sky-hover); box-shadow: var(--shadow-md); }

  .btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    font-size: 12px;
  }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; border-color: rgba(255, 255, 255, 0.22); }

  .btn-secondary {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .btn-secondary:hover { background: var(--surface-alt); border-color: var(--line-strong); }

  .btn-danger { background: #FEE2E2; color: #991B1B; }
  .btn-danger:hover { background: #FCA5A5; }
  body.dark-mode .btn-danger { background: #4B1818; color: #FECACA; }
  body.dark-mode .btn-danger:hover { background: #5E1E1E; color: #FEE2E2; }

  .icon-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
  }
  .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }

  /* ========== HERO (editorial title + schedule tabs) ========== */
  .hero {
    background: var(--paper);
    padding: 34px 28px 0;
    border-bottom: 1px solid var(--line);
    position: relative;
  }
  /* Subtle solar light wash behind hero */
  .hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(180deg,
      rgba(0, 174, 239, 0.06) 0%,
      rgba(0, 174, 239, 0) 100%);
    pointer-events: none;
    z-index: 0;
  }
  .hero-top { position: relative; z-index: 1; }
  .hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
  }
  .hero-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sky);
    margin-bottom: 8px;
  }
  .hero-title {
    margin: 0;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--heading);
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
  }
  .hero-title-btn {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--heading);
    cursor: pointer;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    border-radius: 4px;
    transition: opacity 0.1s;
  }
  .hero-title-btn:hover { opacity: 0.75; }
  .hero-title-btn:hover .hero-chevron { color: var(--sky); }
  .hero-chevron {
    font-size: 16px;
    color: var(--muted);
    transition: transform 0.2s, color 0.1s;
    display: inline-block;
  }
  .hero-title-btn.open .hero-chevron { transform: rotate(-180deg); color: var(--sky); }

  /* Month picker popover */
  .month-picker {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 14px;
    min-width: 300px;
  }
  .month-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .month-picker-year {
    font-size: 18px;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
  }
  .month-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .month-picker-cell {
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.1s;
  }
  .month-picker-cell:hover {
    background: var(--sky-tint);
    border-color: var(--sky);
    color: var(--sky-hover);
  }
  .month-picker-cell.current {
    background: var(--sky);
    color: #FFFFFF;
    border-color: var(--sky);
  }
  .month-picker-cell.today-month {
    border-color: var(--sky);
  }

  /* Task status picker (form) */
  .status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .status-option {
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--paper);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.1s;
  }
  .status-option:hover { border-color: var(--line-strong); }
  .status-option.selected {
    border-color: var(--sky);
    background: var(--sky-tint);
    color: var(--sky-hover);
  }
  .status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block;
  }
  .status-dot.todo    { background: #94A3B8; border: 2px solid #CBD5E1; width: 12px; height: 12px; background: transparent; }
  .status-dot.doing   { background: #F59E0B; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3); }
  .status-dot.done    { background: #10B981; }

  /* Task bars — thinner + left status stripe */
  .gantt-bar.is-task,
  .month-bar.is-task {
    height: 22px;
    box-shadow: inset 3px 0 0 var(--task-status-colour), inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.08);
    padding-left: 12px;
  }
  .gantt-bar.is-task.is-done,
  .month-bar.is-task.is-done {
    opacity: 0.5;
    text-decoration: line-through;
  }
  .gantt-bar.is-task.is-overdue,
  .month-bar.is-task.is-overdue {
    box-shadow: inset 3px 0 0 #EF4444, inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 0 1px rgba(239, 68, 68, 0.3);
  }

  /* Multi-platform icon row on bars */
  .platform-icons {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
    align-items: center;
  }
  .platform-icons .platform-icon {
    font-size: 10px;
    opacity: 0.92;
  }

  /* Day panel — task status badge */
  .task-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
  }
  .task-status-badge.todo    { background: var(--surface-alt); color: var(--ink-subtle); }
  .task-status-badge.doing   { background: #FEF3C7; color: #B45309; }
  .task-status-badge.done    { background: #D1FAE5; color: #065F46; }
  .task-status-badge.overdue { background: #FEE2E2; color: #991B1B; }
  body.dark-mode .task-status-badge.doing   { background: #3A2A10; color: #FCD34D; }
  body.dark-mode .task-status-badge.done    { background: #0F3024; color: #6EE7B7; }
  body.dark-mode .task-status-badge.overdue { background: #3F1616; color: #FCA5A5; }

  /* Day-event status-aware tweaks */
  .day-event.is-done .day-event-title { text-decoration: line-through; opacity: 0.7; }
  .hero-stats {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.005em;
    font-variant-numeric: tabular-nums;
  }
  .hero-stats .stat-divider {
    display: inline-block;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--line-strong);
    margin: 0 10px;
    vertical-align: middle;
  }
  .hero-stats .stat-num { color: var(--ink); font-weight: 700; }

  .hero-controls {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Hero view switcher — sits above the schedule tabs */
  .hero-view-switcher {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 22px;
    margin-bottom: -4px;
  }
  .hero-view-switcher .view-toggle {
    display: inline-flex;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
  }
  .hero-view-switcher .view-toggle button {
    background: transparent;
    color: var(--muted);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 0;
    border-radius: var(--radius-sm);
    transition: all 0.12s;
    cursor: pointer;
  }
  .hero-view-switcher .view-toggle button:hover {
    color: var(--ink);
  }
  .hero-view-switcher .view-toggle button.active {
    background: var(--paper);
    color: var(--heading);
    box-shadow: var(--shadow-sm);
  }

  /* Hero tabs — big, confident, underlined-active (Linear/magazine style) */
  .hero-tabs {
    display: flex;
    gap: 28px;
    margin-top: 26px;
    padding: 0;
    border: none;
    background: transparent;
    border-bottom: 1px solid var(--line);
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
  }
  .hero-tabs button {
    background: transparent;
    color: var(--muted);
    padding: 10px 0 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: color 0.12s, border-color 0.12s;
    box-shadow: none;
  }
  .hero-tabs button:hover { color: var(--ink); }
  .hero-tabs button.active {
    color: var(--heading);
    border-bottom-color: var(--sky);
    background: transparent;
    box-shadow: none;
  }
  .hero-tabs .tab-icon { font-size: 16px; }
  .hero-tabs .tab-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
  }
  .hero-tabs button.active .tab-count {
    background: var(--sky-tint);
    color: var(--sky-hover);
  }
  body.dark-mode .hero-tabs button.active .tab-count {
    background: var(--sky);
    color: var(--navy-deep);
  }

  /* ========== Toolbar (compact, below hero) ========== */
  .toolbar {
    background: var(--paper);
    padding: 10px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .nav-btn {
    background: var(--surface-alt);
    color: var(--ink);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid var(--line);
  }
  .nav-btn:hover { background: var(--paper); border-color: var(--line-strong); }
  .today-btn {
    background: var(--paper);
    color: var(--ink-subtle);
    border: 1px solid var(--line);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  .today-btn:hover { background: var(--surface-alt); color: var(--ink); }

  .view-toggle,
  .sub-toggle {
    display: inline-flex;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    padding: 2px;
    border: 1px solid var(--line);
  }
  .view-toggle button,
  .sub-toggle button {
    background: transparent;
    color: var(--muted);
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    letter-spacing: 0.005em;
  }
  .view-toggle button:hover,
  .sub-toggle button:hover { color: var(--ink); }
  .view-toggle button.active,
  .sub-toggle button.active {
    background: var(--paper);
    color: var(--heading);
    box-shadow: var(--shadow-sm);
  }
  body.dark-mode .view-toggle button.active,
  body.dark-mode .sub-toggle button.active {
    background: var(--navy-deep);
    color: var(--sky);
  }

  .legend {
    margin-left: auto;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
  }
  .legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.005em;
  }
  .legend-dot { width: 8px; height: 8px; border-radius: 2px; }

  /* ========== Main ========== */
  main { padding: 20px 28px 40px; }

  /* Timeline sub-toolbar */
  .gantt-sub {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
  }
  .gantt-sub .sub-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
  }

  /* ========== Gantt ========== */
  .gantt-wrap {
    background: var(--paper);
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
  }
  .gantt-scroll { overflow-x: auto; }
  .gantt {
    display: grid;
    grid-template-columns: var(--label-col) 1fr;
    min-width: 900px;
  }

  .gantt-head-label {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.75);
    padding: 14px 18px;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }
  .gantt-head-days {
    background: var(--navy);
    display: grid;
    position: relative;
  }
  .gantt-day-head {
    padding: 8px 0 10px;
    color: #FFFFFF; text-align: center;
    cursor: pointer;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
    transition: background 0.12s;
  }
  .gantt-day-head:hover { background: rgba(0, 174, 239, 0.15); }
  .gantt-day-head.today { background: var(--sky); }
  .gantt-day-head.selected {
    background: rgba(0, 174, 239, 0.3);
    box-shadow: inset 0 -2px 0 var(--sky);
  }
  .gantt-day-head.today.selected {
    background: var(--sky);
    box-shadow: inset 0 -2px 0 #FFFFFF;
  }
  .gantt-day-head.weekend { background: rgba(255, 255, 255, 0.03); }
  .gantt-day-head.weekend.today { background: var(--sky); }
  .gantt-day-head .dow {
    font-size: 9px; text-transform: uppercase;
    opacity: 0.65; margin-bottom: 2px; letter-spacing: 0.08em; font-weight: 500;
  }
  .gantt-day-head .dom { font-size: 13px; font-weight: 600; }

  .gantt-row-label {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 600; color: var(--heading);
    background: var(--softer);
  }
  .row-dot {
    width: 10px; height: 10px; border-radius: 3px;
    flex-shrink: 0;
  }
  .row-dot.circle { border-radius: 50%; }
  .row-label-text { flex: 1; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .row-count {
    background: var(--line); color: var(--ink-subtle);
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    min-width: 22px; text-align: center;
  }
  .row-count.has-events { background: var(--sky); color: #FFFFFF; }

  .gantt-row-track {
    position: relative;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    min-height: 50px;
  }
  .today-line {
    position: absolute; top: 0; bottom: 0;
    width: 2px; background: var(--sky);
    pointer-events: none; z-index: 1;
    opacity: 0.6;
  }

  /* NOW indicator — live sweep line across the timeline */
  .now-line {
    position: absolute; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(180deg,
      var(--sky) 0%,
      var(--sky) 60%,
      rgba(0, 174, 239, 0) 100%);
    pointer-events: none; z-index: 3;
  }
  .now-dot {
    position: absolute;
    top: -4px; left: 50%;
    transform: translateX(-50%);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--sky);
    box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--sky);
  }
  .now-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--sky);
    opacity: 0.3;
    animation: now-pulse 2s ease-out infinite;
  }
  @keyframes now-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
  }
  .now-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sky);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  /* Past events dim so the reader's eye goes to what's upcoming */
  .gantt-bar.is-past,
  .month-bar.is-past { opacity: 0.55; }
  .gantt-bar.is-past:hover,
  .month-bar.is-past:hover { opacity: 1; }

  /* Event bars — solid fill, refined feel with subtle depth */
  .gantt-bar {
    position: absolute;
    height: var(--bar-height);
    border-radius: 6px;
    padding: 0 9px;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    color: #FFFFFF;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.005em;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 2;
  }
  .gantt-bar:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5;
  }
  .bar-title {
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bar-title b { font-weight: 700; opacity: 0.9; margin-right: 2px; }
  .bar-initials { display: flex; gap: -2px; flex-shrink: 0; }
  .bar-initials > * + * { margin-left: -4px; }
  .initial-circle {
    background: var(--navy);
    border: 1.5px solid #FFFFFF;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: #FFFFFF;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  }
  .platform-icon {
    font-size: 11px;
    flex-shrink: 0;
    opacity: 0.95;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
  }

  /* ========== Day Detail Panel ========== */
  .day-panel {
    background: var(--paper);
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .day-panel-head {
    background: linear-gradient(135deg, var(--navy) 0%, #0F4C5C 100%);
    color: #FFFFFF;
    padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
  }
  body.dark-mode .day-panel-head {
    background: linear-gradient(135deg, var(--navy-deep) 0%, #0A2530 100%);
  }
  .day-panel-title { font-size: 18px; font-weight: 700; letter-spacing: 0.01em; }
  .day-panel-subtitle {
    font-size: 10px; opacity: 0.7;
    margin-bottom: 4px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
  }
  .day-panel-list { padding: 6px; }
  .day-event {
    display: flex; gap: 14px;
    padding: 16px; border-radius: var(--radius-md);
    cursor: pointer; align-items: stretch;
    transition: background 0.12s;
  }
  .day-event:hover { background: var(--surface-alt); }
  .day-event + .day-event { border-top: 1px solid var(--line); }
  .day-event-stripe { width: 3px; border-radius: 2px; flex-shrink: 0; }
  .day-event-body { flex: 1; min-width: 0; }
  .day-event-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
  }
  .day-event-title { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
  .day-event-time { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
  .day-event-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px;
  }
  .day-event-cat-badge {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 4px 9px; border-radius: 4px; color: #FFFFFF;
  }
  .day-event-people { display: flex; gap: 3px; }
  .day-event-details {
    font-size: 13px; color: var(--muted);
    margin-top: 8px; line-height: 1.5;
  }
  .day-event-link {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 10px; font-size: 12px; font-weight: 600;
    color: var(--sky); text-decoration: none;
    padding: 6px 10px; background: var(--sky-tint);
    border-radius: var(--radius-sm);
    transition: background 0.12s;
  }
  .day-event-link:hover { background: var(--sky); color: #FFFFFF; }
  .empty-day {
    padding: 40px 20px; text-align: center;
    color: var(--muted); font-size: 13px;
  }

  /* Avatars */
  .person-avatar {
    background: var(--navy); color: #FFFFFF;
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; flex-shrink: 0;
    letter-spacing: 0.02em;
  }
  .person-avatar.small { width: 22px; height: 22px; font-size: 9px; }

  /* ========== Month view ========== */
  .month-grid {
    background: var(--paper);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr); background: var(--navy);
  }
  .weekday {
    padding: 11px 10px; color: rgba(255, 255, 255, 0.7);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
  }
  .weeks { display: flex; flex-direction: column; }
  .week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: relative;
    border-bottom: 1px solid var(--line);
  }
  .week:last-child { border-bottom: none; }
  .month-day {
    padding: 8px 8px 10px 10px;
    border-right: 1px solid var(--line);
    cursor: pointer;
    min-height: 110px;
    overflow: hidden;
    transition: background 0.1s;
  }
  .month-day:last-child { border-right: none; }
  .month-day:hover { background: var(--softer); }
  .month-day.other-month { background: var(--softer); }
  .month-day.other-month .date-num { color: var(--muted); opacity: 0.55; }
  .date-num {
    font-size: 13px; font-weight: 600; color: var(--heading);
    display: inline-block; width: 26px; height: 26px; line-height: 26px;
    text-align: center; border-radius: 50%;
    position: relative; z-index: 1;
    letter-spacing: -0.01em;
  }
  .month-day.today .date-num { background: var(--sky); color: #FFFFFF; font-weight: 700; }
  .week-bars {
    position: absolute;
    top: 34px; left: 4px; right: 4px;
    pointer-events: none;
  }
  .month-bar {
    position: absolute;
    height: 22px;
    border-radius: 5px;
    padding: 0 8px;
    display: flex; align-items: center; gap: 5px;
    color: #FFFFFF;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.005em;
    overflow: hidden; white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .month-bar:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
  }
  .month-bar b { font-weight: 700; opacity: 0.9; margin-right: 2px; }
  .month-bar-title {
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .month-bar-dots { display: flex; flex-shrink: 0; }
  .month-bar-dots > * + * { margin-left: -4px; }
  .chip-initial {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    font-size: 7px; font-weight: 700; color: #FFFFFF;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--navy);
  }

  /* ========== Modal ========== */
  .modal-overlay {
    display: none; position: fixed; inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
    z-index: 100; padding: 20px;
  }
  .modal-overlay.active { display: flex; }
  .modal {
    background: var(--paper); border-radius: var(--radius-xl);
    width: 100%; max-width: 520px; max-height: 90vh;
    overflow-y: auto; box-shadow: var(--shadow-xl);
    border: 1px solid var(--line);
  }
  .modal-header {
    padding: 22px 26px 16px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
  }
  .modal-header h2 { margin: 0; color: var(--heading); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
  .modal-close {
    background: transparent; color: var(--muted); font-size: 22px;
    padding: 0; width: 32px; height: 32px; line-height: 1;
  }
  .modal-close:hover { color: var(--ink); background: var(--surface-alt); }
  .modal-body { padding: 20px 26px; }
  .modal-footer {
    padding: 16px 26px; border-top: 1px solid var(--line);
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    background: var(--softer);
  }

  .field { margin-bottom: 16px; }
  .field label {
    display: block; font-size: 11px; font-weight: 600;
    color: var(--ink-subtle); text-transform: uppercase;
    letter-spacing: 0.08em; margin-bottom: 7px;
  }
  .field input[type="text"], .field input[type="date"], .field input[type="time"],
  .field input[type="email"], .field input[type="url"],
  .field textarea, .field select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: var(--radius-md);
    font-family: inherit; font-size: 14px;
    color: var(--ink); background: var(--paper);
    transition: border-color 0.1s, box-shadow 0.1s;
  }
  .field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
  }
  .field textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
  .field-row { display: flex; gap: 10px; }
  .field-row .field { flex: 1; }

  .checkbox-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  }
  .checkbox-row input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--sky);
  }
  .checkbox-row label {
    margin: 0; font-size: 13px; font-weight: 500;
    text-transform: none; letter-spacing: 0; color: var(--ink);
  }

  .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }
  .cat-option {
    padding: 10px 12px;
    border: 1.5px solid var(--line); border-radius: var(--radius-md);
    cursor: pointer; font-size: 13px; font-weight: 500;
    text-align: left; background: var(--paper);
    color: var(--ink);
    display: flex; align-items: center; gap: 8px;
    transition: all 0.1s;
  }
  .cat-option:hover { border-color: var(--line-strong); }
  .cat-option.selected {
    border-color: var(--sky);
    background: var(--sky-tint);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1);
  }
  body.dark-mode .cat-option.selected {
    background: var(--sky-tint);
  }
  .cat-option-dot {
    width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
  }

  .platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
  }
  .platform-option {
    padding: 9px 10px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    cursor: pointer; font-size: 12px; font-weight: 500;
    text-align: left; background: var(--paper);
    color: var(--ink);
    display: flex; align-items: center; gap: 6px;
    transition: all 0.1s;
  }
  .platform-option:hover { border-color: var(--line-strong); }
  .platform-option.selected {
    border-color: var(--sky);
    background: var(--sky-tint);
  }

  .release-reminders { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
  .release-reminder {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius);
    border: 1px solid #F2C879; background: #FEF6E7;
  }
  .release-reminder.urgent { border-color: #F0A4A4; background: #FDEDED; }
  .release-reminder-icon { font-size: 18px; flex: none; }
  .release-reminder-body { flex: 1; min-width: 0; }
  .release-reminder-title { font-size: 13px; font-weight: 600; color: var(--ink); }
  .release-reminder-title strong { color: var(--heading); }
  .release-reminder-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .release-reminder.urgent .release-reminder-when { color: #C0392B; font-weight: 600; }
  .release-reminder-actions { display: flex; align-items: center; gap: 6px; flex: none; }
  .release-reminder-add {
    border: none; background: var(--sky); color: #fff; cursor: pointer;
    font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 8px;
  }
  .release-reminder-add:hover { background: var(--sky-hover); }
  .release-reminder-dismiss {
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px;
  }
  .release-reminder-dismiss:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
  .people-list { display: flex; flex-direction: column; gap: 6px; }
  .invite-toggle {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--paper);
    cursor: pointer; text-transform: none; letter-spacing: 0;
  }
  .invite-toggle input { margin-top: 3px; width: 16px; height: 16px; flex: none; cursor: pointer; }
  .invite-toggle span { display: flex; flex-direction: column; gap: 2px; }
  .invite-toggle strong { font-size: 13px; font-weight: 600; color: var(--ink); }
  .invite-toggle small { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.4; }
  .person-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-md); cursor: pointer; transition: all 0.1s;
    background: var(--paper);
  }
  .person-row:hover { background: var(--surface-alt); }
  .person-row.selected { background: var(--sky-tint); border-color: var(--sky); }
  .person-info { flex: 1; min-width: 0; }
  .person-name { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
  .person-email {
    font-size: 12px; color: var(--muted); font-weight: 400;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .person-check {
    width: 18px; height: 18px;
    border: 1.5px solid var(--line-strong); border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .person-row.selected .person-check {
    background: var(--sky); border-color: var(--sky);
    color: #FFFFFF; font-size: 11px;
  }
  .add-person-btn {
    background: transparent; color: var(--sky);
    border: 1px dashed var(--sky); padding: 9px 12px;
    font-size: 12px; margin-top: 8px; font-weight: 600;
  }
  .add-person-btn:hover { background: var(--sky-tint); }

  /* Detail modal header */
  .detail-header {
    padding: 22px 26px 18px; color: #FFFFFF;
    border-top-left-radius: var(--radius-xl); border-top-right-radius: var(--radius-xl);
    position: relative;
  }
  .detail-header::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
    border-top-left-radius: var(--radius-xl); border-top-right-radius: var(--radius-xl);
  }
  .detail-header h2 { margin: 0 0 6px; font-size: 20px; color: #FFFFFF; font-weight: 700; letter-spacing: -0.01em; position: relative; z-index: 1; }
  .detail-meta { font-size: 12px; opacity: 0.9; position: relative; z-index: 1; font-weight: 500; letter-spacing: 0.01em; }
  .detail-close {
    position: absolute; top: 14px; right: 14px;
    background: rgba(0, 0, 0, 0.2); color: #FFFFFF;
    font-size: 18px; padding: 0; width: 30px; height: 30px;
    line-height: 1; border-radius: 50%;
    z-index: 2;
  }
  .detail-close:hover { background: rgba(0, 0, 0, 0.35); }
  .detail-row {
    padding: 14px 26px; border-bottom: 1px solid var(--line);
    display: flex; gap: 16px; align-items: flex-start;
  }
  .detail-row:last-of-type { border-bottom: none; }
  .detail-label {
    font-size: 10px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.1em;
    min-width: 80px; padding-top: 3px;
  }
  .detail-value {
    font-size: 14px; color: var(--ink); flex: 1; line-height: 1.55;
    word-break: break-word;
  }
  .detail-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--sky); font-weight: 600; text-decoration: none;
    padding: 6px 10px; border-radius: var(--radius-sm);
    background: var(--sky-tint);
    transition: all 0.1s;
  }
  .detail-link:hover { background: var(--sky); color: #FFFFFF; }
  /* Clickable platform badges in the detail modal */
  .platform-badge-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; text-decoration: none;
    padding: 4px 9px; border-radius: 999px;
    background: var(--sky-tint); color: var(--sky-hover);
    border: 1px solid transparent; transition: all 0.1s;
  }
  .platform-badge-link:hover { background: var(--sky); color: #FFFFFF; }
  .platform-badge-link .platform-badge-go { font-size: 11px; opacity: 0.75; }
  .platform-badge-link.is-empty {
    background: var(--surface-alt); color: var(--muted);
    border-color: var(--line); cursor: default;
  }
  /* Per-platform link inputs in the edit modal */
  .platform-links { display: flex; flex-direction: column; gap: 8px; }
  .platform-links-empty { font-size: 13px; color: var(--muted); }
  .platform-link-row { display: flex; align-items: center; gap: 8px; }
  .platform-link-tag {
    display: inline-flex; align-items: center; gap: 5px;
    flex: none; min-width: 104px;
    font-size: 12px; font-weight: 600; color: var(--ink);
  }
  .platform-link-input { flex: 1; min-width: 0; }
  .detail-attendees { display: flex; flex-wrap: wrap; gap: 6px; }
  .attendee-chip {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface-alt);
    padding: 4px 10px 4px 4px; border-radius: 18px;
    font-size: 12px; font-weight: 500;
    color: var(--ink);
  }
  .attendee-chip .person-avatar { width: 22px; height: 22px; font-size: 9px; }

  /* ========== Responsive ========== */
  @media (max-width: 900px) {
    header { padding: 10px 14px; gap: 8px; }
    header h1 { font-size: 11px; letter-spacing: 0.1em; }
    .header-right { margin-left: auto; gap: 4px; }
    .header-right .btn-ghost,
    .header-right .btn-primary { padding: 7px 10px; font-size: 12px; }
    .hero { padding: 18px 14px 0; }
    .hero-title { font-size: 28px; letter-spacing: -0.02em; }
    .hero-top { flex-direction: column; gap: 12px; align-items: flex-start; }
    .hero-eyebrow { font-size: 10px; }
    .hero-stats { font-size: 12px; }
    .hero-controls { align-self: flex-start; }
    .hero-tabs { margin-top: 16px; gap: 16px; overflow-x: auto; }
    .hero-tabs button { white-space: nowrap; padding: 10px 0 12px; font-size: 14px; gap: 6px; }
    .hero-tabs .tab-label { display: inline; }
    .hero-tabs .tab-icon { font-size: 15px; }
    .month-picker {
      min-width: auto; width: calc(100vw - 28px); left: 50%; transform: translateX(-50%);
    }
    .toolbar {
      padding: 10px 14px;
      gap: 8px;
      flex-wrap: wrap;
    }
    .toolbar > * { min-height: 34px; }
    .search-wrap { order: 5; max-width: 100%; width: 100%; }
    .view-as-wrap { flex: 1; min-width: 0; }
    .filter-chips {
      padding: 6px 14px 8px;
      gap: 4px;
      overflow-x: auto;
      flex-wrap: nowrap;
      -webkit-overflow-scrolling: touch;
    }
    .filter-chip {
      font-size: 10px;
      padding: 4px 9px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    main { padding: 12px 14px 40px; }
    .legend { width: 100%; gap: 10px; order: 10; }

    .modal { border-radius: var(--radius-lg); max-height: 90vh; }
    .modal-wide { max-width: 100%; }
    .modal-header, .modal-body, .modal-footer, .detail-header, .detail-row {
      padding-left: 18px; padding-right: 18px;
    }
    .modal-body { padding-top: 16px; padding-bottom: 16px; }
    .modal-header h2 { font-size: 16px; }
    .modal-footer { gap: 8px; padding: 14px 18px; }
    .modal-footer button { flex: 1; min-width: 100px; padding: 10px 12px; font-size: 13px; }
    .field { margin-bottom: 12px; }
    .field input, .field textarea, .field select {
      font-size: 16px !important;  /* stop iOS zoom on focus */
      padding: 11px 12px !important;
    }
    .category-grid, .platform-grid, .status-grid {
      grid-template-columns: repeat(2, 1fr);
    }

    /* Projects view mobile */
    .projects-grid { grid-template-columns: 1fr; gap: 10px; }
    .projects-h { font-size: 20px; }
    .projects-title-row { flex-wrap: wrap; gap: 10px; }
    .projects-intro { font-size: 12px; }

    /* Gantt on mobile */
    :root { --label-col: 120px; }
    .gantt-head-label, .gantt-row-label { font-size: 11px; padding: 10px; }
    .row-label-text { font-size: 11px; }

    /* Day panel */
    .day-panel-title { font-size: 16px; }
    .day-panel-head { padding: 14px 16px; }

    /* NOW label smaller */
    .now-label { font-size: 8px; padding: 1px 4px; }

    /* Larger tap targets */
    button, .nav-btn, .cat-option, .platform-option, .status-option, .person-row, .month-picker-cell {
      min-height: 36px;
    }
  }

  /* ========== Projects View ========== */
  .projects-toolbar {
    margin-bottom: 20px;
  }
  .projects-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
  }
  .projects-h {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--heading);
  }
  .projects-intro {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--muted);
    max-width: 720px;
    line-height: 1.5;
  }
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
  }

  .project-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
    position: relative;
    overflow: hidden;
  }
  .project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--line-strong);
  }
  .project-card-stripe {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
  }
  .project-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
  }
  .project-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -0.005em;
    line-height: 1.3;
    flex: 1;
  }
  .project-card-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: 58%;
  }
  .project-card-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 9px;
    border-radius: 10px;
    color: #FFFFFF;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .project-card-meta {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 14px;
    font-weight: 500;
    letter-spacing: 0.005em;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .project-card-meta .meta-divider {
    width: 2px; height: 2px; border-radius: 50%;
    background: var(--line-strong);
  }
  .project-card-zoho {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 999px;
    background: var(--line); color: var(--ink);
    font-size: 10px; font-weight: 600;
  }
  .project-card-location {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-subtle);
    margin: -6px 0 12px;
    line-height: 1.4;
  }
  .project-card-location .loc-pin { flex-shrink: 0; }
  .project-card-location .loc-region {
    color: var(--muted);
    font-weight: 500;
  }
  .project-card-zoho.converted {
    background: #0D8560; color: #FFFFFF;
  }
  .project-card-stages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
  }
  .project-stage {
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    padding: 10px 10px;
    text-align: center;
  }
  .project-stage-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .project-stage-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }
  .project-stage-sub {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 500;
  }
  .project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }
  .project-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  .project-card-notes {
    margin: 0 0 12px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .project-card-team-aware {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
  }
  .project-card-team-aware.aware {
    color: #065F46;
    background: #D1FAE5;
  }
  .project-card-team-aware.not-aware {
    color: #92400E;
    background: #FEF3C7;
  }
  body.dark-mode .project-card-team-aware.aware    { color: #6EE7B7; background: #0F3024; }
  body.dark-mode .project-card-team-aware.not-aware{ color: #FCD34D; background: #3A2A10; }
  /* Installation badge: complete = yellow, booked = green, not booked = red. */
  .project-card-install {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
  }
  .project-card-install.booked   { color: #065F46; background: #D1FAE5; }
  .project-card-install.complete { color: #92400E; background: #FEF3C7; }
  .project-card-install.none     { color: #991B1B; background: #FEE2E2; }
  body.dark-mode .project-card-install.booked   { color: #6EE7B7; background: #0F3024; }
  body.dark-mode .project-card-install.complete { color: #FCD34D; background: #3A2A10; }
  body.dark-mode .project-card-install.none     { color: #FCA5A5; background: #3A1414; }
  .project-card-drive-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sky);
    text-decoration: none;
    padding: 4px 8px;
    background: var(--sky-tint);
    border-radius: 4px;
  }
  .project-card-drive-btn:hover { background: var(--sky); color: #FFFFFF; }

  /* ===== Project card — label / value rows ===== */
  .pc-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; padding: 4px 10px;
    border-radius: 999px; white-space: nowrap; flex-shrink: 0;
  }
  .pc-status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
  .pc-rows {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    row-gap: 9px; column-gap: 10px;
    font-size: 12px; line-height: 1.4;
    align-items: baseline;
  }
  .pc-label { color: var(--muted); font-weight: 500; }
  .pc-val { color: var(--ink-subtle); min-width: 0; }
  .pc-val.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pc-val.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pc-val a { text-decoration: none; }
  .pc-cat { display: inline-flex; align-items: center; gap: 5px; }
  .pc-cat + .pc-cat { margin-left: 8px; }
  .pc-cat-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
  .pc-region { color: var(--muted); }
  .pc-plats { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--ink-subtle); font-size: 14px; }
  .pc-plat { display: inline-flex; align-items: center; gap: 2px; }
  .pc-plat-n { font-size: 9px; font-weight: 700; color: var(--muted); }
  .pc-plat-more { font-size: 11px; font-weight: 600; color: var(--muted); }
  .pc-plat-empty { font-size: 12px; font-style: italic; color: var(--muted); }

  /* ===== Archived project cards + area-archive controls ===== */
  .project-card.is-archived { background: var(--surface-alt); opacity: 0.78; }
  .project-card.is-archived:hover { opacity: 1; }
  body.dark-mode .project-card.is-archived { background: rgba(255,255,255,0.04); }
  .pc-archived {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); background: var(--line); border-radius: 6px;
    padding: 2px 8px; margin: 0 0 10px;
  }
  .area-archive {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 14px 26px; border-top: 1px solid var(--line);
  }
  .area-archive-label { font-size: 12px; font-weight: 600; color: var(--ink-subtle); margin-right: 2px; }
  .area-archive-btn {
    font-size: 12px; font-weight: 600; padding: 5px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-md);
    background: var(--paper); color: var(--ink); cursor: pointer;
  }
  .area-archive-btn:hover { background: var(--surface-alt); }
  .area-archive-btn.on { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
  body.dark-mode .area-archive-btn.on { background: #3A2A10; border-color: #7A5A15; color: #FCD34D; }
  .area-archive-hint { flex-basis: 100%; font-size: 11px; color: var(--muted); line-height: 1.4; }
  .pc-arch-check {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
    width: 100%;
    font-size: 11px; font-weight: 500; color: var(--muted);
    cursor: pointer; user-select: none;
  }
  .pc-arch-check input { cursor: pointer; margin: 0; accent-color: var(--navy); }

  /* ===== Login intro (Jarvis-style HUD), plays once per session ===== */
  #loginIntro {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    background: #06171F; cursor: pointer;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    opacity: 1; transition: opacity 0.6s ease;
  }
  #loginIntro.intro-out { opacity: 0; }
  #loginIntro::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,174,239,0.04) 3px 4px);
  }
  .intro-stage { position: relative; width: min(84vw, 380px); text-align: center; }
  .intro-title {
    color: #00AEEF; font-size: 11px; letter-spacing: 6px; text-transform: uppercase;
    margin-bottom: 18px; opacity: 0; animation: introFade 0.6s ease 0.1s forwards;
  }
  .intro-hud { display: block; width: 230px; height: 230px; margin: 0 auto; }
  .i-spin { transform-box: fill-box; transform-origin: center; animation: introSpin 9s linear infinite; }
  .i-spin-rev { transform-box: fill-box; transform-origin: center; animation: introSpin 6s linear infinite reverse; }
  .i-sweep { transform-box: fill-box; transform-origin: center; animation: introSpin 2.4s linear infinite; }
  @keyframes introSpin { to { transform: rotate(360deg); } }
  .i-core { transform-box: fill-box; transform-origin: center; animation: introPulse 2s ease-in-out infinite; }
  @keyframes introPulse { 0%,100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
  .intro-word { font-family: inherit; font-weight: 700; font-size: 22px; fill: #E0F4FC; letter-spacing: 3px; }
  .intro-boot {
    margin-top: 20px; color: #7FD8F5; font-size: 12px; line-height: 2;
    letter-spacing: 1px; text-transform: uppercase; min-height: 76px; text-align: left;
    max-width: 320px; margin-left: auto; margin-right: auto;
  }
  .intro-boot div { opacity: 0; animation: introLine 0.5s ease forwards; }
  .intro-boot div:nth-child(1) { animation-delay: 0.5s; }
  .intro-boot div:nth-child(2) { animation-delay: 2.0s; }
  .intro-boot div:nth-child(3) { animation-delay: 3.7s; }
  .intro-boot .ok { color: #34D399; }
  @keyframes introLine { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
  .intro-bar { margin: 6px auto 0; max-width: 320px; height: 3px; background: rgba(0,174,239,0.15); border-radius: 3px; overflow: hidden; }
  .intro-bar i { display: block; height: 100%; width: 0; background: #00AEEF; animation: introFill 4.9s ease-out forwards; }
  @keyframes introFill { to { width: 100%; } }
  .intro-welcome {
    margin-top: 20px; font-family: var(--font-sans, sans-serif); font-weight: 700;
    font-size: clamp(18px, 5vw, 26px); line-height: 1.2; color: #E0F4FC;
    letter-spacing: 0.5px; text-shadow: 0 0 18px rgba(0,174,239,0.55);
    white-space: nowrap;
    /* Break out of the ~380px stage so the (wide) phrase can span the screen and
       stay centred instead of being clipped. */
    position: relative; left: 50%; width: max-content; max-width: 92vw;
    opacity: 0; transform: translateX(-50%) scale(0.92);
    animation: introWelcome 0.9s cubic-bezier(0.2,0.8,0.2,1) 3.8s forwards;
  }
  .intro-welcome-vip {
    font-size: clamp(16px, 4.6vw, 24px);
    background: linear-gradient(90deg, #7FD8F5, #E0F4FC 40%, #A855F7 70%, #7FD8F5);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    text-shadow: none;
  }
  @keyframes introWelcome { to { opacity: 1; transform: translateX(-50%) scale(1); } }
  .intro-skip {
    position: absolute; bottom: 26px; left: 0; right: 0; text-align: center;
    color: rgba(224,244,252,0.45); font-size: 11px; letter-spacing: 1px;
    opacity: 0; animation: introFade 0.5s ease 1.4s forwards;
  }
  @keyframes introFade { to { opacity: 1; } }

  /* Project detail modal — three-lane pipeline */
  .modal-wide { max-width: min(1180px, 94vw); }
  .project-lanes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 20px 26px;
  }
  @media (max-width: 700px) {
    .project-lanes { grid-template-columns: 1fr; padding: 14px 18px; }
  }
  .project-lane {
    background: var(--surface-alt);
    border-radius: var(--radius-lg);
    padding: 12px;
    min-height: 180px;
  }
  .project-lane-head {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
  }
  .project-lane-count {
    background: var(--paper);
    color: var(--heading);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    min-width: 22px; text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .project-lane-items { display: flex; flex-direction: column; gap: 6px; }
  .project-lane-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    font-size: 12px;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }
  .project-lane-item:hover { border-color: var(--sky); background: var(--sky-tint); }
  .project-lane-item-stripe {
    width: 3px;
    border-radius: 2px;
    align-self: stretch;
    flex-shrink: 0;
  }
  .lane-item-check {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #10B981;
  }
  .project-lane-item-body { flex: 1; min-width: 0; }
  .project-lane-item-title {
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 3px;
    font-size: 12px;
    color: var(--ink);
  }
  .project-lane-item.is-done .project-lane-item-title {
    text-decoration: line-through;
    opacity: 0.65;
  }
  .project-lane-item-meta {
    font-size: 10px;
    color: var(--muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .project-lane-item-completed {
    font-size: 10px;
    color: #065F46;
    font-weight: 600;
    margin-top: 2px;
  }
  body.dark-mode .project-lane-item-completed { color: #6EE7B7; }
  .project-lane-empty {
    font-size: 11px;
    color: var(--muted);
    padding: 14px 8px;
    text-align: center;
    font-style: italic;
  }
  /* Missing default segments under a lane (brief: acknowledge n/a) */
  .lane-missing {
    margin: 4px 0 8px;
    padding: 8px 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--softer);
  }
  .lane-missing-head {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .lane-missing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    padding: 3px 0;
  }
  .lane-missing-row.acked .lane-missing-title {
    text-decoration: line-through;
    color: var(--muted);
  }
  .lane-missing-title { color: var(--ink-subtle); }
  .lane-missing-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }
  .lane-missing-add {
    border: 1px solid var(--sky);
    background: transparent;
    color: var(--sky);
    border-radius: 6px;
    font-size: 11px;
    padding: 2px 7px;
    cursor: pointer;
  }
  .lane-missing-add:hover { background: var(--sky); color: #fff; }
  .lane-missing-na {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
  }
  /* Per-platform release dates (brief: Release) */
  .rel-sched {
    margin: 0 26px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  .rel-sched-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    background: var(--softer);
    border-bottom: 1px solid var(--line);
  }
  .rel-sched-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
  }
  .rel-sched-badge.warn { background: #FEF3C7; color: #92400E; }
  .rel-sched-badge.ok   { background: #D1FAE5; color: #065F46; }
  body.dark-mode .rel-sched-badge.warn { background: #4a3a12; color: #FCD34D; }
  body.dark-mode .rel-sched-badge.ok   { background: #0F3024; color: #6EE7B7; }
  .rel-sched-rows { padding: 4px 0; }
  .rel-sched-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
  }
  .rel-sched-row:last-child { border-bottom: none; }
  .rel-sched-row.flagged { background: rgba(254, 243, 199, 0.4); }
  body.dark-mode .rel-sched-row.flagged { background: rgba(74, 58, 18, 0.3); }
  .rel-sched-row.excluded { opacity: 0.55; }
  .rel-sched-platform { flex: 0 0 150px; font-weight: 600; }
  .rel-sched-date {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 12px;
  }
  .rel-sched-set { font-size: 12px; color: #065F46; font-weight: 600; }
  body.dark-mode .rel-sched-set { color: #6EE7B7; }
  .rel-sched-na {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    margin-left: auto;
  }
  .rel-sched-flag { font-size: 11px; color: #92400E; font-weight: 600; }
  body.dark-mode .rel-sched-flag { color: #FCD34D; }
  /* Inline per-task assignment (roadmap #1) */
  .lane-assign { position: relative; display: inline-flex; }
  .lane-assign-btn {
    border: 1px dashed var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    font-size: 9px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.1s;
  }
  .lane-assign-btn:hover { border-color: var(--sky); color: var(--sky); background: var(--sky-tint); }
  .lane-assign-pop {
    display: none;
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    left: 0;
    min-width: 168px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    padding: 4px;
  }
  .lane-assign-pop.open { display: block; }
  .lane-assign-pop-empty { font-size: 10px; color: var(--muted); padding: 8px; text-align: center; }
  .lane-assign-opt {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: var(--ink);
  }
  .lane-assign-opt:hover { background: var(--sky-tint); }
  .lane-assign-opt .lane-assign-check {
    width: 14px; height: 14px; flex-shrink: 0;
    border-radius: 4px; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: #FFFFFF;
  }
  .lane-assign-opt.on .lane-assign-check { background: var(--sky); border-color: var(--sky); }
  .lane-assign-opt .lane-assign-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lane-assign-foot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
  .lane-assign-invite-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    border: none; background: var(--sky); color: #FFFFFF;
    border-radius: 6px; padding: 6px 8px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: opacity 0.1s;
  }
  .lane-assign-invite-btn:hover { opacity: 0.9; }
  .lane-assign-invite-hint { font-size: 9px; color: var(--muted); text-align: center; padding: 4px 2px 2px; line-height: 1.3; }

  /* ========== Settings modal ========== */
  .settings-tabs {
    display: flex;
    gap: 2px;
    padding: 0 26px;
    border-bottom: 1px solid var(--line);
    background: var(--softer);
  }
  .settings-tab {
    background: transparent;
    color: var(--muted);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    border-radius: 0;
    letter-spacing: 0.005em;
  }
  .settings-tab:hover { color: var(--ink); }
  .settings-tab.active {
    color: var(--heading);
    border-bottom-color: var(--sky);
    background: transparent;
  }
  .settings-body { min-height: 340px; }
  .settings-intro {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 16px;
    line-height: 1.5;
  }
  .admin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    margin-bottom: 8px;
    transition: border-color 0.12s;
  }
  .admin-row:hover { border-color: var(--line-strong); }
  .admin-swatch {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .admin-swatch input[type="color"] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0;
  }
  .admin-icon-box {
    width: 34px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
  }
  .admin-row input[type="text"],
  .admin-row input[type="email"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--paper);
    min-width: 60px;
  }
  .admin-row input[type="text"].narrow { flex: 0 0 48px; text-align: center; }
  .admin-row .item-count {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    padding: 2px 7px;
    background: var(--surface-alt);
    border-radius: 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .admin-row .admin-delete {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
  }
  .admin-row .admin-delete:hover {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FCA5A5;
  }
  body.dark-mode .admin-row .admin-delete:hover { background: #4B1818; color: #FCA5A5; }
  .admin-row .admin-delete:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }
  .admin-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--sky);
    border: 1px dashed var(--sky);
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-top: 6px;
  }
  .admin-add:hover {
    background: var(--sky-tint);
  }
  .admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
  }

  .collapsible-label {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    margin-bottom: 8px;
  }
  .collapsible-label:hover .collapsible-chev { color: var(--sky); }
  .collapsible-chev {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    transition: transform 0.2s;
    text-transform: none;
    letter-spacing: 0;
  }
  .collapsible-chev.collapsed { transform: rotate(-90deg); }

  /* Sticky modal header + footer */
  .modal-header {
    position: sticky;
    top: 0;
    background: var(--paper);
    z-index: 3;
    border-bottom: 1px solid var(--line);
  }
  .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    z-index: 3;
    border-top: 1px solid var(--line);
  }
  .settings-tabs {
    position: sticky;
    top: 58px;
    z-index: 2;
  }
  .detail-header {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .preprod-picker-head {
    display: grid;
    grid-template-columns: 1fr 160px 140px;
    gap: 8px;
    padding: 0 10px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
  }
  .preprod-picker {
    padding: 4px 0;
    max-height: 320px;
    overflow-y: auto;
  }
  .preprod-pick-row {
    display: grid;
    grid-template-columns: 1fr 160px 140px;
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
  }
  .preprod-pick-row:hover { background: var(--softer); }
  .preprod-pick-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
  }
  .preprod-pick-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--sky);
    flex-shrink: 0;
    margin: 0;
  }
  .preprod-pick-row.custom .preprod-pick-label {
    font-style: italic;
  }
  .preprod-pick-row.custom .preprod-pick-label::before {
    content: '✎';
    color: var(--sky);
    font-style: normal;
    margin-right: 2px;
  }
  .preprod-pick-row select,
  .preprod-pick-row input[type="date"] {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    background: var(--paper);
    width: 100%;
  }
  .preprod-pick-row select:disabled,
  .preprod-pick-row input[type="date"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--softer);
  }
  .preprod-custom-remove {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-left: 6px;
  }
  .preprod-custom-remove:hover {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FCA5A5;
  }
  body.dark-mode .preprod-custom-remove:hover { background: #4B1818; color: #FCA5A5; }

  .preprod-pick-date-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .preprod-pick-relative {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 13px;
  }
  .preprod-pick-relative .rel-before { color: var(--sky); }
  .preprod-pick-relative .rel-on { color: #10B981; font-weight: 700; }
  .preprod-pick-relative .rel-after { color: #EF4444; font-weight: 700; }

  @media (max-width: 700px) {
    .preprod-picker-head, .preprod-pick-row {
      grid-template-columns: 1fr;
    }
    .preprod-picker-head span:nth-child(2),
    .preprod-picker-head span:nth-child(3) {
      display: none;
    }
    .preprod-pick-row select,
    .preprod-pick-row input[type="date"] {
      margin-left: 26px;
      width: calc(100% - 26px);
    }
  }
  .library-task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    background: var(--softer);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }
  .library-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.1s;
    font-size: 13px;
    color: var(--ink);
  }
  .library-task-row:hover { border-color: var(--line-strong); }
  .library-task-row.checked {
    background: var(--sky-tint);
    border-color: var(--sky);
  }
  .library-task-row input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--sky);
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
  }
  .library-task-title {
    flex: 1;
    font-weight: 500;
    line-height: 1.3;
  }
  .library-task-row.checked .library-task-title {
    font-weight: 600;
    color: var(--sky-hover);
  }
  .library-task-timing {
    display: block;
    font-weight: 500;
    font-size: 11px;
    color: var(--sky);
    margin-top: 2px;
  }
  .library-task-timing.muted { color: var(--muted); }

  .lib-offset-input {
    width: 58px;
    text-align: center;
    flex: 0 0 auto;
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
  }
  .lib-offset-input:disabled { opacity: 0.4; cursor: not-allowed; }
  .lib-offset-before {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
  }
  .lib-anchor-select {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
  }

  .prod-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .prod-type-option {
    padding: 14px 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.1s;
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    text-align: left;
  }
  .prod-type-option:hover {
    border-color: var(--sky);
    background: var(--sky-tint);
  }

  @media (max-width: 700px) {
    .library-task-list { grid-template-columns: 1fr; }
  }

  /* Apply-template button on project detail pre-plan lane */
  .project-lane-apply {
    background: var(--sky-tint);
    color: var(--sky-hover);
    border: 1px solid var(--sky);
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    width: 100%;
    transition: all 0.12s;
  }
  .project-lane-apply:hover { background: var(--sky); color: #FFFFFF; }
  body.dark-mode .project-lane-apply { background: var(--sky-tint); color: var(--sky); }
  body.dark-mode .project-lane-apply:hover { background: var(--sky); color: var(--navy-deep); }
  .project-lane-add {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    width: 100%;
    transition: all 0.12s;
  }
  .project-lane-add:hover {
    color: var(--sky);
    border-color: var(--sky);
    background: var(--sky-tint);
  }
  .project-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255,255,255,0.22);
    color: inherit;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
  }
  .project-chip::before { content: '◆'; opacity: 0.7; font-size: 8px; }

  /* Drive button on bars */
  .drive-icon {
    font-size: 10px;
    opacity: 0.85;
    flex-shrink: 0;
  }

  /* Audit trail */
  .detail-audit {
    background: var(--softer);
  }
  .detail-audit .detail-value { font-size: 11px; color: var(--muted); }
  .detail-audit .audit-line { line-height: 1.6; }
  .detail-audit .audit-line strong { font-weight: 600; color: var(--ink-subtle); }

  .hero-filter-hint { display: inline-flex; align-items: center; gap: 8px; }
  .filter-hint-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--sky);
    background: var(--sky-tint);
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.005em;
  }
  .filter-hint-text a {
    color: var(--sky-hover);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 2px;
  }
  .filter-hint-text a:hover { opacity: 0.85; }
  .search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 140px;
    max-width: 280px;
  }
  .search-icon {
    position: absolute;
    left: 10px;
    color: var(--muted);
    font-size: 12px;
    pointer-events: none;
  }
  .search-input {
    width: 100%;
    padding: 7px 28px 7px 30px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    letter-spacing: 0.005em;
    transition: border-color 0.12s, background 0.12s;
  }
  .search-input:focus {
    outline: none;
    border-color: var(--sky);
    background: var(--paper);
  }
  .search-input::placeholder { color: var(--muted); }
  .search-clear {
    position: absolute;
    right: 6px;
    width: 20px; height: 20px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    border: none;
    border-radius: 10px;
    background: var(--line-strong);
    color: var(--paper);
    cursor: pointer;
  }
  .search-clear:hover { background: var(--ink); }

  .filter-chips {
    display: flex;
    gap: 6px;
    padding: 8px 26px 0;
    flex-wrap: wrap;
    align-items: center;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
  }
  .filter-chip {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.01em;
    transition: all 0.12s;
    white-space: nowrap;
  }
  .filter-chip:hover {
    border-color: var(--sky);
    color: var(--sky);
  }
  .filter-chip.active {
    background: var(--sky);
    border-color: var(--sky);
    color: #FFFFFF;
  }
  .filter-chip.filter-clear {
    color: #991B1B;
    border-color: #FCA5A5;
  }
  body.dark-mode .filter-chip.filter-clear {
    color: #FCA5A5;
    border-color: #7B2020;
  }
  .filter-chip.filter-clear:hover {
    background: #FEE2E2;
  }
  body.dark-mode .filter-chip.filter-clear:hover { background: #4B1818; }

  /* Search/filter highlight on matching items */
  .search-highlight {
    background: linear-gradient(transparent 60%, #FEF08A 60%);
  }
  body.dark-mode .search-highlight {
    background: linear-gradient(transparent 60%, rgba(254, 240, 138, 0.3) 60%);
  }

  /* Search empty state */
  .search-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    margin: 20px 0;
  }
  .search-empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.6;
  }
  .search-empty-hint { font-size: 12px; margin-top: 8px; color: var(--muted); }

  /* ========== Cloud UI ========== */
  /* Connection status dot */
  .conn-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--line-strong);
    margin-right: 2px;
    transition: background 0.3s;
    flex-shrink: 0;
  }
  .conn-dot.online {
    background: #10B981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: conn-pulse 2.4s ease-out infinite;
  }
  .conn-dot.offline { background: #EF4444; }
  .conn-dot.syncing { background: #F59E0B; }
  @keyframes conn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
  }

  /* User badge in header */
  .user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    padding: 3px 10px 3px 3px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink);
    transition: border-color 0.12s;
  }
  .user-badge:hover { border-color: var(--sky); }
  .user-badge-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
  }
  .user-badge-name { font-size: 12px; font-weight: 600; letter-spacing: 0.005em; }
  @media (max-width: 700px) {
    .user-badge-name { display: none; }
    .user-badge { padding: 3px; border-radius: 50%; }
  }

  /* Access-role badge (admin / editor / viewer) */
  .role-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid transparent;
    cursor: default;
    white-space: nowrap;
  }
  .role-badge-admin  { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
  .role-badge-editor { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD; }
  .role-badge-viewer { background: var(--surface-alt); color: var(--muted); border-color: var(--line); }
  @media (max-width: 700px) {
    .role-badge { display: none !important; }
  }

  /* Hide write-only controls for viewers (RLS still enforces server-side). */
  body.role-viewer #newProjectBtn,
  body.role-viewer #newEventBtn,
  body.role-viewer .release-reminder-add,
  body.role-viewer .project-lane-add,
  body.role-viewer .add-project-task-btn,
  body.role-viewer .write-only { display: none !important; }
  /* Settings is admin-only. */
  body:not(.role-admin) #settingsBtn { display: none !important; }

  /* Roles settings tab */
  .role-email { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .role-self-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; padding: 1px 6px; margin-left: 6px; }
  .role-select {
    font-family: inherit;
    font-size: 13px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }
  .roles-add-row { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
  .roles-add-row .person-email-input { flex: 1; min-width: 180px; }

  /* Zoho status-change nudge (project detail) */
  .zoho-nudge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 26px 4px;
    padding: 10px 14px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-md, 10px);
    font-size: 13px;
    color: #1E3A5F;
  }
  .zoho-nudge-icon { font-size: 15px; }
  .zoho-nudge-text { flex: 1; line-height: 1.45; }
  .zoho-nudge-apply {
    flex-shrink: 0;
    background: var(--sky, #00AEEF);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm, 8px);
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .zoho-nudge-apply:hover { filter: brightness(0.95); }
  .zoho-nudge-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #1E3A5F;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 2px;
  }
  .zoho-nudge-dismiss:hover { opacity: 1; }
  body.dark-mode .zoho-nudge { background: rgba(0,174,239,0.10); border-color: rgba(0,174,239,0.35); color: #CDE9FB; }
  body.dark-mode .zoho-nudge-dismiss { color: #CDE9FB; }

  /* Progressive Zoho linking — link a CRM record after a project exists (roadmap #10) */
  .zoho-link-prompt {
    margin: 14px 26px 4px;
    padding: 12px 14px;
    background: var(--softer);
    border: 1px dashed var(--line);
    border-radius: var(--radius-md, 10px);
  }
  .zoho-link-prompt-head { font-size: 12px; color: var(--ink-subtle); margin-bottom: 8px; line-height: 1.45; }
  .zoho-link-prompt-head strong { font-weight: 700; }
  .zoho-link-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .zoho-link-row input {
    flex: 1; min-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    font-family: inherit; font-size: 12px;
    background: var(--paper); color: var(--ink);
  }
  .zoho-link-row input:focus { outline: none; border-color: var(--sky); }
  .zoho-link-btn {
    flex-shrink: 0;
    background: var(--sky, #00AEEF); color: #fff;
    border: none; border-radius: var(--radius-sm, 8px);
    padding: 8px 14px;
    font-family: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer;
  }
  .zoho-link-btn:hover { filter: brightness(0.95); }
  .zoho-link-btn:disabled { opacity: 0.6; cursor: default; }
  .zoho-link-status { font-size: 11px; color: var(--muted); margin-top: 7px; min-height: 14px; }
  .zoho-link-status.error { color: #DC2626; }

  /* Welcome modal */
  .welcome-people-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--softer);
    padding: 4px;
  }
  .welcome-person-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.12s;
  }
  .welcome-person-row:hover { border-color: var(--sky); background: var(--sky-tint); }
  .welcome-person-row:last-child { margin-bottom: 0; }
  .welcome-person-info { flex: 1; min-width: 0; }
  .welcome-person-name { font-size: 14px; font-weight: 600; color: var(--ink); }
  .welcome-person-email { font-size: 11px; color: var(--muted); margin-top: 2px; }

  /* App loading overlay */
  #app-loading {
    position: fixed; inset: 0;
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
  }
  .app-loading-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
  .app-loading-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--line);
    border-top-color: var(--sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .app-loading-msg { font-size: 13px; color: var(--muted); letter-spacing: 0.01em; }

  /* App error overlay */
  #app-error {
    position: fixed; inset: 0;
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 20px;
  }
  .app-error-inner {
    max-width: 440px; text-align: center; padding: 32px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
  }
  .app-error-icon { font-size: 40px; margin-bottom: 10px; }
  .app-error-title { font-size: 20px; font-weight: 700; color: var(--heading); margin-bottom: 10px; }
  .app-error-detail {
    font-size: 12px; color: #991B1B; background: #FEE2E2;
    padding: 10px 12px; border-radius: var(--radius-sm);
    margin: 12px 0; word-break: break-word; font-family: monospace;
  }
  body.dark-mode .app-error-detail { color: #FCA5A5; background: #4B1818; }
  .app-error-help { font-size: 13px; color: var(--muted); margin: 14px 0 18px; line-height: 1.5; }

  /* Save button in-flight state */
  button.is-saving {
    opacity: 0.65;
    cursor: progress !important;
    position: relative;
  }
  button.is-saving::before {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -1px;
  }

  /* Duplicate project preset buttons */
  .dupe-preset {
    background: var(--surface-alt);
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.12s;
  }
  .dupe-preset:hover { border-color: var(--sky); color: var(--ink); }
  .dupe-preset.active {
    background: var(--sky);
    color: #FFFFFF;
    border-color: var(--sky);
  }

  /* Delete project choice modal — two big stackable choice buttons */
  .delete-choice-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--paper);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink);
    transition: all 0.15s;
  }
  .delete-choice-btn:hover { border-color: var(--sky); background: var(--sky-tint); }
  .delete-choice-btn:last-child { margin-bottom: 0; }
  .delete-choice-cascade { border-color: #FCA5A5; }
  .delete-choice-cascade:hover {
    border-color: #DC2626;
    background: #FEE2E2;
  }
  body.dark-mode .delete-choice-cascade:hover { background: #4B1818; }
  .delete-choice-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .delete-choice-cascade .delete-choice-title { color: #B91C1C; }
  body.dark-mode .delete-choice-cascade .delete-choice-title { color: #FCA5A5; }
  .delete-choice-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
  }
  .recommended-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    background: #10B981;
    color: #FFFFFF;
    border-radius: 9px;
  }

  /* Per-stage template library tabs */
  .lib-stage-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 14px;
  }
  .lib-stage-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    background: var(--softer);
    color: var(--ink-subtle);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
  }
  .lib-stage-tab:hover { border-color: var(--sky); color: var(--sky); }
  .lib-stage-tab.active { background: var(--sky); border-color: var(--sky); color: #fff; }
  .lib-stage-count {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 9px;
    background: rgba(0,0,0,0.12);
  }
  .lib-stage-tab.active .lib-stage-count { background: rgba(255,255,255,0.25); }

  /* Draggable pre-prod library rows */
  .preprod-lib-list .lib-row {
    cursor: default;
    transition: all 0.15s;
    position: relative;
  }
  .lib-drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: -1px;
    user-select: none;
    padding: 0 4px;
    border-radius: 3px;
    transition: all 0.12s;
  }
  .lib-drag-handle:hover { color: var(--sky); background: var(--sky-tint); }
  .lib-row.dragging { opacity: 0.45; cursor: grabbing; }
  .lib-row.dragging .lib-drag-handle { cursor: grabbing; }
  .lib-row.drag-over {
    border-color: var(--sky) !important;
    background: var(--sky-tint) !important;
    box-shadow: 0 -2px 0 var(--sky);
  }
  .lib-row-num {
    display: inline-block;
    min-width: 22px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    background: var(--surface-alt);
    border-radius: 3px;
    padding: 2px 0;
    letter-spacing: 0.02em;
  }

  .coverage-strip {
    padding: 16px 26px 18px;
    background: var(--softer);
    border-bottom: 1px solid var(--line);
  }
  .coverage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .coverage-eyebrow {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .coverage-summary {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
    letter-spacing: 0.005em;
  }
  .coverage-summary strong {
    color: var(--heading);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .coverage-gap-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    background: #FEF3C7;
    color: #92400E;
    white-space: nowrap;
  }
  body.dark-mode .coverage-gap-chip { background: #3A2A10; color: #FCD34D; }
  .coverage-gap-chip strong { font-weight: 700; font-variant-numeric: tabular-nums; }

  .coverage-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .coverage-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.005em;
    transition: transform 0.1s ease;
  }
  .coverage-pill:hover { transform: translateY(-1px); }
  .coverage-pill.active {
    background: var(--navy);
    color: #FFFFFF;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 1px 2px rgba(0,0,0,0.08);
  }
  .coverage-pill.inactive {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    opacity: 0.75;
  }
  .coverage-pill-icon { font-size: 13px; }
  .coverage-pill-name { font-weight: 600; }
  .coverage-pill-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    background: var(--sky);
    color: #FFFFFF;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    margin-left: 2px;
  }

  /* ========== Mini coverage on project card ========== */
  .project-card-coverage {
    border-top: 1px dashed var(--line);
    margin-top: 12px;
    padding-top: 12px;
    margin-bottom: 12px;
  }
  .coverage-mini-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .coverage-mini-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }
  .coverage-mini-icon {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.005em;
  }
  .coverage-mini-icon.active {
    background: var(--navy);
    color: #FFFFFF;
  }
  .coverage-mini-icon.inactive {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    opacity: 0.5;
    padding: 2px 6px;
    font-size: 11px;
  }
  .coverage-mini-count {
    font-size: 9px;
    font-weight: 700;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
  }

  /* Mobile: tighten coverage */
  @media (max-width: 900px) {
    .coverage-strip { padding: 14px 18px 16px; }
    .coverage-pill { padding: 5px 9px; font-size: 11px; }
    .coverage-pill-name { display: none; }
    .coverage-pill.active .coverage-pill-name { display: inline; }
  }
  .notify-btn { position: relative; }
  .notify-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--navy);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
  }

  .notify-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: var(--softer);
  }
  .notify-item-dot {
    width: 8px; height: 8px; border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
  }
  .notify-item-body { flex: 1; min-width: 0; }
  .notify-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
    line-height: 1.35;
  }
  .notify-item-meta {
    font-size: 11px;
    color: var(--muted);
  }
  .notify-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
  }

  /* ========== View-as selector ========== */
  .view-as-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 3px 3px 10px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }
  .view-as-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .view-as-select {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    padding: 5px 24px 5px 6px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394A3B8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
  }
  body.dark-mode .view-as-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238290A2' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  }
  /* The select is transparent, so its options inherited light text on the OS's
     default white dropdown list in dark mode — names were invisible until hovered. */
  body.dark-mode .view-as-select option {
    background: var(--paper);
    color: var(--ink);
  }

  /* ========== Multi-select pillar filter ========== */
  .pillar-ms { position: relative; flex: 0 0 auto; }
  .pillar-ms-btn {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    padding: 5px 24px 5px 6px;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394A3B8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
  }
  body.dark-mode .pillar-ms-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238290A2' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  }
  .pillar-ms-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 4px;
    z-index: 120;
    max-height: 320px;
    overflow-y: auto;
  }
  .pillar-ms-panel.hidden { display: none; }
  .pillar-ms-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
  }
  .pillar-ms-item:hover { background: var(--wash); }
  .pillar-ms-item input { cursor: pointer; margin: 0; accent-color: var(--navy); }
  .pillar-ms-sep { height: 1px; background: var(--line); margin: 4px 2px; }

  /* ========== Toast ========== */
  .toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--navy);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-xl);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 200;
    letter-spacing: 0.005em;
  }
  .toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }

  /* Responsive fallback kept above — original @media rules were here */
