/* ═══════════════════════════════════════════════════════════
   Commercial Roadmap — Design System
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
[x-cloak] { display: none !important; }
.hidden { display: none !important; }

:root {
    /* Colors */
    --bg: #f7f9fc;
    --bg2: #fbfcff;
    --panel: #ffffff;
    --text: #0c1220;
    --muted: #5a6473;
    --border: #e5ebf3;
    --border-light: #f1f5f9;
    --accent: #2563eb;
    --accent-light: #eff6ff;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 2px 6px rgba(0,0,0,.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 24px rgba(0,0,0,.1);

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 100px;

    /* Transitions */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --duration: 200ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font: 13px/1.5 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Focus visible (accessibility) ── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Skip to content (accessibility) ── */
.skip-link {
    position: absolute; left: -9999px; top: 4px;
    background: var(--accent); color: #fff; padding: 8px 16px; border-radius: var(--radius-sm);
    z-index: 9999; font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ═══════════════════════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════════════════════ */

.nav {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.nav-logo {
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    object-fit: contain;
    background: #fff;
}
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* ── Planning cycle selector ── */
.cycle-selector { position: relative; margin-left: 12px; }
.cycle-btn {
    display: flex; align-items: center; gap: 4px;
    background: var(--accent-bg); border: 1px solid var(--accent);
    border-radius: var(--radius-md); padding: 3px 10px;
    font-size: 12px; font-weight: 600; color: var(--accent);
    cursor: pointer; white-space: nowrap;
}
.cycle-btn:hover { background: var(--accent); color: #fff; }
.cycle-icon { font-size: 13px; }
.cycle-dropdown {
    position: absolute; top: 100%; left: 0; margin-top: 4px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    min-width: 120px; z-index: 100; overflow: visible;
}
.cycle-option {
    display: block; width: 100%; text-align: left;
    padding: 6px 12px; font-size: 12px; border: none;
    background: none; cursor: pointer; color: var(--text);
}
.cycle-option:hover { background: var(--accent-bg); }
.cycle-option.active { background: var(--accent); color: #fff; font-weight: 600; }
.cycle-help {
    display: none; /* replaced by cycle-dropdown-header */
}
.cycle-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 12px; border-bottom: 1px solid var(--border);
}
.cycle-dropdown-title {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
}
.cycle-info-icon {
    position: relative;
    font-size: 13px; color: var(--text-muted); cursor: help;
    opacity: 0.6; transition: opacity 0.15s;
}
.cycle-info-icon:hover { opacity: 1; }
.cycle-info-icon::after {
    content: attr(data-tip);
    position: absolute; top: 100%; right: 0; margin-top: 6px;
    width: 240px; padding: 6px 8px;
    font-size: 11px; line-height: 1.4; color: var(--text-muted);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
    opacity: 0; pointer-events: none;
    transition: opacity 0.1s;
    z-index: 110;
}
.cycle-info-icon:hover::after { opacity: 1; }

/* ── Carry-over badges ── */
.chip-cycle-tag {
    position: absolute; top: -1px; right: 2px;
    font-size: 7px; font-weight: 700; letter-spacing: 0.3px;
    text-transform: uppercase; padding: 0 3px; border-radius: 2px;
    line-height: 12px; pointer-events: none;
}
.chip-cycle-tag.inherited { background: #fbbf24; color: #78350f; }
.chip-cycle-tag.upcoming { background: #60a5fa; color: #1e3a5f; }
.tip-cycle-badge {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 9px; font-weight: 600; margin-bottom: 2px;
}
.tip-cycle-badge.inherited { background: #fbbf24; color: #78350f; }
.tip-cycle-badge.upcoming { background: #60a5fa; color: #1e3a5f; }
.co-badge {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 10px; font-weight: 600; line-height: 16px;
}
.co-badge.inherited { background: #fef3c7; color: #92400e; }
.co-badge.upcoming { background: #dbeafe; color: #1e40af; }
.co-badge.muted { background: var(--bg); color: var(--muted); }
.kpi-carryover {
    display: flex; gap: 4px; justify-content: center; margin-top: 4px; flex-wrap: wrap;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 14px 12px;
    transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--text); }
.nav-link--active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav-link--disabled { color: #cbd5e1; pointer-events: none; }
.nav-link--settings { display: flex; align-items: center; gap: 5px; }
.nav-link--settings svg { flex-shrink: 0; }

/* ── User avatar menu ── */
.user-menu { position: relative; margin-left: 8px; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent); color: #fff; border: 2px solid rgba(255,255,255,.3);
    font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.user-avatar:hover { border-color: #fff; box-shadow: 0 0 0 2px rgba(99,102,241,.3); }
.user-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg, 0 8px 25px rgba(0,0,0,.12));
    min-width: 200px; z-index: 200; overflow: hidden;
}
.user-dropdown-header { padding: 12px 14px; }
.user-dropdown-name { font-weight: 600; font-size: 13px; }
.user-dropdown-email { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-dropdown-role { margin-top: 6px; font-size: 10px; }
.user-dropdown-divider { height: 1px; background: var(--border); }
.user-dropdown-item {
    display: block; padding: 8px 14px; font-size: 12px; color: var(--text);
    text-decoration: none; transition: background .1s;
}
.user-dropdown-item:hover { background: var(--bg); }

/* ═══════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════ */

.main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; }
h1 { font-size: 20px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
h4 { font-size: 12px; font-weight: 600; margin: 8px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
/* ── Page header with search ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { margin-bottom: 0; }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ── Generic page toolbar (reusable across pages) ── */
.page-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; margin-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap; gap: 8px;
}
.page-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-toolbar-right { display: flex; align-items: center; gap: 8px; }
.page-toolbar-ctx { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.page-toolbar-ctx label { font-weight: 600; white-space: nowrap; }

.search-input {
    padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; width: 220px; background: var(--panel);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); outline: none; }
.search-input::placeholder { color: #94a3b8; }

.footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; color: var(--muted); font-size: 12px; }
.footer-left { display: flex; align-items: center; gap: 6px; }
.footer-right { display: flex; align-items: center; gap: 0; }
.footer-link { color: var(--muted); text-decoration: none; font-weight: 500; transition: color var(--duration) var(--ease); }
.footer-link:hover { color: var(--accent); }
.footer-sep { margin: 0 8px; color: #cbd5e1; }

/* ── Presence / Active Users ── */
.presence-bar { display: flex; align-items: center; gap: 6px; }
.presence-status {
    width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,.2);
}
.presence-avatars { display: flex; }
.presence-dot {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--border); color: var(--muted);
    font-size: 8px; font-weight: 700; letter-spacing: .02em;
    display: flex; align-items: center; justify-content: center;
    margin-left: -4px; border: 1.5px solid var(--panel);
    cursor: default; position: relative;
}
.presence-dot:first-child { margin-left: 0; }
.presence-dot:hover::after {
    content: attr(title); position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); padding: 3px 8px; border-radius: 4px;
    background: var(--text-primary, #1e293b); color: #fff;
    font-size: 11px; font-weight: 500; white-space: nowrap;
    pointer-events: none; margin-bottom: 4px; z-index: 10;
}
.presence-label { font-size: 11px; color: var(--muted); }

/* ── Dev Identity Picker ── */
.dev-picker { position: relative; display: inline-flex; align-items: center; }
.dev-picker-btn {
    background: none; border: 1px dashed var(--border); border-radius: 4px;
    color: var(--muted); font-size: 11px; padding: 2px 8px; cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.dev-picker-btn:hover { color: var(--accent); border-color: var(--accent); }
.dev-picker-dropdown {
    position: absolute; bottom: 100%; left: 0;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 -4px 16px rgba(0,0,0,.12);
    min-width: 220px; max-height: 300px; overflow-y: auto;
    padding: 4px; margin-bottom: 6px; z-index: 999;
}
.dev-picker-option {
    display: block; width: 100%; text-align: left;
    background: none; border: none; padding: 6px 10px;
    font-size: 12px; color: var(--text); cursor: pointer;
    border-radius: 4px; transition: background var(--duration) var(--ease);
}
.dev-picker-option:hover { background: var(--border); }
.dev-picker-option.active { background: var(--accent); color: white; font-weight: 600; }
.dev-picker-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dev-picker-clear { color: var(--muted); font-style: italic; }

/* ── Impersonation Banner ── */
.impersonate-banner {
    background: #fef3c7; border-bottom: 2px solid #fbbf24;
    padding: 6px 20px; font-size: 13px; color: #92400e;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    position: sticky; top: 0; z-index: 1000;
}
.impersonate-stop {
    background: #92400e; color: #fff; border: none; border-radius: 4px;
    padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background .2s;
}
.impersonate-stop:hover { background: #78350f; }

/* ═══════════════════════════════════════════════════════════
   Stats Cards
   ═══════════════════════════════════════════════════════════ */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-number { font-size: 32px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Portfolio Overview Layers ── */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi-card {
    background: var(--panel); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 16px 18px; text-align: center;
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.kpi-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kpi-val { font-size: 28px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; line-height: 1.1; }
.kpi-lbl { font-size: 10px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-alert .kpi-val { color: #ef4444; }
.kpi-alert { border-color: #fecaca; background: #fef2f2; }

.layer-card {
    background: var(--panel); border: 1px solid var(--border-light);
    border-left: 4px solid var(--layer-color, var(--accent));
    border-radius: var(--radius-md); margin-bottom: 16px; overflow: hidden;
}
.layer-hdr { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.layer-num {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--layer-color, var(--accent)); color: #fff;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.layer-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.layer-q { margin: 2px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }
.layer-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 16px 20px 20px; }
.layer-sh { margin: 0 0 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.layer-note { font-size: 11px; color: var(--muted); margin-top: 10px; font-style: italic; }
.layer-empty { font-size: 12px; color: var(--muted); }

.strat-rows { display: flex; flex-direction: column; gap: 6px; }
.strat-row {
    display: grid; grid-template-columns: 10px 20px 1fr auto auto;
    align-items: center; gap: 6px; font-size: 12px;
    padding: 5px 8px; background: var(--border-light); border-radius: var(--radius-sm);
}
.strat-dot { width: 10px; height: 10px; border-radius: 50%; }
.strat-icon { font-size: 14px; }
.strat-name { font-weight: 500; }
.strat-cnt { font-weight: 700; color: var(--text); min-width: 20px; text-align: right; }
.strat-budget { font-size: 11px; color: var(--muted); min-width: 45px; text-align: right; }
.strat-plan-hdr {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--accent); padding: 6px 0 2px; border-bottom: 1px solid var(--border-light);
    margin-top: 4px;
}
.strat-plan-hdr:first-child { margin-top: 0; }

.ovw-bars { display: flex; flex-direction: column; gap: 6px; }
.ovw-bar-row { display: grid; grid-template-columns: 100px 1fr 40px; gap: 8px; align-items: center; }
.ovw-bar-lbl { font-size: 12px; color: var(--muted); text-align: right; font-weight: 500; }
.ovw-bar-track { height: 18px; background: var(--border-light); border-radius: var(--radius-sm); overflow: hidden; }
.ovw-bar-fill { height: 100%; border-radius: var(--radius-sm); transition: width 600ms var(--ease); min-width: 4px; }
.ovw-bar-val { font-size: 12px; font-weight: 700; color: var(--text); }

.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-chip { display: flex; align-items: center; gap: 6px; }
.stage-chip-cnt { font-size: 13px; font-weight: 700; color: var(--text); }

.gauge-rows { display: flex; flex-direction: column; gap: 8px; }
.gauge-row { display: grid; grid-template-columns: 70px 1fr 40px; gap: 8px; align-items: center; }
.gauge-lbl { font-size: 11px; font-weight: 600; color: var(--muted); }
.gauge-track { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 4px; transition: width 600ms var(--ease); }
.gauge-val { font-size: 12px; font-weight: 700; color: var(--text); }

.readiness-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.rdy-item { text-align: center; padding: 8px 4px; border-radius: var(--radius-sm); }
.rdy-val { display: block; font-size: 18px; font-weight: 700; }
.rdy-lbl { display: block; font-size: 10px; font-weight: 500; margin-top: 2px; }
.rdy-high { background: #dcfce7; color: #065f46; }
.rdy-partial { background: #fef3c7; color: #92400e; }
.rdy-low { background: #fee2e2; color: #991b1b; }
.rdy-none { background: var(--bg-secondary); color: var(--muted); }

.risk-callout {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: var(--radius-sm); margin-bottom: 10px;
}
.risk-callout-val { font-size: 18px; font-weight: 700; color: #dc2626; }
.risk-callout-lbl { font-size: 12px; color: #991b1b; }
.risk-meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.risk-meta-sep { margin: 0 4px; }

.vr-fill-not_started { background: #94a3b8; }
.vr-fill-tracking { background: #2563eb; }
.vr-fill-partial { background: #d97706; }
.vr-fill-achieved { background: #059669; }
.vr-fill-exceeded { background: #047857; }
.vr-fill-missed { background: #dc2626; }

/* ═══════════════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════════════ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
    overflow: hidden;
}
.table.sticky-header { border-collapse: separate; border-spacing: 0; overflow: visible; }
.table.sticky-header th { position: sticky; top: 52px; z-index: 2; box-shadow: 0 2px 4px rgba(0,0,0,.08); }
.table th {
    background: var(--border-light);
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fafc; }
.table a { color: var(--accent); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

.init-name-cell { max-width: 320px; }
.init-name-link { display: inline; word-break: break-word; overflow-wrap: break-word; hyphens: auto; line-height: 1.4; }

.pri-badge {
    display: inline-block; font-size: 11px; font-weight: 700; color: #7c3aed;
    background: #f3f0ff; padding: 2px 6px; border-radius: 4px; min-width: 28px; text-align: center;
}
.pri-badge--fallback { color: var(--muted); background: var(--bg-secondary); }
.pri-badge-sm { display: inline-block; font-size: 10px; font-weight: 700; color: #7c3aed; background: #f3f0ff; padding: 1px 5px; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════
   Badges
   ═══════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 600; color: var(--text);
    background: var(--bg-alt, #e2e8f0);
    letter-spacing: 0.02em;
}
.badge-idea, .badge-shaping, .badge-in_progress, .badge-done, .badge-on_hold,
.badge-committed, .badge-approved, .badge-under_review, .badge-pipeline,
.badge-deferred, .badge-rejected, .badge-on_track, .badge-at_risk,
.badge-blocked, .badge-challenges, .badge-in_trouble, .badge-not_started,
.badge-tracking, .badge-achieved, .badge-missed { color: #fff; }
.badge-idea { background: #94a3b8; }
.badge-shaping { background: #f59e0b; }
.badge-in_progress { background: #3b82f6; }
.badge-done { background: #22c55e; }
.badge-on_hold { background: #ef4444; }
.badge-committed { background: #059669; }
.badge-approved { background: #2563eb; }
.badge-under_review { background: #7c3aed; }
.badge-pipeline { background: #94a3b8; }
.badge-deferred { background: #d97706; }
.badge-rejected { background: #dc2626; }
.badge-on_track { background: #22c55e; }
.badge-at_risk { background: #f59e0b; }
.badge-blocked { background: #dc2626; }
.badge-challenges { background: #f97316; }
.badge-in_trouble { background: #991b1b; }
.badge-not_started { background: #94a3b8; }
.badge-tracking { background: #3b82f6; }
.badge-achieved { background: #22c55e; }
.badge-missed { background: #dc2626; }
.badge-confirmed { background: #059669; color: #fff; }
.badge-wip { background: #f59e0b; color: #fff; }
.badge-no { background: #94a3b8; color: #fff; }
.badge-tbd { background: #cbd5e1; color: var(--text); }

/* Application lifecycle */
.badge-active { background: #22c55e; color: #fff; }
.badge-retiring { background: #f59e0b; color: #fff; }
.badge-decommissioned { background: #ef4444; color: #fff; }
.badge-planned { background: #3b82f6; color: #fff; }
/* TIME classification */
.badge-time-invest { background: #22c55e; color: #fff; }
.badge-time-tolerate { background: #3b82f6; color: #fff; }
.badge-time-migrate { background: #f59e0b; color: #fff; }
.badge-time-eliminate { background: #ef4444; color: #fff; }
/* Investment direction */
.badge-invest-grow { background: #059669; color: #fff; }
.badge-invest-contain { background: #3b82f6; color: #fff; }
.badge-invest-retire { background: #f59e0b; color: #fff; }
.badge-invest-evaluate { background: #8b5cf6; color: #fff; }
/* Tier */
.badge-tier-major { background: #6366f1; color: #fff; }
.badge-tier-minor { background: #94a3b8; color: #fff; }
.badge-tier-supporting { background: #cbd5e1; color: var(--text); }
/* Platform / foundational */
.badge-platform { background: #0891b2; color: #fff; }
/* Source link */
.source-link { color: var(--muted); text-decoration: none; font-size: 12px; margin-left: 4px; opacity: .6; transition: opacity .15s; }
.source-link:hover { opacity: 1; color: var(--accent); }

.strategy-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 14px; border-radius: var(--radius-pill);
    color: #fff; font-size: 12px; font-weight: 600;
    margin: 2px 4px 2px 0;
    background: var(--pill-bg, #6366f1);
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.strategy-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.strategy-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.tag-badge {
    display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
    font-size: 11px; background: var(--border-light); color: var(--muted);
    margin: 2px; font-weight: 500;
}
.badge-rel-impacts   { background:#64748b; color:#fff; }
.badge-rel-delivers  { background:#059669; color:#fff; }
.badge-rel-enhances  { background:#2563eb; color:#fff; }
.badge-rel-replaces  { background:#dc2626; color:#fff; }
.badge-rel-integrates{ background:#0891b2; color:#fff; }
.badge-rel-migrates  { background:#d97706; color:#fff; }

/* ═══════════════════════════════════════════════════════════
   Detail Sections
   ═══════════════════════════════════════════════════════════ */

/* ── Breadcrumb navigation ── */
.detail-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 16px; font-size: 13px;
}
.breadcrumb-back {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--accent); text-decoration: none; font-weight: 500;
    padding: 4px 8px; border-radius: var(--radius); transition: background .15s;
}
.breadcrumb-back:hover { background: var(--bg); }
.breadcrumb-back svg { flex-shrink: 0; }
.breadcrumb-sep { color: var(--muted); font-size: 11px; }
.breadcrumb-link { color: var(--muted); text-decoration: none; }
.breadcrumb-link:hover { color: var(--text); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.detail-section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
}
.detail-section dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.detail-section dt { font-weight: 600; color: var(--muted); font-size: 12px; }
.detail-section dd { font-size: 13px; }
.detail-section ul { padding-left: 18px; }
.detail-section li { margin-bottom: 4px; }

/* ═══════════════════════════════════════════════════════════
   Initiative Detail Card Layout
   ═══════════════════════════════════════════════════════════ */

/* ── Detail Hero Header ── */
.detail-hero {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.detail-hero-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.hero-back {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--muted);
    transition: background .15s, color .15s;
    margin-top: 2px;
}
.hero-back:hover { background: var(--bg); color: var(--text); }
.hero-title-block { flex: 1; min-width: 0; }
.hero-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.hero-name { font-size: 20px; font-weight: 700; margin: 0; line-height: 1.3; }
.hero-code { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: var(--radius-sm); }
.hero-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.hero-lineage {
    display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px;
}
.hero-lineage-item {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted);
}
.hero-lineage-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted);
}
.hero-lineage-item a { color: var(--accent); text-decoration: none; font-weight: 500; }
.hero-lineage-item a:hover { text-decoration: underline; }
.hero-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Hero inline edit form */
.hero-edit-toolbar {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}
.hero-edit-title { font-size: 14px; font-weight: 700; color: var(--text); }
.hero-edit-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px;
}
.hero-edit-field label {
    display: block; font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px;
}
.hero-edit-field .form-input, .hero-edit-field .form-input-sm { width: 100%; box-sizing: border-box; }
.hero-edit-wide { grid-column: span 2; }
.hero-edit-wide3 { grid-column: span 3; }
@media (max-width: 700px) { .hero-edit-grid { grid-template-columns: 1fr 1fr; } }

/* Key facts strip */
.hero-facts {
    display: flex;
    gap: 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-light);
    overflow-x: auto;
}
.hero-fact {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    border-right: 1px solid var(--border-light);
    min-width: 0;
    white-space: nowrap;
}
.hero-fact:first-child { padding-left: 0; }
.hero-fact:last-child { border-right: none; }
.hero-fact-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hero-fact-value { font-size: 14px; font-weight: 600; color: var(--text); }
.hero-fact-sep {
    width: 1px; align-self: stretch;
    background: var(--border);
    margin: 0 4px;
}

/* Description block */
.detail-desc {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}
.detail-desc p { margin: 0; line-height: 1.6; font-size: 13px; color: var(--text); }

/* Team strip (under description) */
.detail-team {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}
.detail-team-header {
    display: flex; align-items: center; padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--bg) 40%, var(--panel));
}
.detail-team-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted); margin: 0;
}
.detail-team-list {
    display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center;
}
.detail-team-member {
    display: inline-flex; align-items: center; gap: 3px; font-size: 13px; line-height: 1.5;
    padding: 2px 12px; border-right: 1px solid var(--border);
}
.detail-team-member:last-child { border-right: none; }
.detail-team-role {
    font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
}
.detail-team-edit { display: inline-flex; }
.detail-team-add {
    display: inline-flex; gap: 4px; align-items: center; margin-top: 6px;
}
.hero-lineage-meta { font-size: 11px; color: var(--muted); margin-left: 2px; }

/* Persona pills (muted teal) */
.persona-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: #e0f2f1; color: #00695c; font-size: 11px; font-weight: 500;
    padding: 4px 10px; border-radius: 12px; border: 1px solid #b2dfdb;
}
.persona-pill .pill-remove { color: #00695c; }
.persona-pill .pill-remove:hover { color: #b71c1c; }

/* Strategy plan label */
.strategy-plan-label { opacity: 0.7; font-size: 9px; margin-left: 4px; }

.init-header { margin-bottom: 20px; }
.init-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.init-title { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.3; }
.init-code { font-size: 13px; font-weight: 500; color: var(--muted); vertical-align: middle; margin-left: 6px; }
.scope-flag { vertical-align: middle; margin-right: 2px; display: inline-flex; align-items: center; }
.init-actions { display: flex; gap: 6px; flex-shrink: 0; }
.init-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.init-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .init-layout { grid-template-columns: 1fr; } }
.init-content { max-width: 100%; }
.init-main { min-width: 0; }
.init-section { margin-bottom: 20px; }
.init-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); margin-bottom: 8px; padding-left: 2px;
    border-bottom: 1px solid var(--border-light); padding-bottom: 4px;
}
.init-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.init-grid .init-card { margin-bottom: 0; }
.init-card-wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .init-grid { grid-template-columns: 1fr; } }
.init-sidebar { min-width: 0; }
@media (min-width: 901px) { .init-sidebar { position: sticky; top: 64px; } }

.init-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
}
.init-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--bg) 40%, var(--panel));
}
.init-card-header h3 { margin: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.init-card-body { padding: 10px 14px; }
.init-card-compact { border-left: 3px solid var(--accent); }
.init-card-compact .init-card-body { padding: 10px 14px; }
.at-glance .init-meta + .glance-divider { margin: 8px 0; }
.glance-divider { border: none; border-top: 1px solid var(--border-light); margin: 8px 0; }

.init-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    font-size: 10px; font-weight: 700;
    background: var(--accent); color: #fff;
    border-radius: 9px;
}

.init-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; }
.init-meta dt { font-weight: 600; color: var(--muted); font-size: 11px; white-space: nowrap; }
.init-meta dd { font-size: 12px; word-break: break-word; }

.init-list { display: flex; flex-direction: column; gap: 2px; }
.init-list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 8px; border-radius: var(--radius-sm);
    font-size: 13px; transition: background .1s; gap: 8px;
}
.init-list-item:hover { background: var(--bg); }
.init-list-item:hover .init-row-actions { opacity: 1; }
.init-list-text { flex: 1; min-width: 0; }
.init-list-label { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.init-list-meta { color: var(--muted); font-size: 12px; }

.init-team-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;
}
.init-team-grid .init-list-item {
    background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px;
}
.init-team-row { display: flex; flex-direction: column; gap: 1px; }
.init-team-role { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.init-team-name { font-size: 13px; }

.init-row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.init-action-btn {
    width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border: none; background: none; cursor: pointer; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--muted); transition: all .15s;
}
.init-action-btn:hover { background: var(--border-light); color: var(--text); }
.init-action-btn.danger:hover { background: #fee2e2; color: #dc2626; }

.init-remove-btn {
    background: none; border: none; cursor: pointer; color: var(--muted);
    font-size: 16px; padding: 0 4px; line-height: 1; transition: color .15s;
}
.init-remove-btn:hover { color: #dc2626; }

.init-inline-add {
    display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap;
    padding-top: 8px; border-top: 1px solid var(--border-light);
}
.init-checkbox { font-size: 11px; display: flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; }

.form-input-sm { font-size: 11px; padding: 4px 8px; }
.btn-sm { font-size: 11px; padding: 4px 10px; }

.strategy-pills-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-remove {
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,.7); font-size: 14px;
    margin-left: 2px; padding: 0; line-height: 1;
}
.pill-remove:hover { color: #fff; }

/* ── Initiative view rows ── */
.init-view-row { padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.init-view-row:last-child { border-bottom: none; }

/* ── Initiative Form Page ── */
.init-form { max-width: 760px; margin: 0 auto 40px; }
.init-form-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.init-form-header h1 { font-size: 22px; font-weight: 700; margin: 0; }
.init-form-actions { display: flex; gap: 8px; }
.init-form-section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-xs); }
.init-form-section h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.form-field .form-input { width: 100%; }
.init-form-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }

/* ═══════════════════════════════════════════════════════════
   Subtabs
   ═══════════════════════════════════════════════════════════ */

.subtabs { display: flex; gap: 2px; }
.subtab-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: none;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.subtab-btn:hover { background: var(--border-light); color: var(--text); }
.subtab-btn.active { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-xs); }
.subtab-help-btn {
    margin-left: 8px; width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg); color: var(--muted);
    font-weight: 700; font-size: 13px; cursor: pointer; align-self: center;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.subtab-help-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.help-dl { margin: 0 0 8px; }
.help-dl dt { font-weight: 600; margin-top: 8px; }
.help-dl dd { margin: 2px 0 0 16px; color: var(--muted); }
.help-scale { font-weight: 400; color: var(--muted); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   Roadmap Header + Filters
   ═══════════════════════════════════════════════════════════ */

.nav-subtitle { font-size: 10px; color: var(--muted); font-style: italic; font-weight: 400; line-height: 1.2; }
.roadmap-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.roadmap-actions { display: flex; gap: 8px; margin-left: auto; }

.shared-toolbar {
    display: flex; align-items: flex-end; gap: 14px; padding: 7px 12px;
    background: #fafbfe; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    margin-bottom: 6px;
}
.shared-toolbar-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); white-space: nowrap; padding-bottom: 6px;
}
.shared-toolbar-field { display: flex; flex-direction: column; gap: 2px; }
.shared-toolbar-field label { font-size: 10px; font-weight: 600; color: var(--muted); }
.shared-toolbar-field input,
.shared-toolbar-field select { font-size: 12px; padding: 4px 8px; width: 90px; }

.timeline-toolbar { display: flex; align-items: center; justify-content: flex-end; padding: 6px 12px; border-bottom: 1px solid var(--border-light); background: #fafbfe; }

.filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-control { display: flex; flex-direction: column; gap: 3px; }
.filter-control label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-control select {
    font-size: 12px; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); min-width: 110px;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.filter-control select:hover { border-color: #94a3b8; }
.filter-control select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.filter-search {
    font-size: 12px; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); width: 120px;
    transition: border-color var(--duration) var(--ease);
}
.filter-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); outline: none; }
.filter-search::placeholder { color: #94a3b8; }

/* ── Multi-select filter dropdowns ── */
.filter-multi-btn {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); min-width: 110px; cursor: pointer;
    color: var(--text); text-align: left;
    transition: border-color var(--duration) var(--ease);
}
.filter-multi-btn:hover { border-color: #94a3b8; }
.filter-multi-btn span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.filter-chevron { font-size: 10px; color: var(--muted); }
.filter-multi-dropdown {
    position: absolute; top: 100%; left: 0;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 6px;
    box-shadow: var(--shadow-md); z-index: 200; min-width: 160px;
    margin-top: 4px;
}
.filter-multi-option {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 12px;
    transition: background var(--duration) var(--ease);
}
.filter-multi-option:hover { background: var(--border-light); }
.filter-multi-option input[type="checkbox"] { accent-color: var(--accent); }
.filter-multi-clear {
    display: block; width: 100%; margin-top: 4px; padding: 4px;
    border: none; background: none; color: var(--muted);
    font-size: 11px; cursor: pointer; text-align: center;
    border-top: 1px solid var(--border-light);
}
.filter-multi-clear:hover { color: var(--accent); }
.filter-control { position: relative; display: flex; flex-direction: column; gap: 3px; }

.view-settings { margin-left: auto; position: relative; }
.btn-settings {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel);
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    transition: all var(--duration) var(--ease);
}
.btn-settings:hover { background: var(--border-light); color: var(--text); border-color: #94a3b8; }
/* ── Export dropdown ── */
.export-group { position: relative; }
.btn-export {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); cursor: pointer; font-size: 12px;
    color: var(--muted); font-weight: 500; line-height: 1.2;
    transition: all var(--duration) var(--ease);
}
.btn-export:hover { background: var(--border-light); color: var(--text); }
.export-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    z-index: 200; min-width: 160px; overflow: hidden;
}
.export-option {
    display: block; width: 100%; padding: 8px 14px;
    font-size: 12px; color: var(--text); text-decoration: none;
    border: none; background: none; text-align: left; cursor: pointer;
    transition: background var(--duration) var(--ease);
}
.export-option:hover { background: var(--border-light); }

.btn-display-options {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--accent-light); cursor: pointer; font-size: 12px;
    color: var(--accent); font-weight: 600;
    transition: all var(--duration) var(--ease);
}
.btn-display-options:hover { background: var(--accent); color: #fff; }

.settings-panel {
    position: absolute; right: 24px; top: 145px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    box-shadow: var(--shadow-lg); z-index: 200; min-width: 420px;
}
.settings-input {
    width: 80px; padding: 5px 8px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12px;
}

/* ── Display Options panel (roadmap-specific) ── */
.display-panel {
    position: absolute; right: 0; top: 100%; margin-top: 4px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 0;
    box-shadow: var(--shadow-lg); z-index: 200; width: 360px;
}
.display-section { padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.display-section:last-child { border-bottom: none; }
.display-section h4 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.display-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 11px; font-weight: 500; color: var(--muted); }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; padding: 2px 0; grid-column: span 2; }
.switch-row input[type="checkbox"] { accent-color: var(--accent); }
.range-readout { font-size: 10px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   Roadmap Board (Timeline) — Legacy-faithful grid layout
   ═══════════════════════════════════════════════════════════ */

:root {
    --capColW: 220px;
    --qW: 112px;
    --rowH: 22px;
    --chipRadius: 10px;
    --chipShadow: 0 2px 7px rgba(0,0,0,.05);
    --markerSize: 7px;
    --pinTop: 3px;
}

.roadmap-board {
    position: relative;
    border: 1px solid #dbe3ef;
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 10px 24px rgba(0,0,0,.05);
    overflow: hidden;
}
.roadmap-scroll { overflow-x: auto; overflow-y: visible; }
.roadmap-table { position: relative; min-height: 100%; }

/* Header row — CSS Grid, sticky top */
.roadmap-header-row {
    display: grid;
    grid-template-columns: var(--capColW) 1fr;
    align-items: center;
    position: sticky; top: 0; z-index: 10;
    padding: 8px 0;
    background: #fff;
    border-bottom: 1px solid #e7edf6;
}
.cap-label-header {
    color: #475569; font-weight: 600; font-size: 12px; letter-spacing: .2px;
    padding: 0 8px 0 13px; line-height: 1.3;
}
.stickyLabel {
    position: sticky; left: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88));
    border-right: 1px solid #eef2f9;
}
.quarters-row {
    position: relative; display: flex; gap: 0;
    height: 34px; align-items: flex-start; padding: 4px 0 6px;
}
.q { width: var(--qW); text-align: center; font-weight: 600; color: #3b4a60; font-size: 12px; line-height: 1.15; letter-spacing: .1px; }
.q-cur { color: var(--accent); font-weight: 700; background: rgba(37,99,235,.05); }

/* Go-live SVG header overlay */
.glHeader { position: absolute; left: 0; top: 0; height: 100%; pointer-events: none; }
.glHeader .mark { pointer-events: auto; cursor: default; }
.glHeader .tri { fill: #10b981; opacity: .9; }

/* Group header — CSS Grid, sticky */
.groupSection { }
#timeline-groups { position: relative; }
.groupHeader {
    display: grid;
    grid-template-columns: var(--capColW) 1fr;
    align-items: center;
    padding: 6px 10px;
    border-top: 1px solid #eef2f9; border-bottom: 1px solid #eef2f9;
    background: #f7faff;
    position: sticky; top: 46px; z-index: 6;
}
.groupTitle {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; color: #111827; font-size: 11px; padding-left: 3px;
}
.groupTitle.stickyLabel {
    position: sticky; left: 0; z-index: 7;
    background: #f7faff; padding-right: 8px; border-right: 1px solid #eef2f9;
}
.chev { font-size: 12px; color: #64748b; cursor: pointer; user-select: none; display: inline-flex; align-items: center; }
.chev:hover { color: #334155; }
.swatch--round { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
.groupCount { font-size: 9px; color: var(--muted); margin-left: 4px; }

/* Rows wrapper — CSS Grid, collapsible */
.rowsWrap {
    display: grid;
    grid-template-columns: var(--capColW) 1fr;
    padding-top: 1px; padding-left: 4px;
}

/* Capability tag — sticky left column */
.capTag {
    position: sticky; left: 0; z-index: 3;
    display: block;
    padding: 6px 10px 6px 22px;
    font-weight: 520; color: #0f172a;
    background: #fdfeff;
    border-right: 1px solid #e2e8f5; border-bottom: 1px solid #edf2fb;
    font-size: 11px; line-height: 1.25;
    word-break: break-word; hyphens: auto;
}

/* Track cell — scrollable content with grid background */
.trackCell {
    position: relative;
    min-height: var(--rowH);
    padding: 4px 0 6px;
    border-bottom: 1px dashed #e6edf7;
    background-image: linear-gradient(to right, transparent calc(var(--qW) - 1px), var(--border) calc(var(--qW) - 1px));
    background-size: var(--qW) 100%;
    background-position: 0 0;
    background-repeat: repeat-x;
    overflow: hidden;
}
.altBands .trackCell {
    background-image:
        linear-gradient(to right, rgba(0,0,0,.025), rgba(0,0,0,.025)),
        linear-gradient(to right, transparent calc(var(--qW) - 1px), var(--border) calc(var(--qW) - 1px));
    background-size: calc(var(--qW) * 2) 100%, var(--qW) 100%;
}
.scopeLane { position: relative; }

/* ═══════════════════════════════════════════════════════════
   Chips (initiative bars)
   ═══════════════════════════════════════════════════════════ */

.chip {
    position: absolute;
    min-width: 20px;
    border-radius: var(--chipRadius);
    display: flex; align-items: center; gap: 5px;
    padding: 0 6px;
    box-shadow: var(--chipShadow);
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
    will-change: transform, filter;
    font-size: 12px; font-weight: 600;
    z-index: 1;
    overflow: hidden; white-space: nowrap;
}
.chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,.07);
    z-index: 2;
}
.persona {
    display: inline-grid; place-items: center;
    width: 14px; height: 14px;
    border-radius: 999px;
    background: #fff; color: #111827;
    font-weight: 800; font-size: 8px;
    border: 1px solid #e6eaf3;
    flex-shrink: 0;
}
.label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; opacity: .9; }
.scopeIcon { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0; }
.scopeIcon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.project { opacity: .9; font-weight: 600; }
.muted { color: inherit; opacity: .6; }
.faded .chip { filter: grayscale(.5) brightness(.95) opacity(.65); }
.faded .chip.active { filter: none; }

/* Over-capacity dot */
.dot {
    position: absolute; bottom: 2px;
    width: var(--markerSize); height: var(--markerSize);
    border-radius: 999px; background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239,68,68,.18);
    transform: translateX(-50%);
}

/* Go-live markers */
.gl-pin {
    position: absolute; bottom: var(--pinTop);
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: var(--markerSize) solid transparent;
    border-right: var(--markerSize) solid transparent;
    border-top: calc(var(--markerSize) + 2px) solid #10b981;
    opacity: .9;
}
.gl-pill {
    position: absolute; bottom: calc(100% + 4px);
    transform: translateX(-50%);
    background: #ecfdf5; color: #065f46;
    border: 1px solid #a7f3d0; border-radius: 999px;
    padding: 2px 6px; font-size: 11px; white-space: nowrap;
}
.gl-line {
    position: absolute; bottom: 0; width: 1px; height: 10px;
    background: #a7f3d0; transform: translateX(-50%);
}
.gl-diamond {
    display: inline-block; width: 8px; height: 8px;
    background: #22c55e; transform: rotate(45deg); margin-right: 4px;
}

/* Today markers */
.todayLine {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, rgba(239,68,68,.85), rgba(239,68,68,.35));
    box-shadow: 0 0 0 1px rgba(239,68,68,.18);
    pointer-events: none; z-index: 5;
}
.todayLabel {
    position: absolute; top: 6px;
    transform: translateX(-50%);
    background: rgba(254,242,242,.95); color: #991b1b;
    border: 1px solid #fecaca; border-radius: 999px;
    padding: 1px 6px; font-size: 10px;
    pointer-events: none; z-index: 6;
}

/* ═══════════════════════════════════════════════════════════
   Executive View
   ═══════════════════════════════════════════════════════════ */

.exec-chart {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}
.exec-header {
    padding: 10px 16px 6px;
}
.exec-title {
    font-size: 14px; font-weight: 600; color: var(--fg);
    display: flex; align-items: center; gap: 6px;
}
.exec-logo {
    display: inline-block; padding: 2px 8px;
    background: #1e40af; color: #fff;
    font-size: 12px; font-weight: 800; letter-spacing: .5px;
    border-radius: 4px;
}
.exec-chart svg { display: block; font-family: 'Inter', system-ui, sans-serif; }
.exec-cap-legend {
    padding: 2px 20px 10px;
    font-size: 10px; color: #9ca3af;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.exec-cap-legend .lsw { display: inline-block; width: 16px; height: 7px; border-radius: 2px; }
.exec-cap-legend .lsw-lo { background: #86efac; }
.exec-cap-legend .lsw-md { background: #fde68a; }
.exec-cap-legend .lsw-hi { background: #fca5a5; }
.exec-cap-legend .ldia {
    display: inline-block; width: 8px; height: 8px;
    background: #facc15; transform: rotate(45deg);
    border: 1px solid #92400e; margin: 0 2px;
}
.exec-cap-legend .lsep { border-left: 1px solid #e5e7eb; height: 12px; margin: 0 4px; }
.exec-swatch-dashed { display: inline-block; width: 14px; height: 2px; background: #ef4444; }
.exec-toggle {
    margin-left: auto; padding: 3px 10px;
    font-size: 10px; font-weight: 600;
    border: 1px solid #d1d5db; border-radius: 4px;
    background: #fff; color: #374151; cursor: pointer;
    transition: all .15s;
}
.exec-toggle:hover { background: #f3f4f6; border-color: #9ca3af; }
.exec-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   Heatmap
   ═══════════════════════════════════════════════════════════ */

.hm-wrapper {
    display: grid;
    gap: 0;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--panel);
}
.hm-header, .hm-row {
    display: grid;
    grid-template-columns: 220px repeat(auto-fill, minmax(42px, 1fr));
}
.hm-corner { background: var(--panel); }
.hm-q-header {
    display: flex; align-items: flex-end; justify-content: center;
    padding: 8px 2px 6px;
    font-size: 10px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.hm-q-header.hm-year-start { border-left: 2px solid var(--border); }
.hm-row {
    border-bottom: 1px solid var(--border-light);
    transition: background .12s;
}
.hm-row:last-child { border-bottom: none; }
.hm-row:hover { background: #f0f5ff; }
.hm-row-group { background: #f8fafc; }
.hm-row-group:hover { background: #eef2ff; }
.hm-label-cell {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    font-size: 12px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-right: 1px solid var(--border-light);
    min-height: 32px;
}
.hm-row-group .hm-label-cell { font-weight: 600; }
.hm-row-indent .hm-label-cell { padding-left: 28px; font-size: 11px; color: var(--muted); }
.hm-dot {
    flex-shrink: 0;
    width: 8px; height: 8px; border-radius: 50%;
}
.hm-icon { font-size: 14px; flex-shrink: 0; }
.hm-label-text { overflow: hidden; text-overflow: ellipsis; }
.hm-label-link { color: var(--accent); text-decoration: none; cursor: pointer; }
.hm-label-link:hover { text-decoration: underline; }
.hm-cell {
    display: flex; align-items: center; justify-content: center;
    min-height: 32px;
    font-size: 11px; font-weight: 600;
    border-left: 1px solid rgba(255,255,255,.6);
    transition: transform .1s, box-shadow .1s;
    user-select: none;
}
.hm-cell.hm-year-start { border-left: 2px solid var(--border); }
.hm-cell-active { cursor: pointer; }
.hm-cell-active:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
    z-index: 2;
    border-radius: 4px;
}

/* Totals */
.hm-total-header { font-weight: 700; background: var(--surface, #f8fafc); }
.hm-total-cell { background: var(--surface, #f8fafc); color: var(--fg); font-weight: 700; font-size: 10px; border-left: 2px solid var(--border); flex-direction: column; line-height: 1.2; }
.hm-total-window { display: block; font-size: 8px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.hm-row-footer { border-top: 2px solid var(--border); }
.hm-footer-label { font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hm-footer-cell { background: var(--surface, #f8fafc); color: var(--fg); font-weight: 700; font-size: 10px; }

/* Legend */
.hm-legend {
    display: flex; align-items: center; gap: 4px;
    padding: 12px 10px 4px;
    font-size: 11px; color: var(--muted);
}
.hm-legend-label { margin-right: 6px; font-weight: 500; }
.hm-legend-swatch {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 20px;
    border-radius: 4px; border: 1px solid var(--border-light);
    font-size: 10px; font-weight: 600;
}

/* Popup */
.hm-popup {
    position: fixed; z-index: 1000;
    background: #1e293b; color: #e2e8f0;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    min-width: 220px; max-width: 340px;
    max-height: 260px; overflow-y: auto;
    padding: 0;
    animation: hmPopIn .15s ease-out;
    pointer-events: auto;
}
@keyframes hmPopIn { from { opacity: 0; transform: translateY(4px) scale(.97); } to { opacity: 1; transform: none; } }
.hm-popup-hdr {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px 6px;
    font-weight: 600; font-size: 12px; color: #fff;
    border-bottom: 1px solid #334155;
}
.hm-popup-qtr { font-weight: 400; color: #94a3b8; font-size: 11px; }
.hm-popup-count { padding: 4px 14px 2px; font-size: 11px; color: #94a3b8; }
.hm-popup-list {
    list-style: none; margin: 0; padding: 4px 14px 10px;
}
.hm-popup-list li { padding: 2px 0; font-size: 12px; }
.hm-popup-list li::before { content: '•'; color: #60a5fa; margin-right: 6px; }
.hm-popup-list a { color: #93c5fd; text-decoration: none; }
.hm-popup-list a:hover { color: #bfdbfe; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   Tooltip
   ═══════════════════════════════════════════════════════════ */

.tip {
    position: fixed; max-width: 360px;
    background: #1e293b; color: #e2e8f0;
    padding: 10px 14px; border-radius: var(--radius-md);
    font-size: 12px; line-height: 1.5;
    z-index: 1000; pointer-events: none;
    opacity: 0; visibility: hidden;
    transition: opacity 150ms var(--ease), visibility 150ms;
    box-shadow: var(--shadow-lg);
}
.tip-visible { opacity: 1; visibility: visible; }
.tip b { color: #fff; font-weight: 600; }
.tip i { color: #94a3b8; }

/* ═══════════════════════════════════════════════════════════
   AI Insights Drawer
   ═══════════════════════════════════════════════════════════ */

.insights-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--text); cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.insights-toggle:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.insights-toggle-icon { font-size: 13px; }

.insights-drawer {
    display: flex; flex-direction: column;
}
.insights-drawer .panel {
    display: flex; flex-direction: column; height: 100%;
}
.insights-drawer .panel-header {
    flex-shrink: 0;
}

.insights-context {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 24px; border-bottom: 1px solid var(--border);
    font-size: 11px; color: var(--muted);
}
.insights-context-badge {
    display: inline-block; padding: 2px 8px;
    background: var(--accent-bg); color: var(--accent);
    border-radius: var(--radius-sm); font-weight: 600;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.insights-context-cycle { font-size: 11px; color: var(--muted); }

.insights-auto {
    flex-shrink: 0; padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}
.insights-loading {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--muted);
}
.insights-bullets {
    display: flex; flex-direction: column; gap: 10px;
}
.insight-bullet {
    display: flex; gap: 8px; font-size: 12px; line-height: 1.5;
    color: var(--text);
}
.insight-bullet-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.insight-bullet-text { flex: 1; }
.insight-bullet-text strong { font-weight: 600; }

.insights-thread {
    flex: 1; overflow-y: auto; padding: 16px 24px;
    display: flex; flex-direction: column; gap: 12px;
}
.insights-msg {
    font-size: 12px; line-height: 1.5; padding: 10px 14px;
    border-radius: var(--radius-md); max-width: 90%;
}
.insights-msg.user {
    align-self: flex-end;
    background: var(--accent); color: #fff;
}
.insights-msg.ai {
    align-self: flex-start;
    background: var(--accent-bg); color: var(--text);
    border: 1px solid var(--border);
}
.insights-msg.ai .insights-typing {
    display: inline-block; animation: insightsPulse 1.2s ease-in-out infinite;
}
@keyframes insightsPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.insights-input-wrap {
    flex-shrink: 0; padding: 12px 24px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.insights-suggestions {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 10px;
}
.insights-chip {
    padding: 4px 10px; font-size: 11px;
    border: 1px solid var(--border); border-radius: 20px;
    background: var(--bg); color: var(--text); cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.insights-chip:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

.insights-form {
    display: flex; gap: 8px;
}
.insights-text-input {
    flex: 1; padding: 8px 12px; font-size: 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--text); outline: none;
}
.insights-text-input:focus { border-color: var(--accent); }
.insights-send {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: var(--accent); color: #fff; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background var(--duration) var(--ease);
}
.insights-send:hover { background: var(--accent-hover, #1d4ed8); }

/* ═══════════════════════════════════════════════════════════
   Initiative Panel (slide-in)
   ═══════════════════════════════════════════════════════════ */

.panel-overlay {
    position: fixed; top: 0; right: -540px;
    width: min(520px, 100vw);
    height: 100vh;
    background: var(--panel);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 300ms var(--ease);
}
.panel-overlay.panel-open { right: 0; }

.panel { padding: 0; }
.panel-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfe, var(--panel));
}
.panel-header h3 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; flex: 1; min-width: 0; }
.panel-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.panel-detail-link {
    font-size: 11px; color: var(--muted); text-decoration: none;
    padding: 4px 8px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); transition: all var(--duration) var(--ease);
}
.panel-detail-link:hover { color: var(--accent); border-color: var(--accent); background: rgba(37,99,235,.05); }
.panel-close {
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; color: var(--muted);
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
}
.panel-close:hover { background: var(--border-light); color: var(--text); }
.panel-body { padding: 20px 24px; }
.panel-badges { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-dl { display: grid; grid-template-columns: 100px 1fr; gap: 6px 16px; font-size: 13px; margin-bottom: 20px; }
.panel-dl dt { font-weight: 600; color: var(--muted); font-size: 12px; }
.panel-dl dd { font-size: 13px; }
.panel-section { margin-bottom: 16px; }
.panel-section h4 { margin-bottom: 6px; }
.panel-cap { font-size: 13px; margin-bottom: 3px; padding: 2px 0; }
.panel-role { font-size: 13px; margin-bottom: 4px; padding: 4px 6px; border-radius: var(--radius-sm); transition: background .1s; }
.panel-role:hover { background: var(--bg); }
.panel-role:hover .row-actions-inline { opacity: 1 !important; }
.panel-role-label { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.panel-link {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 16px; color: var(--accent);
    font-size: 13px; font-weight: 600; text-decoration: none;
    padding: 8px 16px; border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}
.panel-link:hover { background: var(--accent); color: #fff; }
.panel-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-section-header h4 { margin: 0; }
.panel-role-label { font-weight: 600; color: var(--muted); font-size: 11px; min-width: 80px; display: inline-block; }
.panel-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }
.btn-edit {
    padding: 3px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--panel);
    cursor: pointer; font-size: 11px; color: var(--accent);
    font-weight: 500; transition: all var(--duration) var(--ease);
}
.btn-edit:hover { background: var(--accent-light); border-color: var(--accent); }
.panel-loading { padding: 60px; text-align: center; color: var(--muted); }
.panel-error { padding: 40px; text-align: center; color: #ef4444; font-weight: 500; }

/* ── Panel collapsible sections ── */
.panel-details { border-top: 1px solid var(--border-light); }
.panel-details summary {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 0; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted); cursor: pointer; list-style: none;
    user-select: none;
}
.panel-details summary::-webkit-details-marker { display: none; }
.panel-details summary::before {
    content: '▸'; font-size: 10px; transition: transform .15s;
    display: inline-block; width: 12px; flex-shrink: 0;
}
.panel-details[open] > summary::before { transform: rotate(90deg); }
.panel-details-count {
    font-size: 10px; font-weight: 700; background: var(--accent); color: #fff;
    min-width: 18px; height: 18px; line-height: 18px; text-align: center;
    border-radius: 9px; padding: 0 5px;
}
.panel-details-body { padding: 0 0 12px; }
.panel-list-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 6px; font-size: 13px; border-radius: var(--radius-sm);
    gap: 6px; min-height: 28px;
}
.panel-list-row:hover { background: var(--bg); }
.panel-list-row:hover .panel-row-actions { opacity: 1; }
.panel-remove {
    background: none; border: none; cursor: pointer; color: var(--muted);
    font-size: 14px; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.panel-remove:hover { color: #dc2626; }
.panel-row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.panel-action-btn {
    width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border: none; background: none; cursor: pointer; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--muted);
}
.panel-action-btn:hover { background: var(--border-light); color: var(--text); }
.panel-action-btn.danger:hover { background: #fee2e2; color: #dc2626; }
.panel-empty { font-size: 12px; color: var(--muted); font-style: italic; }
.panel-muted { color: var(--muted); font-size: 12px; }

/* ── Panel form layout (prevents h-scroll) ── */
.panel-add-form {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light);
}
.panel-add-stacked { flex-direction: column; align-items: stretch; }
.panel-add-row { display: flex; gap: 6px; align-items: center; }
.panel-input { font-size: 11px !important; padding: 5px 8px !important; min-width: 0 !important; width: 100% !important; }
.panel-btn { font-size: 10px !important; padding: 5px 10px !important; white-space: nowrap; flex-shrink: 0; }
.panel-check { font-size: 11px; display: flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; }
.panel-loading-sm { padding: 12px; text-align: center; }

/* ═══════════════════════════════════════════════════════════
   Legend
   ═══════════════════════════════════════════════════════════ */

.legend-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 8px;
    box-shadow: var(--shadow-xs);
}
.legend-compact {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; font-size: 12px;
}
.legend-title { font-weight: 700; color: var(--muted); }
.legend-budget { font-weight: 600; color: var(--text); }
.legend-budget-split { color: var(--muted); }
.legend-sep { color: #cbd5e1; }
.legendSummary {
    padding: 8px 16px; font-size: 11px; color: var(--muted);
    border-bottom: 1px solid var(--border-light);
    display: flex; gap: 16px; font-weight: 500;
}
.legendRow {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 16px; cursor: pointer; font-size: 12px;
    border-bottom: 1px solid #fafbfc;
    transition: background var(--duration) var(--ease);
}
.legendRow:hover { background: var(--accent-light); }
.legendSwatch { width: 14px; height: 14px; border-radius: var(--radius-sm); flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.legendName { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legendMeta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.legendPersona { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: 0.02em; }

/* ═══════════════════════════════════════════════════════════
   Funnel (Portfolio pipeline)
   ═══════════════════════════════════════════════════════════ */

.funnel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.funnel-step {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px 24px;
    text-align: center; min-width: 110px;
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.funnel-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.funnel-count { display: block; font-size: 28px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.funnel-label { font-size: 11px; color: var(--muted); text-transform: capitalize; font-weight: 500; }
.funnel-arrow { color: #cbd5e1; font-size: 20px; }
.funnel-committed .funnel-count { color: #059669; }
.funnel-approved .funnel-count { color: #2563eb; }
.funnel-under_review .funnel-count { color: #7c3aed; }
.funnel-pipeline .funnel-count { color: #64748b; }
.funnel-deferred .funnel-count { color: #d97706; }
.funnel-exits { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 16px; }
.funnel-exit { padding: 4px 10px; background: #fef3c7; border-radius: var(--radius-sm); font-weight: 500; }

/* ── Pipeline bars (horizontal bar chart) ── */
.pipeline-bars { max-width: 500px; }
.pipeline-bar-item { display: grid; grid-template-columns: 100px 1fr 40px; gap: 8px; align-items: center; margin-bottom: 6px; }
.pipeline-bar-label { font-size: 12px; font-weight: 500; text-align: right; color: var(--muted); }
.pipeline-bar-track { height: 20px; background: var(--border-light); border-radius: var(--radius-sm); overflow: hidden; }
.pipeline-bar-fill { height: 100%; border-radius: var(--radius-sm); transition: width 500ms var(--ease); min-width: 4px; }
.pipeline-fill-committed { background: #059669; }
.pipeline-fill-approved { background: #2563eb; }
.pipeline-fill-under_review { background: #7c3aed; }
.pipeline-fill-pipeline { background: #94a3b8; }
.pipeline-fill-deferred { background: #d97706; }
.pipeline-fill-rejected { background: #dc2626; }
.pipeline-bar-count { font-size: 13px; font-weight: 700; color: var(--text); }
.section-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; font-style: italic; }

/* ── Health indicators ── */
.health-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.health-item { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; background: var(--border-light); border-radius: var(--radius-sm); }
.health-count { font-weight: 700; color: var(--text); }
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.health-on_track { background: #22c55e; }
.health-challenges { background: #f59e0b; }
.health-at_risk { background: #f59e0b; }
.health-blocked { background: #ef4444; }
.health-in_trouble { background: #dc2626; }
.issues-list { display: flex; flex-direction: column; gap: 4px; }
.issue-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-size: 12px; transition: background var(--duration) var(--ease); }
.issue-row:hover { background: var(--border-light); }
.issue-name { flex: 1; font-weight: 500; }

/* ── Tree table ── */
.tree-anchor td { background: #f1f5f9; font-weight: 600; }
.tree-program td { background: #f8fafc; }
.tree-toggle { display: inline-block; width: 18px; font-size: 13px; color: #64748b; user-select: none; cursor: pointer; transition: transform 0.15s; }
.tree-toggle:hover { color: #1e293b; }
.tree-leaf { display: inline-block; width: 18px; font-size: 11px; color: #cbd5e1; user-select: none; }
.tree-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: #e2e8f0; pointer-events: none; }
#initiatives-table tbody td:nth-child(2) { position: relative; }
#initiatives-table th:nth-child(1),
#initiatives-table td:nth-child(1) { width: 48px; text-align: center; }
.badge-theme { background: #86efac; color: #14532d; }
.badge-epic { background: #a5b4fc; color: #312e81; }
.badge-table { font-size: 9px; padding: 1px 6px; white-space: nowrap; }

/* ── Sortable table headers ── */
.sortable-table .th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-table .th-sortable:hover { background: #f1f5f9; }
.sortable-table .sort-icon { font-size: 10px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   Settings Layout
   ═══════════════════════════════════════════════════════════ */

.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; min-height: 60vh; }
.settings-sidebar {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-xs);
    position: sticky; top: 72px; height: fit-content;
}
.settings-sidebar h2 { font-size: 14px; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.settings-ctx-badge {
    display: flex; align-items: center; gap: 8px;
    background: var(--accent-light); border: 1px solid var(--accent);
    border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 14px;
}
.settings-ctx-icon { font-size: 16px; }
.settings-ctx-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); line-height: 1; }
.settings-ctx-name { font-size: 13px; font-weight: 600; color: var(--accent); line-height: 1.3; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-link {
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
    display: flex; align-items: center; gap: 8px;
}
.settings-nav-link:hover { background: var(--border-light); }
.settings-nav-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.settings-nav-icon { font-size: 15px; width: 20px; text-align: center; }
.settings-content { min-width: 0; }
.settings-content h1 { margin-bottom: 20px; }
.settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ── Settings section header with count + add button ── */
.settings-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.settings-section-header h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.settings-filter {
    padding: 6px 10px 6px 30px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12px; font-family: inherit; width: 220px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cline x1='9.5' y1='9.5' x2='13' y2='13'/%3E%3C/svg%3E") 8px center no-repeat;
}
.settings-filter:focus { border-color: var(--accent); outline: none; }
.settings-filter::placeholder { color: var(--muted); }
.settings-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    background: var(--accent-light); color: var(--accent);
    border-radius: var(--radius-pill); font-size: 11px; font-weight: 700;
}

/* ── Settings add form — collapsible ── */
.settings-hint { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.ctx-pin {
    background: none; border: none; cursor: pointer; font-size: 14px;
    opacity: .25; transition: opacity .15s, transform .15s; padding: 2px;
}
.ctx-pin:hover { opacity: .7; transform: scale(1.15); }
.ctx-pin.active { opacity: 1; }
.org-context-row { background: var(--accent-light); }
.settings-add-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: none;
}
.settings-add-form.open { display: block; animation: slideDown 200ms var(--ease); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.settings-add-form h4 {
    margin: 0 0 12px; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}
.settings-add-row {
    display: flex; gap: 8px; align-items: end; flex-wrap: wrap;
}
.settings-add-row .form-field { flex: 1; min-width: 140px; }

/* ── Settings table improved ── */
.settings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.settings-table thead th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
}
.settings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.settings-table.fixed-layout { table-layout: fixed; }
.settings-table.fixed-layout td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-table.fixed-layout td .form-input,
.settings-table.fixed-layout td select.form-input,
.settings-table.fixed-layout td input[type="text"],
.settings-table.fixed-layout td input[type="email"],
.settings-table.fixed-layout td input[type="tel"] {
    width: 100%; box-sizing: border-box;
}
.settings-table tr:last-child td { border-bottom: none; }
.settings-table tr:hover td { background: var(--accent-light); }
.settings-table tr:hover .row-actions { opacity: 1; }

/* ── Row actions (appear on hover) ── */
.row-actions {
    display: flex; gap: 4px; align-items: center;
    opacity: 0.4; transition: opacity var(--duration) var(--ease);
}
.row-actions:focus-within { opacity: 1; }

/* ── Inline edit row ── */
.inline-edit-row {
    display: flex; gap: 8px; align-items: center;
}
.inline-edit-row .form-input { font-size: 12px; padding: 5px 8px; }
.inline-edit-row .btn-sm { flex-shrink: 0; white-space: nowrap; }

/* ── Settings card (for nested entities like capability areas, plans) ── */
.settings-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration) var(--ease);
}
.settings-card:hover { box-shadow: var(--shadow-sm); }
.settings-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}
.settings-card-header h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.settings-card-actions { display: flex; gap: 6px; align-items: center; }
.collapse-arrow { display: inline-block; transition: transform 0.15s ease; color: var(--muted); font-size: 12px; }
.collapse-arrow--open { transform: rotate(90deg); }

/* ── Better btn-icon for subtle actions ── */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; cursor: pointer;
    color: var(--muted); font-size: 14px;
    transition: all var(--duration) var(--ease);
}
.btn-icon:hover { background: var(--border-light); color: var(--text); border-color: var(--border); }
.btn-icon.danger:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ── Toast notifications ── */
.toast-container {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: toastIn 300ms var(--ease);
    display: flex; align-items: center; gap: 8px;
    max-width: 400px; cursor: pointer;
    transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.toast-success { background: #065f46; color: #ecfdf5; }
.toast-error { background: #991b1b; color: #fef2f2; }
.toast-info { background: #1e3a5f; color: #eff6ff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ── Smooth btn transitions for inline editing ── */
.btn-sm {
    padding: 4px 10px; font-size: 11px; font-weight: 600;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.btn-sm.primary { background: var(--accent); color: #fff; border: none; }
.btn-sm.primary:hover { background: #1d4ed8; }
.btn-sm.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm.ghost:hover { background: var(--border-light); color: var(--text); }

/* ── Empty state for settings ── */
.settings-empty {
    padding: 32px; text-align: center; color: var(--muted);
    background: var(--bg); border-radius: var(--radius-md);
    border: 2px dashed var(--border);
}
.settings-empty p { font-size: 13px; margin: 0; }

/* ── Architecture subtabs ── */
.arch-subtabs { margin-bottom: 16px; }

/* ── Pipeline toolbar ── */
.pipeline-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; margin-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap; gap: 8px;
}
.pipeline-header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pipeline-header-right { display: flex; align-items: center; gap: 8px; }
.pipeline-header-ctx { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pipeline-header-ctx label { font-weight: 600; white-space: nowrap; }
.pip-select {
    font-size: 12px; padding: 4px 8px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--panel); color: var(--text);
}
.pip-search {
    font-size: 12px; padding: 5px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--panel); width: 170px;
    transition: border-color var(--duration) var(--ease);
}
.pip-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); outline: none; }
.pip-search::placeholder { color: #94a3b8; }
.pip-filter-toggle {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 500; padding: 5px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); color: var(--muted); cursor: pointer;
    line-height: 1.2; transition: all var(--duration) var(--ease);
}
.pip-filter-toggle:hover { background: var(--border-light); color: var(--text); }
.pip-filter-toggle.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.pipeline-filters { padding: 10px 0 4px; }
.pipeline-toolbar-options { display: flex; align-items: center; gap: 8px; }

/* ── Pipeline board ── */
.pipeline-board { display: grid; grid-template-columns: repeat(var(--board-cols, 6), 1fr); gap: 8px; margin-top: 12px; }
.pipeline-col {
    background: var(--surface, #f8fafc); border-radius: var(--radius-md);
    padding: 10px; min-height: 200px;
    border-top: 3px solid var(--col-color, var(--border));
    display: flex; flex-direction: column;
}
.pipeline-col-header {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    position: sticky; top: 52px; z-index: 10;
    background: var(--surface, #f8fafc);
    padding-top: 8px;
}
.pipeline-col-label { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--col-color, var(--muted)); }
.pipeline-col-count { font-size: 22px; font-weight: 800; color: var(--col-color, var(--accent)); line-height: 1.2; }
.pipeline-col-cards { min-height: 80px; flex: 1; }
.pipeline-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px;
    cursor: grab; font-size: 12px;
    transition: box-shadow var(--duration) var(--ease);
}
.pipeline-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.pipeline-card-name { font-weight: 600; margin-bottom: 4px; cursor: pointer; color: var(--text); }
.pipeline-card-name:hover { color: var(--accent); }
.pipeline-card-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline-col-add {
    display: block; width: 100%; padding: 6px 0; margin-top: 4px;
    font-size: 12px; font-weight: 500; color: var(--muted);
    background: transparent; border: 1px dashed var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.pipeline-col-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light, rgba(37,99,235,.04)); }

/* ── Ranking list ── */
.ranking-list { max-width: 820px; margin: 0 auto; }
.ranking-header-bar {
    max-width: 820px; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px;
}
.ranking-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.ranking-legend-item { display: flex; align-items: center; gap: 4px; }
.ranking-tile {
    display: flex; align-items: stretch; gap: 0;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: 6px;
    cursor: pointer; font-size: 13px;
    transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.ranking-tile:hover { box-shadow: var(--shadow-sm); border-color: var(--accent); }
.ranking-tile-grip {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 10px 10px; background: var(--surface, #f8fafc);
    border-right: 1px solid var(--border-light);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    width: 48px; flex-shrink: 0; cursor: grab;
}
.ranking-handle { color: var(--muted); font-size: 18px; line-height: 1; }
.ranking-rank { font-weight: 700; color: var(--accent); font-size: 15px; }
.ranking-tile-main { flex: 1; padding: 10px 14px; min-width: 0; }
.ranking-tile-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 6px;
}
.ranking-tile-name { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-tile-badges { display: flex; gap: 4px; flex-shrink: 0; }
.ranking-tile-metrics { display: flex; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.rank-metric {
    display: flex; align-items: center; gap: 4px; font-size: 11px;
}
.rank-metric-label {
    font-weight: 700; font-size: 9px; color: var(--muted);
    letter-spacing: 0.05em; min-width: 22px;
}
.rank-metric-bar-wrap {
    width: 50px; height: 6px; background: var(--border-light);
    border-radius: 3px; overflow: hidden; display: inline-block;
}
.rank-metric-fill {
    height: 100%; border-radius: 3px; display: block;
    transition: width 0.3s ease;
}
.rank-fill-priority { background: #7c3aed; }
.rank-fill-impact { background: #2563eb; }
.rank-fill-effort { background: #f59e0b; }
.rank-fill-readiness { background: #22c55e; }
.rank-metric-val { font-size: 11px; color: var(--text); font-weight: 500; min-width: 18px; }
.rank-cumulative { font-weight: 600; color: var(--primary); }
.ranking-tile-bottom {
    display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted);
}
.rank-detail { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.rank-drivers { color: var(--text); }
.rank-strats { color: var(--text); }
.scope-flag { font-size: 13px; }
.ranking-group-header {
    font-weight: 600; font-size: 12px; color: var(--muted);
    margin: 14px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px;
}

/* ── Matrix popup ── */
.matrix-popup {
    position: fixed; z-index: 1000; background: var(--panel);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); min-width: 260px; max-width: 380px; max-height: 320px;
    overflow-y: auto; font-size: 13px;
}
.matrix-popup-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; font-weight: 600; font-size: 12px; color: var(--muted);
    border-bottom: 1px solid var(--border-light); position: sticky; top: 0; background: var(--panel);
}
.matrix-popup-close {
    background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted);
    padding: 0; line-height: 1;
}
.matrix-popup-close:hover { color: var(--text); }
.matrix-popup-list { padding: 4px 0; }
.matrix-popup-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; cursor: pointer; transition: background var(--duration) var(--ease);
}
.matrix-popup-item:hover { background: var(--surface, #f8fafc); }
.matrix-popup-name { font-weight: 500; }
.matrix-popup-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }

/* ── View mode toggle ── */
.view-toggle { display: flex; gap: 2px; }
.view-toggle-btn {
    padding: 6px 16px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--panel);
    cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted);
    transition: all var(--duration) var(--ease);
}
.view-toggle-btn:hover { background: var(--border-light); }
.view-toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Team cards ── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; padding: 8px 0; }
.team-member-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.team-member-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.team-member-card:focus-within { box-shadow: 0 0 0 3px rgba(99,102,241,.15), var(--shadow-xs); }
.team-avatar {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), #818cf8); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
    border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(99,102,241,.12), 0 2px 6px rgba(0,0,0,.06);
}
.team-avatar-img {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
    object-fit: cover;
    border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(99,102,241,.12), 0 2px 6px rgba(0,0,0,.06);
}
.team-member-info { flex: 1; min-width: 0; }
.team-member-info .name { font-weight: 700; font-size: 16px; line-height: 1.25; margin: 0 0 2px; color: var(--text); }
.team-member-info .role { font-size: 13px; line-height: 1.35; color: var(--muted); margin: 0 0 8px; }
.team-member-info a {
    display: inline-block; margin-right: 12px; font-size: 13px; font-weight: 500;
    text-decoration: none; transition: color .15s ease;
}
.team-member-info a:hover { text-decoration: underline; }
.team-member-info a:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.2); border-radius: 4px; }
.team-member-info .email { color: var(--accent); }
.team-member-info .phone { color: #059669; }
.team-member-info .about { color: #7c3aed; }
.team-member-info .about::after { content: ' \2197'; font-size: 10px; }

/* ── Edit form toolbar ── */
.edit-form-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0 12px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; background: var(--panel); z-index: 2;
}

/* ── Resources list ── */
.resources-list { list-style: none; padding: 0; margin: 0; }
.resources-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.resources-list li:last-child { border-bottom: none; }
.resources-list a { font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; }
.resources-list a:hover { text-decoration: underline; }
.resources-list a::after { content: ' \2197'; font-size: 11px; }
.resources-list p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Help page ── */
.help-section { margin-bottom: 24px; }
.help-section h2 { margin-bottom: 12px; }

/* ── References ── */
.ref-list { list-style: none; padding: 0; }
.ref-list li { margin-bottom: 8px; }
.ref-list a { color: var(--accent); font-weight: 500; text-decoration: none; font-size: 14px; }
.ref-list a:hover { text-decoration: underline; }

/* ── Btn danger ── */
.btn-danger {
    padding: 3px 10px; border: 1px solid #fecaca;
    border-radius: var(--radius-sm); background: #fff;
    cursor: pointer; font-size: 11px; color: #dc2626;
    font-weight: 500; transition: all var(--duration) var(--ease);
}
.btn-danger:hover { background: #fef2f2; border-color: #dc2626; }

@media (max-width: 768px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-sidebar { position: static; }
    .pipeline-board { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   Forms, Modals, Comments
   ═══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 600; backdrop-filter: blur(2px);
}
.modal-content {
    background: var(--panel); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); max-width: 600px; width: 90%;
    max-height: 80vh; overflow-y: auto; padding: 24px;
}
.create-form h3 { margin-bottom: 16px; }
.create-form details { margin-bottom: 4px; }
.create-form summary {
    font-weight: 600; font-size: 13px; cursor: pointer;
    padding: 8px 0; color: var(--text); user-select: none;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
    list-style: none;
}
.create-form summary::before { content: '▸ '; color: var(--muted); transition: transform var(--duration) var(--ease); }
.create-form details[open] > summary::before { content: '▾ '; }
.create-form summary::-webkit-details-marker { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field-help {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    font-size: 10px; font-weight: 700; line-height: 1;
    color: var(--accent); background: var(--accent-light, rgba(37,99,235,.1));
    border: 1px solid var(--accent);
    cursor: help; vertical-align: middle; margin-left: 3px;
    position: relative;
}
.field-help::after {
    content: attr(data-tip);
    position: absolute; left: 0; bottom: calc(100% + 6px);
    background: var(--text, #1e293b); color: #fff;
    font-size: 11px; font-weight: 400; line-height: 1.4;
    padding: 6px 10px; border-radius: var(--radius-sm);
    white-space: normal; width: max-content; max-width: 260px;
    pointer-events: none; opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 600; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.field-help:hover::after { opacity: 1; }
.form-input {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; background: var(--panel);
    transition: border-color var(--duration) var(--ease);
}
.form-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.form-input { resize: vertical; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-primary {
    padding: 8px 16px; background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius-sm); font-size: 13px;
    font-weight: 600; cursor: pointer; transition: background var(--duration) var(--ease);
}
.btn-primary:hover { background: #1d4ed8; }
.panel-success { padding: 12px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; }
.panel-success a { color: #065f46; font-weight: 600; }

/* ── Comments ── */
.comment-thread { }
.comment-item { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-header strong { font-size: 12px; }
.comment-time { font-size: 10px; color: var(--muted); }
.comment-body { font-size: 13px; line-height: 1.5; word-break: break-word; }
.comment-body a { color: var(--accent); text-decoration: none; }
.comment-body a:hover { text-decoration: underline; }
.comment-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; align-items: flex-start; }
.mention-wrap { flex: 1; position: relative; }
.comment-input {
    width: 100%; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12px; resize: vertical; font-family: inherit;
}
.comment-input:focus { border-color: var(--accent); outline: none; }

/* ── @mentions ── */
.mention {
    background: #dbeafe; color: #1e40af; border-radius: 3px; padding: 1px 4px;
    font-weight: 600; font-size: 12px; white-space: nowrap;
}
.detail-desc .mention, .comment-body .mention { font-size: inherit; }
.mention-dropdown {
    position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 2px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,.12); max-height: 200px; overflow-y: auto; z-index: 100;
}
.mention-item {
    padding: 6px 10px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px;
}
.mention-item:hover, .mention-item.active { background: #f0f4ff; }
.mention-item strong { font-weight: 600; }
.mention-email { color: var(--muted); font-size: 11px; }

/* ── Richtext links in descriptions ── */
.detail-desc a { color: var(--accent); text-decoration: none; }
.detail-desc a:hover { text-decoration: underline; }

/* ── Links ── */
.link-list { }
.link-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.link-item a { color: var(--accent); text-decoration: none; font-weight: 500; }
.link-item a:hover { text-decoration: underline; }
.link-form { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }

/* ── Tags ── */
.tag-picker { }
.tag-assigned { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag-remove { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--muted); padding: 0 2px; margin-left: 2px; }
.tag-remove:hover { color: #ef4444; }
.tag-add-form { display: flex; gap: 6px; align-items: center; }

/* ── Dependencies ── */
.dep-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.dep-item a { color: var(--accent); text-decoration: none; }
.dep-add-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dep-search-wrap { position: relative; }
.dep-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    max-height: 260px; overflow-y: auto; margin-top: 2px;
}
.dep-drop-group {
    padding: 6px 10px 3px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted); background: var(--surface, #f8fafc);
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0;
}
.dep-drop-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px;
    border-bottom: 1px solid var(--border-light);
}
.dep-drop-item:last-child { border-bottom: none; }
.dep-drop-item:hover { background: #eff6ff; }
.dep-drop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-drop-meta { display: flex; gap: 3px; flex-shrink: 0; }

/* ── Assessment ── */
.assessment-grid { display: flex; flex-direction: column; gap: 6px; }
.assessment-row { display: flex; align-items: center; gap: 8px; }
.assessment-label { width: 180px; font-size: 12px; font-weight: 500; color: var(--muted); }
.assessment-levels { display: flex; gap: 4px; }
.assessment-btn {
    padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); font-size: 11px; cursor: pointer; color: var(--muted);
    transition: all var(--duration) var(--ease); text-transform: capitalize;
}
.assessment-btn:hover { border-color: var(--accent); color: var(--accent); }
.assessment-btn--active { color: #fff; border-color: transparent; }
.assessment-btn--low { background: #ef4444; }
.assessment-btn--medium { background: #f59e0b; }
.assessment-btn--high { background: #22c55e; }

/* Prioritization scoring */
.assessment-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.assessment-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.prio-score-badge {
    display: inline-flex; align-items: center; padding: 2px 10px;
    background: var(--primary, #2563eb); color: #fff; border-radius: 12px;
    font-size: 12px; font-weight: 700; min-width: 40px; justify-content: center;
}
.prio-score-btn {
    width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
    background: var(--panel); font-size: 12px; font-weight: 600; cursor: pointer;
    color: #64748b; transition: all var(--duration) var(--ease); padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.prio-score-btn:nth-child(1):hover { border-color: #ef4444; color: #ef4444; }
.prio-score-btn:nth-child(2):hover { border-color: #f97316; color: #f97316; }
.prio-score-btn:nth-child(3):hover { border-color: #eab308; color: #eab308; }
.prio-score-btn:nth-child(4):hover { border-color: #22c55e; color: #22c55e; }
.prio-score-btn:nth-child(5):hover { border-color: #16a34a; color: #16a34a; }
.prio-score-btn:nth-child(1).prio-score-btn--active { background: #ef4444; color: #fff; border-color: #ef4444; }
.prio-score-btn:nth-child(2).prio-score-btn--active { background: #f97316; color: #fff; border-color: #f97316; }
.prio-score-btn:nth-child(3).prio-score-btn--active { background: #eab308; color: #fff; border-color: #eab308; }
.prio-score-btn:nth-child(4).prio-score-btn--active { background: #22c55e; color: #fff; border-color: #22c55e; }
.prio-score-btn:nth-child(5).prio-score-btn--active { background: #16a34a; color: #fff; border-color: #16a34a; }

.assessment-note-row { padding-left: 188px; margin-top: -2px; margin-bottom: 4px; }
.assessment-note-input, .assessment-note-inline {
    font-size: 11px; padding: 3px 6px; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); color: var(--text); background: var(--bg);
}
.assessment-note-input { width: 100%; }
.assessment-note-inline { flex: 1; min-width: 0; }
.assessment-note-input:focus, .assessment-note-inline:focus { border-color: var(--primary); outline: none; }
.assessment-note-input::placeholder, .assessment-note-inline::placeholder { color: var(--muted); font-style: italic; }

/* ── Impact analysis ── */
.impact-analysis { }
.impact-section { margin-bottom: 12px; }
.impact-section h4 { margin-bottom: 4px; }

/* ── Value realization badges ── */
.badge-not_started { background: #94a3b8; }
.badge-tracking { background: #3b82f6; }
.badge-partial { background: #f59e0b; }
.badge-achieved { background: #22c55e; }
.badge-exceeded { background: #059669; }
.badge-missed { background: #ef4444; }

/* ── Activity feed ── */
.activity-feed { max-height: 300px; overflow-y: auto; }
.activity-item { padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.activity-time { font-size: 10px; color: var(--muted); margin-right: 4px; }
.activity-item code { background: var(--border-light); padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* ── Edit lock banner ── */
.edit-lock-banner {
    background: #fef3c7; border: 1px solid #fde68a; border-radius: var(--radius-sm);
    padding: 8px 12px; font-size: 12px; color: #92400e; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Loading, Error, Empty States
   ═══════════════════════════════════════════════════════════ */

.loading-state { padding: 60px; text-align: center; color: var(--muted); }
.loading-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-state { padding: 40px; text-align: center; color: #ef4444; }
.error-state p { margin-bottom: 12px; font-weight: 500; }

.empty-state { padding: 40px; text-align: center; color: var(--muted); }
.empty-state p { font-size: 14px; }
.empty-state-icon { font-size: 32px; margin-bottom: 8px; }

.skeleton-wrap { padding: 16px; }
.skeleton-line {
    height: 12px; border-radius: var(--radius-sm); margin-bottom: 10px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════════════════════ */

@media print {
    .nav, .footer, .filters-row, .legend-wrap, .view-settings,
    .subtabs, .panel-overlay, .btn-settings, .shared-toolbar { display: none !important; }
    .roadmap-board, .exec-chart { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
    .main { max-width: 100%; padding: 0; }
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .nav { padding: 0 12px; gap: 16px; }
    .nav-brand { font-size: 13px; }
    .nav-link { font-size: 12px; padding: 14px 8px; }
    .main { padding: 12px; }
    .roadmap-header { flex-direction: column; align-items: stretch; }
    .filters-row { flex-wrap: wrap; }
    .filter-control select { min-width: 90px; }
    .two-col { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .settings-panel { right: 12px; left: 12px; min-width: auto; }
    .funnel { flex-direction: column; }
    .funnel-arrow { transform: rotate(90deg); }
    .panel-overlay { width: 100vw; }
}

/* ═══════════════════════════════════════════════════════════
   Themes & Epics (Programs Page)
   ═══════════════════════════════════════════════════════════ */

.programs-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 24px; gap: 16px;
}
.programs-header h1 { font-size: 22px; font-weight: 700; margin: 0; }
.programs-stats {
    display: flex; align-items: center; gap: 6px;
    margin-top: 4px; font-size: 13px; color: var(--muted);
}
.programs-stats-sep { opacity: .4; }
.programs-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Theme card */
.theme-card {
    background: var(--panel); border: 1px solid var(--border);
    border-left: 4px solid var(--theme-color, #374151);
    border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
    margin-bottom: 16px; overflow: hidden;
    transition: box-shadow var(--duration) var(--ease);
}
.theme-card:hover { box-shadow: var(--shadow-sm); }
.theme-card-orphan { border-left-style: dashed; opacity: .85; }

.theme-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 16px 20px; gap: 16px;
}
.theme-card-info { flex: 1; min-width: 0; }
.theme-card-title-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.theme-card-swatch {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.theme-card-title-row h2 {
    font-size: 15px; font-weight: 600; margin: 0;
}
.theme-card-title-row h2 a {
    color: var(--text); text-decoration: none;
}
.theme-card-title-row h2 a:hover { color: var(--accent); }
.theme-card-desc {
    font-size: 12px; color: var(--muted); margin-top: 4px;
    line-height: 1.4;
}

.theme-card-meta {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.theme-card-stats {
    font-size: 12px; color: var(--muted); white-space: nowrap;
}

/* Badges - small variants for programs page */
.badge-sm { font-size: 10px; padding: 1px 7px; }
.badge-scope-sm, .badge-cycle-sm {
    font-size: 10px; padding: 1px 7px; border-radius: var(--radius-pill);
    background: var(--bg); color: var(--muted); font-weight: 500;
}
.badge-epic { background: #7c3aed; color: #fff; }

/* Epic rows inside theme cards */
.theme-card-epics {
    border-top: 1px solid var(--border-light);
    min-height: 36px;
}
.epic-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 20px 8px 24px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px; transition: background var(--duration) var(--ease);
}
.epic-row:last-child { border-bottom: none; }
.epic-row:hover { background: var(--accent-light); }

.epic-drag-handle {
    cursor: grab; color: var(--muted); font-size: 14px;
    opacity: .35; user-select: none; flex-shrink: 0;
    transition: opacity var(--duration) var(--ease);
    line-height: 1;
}
.epic-row:hover .epic-drag-handle { opacity: .7; }
.epic-drag-handle:active { cursor: grabbing; }

.epic-row-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; color: var(--text); text-decoration: none;
    font-weight: 500;
}
.epic-row-name:hover { color: var(--accent); }
.epic-row-code {
    font-size: 11px; color: var(--muted); font-family: 'SF Mono', Monaco, monospace;
    flex-shrink: 0;
}

.epic-row-meta {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    margin-left: auto;
}
.epic-row-count {
    font-size: 12px; color: var(--muted); text-decoration: none;
    white-space: nowrap;
}
.epic-row-count:hover { color: var(--accent); }
.epic-row-empty-count { opacity: .45; }

/* Stage distribution mini-bar */
.stage-mini-bar {
    display: inline-flex; width: 48px; height: 6px;
    border-radius: 3px; overflow: hidden; background: var(--border-light);
    vertical-align: middle;
}
.stage-mini-seg { min-width: 2px; }
.stage-mini-idea { background: #94a3b8; }
.stage-mini-shaping { background: #f59e0b; }
.stage-mini-in_progress { background: #3b82f6; }
.stage-mini-done { background: #22c55e; }
.stage-mini-on_hold { background: #ef4444; }

/* Drag states */
.epic-row-ghost {
    opacity: .4; background: var(--accent-light);
}
.epic-row-chosen {
    background: var(--accent-light); box-shadow: var(--shadow-sm);
}
.epic-row-drag { opacity: 0; }

/* Placeholder & direct rows */
.epic-row-placeholder {
    color: var(--muted); font-size: 12px; font-style: italic;
    padding: 12px 24px; opacity: .6;
}
.epic-row-placeholder:hover { background: transparent; }
.epic-row-direct { opacity: .7; }
.epic-row-direct:hover { background: transparent; }

/* Empty state & footer */
.programs-empty {
    text-align: center; padding: 48px 20px; color: var(--muted);
    background: var(--panel); border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}
.programs-empty p { margin-bottom: 16px; }
.programs-footer {
    text-align: center; padding: 16px; font-size: 13px; color: var(--muted);
    margin-top: 8px;
}
.programs-footer a { color: var(--accent); text-decoration: none; }
.programs-footer a:hover { text-decoration: underline; }

/* Programs page responsive */
.theme-strat-dots { display:flex; gap:4px; margin-top:6px; flex-wrap:wrap; align-items:center; }
.theme-strat-dots .strat-dot { font-size:8px; display:flex; align-items:center; justify-content:center; cursor:default; }
.theme-strat-plan-label { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin-right:2px; }
.theme-strat-plan-label:not(:first-child) { margin-left:8px; }
.epic-row-temporal { font-size:10px; color:var(--muted); font-style:italic; white-space:nowrap; margin-left:6px; }
.epic-row-cycles { display:inline-flex; gap:2px; margin-left:4px; }
.badge-cycle-xs { font-size:9px; padding:1px 5px; background:var(--accent-bg); color:var(--accent); border-radius:var(--radius-sm); }
.theme-card-temporal { font-size:10px; color:var(--muted); font-style:italic; }

@media (max-width: 768px) {
    .programs-header { flex-direction: column; }
    .theme-card-header { flex-direction: column; gap: 8px; }
    .epic-row { padding: 8px 12px 8px 16px; }
    .stage-mini-bar { width: 36px; }
}

/* ── Integration Map ── */
.intmap-fullscreen-wrap.intmap-fullscreen {
    position:fixed; inset:0; z-index:9000; background:var(--bg, #fff);
    display:flex; flex-direction:column; padding:8px 16px;
}
.intmap-fullscreen-wrap.intmap-fullscreen .intmap-container {
    flex:1; height:auto; min-height:0;
}
.intmap-toolbar { display:flex; align-items:center; justify-content:space-between; padding:8px 0; }
.intmap-toolbar-left { display:flex; align-items:center; gap:8px; }
.intmap-toolbar-right { display:flex; align-items:center; gap:6px; }
.intmap-container { display:flex; gap:0; height:calc(100vh - 220px); min-height:400px; border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; background:#fafbfc; }
.intmap-sidebar { width:210px; min-width:210px; border-right:1px solid var(--border); padding:12px; overflow-y:auto; background:var(--panel); }
.intmap-graph { flex:1; position:relative; overflow:hidden; }
.intmap-graph svg { display:block; position:relative; z-index:1; }
.intmap-tooltip { position:absolute; pointer-events:none; background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-md); padding:8px 12px; font-size:12px; line-height:1.5; box-shadow:0 4px 12px rgba(0,0,0,.1); z-index:100; max-width:300px; }
.intmap-filter-group { margin-bottom:10px; }
.intmap-filter-group label { display:block; font-size:11px; font-weight:600; color:var(--muted); margin-bottom:3px; }
.intmap-filter-group select { width:100%; font-size:12px; padding:4px 6px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--panel); }
.intmap-legend { margin-top:16px; border-top:1px solid var(--border); padding-top:10px; }
.intmap-legend-section { font-weight:600; font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin:10px 0 4px; }
.intmap-legend-section:first-child { margin-top:0; }
.intmap-legend-item { display:flex; align-items:center; gap:6px; margin-bottom:3px; font-size:11px; color:var(--text); }
.intmap-line-swatch { width:20px; flex-shrink:0; border-bottom:2px solid #475569; }
.intmap-box-swatch { width:24px; height:12px; border:1.5px solid #475569; border-radius:3px; background:#fff; flex-shrink:0; }
.intmap-empty { display:flex; align-items:center; justify-content:center; position:absolute; inset:0; text-align:center; color:var(--muted); font-size:14px; line-height:1.6; padding:20px; }
.intmap-connect-btn.active { background:var(--accent); color:#fff; box-shadow:0 0 0 2px rgba(37,99,235,.25); }
.intmap-connect-hint { font-size:12px; color:var(--accent); font-weight:500; animation:intmap-hint-pulse 1.5s ease-in-out infinite; }
@keyframes intmap-hint-pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
.intmap-float-popover {
    position:fixed; z-index:9999; width:200px;
    background:var(--panel); border:1px solid var(--border); border-radius:var(--radius-md);
    padding:10px 12px; box-shadow:0 4px 16px rgba(0,0,0,.12);
    font-size:11px;
}
.intmap-float-popover label { display:block; font-size:10px; font-weight:600; color:var(--muted); margin:6px 0 2px; }
.intmap-float-popover label:first-of-type { margin-top:4px; }
.intmap-float-popover .form-input { width:100%; font-size:11px; padding:3px 6px; box-sizing:border-box; }
.intmap-float-header { display:flex; align-items:center; justify-content:space-between; font-size:12px; }
.intmap-float-close { background:none; border:none; font-size:16px; cursor:pointer; color:var(--muted); padding:0 2px; line-height:1; }
.intmap-float-close:hover { color:var(--text); }
.intmap-float-pair { font-size:11px; color:var(--muted); margin-bottom:2px; }
.intmap-float-actions { display:flex; gap:6px; justify-content:flex-end; margin-top:8px; }
.intmap-float-actions button { font-size:11px; padding:3px 10px; }
.btn-icon-danger, .btn-icon-muted { background:none; border:1px solid var(--border); border-radius:var(--radius-sm, 4px); cursor:pointer; padding:3px 6px; font-size:13px; line-height:1; }
.btn-icon-danger:hover { background:#fef2f2; border-color:#fca5a5; }
.btn-icon-muted:hover { background:var(--accent-bg, #f0f4ff); border-color:var(--primary, #2563eb); }

/* Archived items */
.archived-row { opacity: 0.45; }
.archived-row:hover { opacity: 0.7; }
.archived-badge { display:inline-block; font-size:9px; padding:1px 5px; border-radius:3px; background:#f3f4f6; color:#9ca3af; font-weight:500; margin-left:4px; vertical-align:middle; }
.usage-badge.unused { display:inline-block; font-size:9px; padding:1px 5px; border-radius:3px; background:#fef3c7; color:#92400e; font-weight:500; margin-left:4px; vertical-align:middle; }
.settings-card.archived-card { opacity: 0.45; border-left:3px solid #d1d5db; }
.settings-card.archived-card:hover { opacity: 0.7; }
.archive-toggle { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); cursor:pointer; user-select:none; }
.archive-toggle input { margin:0; }

/* Value driver chips */
.vd-chip { transition: background .15s; }
.vd-chip:hover { background: var(--accent-bg, #e0e7ff) !important; }
.vd-has-detail { border-left: 2px solid var(--accent, #6366f1); }
#vd-popover textarea.form-input { width:100%; box-sizing:border-box; }

/* App picker */
.intmap-picker { margin-top:12px; border-top:1px solid var(--border); padding-top:10px; }
.intmap-picker-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.intmap-picker-header label { font-size:11px; font-weight:600; color:var(--muted); }
.intmap-picker-actions { display:flex; gap:4px; }
.intmap-picker-actions button { font-size:10px; padding:1px 6px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--panel); color:var(--muted); cursor:pointer; }
.intmap-picker-actions button:hover { background:var(--accent-bg, #eff6ff); color:var(--accent); }
.intmap-picker-search { width:100%; font-size:11px; padding:4px 6px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--panel); margin-bottom:4px; box-sizing:border-box; }
.intmap-picker-search:focus { outline:none; border-color:var(--accent); }
.intmap-picker-list { max-height:calc(100vh - 520px); min-height:80px; overflow-y:auto; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; }
.intmap-picker-item { display:flex; align-items:center; gap:5px; padding:3px 6px; font-size:11px; cursor:pointer; }
.intmap-picker-item:hover { background:var(--accent-bg, #f0f4ff); }
.intmap-picker-item input { margin:0; flex-shrink:0; }
.intmap-picker-item label { cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.intmap-picker-item.has-integrations label { font-weight:600; }
.intmap-picker-count { font-size:10px; color:var(--muted); margin-top:3px; }

/* ── App detail integration map ── */
.intmap-card-chevron { display:inline-block; font-size:10px; transition:transform 0.15s; margin-right:4px; }
.intmap-card-chevron.open { transform:rotate(90deg); }
.appintmap-toolbar { display:flex; align-items:center; justify-content:space-between; padding:6px 14px; border-bottom:1px solid var(--border-light, var(--border)); background:color-mix(in srgb, var(--bg) 40%, var(--panel)); }
.appintmap-toolbar-left { display:flex; align-items:center; gap:6px; }
.appintmap-toolbar-right { display:flex; align-items:center; gap:4px; }
.appintmap-graph { background:#fafbfc; border-radius:0 0 var(--radius-md, 8px) var(--radius-md, 8px); }
.appintmap-graph svg { display:block; }

/* ── Integration list inline edit ── */
.app-link { color: var(--primary, #2563eb); text-decoration: none; }
.app-link:hover { text-decoration: underline; }
tr.int-row:hover { background: var(--accent-bg, #f0f4ff); }
tr.row-editing { background: var(--accent-bg, #f0f4ff); }
tr.int-edit-row td { border-top: none; }
.int-edit-form .form-field { display:flex; flex-direction:column; gap:2px; }
.int-edit-form .form-field label { font-size:11px; color:var(--muted); font-weight:500; }

/* ── Value Driver Reference Details ── */
.vd-ref-details { margin-top: 4px; padding: 4px 8px; background: var(--accent-bg, #f0f4ff); border-radius: 4px; font-size: 11px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.vd-ref-item { color: var(--text-muted); white-space: nowrap; }
.vd-ref-label { font-weight: 600; color: var(--text-secondary, #475569); }
.vd-ref-desc { color: var(--text-muted); font-size: 11px; width: 100%; line-height: 1.4; }

/* ── Value Realization Worksheet ── */
.vr-worksheet { font-size: 12px; border-collapse: separate; border-spacing: 0; overflow: visible; }
.vr-worksheet th { position: sticky; top: 52px; background: #fff; z-index: 2; font-size: 11px; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,.08); }
.vr-worksheet td { vertical-align: top; }
.vr-group-start td { border-top: 2px solid var(--border, #e2e8f0); }
.vr-group-continuation td:first-child { border-bottom: none; }
.vr-init-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 12px; line-height: 1.3; }
.vr-init-link:hover { text-decoration: underline; }
.vr-init-code { color: var(--text-muted); font-weight: 400; margin-right: 4px; }
.vr-init-meta { display: flex; gap: 4px; margin-top: 10px; align-items: center; white-space: nowrap; }
.vr-strategy-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.vr-vd-desc { cursor: help; color: var(--text-muted); font-size: 11px; margin-left: 4px; }
.vr-contrib-note { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-style: italic; }
.vr-meta-cell { color: var(--text-muted); font-size: 11px; }
.vr-input { width: 70px; font-size: 11px; padding: 3px 6px; }
.vr-status-select { font-size: 11px; padding: 3px 4px; width: 100%; }
.vr-prio-score { display: inline-block; background: var(--accent-bg, #e0e7ff); color: var(--accent, #3b82f6); font-weight: 600; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.vr-save-btn { font-size: 10px; padding: 2px 8px; white-space: nowrap; }
.vr-save-status { display: inline; }
.vr-saved-indicator { color: #22c55e; font-size: 10px; margin-left: 4px; animation: vr-fade 2s ease-out forwards; }
@keyframes vr-fade { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.vr-meta-sep { color: var(--border, #cbd5e1); font-size: 9px; margin: 0 2px; }
.vr-narrative-toggle { background: none; border: 1px solid var(--border, #cbd5e1); border-radius: 9px; cursor: pointer; font-size: 10px; color: var(--text-secondary, #475569); padding: 1px 8px; line-height: 1.4; transition: all 150ms ease; }
.vr-narrative-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg, #f0f4ff); }
.vr-narrative-row td { border-top: none !important; }
.vr-narrative-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.vr-narrative-label { display: block; font-size: 10px; font-weight: 600; color: var(--text-secondary, #475569); margin-bottom: 2px; }
.vr-narrative-form textarea { font-size: 11px; width: 100%; }
.vr-group + .vr-group > tr:first-child td { border-top: 2px solid var(--border, #e2e8f0); }

/* ── Prioritization Worksheet ── */
.prio-worksheet { font-size: 12px; border-collapse: separate; border-spacing: 0; overflow: visible; }
.prio-worksheet th { position: sticky; top: 52px; background: #fff; z-index: 2; font-size: 10px; white-space: nowrap; padding: 6px 4px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.08); }
.prio-worksheet td { vertical-align: middle; padding: 6px 4px; text-align: center; }
.prio-header-prio { background: #eff6ff !important; color: var(--primary); border-bottom: 2px solid #bfdbfe; }
.prio-header-read { background: #f5f3ff !important; color: #7c3aed; border-bottom: 2px solid #ddd6fe; }
.prio-col-rank { width: 36px; text-align: center; color: var(--muted); font-size: 11px; }
.prio-col-name { text-align: left !important; min-width: 220px; max-width: 320px; position: sticky; left: 0; background: var(--surface, #fff); z-index: 1; }
.prio-col-score { min-width: 80px; }
.prio-col-total { min-width: 50px; font-weight: 700; }
.prio-col-readiness { min-width: 60px; }
.prio-init-info { display: flex; flex-direction: column; gap: 2px; }
.prio-init-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 12px; line-height: 1.3; }
.prio-init-link:hover { text-decoration: underline; }
.prio-init-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.prio-total-score { font-size: 13px; color: var(--primary); }
.prio-group + .prio-group > tr:first-child td { border-top: 2px solid var(--border, #e2e8f0); }
.prio-score-btns { display: inline-flex; gap: 1px; }
.prio-ws-btn {
    width: 20px; height: 20px; border-radius: 3px; border: 1px solid #cbd5e1;
    background: var(--surface, #fff); color: #64748b; font-size: 9px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .15s ease; padding: 0;
}
.prio-ws-btn:nth-child(1):hover { border-color: #ef4444; color: #ef4444; }
.prio-ws-btn:nth-child(2):hover { border-color: #f97316; color: #f97316; }
.prio-ws-btn:nth-child(3):hover { border-color: #eab308; color: #eab308; }
.prio-ws-btn:nth-child(4):hover { border-color: #22c55e; color: #22c55e; }
.prio-ws-btn:nth-child(5):hover { border-color: #16a34a; color: #16a34a; }
.prio-ws-btn:nth-child(1).prio-ws-btn--active { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
.prio-ws-btn:nth-child(2).prio-ws-btn--active { background: #f97316 !important; color: #fff !important; border-color: #f97316 !important; }
.prio-ws-btn:nth-child(3).prio-ws-btn--active { background: #eab308 !important; color: #fff !important; border-color: #eab308 !important; }
.prio-ws-btn:nth-child(4).prio-ws-btn--active { background: #22c55e !important; color: #fff !important; border-color: #22c55e !important; }
.prio-ws-btn:nth-child(5).prio-ws-btn--active { background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }
.prio-ws-static { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.prio-read-btns { display: inline-flex; gap: 1px; }
.prio-read-btn {
    width: 22px; height: 20px; border-radius: 3px; border: 1px solid var(--border);
    background: var(--surface, #fff); color: var(--muted); font-size: 9px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .15s ease; padding: 0;
}
.prio-read-btn:hover { opacity: .85; }
.prio-read-btn--low:hover { border-color: #ef4444; color: #ef4444; }
.prio-read-btn--medium:hover { border-color: #f59e0b; color: #f59e0b; }
.prio-read-btn--high:hover { border-color: #22c55e; color: #22c55e; }
.prio-read-btn--active.prio-read-btn--low { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.prio-read-btn--active.prio-read-btn--medium { background: #fffbeb; color: #d97706; border-color: #fcd34d; }
.prio-read-btn--active.prio-read-btn--high { background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.prio-read-static { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.prio-read-static--low { background: #fef2f2; color: #dc2626; }
.prio-read-static--medium { background: #fffbeb; color: #d97706; }
.prio-read-static--high { background: #f0fdf4; color: #16a34a; }
.prio-rationale-toggle { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 10px; padding: 0; }
.prio-rationale-toggle:hover { color: var(--accent); }
.prio-rationale-row td { padding: 8px 12px 12px !important; background: var(--surface-alt, #f8fafc); }
.prio-rationale-content { display: flex; flex-direction: column; gap: 12px; }
.prio-rationale-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.prio-rationale-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prio-rationale-field { display: flex; flex-direction: column; gap: 3px; }
.prio-rationale-field label { font-size: 10px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.prio-rationale-field textarea { font-size: 11px; resize: vertical; min-height: 48px; width: 100%; }
.prio-rationale-text { font-size: 11px; color: var(--text-secondary, var(--muted)); line-height: 1.4; }
@media (max-width: 900px) { .prio-rationale-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .prio-rationale-grid { grid-template-columns: 1fr; } }

/* ── Profile page ── */
.profile-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 40px; }
