/* ── RESET & ROOT ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #07111C;
  --surface:   #0C1929;
  --card:      #101F30;
  --card2:     #142840;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --txt:       #E1EAF4;
  --txt2:      #8AAAC8;
  --txt3:      #456080;
  --primary:   #1D4ED8;
  --green:     #22C55E;
  --amber:     #F59E0B;
  --red:       #EF4444;
  --teal:      #14B8A6;
  --radius:    8px;
  --radius-lg: 12px;
}

/* ── BASE ─────────────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* Header */
#header {
  height: 60px;
  background: #050D18;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 100;
}

/* Body */
#body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
#sidebar {
  width: 248px;
  background: #060E1A;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 18px 13px;
  flex-shrink: 0;
}

/* Main content */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}

/* Detail panel */
#detail {
  width: 375px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  display: none;
}
#detail.open { display: flex; flex-direction: column; }

/* ── HEADER COMPONENTS ────────────────────────────────────────────────────── */
.logo {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: #fff;
  flex-shrink: 0;
}

.logo-text .name { font-size: 14px; font-weight: 700; color: var(--txt); line-height: 1.2; }
.logo-text .sub  { font-size: 10px; color: var(--txt3); letter-spacing: 0.06em; }

.divider-v { width: 1px; height: 30px; background: var(--border); flex-shrink: 0; }

.header-title .main { font-size: 13px; font-weight: 600; color: var(--txt); }
.header-title .desc { font-size: 10px; color: var(--txt3); }

.spacer { flex: 1; }

/* Tab bar */
.tabs { display: flex; gap: 3px; background: rgba(255,255,255,0.05); border-radius: var(--radius); padding: 2px; }
.tab {
  padding: 5px 13px;
  border-radius: 6px; border: none;
  background: transparent; color: var(--txt2);
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--txt); }
.tab.active { background: var(--primary); color: #fff; }

/* Role switcher */
.roles { display: flex; background: rgba(255,255,255,0.05); border-radius: var(--radius); padding: 2px; gap: 1px; }
.role-btn {
  padding: 4px 11px; border-radius: 6px; border: none;
  background: transparent; color: var(--txt3);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.role-btn.active { background: #fff; color: #060D18; }

/* ── SIDEBAR / CONTROL TOWER ─────────────────────────────────────────────── */
.ct-label { font-size: 9px; font-weight: 700; color: var(--txt3); letter-spacing: 0.12em; margin-bottom: 3px; }
.ct-title { font-size: 14px; font-weight: 700; color: var(--txt); margin-bottom: 2px; }
.ct-count { font-size: 11px; color: var(--txt3); margin-bottom: 18px; }

.ct-section { margin-bottom: 20px; }
.ct-section-label { font-size: 9px; font-weight: 700; color: var(--txt2); letter-spacing: 0.1em; margin-bottom: 8px; }

/* Search */
#search {
  width: 100%; padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--txt); font-size: 12px; outline: none;
}
#search::placeholder { color: var(--txt3); }
#search:focus { border-color: rgba(29,78,216,0.4); }

.clear-search { font-size: 11px; color: var(--primary); cursor: pointer; margin-top: 5px; display: none; }

/* Dept filter buttons */
.dept-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 9px;
  background: transparent; border: 1px solid transparent;
  border-radius: 6px; color: var(--txt2);
  font-size: 12px; font-weight: 500; cursor: pointer; text-align: left;
  margin-bottom: 2px; transition: all 0.15s;
}
.dept-btn:hover { background: rgba(255,255,255,0.04); }
.dept-btn.active { background: rgba(29,78,216,0.12); border-color: rgba(29,78,216,0.3); color: #60A5FA; }

.dept-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Quick stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stat-box { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 8px; text-align: center; }
.stat-box .n { font-size: 18px; font-weight: 700; }
.stat-box .l { font-size: 10px; color: var(--txt3); }

/* ── VIEWS ────────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

.view-header { margin-bottom: 16px; }
.view-title { font-size: 17px; font-weight: 700; color: var(--txt); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.view-sub { font-size: 12px; color: var(--txt3); }
.edition-badge { font-size: 10px; font-weight: 600; background: rgba(180,83,9,0.2); color: #FCD34D; padding: 2px 8px; border-radius: 10px; }

/* ── PRIORITY BOARD ──────────────────────────────────────────────────────── */
#scatter-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 8px 8px;
  position: relative;
}

