/* Extracted from lighthouse-app.html (UI redesign N1) — load order matters */
    /* Main Content - offset for fixed sidebar */
    .dashboard-content {
      display: block;
      min-height: calc(100vh - 200px);
      overflow-x: hidden;
    }

    /* Content areas shift right when sidebar is present */
    .dashboard .dashboard-header,
    .dashboard #uirWeeklyStrip,
    .dashboard .lh-helpful-bar,
    .dashboard .metrics-trend-container,
    .dashboard .score-grid,
    .dashboard #insightBriefCard,
    .dashboard #actChecklistCard,
    .dashboard #actNextStepStrip,
    .dashboard .dashboard-content {
      margin-left: 220px;
      /* margin-left transition removed – triggers reflow on every frame across 5 sections */
    }
    .dashboard.sidebar-collapsed .dashboard-header,
    .dashboard.sidebar-collapsed #uirWeeklyStrip,
    .dashboard.sidebar-collapsed .lh-helpful-bar,
    .dashboard.sidebar-collapsed .metrics-trend-container,
    .dashboard.sidebar-collapsed .score-grid,
    .dashboard.sidebar-collapsed #insightBriefCard,
    .dashboard.sidebar-collapsed #actChecklistCard,
    .dashboard.sidebar-collapsed #actNextStepStrip,
    .dashboard.sidebar-collapsed .dashboard-content {
      margin-left: 56px;
    }
    /* Narrow viewports: a 220px rail can't share a phone/tablet width without
       forcing horizontal scroll. Collapse to the slim icon rail and reset the
       content offset so the layout reflows without stray horizontal scroll.
       Navigation stays usable (icon rail), no JS toggle required. */
    @media (max-width: 768px) {
      .tabs-nav { width: 56px; }
      .tabs-nav .tab-label,
      .tabs-nav .tab-badge,
      .tabs-nav .sidebar-section-label,
      .tabs-nav .pinned-label { display: none; }
      .tabs-nav .tab-btn { padding: 10px 0; justify-content: center; gap: 0; }
      .dashboard .dashboard-header,
      .dashboard #uirWeeklyStrip,
      .dashboard .lh-helpful-bar,
      .dashboard .metrics-trend-container,
      .dashboard .score-grid,
      .dashboard #insightBriefCard,
      .dashboard #actChecklistCard,
      .dashboard #actNextStepStrip,
      .dashboard .dashboard-content,
      .dashboard.sidebar-collapsed .dashboard-header,
      .dashboard.sidebar-collapsed #uirWeeklyStrip,
      .dashboard.sidebar-collapsed .lh-helpful-bar,
      .dashboard.sidebar-collapsed .metrics-trend-container,
      .dashboard.sidebar-collapsed .score-grid,
      .dashboard.sidebar-collapsed #insightBriefCard,
      .dashboard.sidebar-collapsed #actChecklistCard,
      .dashboard.sidebar-collapsed #actNextStepStrip,
      .dashboard.sidebar-collapsed .dashboard-content {
        margin-left: 56px;
      }
    }
    /* Onboarding cards are bordered cards, not full-bleed strips — inset them */
    .dashboard #uirWeeklyStrip,
    .dashboard #insightBriefCard,
    .dashboard #actChecklistCard,
    .dashboard #actNextStepStrip {
      margin-right: 16px;
    }

    /* Tabs container no longer needs flex — sidebar is fixed */
    .tabs-container {
      min-height: calc(100vh - 200px);
    }

    /* ── Fixed Left Rail ── */
    .tabs-nav {
      display: flex;
      flex-direction: column;
      width: 220px;
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
      backdrop-filter: blur(16px) saturate(1.4);
      -webkit-backdrop-filter: blur(16px) saturate(1.4);
      border-right: 1px solid color-mix(in srgb, var(--brand-primary, var(--border)) 12%, var(--border));
      z-index: 110;
      overflow-y: auto;
      overflow-x: hidden;
      /* width transition removed – sidebar reflow is expensive; snap instead */
      padding: 12px 0 16px;
    }

    /* Custom scrollbar for the sidebar */
    .tabs-nav::-webkit-scrollbar { width: 3px; }
    .tabs-nav::-webkit-scrollbar-track { background: transparent; }
    .tabs-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: var(--radius-xs); }
    .tabs-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

    /* Collapsed state */
    .tabs-nav.collapsed { width: 56px; }
    .tabs-nav.collapsed .tab-label { opacity: 0; width: 0; overflow: hidden; }
    .tabs-nav.collapsed .tab-badge { display: none; }
    .tabs-nav.collapsed .tab-btn { padding: 10px 0; justify-content: center; gap: 0; }
    .tabs-nav.collapsed .sidebar-toggle { margin: 0 8px 8px; }
    .tabs-nav.collapsed .toggle-icon svg { transform: rotate(180deg); }
    .tabs-nav.collapsed .sidebar-divider { margin: 8px 8px; }
    .tabs-nav.collapsed .sidebar-section-label { display: none; }

    /* ── Sidebar Toggle ── */
    .sidebar-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      margin: 8px 12px 4px;
      border-radius: var(--radius-md);
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-family: inherit;
      flex-shrink: 0;
      transition: background 0.15s ease, color 0.15s ease;
    }
    .sidebar-toggle:hover {
      background: rgba(255, 255, 255, 0.06);
      color: var(--text-primary);
    }
    .toggle-icon {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .toggle-icon svg {
      transition: transform 0.2s ease;
      width: 14px;
      height: 14px;
    }

    /* ── Section Labels ── */
    .sidebar-section-label {
      position: sticky;
      top: 0;
      z-index: 2;
      background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
      padding: 16px 16px 6px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--text-secondary);
      opacity: 1;
      white-space: nowrap;
      overflow: hidden;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
      transition: color var(--duration-fast) ease;
    }
    .sidebar-section-label:hover { color: var(--text-primary); }
    .sidebar-section-label .section-chevron {
      width: 12px; height: 12px;
      transition: transform 0.2s var(--ease-out);
      opacity: 0.5;
      flex-shrink: 0;
    }
    .sidebar-section-label:hover .section-chevron { opacity: 0.9; }
    .sidebar-section.collapsed .sidebar-section-label .section-chevron {
      transform: rotate(-90deg);
    }
    .sidebar-section.collapsed .tab-btn { display: none; }

    /* ── Divider ── */
    .sidebar-divider {
      height: 1px;
      background: var(--border);
      margin: 10px 16px;
      flex-shrink: 0;
      opacity: 0.6;
    }

    /* ── Nav Button ── */
    .tab-btn {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 9px 16px;
      background: transparent;
      border: none;
      border-left: 3px solid transparent;
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
      font-family: inherit;
      cursor: pointer;
      text-align: left;
      transition: color 0.15s ease, background 0.15s ease, border-left-color 0.15s ease;
      white-space: nowrap;
      letter-spacing: 0.1px;
      position: relative;
    }

    .tab-btn:hover {
      color: var(--text-primary);
      background: rgba(255, 255, 255, 0.04);
    }

    .tab-btn.active {
      color: var(--brand-primary, var(--accent));
      border-left-color: transparent;
      background: color-mix(in srgb, var(--brand-primary, var(--accent)) 5%, transparent);
      font-weight: 600;
    }
    .tab-btn::before {
      content: '';
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 3px;
      background: var(--brand-primary, var(--accent));
      border-radius: 0 3px 3px 0;
      transform: scaleY(0);
      transition: transform 0.2s var(--ease-out);
    }
    .tab-btn.active::before { transform: scaleY(1); }
    .tab-btn.active { border-left-color: transparent; }

    /* ── Pin Icon ── */
    .pin-icon {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      opacity: 0;
      transition: opacity 0.15s ease, color 0.15s ease;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 14px;
      line-height: 1;
      padding: 2px;
    }
    .tab-btn:hover .pin-icon { opacity: 0.6; }
    .tab-btn:hover .pin-icon:hover { opacity: 1; color: var(--brand-primary, var(--accent)); }
    .tab-btn.pinned .pin-icon { opacity: 0.8; color: var(--brand-primary, var(--accent)); }
    .tab-btn.pinned:hover .pin-icon:hover { opacity: 1; }
    .tabs-nav.collapsed .pin-icon { display: none; }

    /* ── Pinned Section ── */
    .pinned-section {
      display: none;
      padding-bottom: 4px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 4px;
    }
    .pinned-section.has-pins { display: block; }
    .pinned-section .pinned-label {
      padding: 12px 16px 6px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--brand-primary, var(--accent));
      opacity: 0.7;
      white-space: nowrap;
      overflow: hidden;
    }
    .tabs-nav.collapsed .pinned-label { display: none; }

    /* ── Tab Context Menu ── */
    .tab-context-menu {
      display: none;
      position: fixed;
      z-index: 10000;
      min-width: 160px;
      background: color-mix(in srgb, var(--bg-primary) 90%, transparent);
      backdrop-filter: blur(16px) saturate(1.3);
      -webkit-backdrop-filter: blur(16px) saturate(1.3);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 4px 0;
      box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    .tab-context-menu.active { display: block; }
    .tab-context-menu-item {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 8px 14px;
      background: none;
      border: none;
      color: var(--text-primary);
      font-size: 13px;
      font-family: inherit;
      cursor: pointer;
      text-align: left;
    }
    .tab-context-menu-item:hover {
      background: rgba(0, 255, 255, 0.08);
    }

    /* ── Nav Icon ── */
    .tab-icon {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.7;
    }
    .tab-btn:hover .tab-icon { opacity: 1; }
    .tab-btn.active .tab-icon { opacity: 1; }
    .tab-icon svg {
      width: 18px;
      height: 18px;
      stroke-width: 1.75;
    }

    .tab-label {
      overflow: hidden;
      text-overflow: ellipsis;
      transition: opacity 0.15s ease;
    }

    /* ── Sidebar Footer Link ── */
    .sidebar-link {
      text-decoration: none;
      color: var(--text-muted) !important;
      font-size: 12px;
    }
    .sidebar-link:hover {
      color: var(--accent-purple) !important;
    }
    .sidebar-link .tab-icon { opacity: 0.5; }
    .sidebar-link:hover .tab-icon { opacity: 0.8; }


    /* ── Tab Content ── */
    .tab-content {
      display: none;
      padding: 28px 24px;
    }

    .tab-content.active {
      display: block;
      animation: tabFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    /* ── Breadcrumb ── */
    .tab-breadcrumb {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 10px 24px;
      font-size: 12px;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border-subtle);
      animation: tabFadeIn 0.25s ease;
    }
    .breadcrumb-section {
      text-transform: uppercase;
      letter-spacing: 1px;
      font-weight: 600;
      font-size: 10px;
      opacity: 0.7;
    }
    .breadcrumb-sep {
      width: 12px; height: 12px;
      opacity: 0.4;
      flex-shrink: 0;
    }
    .breadcrumb-tab {
      color: var(--text-secondary);
      font-weight: 500;
    }

    /* ── Confirm Modal ── */
    .confirm-modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000;
      display: none; align-items: center; justify-content: center;
      opacity: 0; transition: opacity 0.15s ease;
      pointer-events: none;
    }
    .confirm-modal-overlay.visible { opacity: 1; pointer-events: auto; }
    .confirm-modal {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl);
      padding: 24px; max-width: 420px; width: 90%; box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    }
    .confirm-modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
    .confirm-modal p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
    .confirm-modal-input { width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); font-size: 14px; font-family: inherit; margin-bottom: 16px; box-sizing: border-box; }
    .confirm-modal-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
    .confirm-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
    .confirm-modal-actions button { padding: 8px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; border: none; }
    .confirm-modal-cancel { background: var(--bg-tertiary); color: var(--text-secondary); }
    .confirm-modal-cancel:hover { background: var(--border); }
    .confirm-modal-confirm { background: var(--accent); color: #06080c; }
    .confirm-modal-confirm.destructive { background: var(--accent-red); color: #fff; }

    /* ── Command Palette ── */
    .cmd-palette-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 9999;
      align-items: flex-start;
      justify-content: center;
      padding-top: min(20vh, 160px);
    }
    .cmd-palette-overlay.visible { display: flex; }
    .cmd-palette {
      width: 100%;
      max-width: 520px;
      background: color-mix(in srgb, var(--bg-card) 95%, transparent);
      backdrop-filter: blur(20px) saturate(1.5);
      -webkit-backdrop-filter: blur(20px) saturate(1.5);
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
      overflow: hidden;
      animation: cmdPaletteIn 0.15s ease-out;
    }
    @keyframes cmdPaletteIn {
      from { opacity: 0; transform: scale(0.96) translateY(-8px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .cmd-palette-input-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
    }
    .cmd-palette-input-wrap svg {
      width: 18px; height: 18px;
      color: var(--text-muted);
      flex-shrink: 0;
    }
    .cmd-palette-input {
      flex: 1;
      background: transparent;
      border: none;
      outline: none;
      color: var(--text-primary);
      font-size: 15px;
      font-family: inherit;
      font-weight: 400;
    }
    .cmd-palette-input::placeholder { color: var(--text-muted); }
    .cmd-palette-kbd {
      font-size: 10px;
      font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
      padding: 2px 6px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: var(--radius-xs);
      color: var(--text-muted);
    }
    .cmd-palette-results {
      max-height: 340px;
      overflow-y: auto;
      padding: 6px;
    }
    .cmd-palette-results::-webkit-scrollbar { width: 3px; }
    .cmd-palette-results::-webkit-scrollbar-track { background: transparent; }
    .cmd-palette-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
    .cmd-palette-group {
      padding: 6px 10px 4px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      color: var(--text-muted);
    }
    .cmd-palette-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: background 0.1s ease;
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
    }
    .cmd-palette-item:hover,
    .cmd-palette-item.selected {
      background: color-mix(in srgb, var(--brand-primary, var(--accent)) 8%, transparent);
      color: var(--text-primary);
    }
    .cmd-palette-item .cp-icon {
      width: 18px; height: 18px;
      flex-shrink: 0;
      opacity: 0.6;
    }
    .cmd-palette-item.selected .cp-icon { opacity: 1; }
    .cmd-palette-item .cp-section {
      margin-left: auto;
      font-size: 10px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.8px;
    }
    .cmd-palette-empty {
      padding: 24px 16px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
    }
    .cmd-palette-footer {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 8px 16px;
      border-top: 1px solid var(--border);
      font-size: 11px;
      color: var(--text-muted);
    }
    .cmd-palette-footer kbd {
      font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
      font-size: 10px;
      padding: 1px 5px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 3px;
      color: var(--text-muted);
    }

    /* Section spacing rhythm within tabs */
    .tab-content > h3,
    .tab-content > .section-header {
      margin-top: 32px;
      margin-bottom: 16px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-subtle);
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.2px;
    }
    .tab-content > h3:first-child,
    .tab-content > .section-header:first-child {
      margin-top: 0;
    }
    