#scatter { width: 100%; cursor: default; display: block; }
#scatter .dot { cursor: pointer; transition: r 0.15s; }
#scatter .dot:hover circle.main { r: 9; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.scatter-count { font-size: 11px; color: var(--txt3); text-align: right; margin-top: 5px; }

/* Tooltip */
#tooltip {
  position: fixed; z-index: 999;
  background: #162032; border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 10px 13px;
  font-size: 12px; color: var(--txt);
  pointer-events: none; display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-width: 220px;
}

/* ── BUDGET WASTE ─────────────────────────────────────────────────────────── */
.waste-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.waste-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.waste-card-header { padding: 12px 15px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); display: flex; justify-content: space-between; align-items: flex-start; }
.waste-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--txt); }
.waste-dot { width: 9px; height: 9px; border-radius: 50%; }
.waste-meta { display: flex; gap: 6px; margin-top: 7px; }
.waste-avg { text-align: right; }
.waste-avg-label { font-size: 10px; color: var(--txt3); margin-bottom: 2px; }
.waste-avg-val { font-size: 18px; font-weight: 700; }

.waste-card-body { padding: 11px 14px; }
.uc-row {
  padding: 9px 11px; border-radius: 6px; cursor: pointer;
  border-left: 2px solid transparent; margin-bottom: 4px;
  transition: background 0.12s;
}
.uc-row:hover { background: rgba(255,255,255,0.04); }
.uc-row .uc-title { font-size: 12px; font-weight: 600; color: var(--txt); margin-bottom: 3px; }
.uc-row .uc-meta { display: flex; gap: 10px; font-size: 11px; color: var(--txt2); }
.uc-row .uc-desc { font-size: 11px; color: var(--txt3); line-height: 1.55; margin-bottom: 6px; }

/* ── FUNNEL ───────────────────────────────────────────────────────────────── */
.funnel-bands { margin-bottom: 20px; }
.funnel-band {
  padding: 16px 22px; display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2px; border-radius: 0; border: 1px solid transparent;
}
.funnel-band:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.funnel-band:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.funnel-band-left .band-label { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.funnel-band-left .band-detail { font-size: 13px; color: var(--txt); font-weight: 500; margin-bottom: 2px; }
.funnel-band-left .band-sub { font-size: 12px; color: var(--txt2); max-width: 480px; line-height: 1.55; }
.funnel-band-right { text-align: right; flex-shrink: 0; padding-left: 16px; }
.funnel-count { font-size: 36px; font-weight: 800; line-height: 1; }
.funnel-count-label { font-size: 11px; color: var(--txt3); }

.signal-title { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 10px; }
.signal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 20px; }
.signal-card { background: var(--card); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--radius); padding: 12px 14px; }
.signal-card .sc-title { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 3px; }
.signal-card .sc-dept { font-size: 11px; margin-bottom: 8px; }
.signal-card .sc-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.barriers-title { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 12px; }
.barriers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.barrier-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; display: flex; gap: 11px; }
.barrier-icon { font-size: 22px; flex-shrink: 0; }
.barrier-num { font-size: 9px; font-weight: 700; color: var(--txt3); letter-spacing: 0.08em; margin-bottom: 2px; }
.barrier-name { font-size: 12px; font-weight: 600; color: var(--txt); margin-bottom: 3px; }
.barrier-solution { font-size: 11px; font-weight: 600; color: var(--amber); margin-bottom: 4px; }
.barrier-desc { font-size: 11px; color: var(--txt2); line-height: 1.55; }

/* ── JOURNEY ──────────────────────────────────────────────────────────────── */
.journey-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.journey-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.journey-stat .val { font-size: 24px; font-weight: 800; color: var(--txt); margin-bottom: 3px; }
.journey-stat .label { font-size: 12px; font-weight: 600; color: var(--txt); margin-bottom: 2px; }
.journey-stat .sub { font-size: 10px; color: var(--txt3); }

.steps { position: relative; padding-left: 50px; margin-bottom: 20px; }
.steps::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--border); }

.step { position: relative; margin-bottom: 12px; }
.step-num {
  position: absolute; left: -50px; top: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
}
.step-body { background: var(--card); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--radius); padding: 14px 16px; }
.step-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; gap: 12px; }
.step-title { font-size: 14px; font-weight: 700; color: var(--txt); }
.step-tags { display: flex; gap: 6px; flex-shrink: 0; }
.step-desc { font-size: 12px; color: var(--txt2); line-height: 1.65; }

.hybrid-title { font-size: 13px; font-weight: 700; color: var(--txt); margin-bottom: 12px; }
.hybrid-grid { display: grid; grid-template-columns: 1fr 32px 1fr 32px 1fr; gap: 6px; align-items: center; margin-bottom: 16px; }
.hybrid-cell { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; }
.hybrid-cell .hc-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.hybrid-cell .hc-sub { font-size: 10px; color: var(--txt3); margin-bottom: 8px; }
.hybrid-cell .hc-item { font-size: 11px; color: var(--txt2); margin-bottom: 3px; }
.hybrid-op { font-size: 28px; font-weight: 700; color: var(--txt3); text-align: center; }

.moat-quote { background: rgba(29,78,216,0.1); border: 1px solid rgba(29,78,216,0.25); border-radius: var(--radius-lg); padding: 16px 20px; }
.moat-quote .q { font-size: 14px; font-weight: 600; color: var(--txt); line-height: 1.6; margin-bottom: 7px; }
.moat-quote .src { font-size: 11px; color: var(--txt3); }

/* ── DETAIL PANEL ─────────────────────────────────────────────────────────── */
.detail-topbar { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.detail-topbar-left .dt-label { font-size: 9px; font-weight: 700; color: var(--txt3); letter-spacing: 0.1em; }
.detail-topbar-left .dt-sub { font-size: 12px; color: var(--txt2); font-weight: 600; }
.close-btn { background: rgba(255,255,255,0.07); border: none; color: var(--txt2); cursor: pointer; border-radius: 6px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.close-btn:hover { background: rgba(255,255,255,0.12); }

.detail-body { padding: 18px; flex: 1; }

.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { display: inline-flex; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }

.detail-cat { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 5px; }
.detail-title { font-size: 18px; font-weight: 800; color: #EBF2FA; line-height: 1.3; margin-bottom: 12px; }
.detail-desc { font-size: 12px; color: var(--txt2); line-height: 1.75; margin-bottom: 18px; }

.detail-section-title { font-size: 10px; font-weight: 700; color: var(--txt3); letter-spacing: 0.1em; margin-bottom: 10px; }

/* Radar SVG */
#radar-wrap { background: rgba(255,255,255,0.02); border-radius: var(--radius); padding: 8px 0; margin-bottom: 14px; }
#radar { display: block; margin: 0 auto; }

/* Score bars */
.score-bar { margin-bottom: 11px; }
.score-bar-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.score-bar-label { font-size: 12px; color: var(--txt2); }
.score-bar-val { font-size: 12px; font-weight: 600; color: var(--txt); }
.score-bar-track { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }
.score-bar-fill { height: 100%; border-radius: 2px; }

/* Flags */
.flag { font-size: 12px; margin-bottom: 7px; }

/* Score Rationale (10-dimension breakdown) */
.score-rationale { }
.rationale-row { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.rationale-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.rationale-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.rationale-label  { font-size: 12px; font-weight: 600; color: var(--txt); }
.rationale-score  { font-size: 12px; font-weight: 700; color: var(--txt); }
.rationale-denom  { font-size: 10px; color: var(--txt3); font-weight: 400; }
.rationale-weight { font-size: 10px; color: var(--txt3); background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.rationale-delta-pos { font-size: 10px; font-weight: 700; color: #22C55E; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); padding: 1px 6px; border-radius: 4px; }
.rationale-delta-neg { font-size: 10px; font-weight: 700; color: #EF4444; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); padding: 1px 6px; border-radius: 4px; }
.rationale-track { height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; margin-bottom: 5px; overflow: hidden; }
.rationale-fill  { height: 100%; border-radius: 2px; transition: width .3s; }
.rationale-desc  { font-size: 11px; color: var(--txt3); line-height: 1.45; }

/* Blueprint */
.blueprint-box { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 16px; }
.blueprint-item { display: flex; gap: 7px; margin-bottom: 8px; }
.blueprint-line { width: 2px; border-radius: 1px; flex-shrink: 0; }
.blueprint-item-title { font-size: 11px; font-weight: 600; color: var(--txt); }
.blueprint-item-sub { font-size: 11px; color: var(--txt3); }

/* Portfolio button */
.portfolio-btn {
  width: 100%; padding: 12px; border-radius: var(--radius); border: none;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.15s;
}
.portfolio-btn.add { background: var(--primary); color: #fff; }
.portfolio-btn.remove { background: rgba(34,197,94,0.15); color: #22C55E; border: 1px solid rgba(34,197,94,0.4); }

/* ── PORTFOLIO BADGE ──────────────────────────────────────────────────────── */
#portfolio-badge {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: 24px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 24px rgba(29,78,216,0.45);
  display: none; z-index: 200;
  transition: right 0.25s;
}
#portfolio-badge.show { display: flex; align-items: center; gap: 8px; }
#portfolio-badge.shifted { right: 395px; }

/* ── SHARED COMPONENTS ────────────────────────────────────────────────────── */
.tag { display: inline-flex; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.07); color: var(--txt2); font-size: 10px; font-weight: 600; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── SCROLLBAR ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── PORTFOLIO VIEW ───────────────────────────────────────────────────────── */
.port-empty          { text-align:center; padding:60px 20px; }
.port-empty-icon     { font-size:40px; margin-bottom:16px; }
.port-empty-title    { font-size:20px; font-weight:700; margin-bottom:8px; }
.port-empty-sub      { font-size:13px; color:var(--txt2); max-width:420px; margin:0 auto 24px; line-height:1.6; }
.port-empty-btn      { background:var(--primary); color:#fff; border:none; border-radius:8px; padding:11px 22px; font-size:13px; font-weight:600; cursor:pointer; transition:opacity .15s; }
.port-empty-btn:hover { opacity:.85; }

.port-summary        { display:flex; gap:12px; margin-bottom:24px; flex-wrap:wrap; }
.port-sum-stat       { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:14px 20px; min-width:100px; flex:1; }
.port-sum-n          { font-size:28px; font-weight:800; }
.port-sum-l          { font-size:12px; color:var(--txt2); margin-top:4px; }

.port-phase          { margin-bottom:28px; }
.port-phase-hd       { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.port-phase-dot      { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.port-phase-label    { font-size:14px; font-weight:700; }
.port-phase-count    { font-size:12px; color:var(--txt2); margin-left:4px; }

.port-cards          { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:12px; }

.port-card           { background:var(--card); border:1px solid var(--border); border-radius:10px; overflow:hidden; transition:border-color .15s; display:flex; }
.port-card:hover     { border-color:var(--border2); }
.port-card-accent    { width:4px; flex-shrink:0; }
.port-card-body      { flex:1; padding:14px 16px; min-width:0; }

.port-card-top       { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.port-card-dept      { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.port-remove-btn     { background:none; border:none; color:var(--txt3); cursor:pointer; font-size:13px; padding:2px 6px; border-radius:4px; transition:color .15s,background .15s; }
.port-remove-btn:hover { color:var(--red); background:rgba(239,68,68,.1); }

.port-card-title     { font-size:14px; font-weight:700; margin-bottom:10px; line-height:1.35; }
.port-card-metrics   { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.port-metric         { display:flex; align-items:center; gap:5px; }
.pcm-l               { font-size:10px; color:var(--txt3); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.pcm-v               { font-size:13px; font-weight:700; }

.port-brief-toggle   { background:var(--surface); border:1px solid var(--border); border-radius:6px; padding:7px 14px; font-size:12px; font-weight:600; color:var(--txt2); cursor:pointer; width:100%; text-align:left; transition:background .15s,color .15s; }
.port-brief-toggle:hover { background:var(--card2); color:var(--txt); }

.port-brief          { display:none; margin-top:10px; border-top:1px solid var(--border); padding-top:14px; }
.port-brief.open     { display:block; }
.port-brief-sec      { margin-bottom:14px; }
.port-brief-lbl      { font-size:11px; font-weight:700; color:var(--txt2); text-transform:uppercase; letter-spacing:.07em; margin-bottom:6px; }
.port-brief-txt      { font-size:13px; color:var(--txt); line-height:1.6; }
.port-tl-line        { padding:3px 0; }
.port-tl-line + .port-tl-line { border-top:1px solid var(--border); margin-top:3px; }
.port-brief-list     { padding-left:18px; }
.port-brief-list li  { font-size:13px; color:var(--txt); line-height:1.6; margin-bottom:2px; }

.port-actions        { display:flex; gap:10px; padding-top:20px; border-top:1px solid var(--border); margin-top:8px; flex-wrap:wrap; }
.port-action-btn     { background:var(--card); border:1px solid var(--border); border-radius:8px; padding:10px 18px; font-size:13px; font-weight:600; color:var(--txt2); cursor:pointer; transition:all .15s; }
.port-action-btn:hover { color:var(--txt); border-color:var(--primary); background:rgba(29,78,216,.07); }
/* ── INTEGRATION TIER BADGES ─────────────────────────────────────────────── */
.tier-badge   { display:inline-flex; align-items:center; gap:5px; border-radius:6px; padding:3px 10px; font-size:11px; font-weight:700; margin-bottom:6px; }
.tier-native  { background:rgba(34,197,94,.15);   color:#22C55E; }
.tier-api     { background:rgba(245,158,11,.15);  color:#F59E0B; }
.tier-custom  { background:rgba(239,68,68,.12);   color:#EF4444; }
.tier-none    { background:rgba(110,143,173,.12); color:#6E8FAD; }
.tier-desc    { font-size:11px; color:var(--txt3); margin-bottom:12px; line-height:1.5; padding:6px 10px; background:rgba(255,255,255,.03); border-radius:6px; }

/* ── BENCHMARK SIDEBAR ──────────────────────────────────────────────────── */
#benchmark-sidebar { margin-top:18px; }
.bm-hd        { font-size:9px; font-weight:800; color:var(--txt3); text-transform:uppercase; letter-spacing:.1em; margin-bottom:10px; }
.bm-item      { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:10px 12px; margin-bottom:7px; cursor:pointer; transition:border-color .15s; }
.bm-item:hover { border-color:rgba(29,78,216,.4); }
.bm-label-row { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:4px; }
.bm-label     { font-size:10px; font-weight:700; color:var(--txt2); text-transform:uppercase; letter-spacing:.06em; }
.bm-pos       { font-size:10px; font-weight:700; }
.bm-val-row   { display:flex; align-items:baseline; gap:8px; margin-bottom:3px; }
.bm-their     { font-size:13px; font-weight:700; color:var(--txt); }
.bm-vs        { font-size:10px; color:var(--txt3); }
.bm-dollar    { font-size:11px; color:#F59E0B; font-weight:700; margin-top:4px; }
.bm-source    { font-size:9px; color:var(--txt3); opacity:.6; margin-top:8px; text-align:center; }

/* ── SESSION PROGRESS WIDGET ─────────────────────────────────────────────── */
.sp-widget    { margin-top:14px; background:rgba(29,78,216,.07); border:1px solid rgba(29,78,216,.2); border-radius:8px; padding:12px 14px; }
.sp-hd        { font-size:9px; font-weight:800; color:#93C5FD; text-transform:uppercase; letter-spacing:.1em; margin-bottom:8px; }
.sp-score-row { display:flex; align-items:baseline; gap:6px; margin-bottom:3px; }
.sp-arrow     { font-size:16px; font-weight:800; line-height:1; }
.sp-nums      { font-size:13px; color:var(--txt); }
.sp-delta     { font-size:11px; font-weight:700; }
.sp-dates     { font-size:10px; color:var(--txt3); margin-bottom:6px; }
.sp-signal    { font-size:11px; color:#22C55E; font-weight:600; border-top:1px solid rgba(34,197,94,.15); padding-top:6px; margin-top:6px; }

/* ── INITIATIVE STATUS ───────────────────────────────────────────────────── */
.port-status-row   { display:flex; align-items:center; margin-bottom:8px; }
.port-status-btn   { display:inline-block; border-radius:4px; padding:3px 10px; font-size:10px; font-weight:700; cursor:pointer; transition:all .15s; user-select:none; }
.port-status-btn:hover { opacity:.8; }

.port-clear-btn      { background:transparent; border:1px solid var(--border); border-radius:8px; padding:10px 18px; font-size:13px; font-weight:600; color:#6E8FAD; cursor:pointer; transition:all .15s; margin-left:auto; }
.port-clear-btn:hover { border-color:#EF4444; color:#FCA5A5; background:rgba(239,68,68,.07); }

/* ── INTERNAL FINANCIAL MODEL ────────────────────────────────────────────── */
.port-brief-int-toggle {
  background:transparent; border:none; padding:8px 0 4px; font-size:10.5px; font-weight:700;
  color:var(--txt3); cursor:pointer; display:flex; align-items:center; gap:6px;
  transition:color .15s; letter-spacing:.06em; text-transform:uppercase; width:100%;
}
.port-brief-int-toggle:hover { color:#F59E0B; }
.port-brief-int-toggle .pfi-lock { font-size:11px; opacity:.7; }

.port-brief-internal {
  display:none; margin-top:10px;
  background:rgba(245,158,11,.04); border:1px solid rgba(245,158,11,.18);
  border-radius:8px; padding:16px 18px;
}
.port-brief-internal.open { display:block; }

.port-brief-internal-hd {
  font-size:9.5px; font-weight:800; color:#F59E0B; text-transform:uppercase;
  letter-spacing:.1em; margin-bottom:14px; display:flex; align-items:center; gap:8px;
  padding-bottom:8px; border-bottom:1px solid rgba(245,158,11,.2);
}
.port-brief-internal-hd::before {
  content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:#F59E0B; flex-shrink:0;
}

.pfi-section          { margin-bottom:10px; }
.pfi-section-title    { font-size:9px; font-weight:800; color:#F59E0B; text-transform:uppercase; letter-spacing:.12em; margin-bottom:8px; }

/* Score → estimate mapping rows */
.pfi-score-row        { display:grid; grid-template-columns:56px 16px 1fr auto; gap:4px 8px; padding:4px 0; align-items:baseline; font-size:11.5px; border-bottom:1px solid rgba(245,158,11,.07); }
.pfi-score-row:last-child { border-bottom:none; }
.pfi-dim              { font-size:10.5px; font-weight:700; color:#F59E0B; font-family:monospace; white-space:nowrap; }
.pfi-arrow            { color:var(--txt3); font-size:10px; text-align:center; }
.pfi-driver           { color:var(--txt); font-weight:600; }
.pfi-role             { color:var(--txt3); font-size:10px; font-style:italic; white-space:nowrap; }

/* Data rows (label / value / note) */
.pfi-data-row         { display:grid; grid-template-columns:145px 1fr auto; gap:4px 8px; padding:4px 0; align-items:baseline; font-size:11.5px; border-bottom:1px solid rgba(245,158,11,.07); }
.pfi-data-row:last-child { border-bottom:none; }
.pfi-data-row.pfi-total { background:rgba(245,158,11,.07); border-radius:4px; margin:3px -6px; padding:5px 6px; border-bottom:none; font-weight:700; }
.pfi-lbl              { color:var(--txt3); font-size:11px; }
.pfi-val              { color:var(--txt); font-weight:600; }

.pfi-divider          { height:1px; background:rgba(245,158,11,.15); margin:10px 0; }

.pfi-note-box         {
  background:rgba(245,158,11,.06); border-left:2px solid rgba(245,158,11,.35);
  border-radius:0 4px 4px 0; padding:6px 10px; font-size:10.5px; color:var(--txt3);
  line-height:1.55; margin:7px 0;
}

.pfi-chips            { display:flex; gap:6px; flex-wrap:wrap; margin-top:7px; }
.pfi-chips span       { background:rgba(245,158,11,.12); border-radius:4px; padding:2px 8px; font-size:10px; font-weight:700; color:#F59E0B; }

.pfi-assumption-item  {
  font-size:11px; color:var(--txt3); padding:3px 0 3px 12px; position:relative; line-height:1.5;
}
.pfi-assumption-item::before { content:'·'; position:absolute; left:0; color:#F59E0B; font-weight:700; }

/* ── PRINT ────────────────────────────────────────────────────────────────── */
@media print {
  @page { margin:15mm; size:A4 portrait; }

  body.printing-portfolio {
    background:#fff !important; color:#000 !important; overflow:visible !important;
  }
  body.printing-portfolio #header,
  body.printing-portfolio #sidebar,
  body.printing-portfolio #detail,
  body.printing-portfolio #tooltip,
  body.printing-portfolio #portfolio-badge,
  body.printing-portfolio .port-actions,
  body.printing-portfolio .port-remove-btn,
  body.printing-portfolio .port-brief-toggle,
  body.printing-portfolio #session-banner { display:none !important; }

  /* Unlock all scroll containers so nothing is clipped */
  body.printing-portfolio #body,
  body.printing-portfolio #main,
  body.printing-portfolio #view-portfolio,
  body.printing-portfolio #portfolio-content { overflow:visible !important; height:auto !important; max-height:none !important; }
  body.printing-portfolio #body { flex-direction:column; }
  body.printing-portfolio #main { padding:0; }

  body.printing-portfolio #view-board,
  body.printing-portfolio #view-waste,
  body.printing-portfolio #view-funnel,
  body.printing-portfolio #view-journey { display:none !important; }
  body.printing-portfolio #view-portfolio { display:block !important; }

  /* Briefs — force all open, black text */
  body.printing-portfolio .port-brief     { display:block !important; }
  body.printing-portfolio .port-brief-txt,
  body.printing-portfolio .port-brief-list li { color:#333 !important; font-size:12px; }
  body.printing-portfolio .port-brief-lbl { color:#555 !important; }

  /* Cards — linearise grid, avoid mid-card page splits */
  body.printing-portfolio .port-cards     { display:block !important; }
  body.printing-portfolio .port-card      {
    break-inside:avoid; page-break-inside:avoid;
    border:1px solid #ccc !important; background:#fff !important;
    box-shadow:none !important; margin-bottom:12px;
  }
  body.printing-portfolio .port-card-accent { display:none !important; }
  body.printing-portfolio .port-brief-sec { break-inside:avoid; page-break-inside:avoid; }
  body.printing-portfolio .port-summary   { break-inside:avoid; page-break-inside:avoid; }
  body.printing-portfolio .port-phase     { break-before:auto; }

  body.printing-portfolio .port-card-title,
  body.printing-portfolio .port-phase-label { color:#000 !important; }
  body.printing-portfolio .port-card-dept,
  body.printing-portfolio .pcm-v { color:#333 !important; }

  /* Internal financial model is internal-only — never prints */
  body.printing-portfolio .port-brief-internal,
  body.printing-portfolio .port-brief-int-toggle { display:none !important; }
}
