:root {
    color-scheme: dark;
    --bg: #06101a;
    --bg-2: #081522;
    --panel: #0e1c29;
    --panel-2: #122435;
    --panel-3: #172b3d;
    --border: #263d51;
    --border-soft: #1a3042;
    --text: #f2f7fb;
    --muted: #8fa8bd;
    --muted-2: #6f879a;
    --accent: #43a8ff;
    --accent-2: #1475c7;
    --accent-soft: rgba(67,168,255,.13);
    --green: #68d36d;
    --amber: #efbd4c;
    --red: #f26666;
    --purple: #aa8cff;
    --shadow: 0 12px 32px rgba(0,0,0,.22);
    --sidebar-w: 214px;
    --topbar-h: 72px;
    --radius: 14px;
    --map-unknown: #172a38;
}
html[data-theme="light"] {
    color-scheme: light;
    --bg: #edf2f6;
    --bg-2: #f6f8fa;
    --panel: #ffffff;
    --panel-2: #f4f7f9;
    --panel-3: #edf3f7;
    --border: #ccd9e3;
    --border-soft: #dfe7ed;
    --text: #142431;
    --muted: #60778a;
    --muted-2: #7890a1;
    --accent: #1879c9;
    --accent-2: #0c5fa4;
    --accent-soft: rgba(24,121,201,.10);
    --green: #2f9f56;
    --amber: #b87911;
    --red: #d44a4a;
    --purple: #7357c8;
    --shadow: 0 10px 28px rgba(34,58,76,.10);
    --map-unknown: #dce6ed;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.app-shell { height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0,1fr); grid-template-rows: var(--topbar-h) minmax(0,1fr); background: radial-gradient(circle at 20% 0%, rgba(27,91,132,.12), transparent 34%), var(--bg); }
.sidebar { grid-row: 1 / 3; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border-soft); background: rgba(5,15,24,.86); backdrop-filter: blur(14px); padding: 14px 10px 12px; }
html[data-theme="light"] .sidebar { background: rgba(255,255,255,.90); }
.brand-block { display: flex; align-items: center; gap: 11px; height: 48px; padding: 0 8px 11px; border-bottom: 1px solid var(--border-soft); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg,var(--accent),var(--accent-2)); color: white; font-weight: 800; letter-spacing: .06em; box-shadow: 0 8px 22px rgba(33,134,215,.25); }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy small { color: var(--muted); margin-top: 3px; }
.main-nav { display: grid; gap: 5px; margin-top: 12px; }
.nav-item { appearance: none; border: 1px solid transparent; background: transparent; border-radius: 10px; min-height: 44px; padding: 0 11px; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--muted); transition: .16s ease; }
.nav-item:hover { background: var(--panel-2); color: var(--text); border-color: var(--border-soft); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg,var(--accent-soft),rgba(67,168,255,.04)); border-color: rgba(67,168,255,.28); box-shadow: inset 3px 0 var(--accent); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--accent); font-size: 18px; flex: none; }
.sidebar-spacer { flex: 1; }
.world-status { margin: 8px 4px 10px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel); display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.world-status .status-dot { margin-top: 4px; }
.world-status div { display: flex; min-width: 0; flex-direction: column; }
.world-status strong { font-size: 12px; }
.world-status small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.nav-item.utility { border-top: 1px solid var(--border-soft); border-radius: 0; margin-top: 2px; padding-top: 8px; }
.topbar { grid-column: 2; min-width: 0; height: var(--topbar-h); border-bottom: 1px solid var(--border-soft); background: rgba(7,17,27,.82); backdrop-filter: blur(14px); display: grid; grid-template-columns: minmax(230px,1.5fr) repeat(4,minmax(125px,.65fr)) 52px minmax(180px,.8fr); align-items: stretch; }
html[data-theme="light"] .topbar { background: rgba(250,252,253,.88); }
.topbar-context, .top-stat, .player-chip { padding: 0 16px; border-right: 1px solid var(--border-soft); display: flex; justify-content: center; flex-direction: column; min-width: 0; }
.context-label, .top-stat span { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.topbar-context strong { font-size: 17px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-stat strong { font-size: 16px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-stat:nth-of-type(2) strong, .top-stat:nth-of-type(4) strong { color: var(--green); }
.top-icon-button { position: relative; border: 0; border-right: 1px solid var(--border-soft); background: transparent; color: var(--muted); font-size: 20px; }
.top-icon-button:hover { color: var(--text); background: var(--panel); }
.top-icon-button b { position: absolute; right: 7px; top: 12px; min-width: 17px; height: 17px; border-radius: 8px; background: var(--red); color: white; display: grid; place-items: center; font-size: 10px; }
.player-chip { border-right: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.player-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--border); color: var(--accent); font-weight: 800; }
.player-chip div { display: flex; flex-direction: column; min-width: 0; }
.player-chip small { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace { grid-column: 2; min-width: 0; min-height: 0; overflow: hidden; }
.app-view { display: none; height: 100%; padding: 14px 16px 15px; min-width: 0; min-height: 0; overflow: hidden; }
.app-view.active-view { display: grid; }
#dashboardView { grid-template-rows: 48px 92px minmax(0,1fr) 174px; gap: 11px; }
.view-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.view-heading h1 { margin: 2px 0 0; font-size: clamp(22px,1.8vw,31px); letter-spacing: -.035em; line-height: 1.05; }
.eyebrow, .card-kicker { margin: 0; font-size: 10px; color: var(--accent); letter-spacing: .15em; font-weight: 800; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.live-indicator i, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(104,211,109,.1); flex: none; }
.quiet-button, .text-action, .icon-action, .secondary-button, .primary-button, .close-map-button { border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2); padding: 8px 12px; color: var(--text); transition: .15s ease; }
.quiet-button:hover, .icon-action:hover, .secondary-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.text-action { padding: 5px 8px; border: 0; color: var(--accent); background: transparent; }
.primary-button { border-color: var(--accent); background: linear-gradient(135deg,var(--accent),var(--accent-2)); color: white; font-weight: 750; box-shadow: 0 8px 20px rgba(25,116,187,.2); }
.primary-button:hover { filter: brightness(1.08); }
.primary-button[hidden] { display: none; }
.full-button { width: 100%; }
.kpi-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; min-height: 0; }
.kpi-card, .dashboard-card { background: linear-gradient(150deg,var(--panel),color-mix(in srgb,var(--panel) 92%,var(--accent) 8%)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.kpi-card { padding: 13px 15px 11px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.kpi-card span { color: var(--muted); font-size: 10px; letter-spacing: .09em; font-weight: 750; }
.kpi-card strong { font-size: 25px; line-height: 1; margin-top: 6px; letter-spacing: -.03em; }
.kpi-card small { color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card.accent-card { border-color: rgba(67,168,255,.5); background: linear-gradient(145deg,var(--accent-soft),var(--panel)); }
.kpi-card.accent-card strong { color: var(--accent); }
.dashboard-core { display: grid; grid-template-columns: minmax(0,1.82fr) minmax(230px,.68fr) minmax(230px,.68fr); gap: 11px; min-height: 0; }
.dashboard-card { padding: 13px 14px; min-height: 0; overflow: hidden; }
.card-heading { height: 41px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border-soft); padding-bottom: 9px; }
.card-heading h2 { margin: 2px 0 0; font-size: 15px; letter-spacing: -.01em; }
.card-heading > strong { font-size: 18px; color: var(--green); align-self: center; }
.count-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 13px; background: var(--panel-3); color: var(--muted); border: 1px solid var(--border); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.map-card { display: grid; grid-template-rows: 42px 28px minmax(0,1fr) 25px; padding-bottom: 9px; }
.map-card-heading { border: 0; padding-bottom: 3px; }
.map-heading-actions { display: flex; align-items: center; gap: 7px; }
.map-heading-actions select, .map-workspace-actions select { height: 30px; max-width: 155px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text); padding: 0 8px; font-size: 11px; }
.icon-action { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; }
.map-breadcrumb { display: flex; align-items: center; min-width: 0; gap: 4px; overflow: hidden; }
.map-breadcrumb button { border: 0; background: transparent; color: var(--muted); padding: 2px 4px; font-size: 11px; white-space: nowrap; }
.map-breadcrumb button:hover, .map-breadcrumb button:last-child { color: var(--accent); }
.map-breadcrumb i { color: var(--muted-2); font-style: normal; font-size: 10px; }
.map-stage { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--border-soft); background: radial-gradient(circle at 45% 42%,rgba(31,94,130,.20),transparent 38%), #07131d; border-radius: 11px; }
html[data-theme="light"] .map-stage { background: radial-gradient(circle at 45% 42%,rgba(39,128,185,.10),transparent 38%), #eaf1f5; }
.map-stage svg { display: block; width: 100%; height: 100%; }
.map-loading, .map-error { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.map-feature { stroke: rgba(172,208,231,.58); stroke-width: .75; vector-effect: non-scaling-stroke; transition: fill .18s ease, opacity .18s ease, filter .18s ease; cursor: pointer; }
.map-feature:hover { filter: brightness(1.23); stroke: var(--text); stroke-width: 1.2; }
.map-feature.inactive { opacity: .28; cursor: default; }
.map-feature.inactive:hover { filter: none; stroke: rgba(172,208,231,.58); }
.map-feature.selected { stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 5px rgba(67,168,255,.8)); }
.map-country-outline { fill: var(--map-unknown); stroke: rgba(172,208,231,.42); stroke-width: .6; }
.map-state-label { fill: var(--text); font-size: 11px; font-weight: 800; pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.map-region-label { fill: var(--text); font-size: 9px; font-weight: 700; pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 2.4px; }
.map-footer-row, .fullscreen-map-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; min-width: 0; }
.map-footer-row > span:first-child, .fullscreen-map-footer > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-legend { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.heat-legend em { font-style: normal; }
.heat-legend i { width: 72px; height: 7px; border-radius: 4px; background: linear-gradient(90deg,#304557,#4d8a73,#d0b64b,#d76e50); }
.intelligence-card, .portfolio-card { display: grid; grid-template-rows: 42px minmax(0,1fr) 37px; gap: 8px; }
.compact-list { min-height: 0; display: grid; align-content: stretch; grid-auto-rows: minmax(0,1fr); gap: 6px; }
.opportunity-row { min-height: 0; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--panel-2); padding: 7px; }
.opportunity-row .opp-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.opportunity-row span { display: flex; flex-direction: column; min-width: 0; }
.opportunity-row strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opportunity-row small { color: var(--muted); font-size: 10px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opportunity-row b { font-size: 16px; color: var(--green); }
.empty-portfolio { align-self: center; text-align: center; display: grid; justify-items: center; padding: 5px 8px; }
.empty-portfolio-icon { width: 45px; height: 45px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 25px; border: 1px solid rgba(67,168,255,.28); }
.empty-portfolio strong { margin-top: 8px; font-size: 13px; }
.empty-portfolio p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.dashboard-lower { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 11px; min-height: 0; }
.dashboard-lower .dashboard-card { padding-top: 11px; }
.signal-card, .allocation-card, .activity-card { display: grid; grid-template-rows: 39px minmax(0,1fr); }
.signal-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; align-items: stretch; padding-top: 9px; }
.signal-item { border: 1px solid var(--border-soft); border-radius: 9px; background: var(--panel-2); display: flex; flex-direction: column; justify-content: center; padding: 7px 9px; min-width: 0; }
.signal-item span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.signal-item strong { font-size: 16px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal-item small { margin-top: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.allocation-card { grid-template-rows: 39px 48px minmax(0,1fr); }
.allocation-bar { display: grid; grid-template-columns: 70fr 30fr; height: 37px; margin-top: 9px; overflow: hidden; border-radius: 8px; border: 1px solid var(--border-soft); }
.allocation-bar span { display: flex; flex-direction: column; justify-content: center; padding: 0 10px; background: var(--accent-soft); min-width: 0; }
.allocation-bar span + span { background: rgba(239,189,76,.14); border-left: 1px solid var(--border); }
.allocation-bar b { font-size: 10px; }
.allocation-bar em { color: var(--muted); font-style: normal; font-size: 9px; }
.allocation-card p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.38; }
.activity-list { display: grid; grid-template-rows: repeat(3,1fr); padding-top: 5px; min-height: 0; }
.activity-list > div { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-soft); min-height: 0; }
.activity-list > div:last-child { border: 0; }
.activity-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.activity-list i.good { background: var(--green); }
.activity-list span { display: flex; flex-direction: column; min-width: 0; }
.activity-list strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-list small { color: var(--muted); font-size: 9px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-list time { color: var(--muted); font-size: 9px; }
/* Catalog */
#catalogView { grid-template-rows: 50px 58px 176px minmax(0,1fr); gap: 11px; }
.compact-search { display: flex; align-items: flex-end; gap: 7px; }
.compact-search span { display: none; }
.compact-search input { width: min(300px,22vw); height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); padding: 0 11px; }
.catalog-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.catalog-metrics > div { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); display: flex; align-items: center; justify-content: space-between; padding: 0 15px; }
.catalog-metrics span { color: var(--muted); font-size: 11px; }
.catalog-metrics strong { font-size: 22px; }
.family-grid { display: grid; grid-template-columns: repeat(4,1fr); grid-template-rows: repeat(2,1fr); gap: 9px; min-height: 0; }
.family-card { appearance: none; text-align: left; border: 1px solid var(--border); border-radius: 11px; background: var(--panel); padding: 11px 12px; color: var(--text); min-width: 0; overflow: hidden; }
.family-card:hover, .family-card.active { border-color: var(--accent); background: var(--accent-soft); }
.family-card .family-code { color: var(--accent); font-weight: 800; font-size: 10px; letter-spacing: .08em; }
.family-card h3 { font-size: 13px; margin: 5px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.family-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.family-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.catalog-workspace, .network-workspace { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.75fr); gap: 11px; min-height: 0; }
.catalog-workspace .dashboard-card, .network-workspace .dashboard-card { display: grid; grid-template-rows: 41px minmax(0,1fr); }
.catalog-browser, #industryDetail { min-height: 0; overflow: hidden; padding-top: 8px; }
.empty-state { color: var(--muted); display: grid; place-items: center; text-align: center; }
.catalog-columns { height: 100%; display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.catalog-column { min-width: 0; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--panel-2); padding: 9px; overflow: hidden; }
.catalog-column h4 { margin: 0 0 7px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.catalog-items { display: grid; gap: 5px; }
.catalog-item { border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 6px 8px; text-align: left; width: 100%; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-item:hover, .catalog-item.active { background: var(--accent-soft); border-color: rgba(67,168,255,.25); }
.detail-summary h3 { margin: 4px 0; font-size: 17px; }
.detail-summary > p { color: var(--muted); font-size: 11px; margin: 0 0 8px; line-height: 1.35; }
.detail-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.detail-tags span { background: var(--panel-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px 7px; font-size: 9px; color: var(--muted); }
.detail-section { margin-top: 9px; }
.detail-section h4 { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 5px; }
.detail-list { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-list span { border: 1px solid var(--border-soft); background: var(--panel-2); border-radius: 7px; padding: 4px 6px; font-size: 9px; }
/* Network */
#networkView { grid-template-rows: 52px minmax(0,1fr); gap: 11px; }
.network-flow { min-height: 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 9px; align-items: center; padding: 12px 2px; }
.network-node { position: relative; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); padding: 12px; text-align: center; min-width: 0; }
.network-node:not(:last-child)::after { content: "→"; position: absolute; right: -16px; top: 50%; color: var(--accent); font-size: 18px; transform: translateY(-50%); z-index: 2; }
.network-node strong { display: block; font-size: 12px; }
.network-node small { display: block; color: var(--muted); font-size: 9px; margin-top: 5px; }
.health-grid { display: grid; gap: 9px; padding-top: 10px; }
.health-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border-soft); padding: 8px 0; }
.health-row span { color: var(--muted); }
.health-row strong.success { color: var(--green); }
/* Research */
#researchView { grid-template-rows: 53px minmax(0,1fr); gap: 11px; }
.research-budget-chip { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); background: var(--panel); border-radius: 10px; padding: 7px 10px; }
.research-budget-chip span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.research-budget-chip strong { color: var(--green); font-size: 17px; }
.research-budget-chip button { border: 0; background: transparent; color: var(--accent); }
.research-layout { min-height: 0; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(330px,.85fr) minmax(300px,.72fr); gap: 11px; }
.research-ladder-card, .research-control-card, .region-detail-card { min-height: 0; }
.research-steps { height: 100%; display: grid; grid-template-rows: repeat(5,1fr); gap: 8px; }
.research-steps article { position: relative; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--panel-2); padding: 10px 12px 9px 49px; min-height: 0; }
.research-steps article > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 10px; }
.research-steps h3 { margin: 0; font-size: 12px; }
.research-steps p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.3; }
.research-control-card { display: grid; grid-template-rows: 42px minmax(0,1fr) 38px 28px; gap: 8px; }
.research-findings { min-height: 0; overflow: hidden; display: block; padding-top: 5px; }
.research-status { color: var(--muted); font-size: 10px; align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-detail-card { display: grid; grid-template-rows: 42px minmax(0,1fr); }
#regionDetail { padding-top: 7px; overflow: hidden; min-height: 0; display: block; }
.region-title { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.region-title h3 { margin: 0; font-size: 16px; }
.region-title p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.region-code { color: var(--muted); font-size: 10px; }
.region-metric-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-top: 10px; }
.region-metric-grid > div { border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel-2); padding: 7px; min-width: 0; }
.region-metric-grid span { color: var(--muted); font-size: 9px; display: block; }
.region-metric-grid strong { margin-top: 3px; display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.research-callout { margin-top: 10px; border: 1px solid rgba(67,168,255,.25); background: var(--accent-soft); border-radius: 9px; padding: 9px; }
.research-callout strong { font-size: 11px; }
.research-callout p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.family-market-list { display: grid; gap: 5px; margin-top: 9px; }
.family-market-row { min-width: 0; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel-2); color: var(--text); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 6px 8px; text-align: left; }
.family-market-row.active { border-color: var(--accent); background: var(--accent-soft); }
.family-market-row span:first-child { display: flex; flex-direction: column; min-width: 0; }
.family-market-row strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.family-market-row small { color: var(--muted); font-size: 8px; }
.market-score { font-size: 14px; }
.score-high { color: var(--green); }.score-medium { color: var(--amber); }.score-low { color: var(--red); }
/* Full screen map */
.map-workspace { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: 70px minmax(0,1fr); background: var(--bg); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.map-workspace.open { opacity: 1; pointer-events: auto; transform: none; }
.map-workspace-header { display: grid; grid-template-columns: minmax(230px,.8fr) minmax(300px,1.2fr) auto; align-items: center; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.map-workspace-header h1 { margin: 3px 0 0; font-size: 22px; }
.fullscreen-breadcrumb { justify-content: center; }
.map-workspace-actions { display: flex; align-items: center; gap: 9px; }
.map-workspace-actions label { display: flex; flex-direction: column; gap: 3px; }
.map-workspace-actions label span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.close-map-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; font-size: 24px; background: var(--panel-2); }
.map-workspace-body { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 354px; gap: 11px; padding: 11px; }
.fullscreen-map-panel { min-height: 0; display: grid; grid-template-rows: minmax(0,1fr) 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 10px; }
.fullscreen-map-stage { border-radius: 9px; }
.map-context-panel { min-height: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 13px; display: grid; grid-template-rows: 42px minmax(0,1fr); box-shadow: var(--shadow); }
.map-context-body { min-height: 0; overflow: hidden; padding-top: 8px; }
.context-summary { display: grid; gap: 8px; }
.context-hero { border: 1px solid var(--border-soft); background: var(--panel-2); border-radius: 10px; padding: 11px; }
.context-hero strong { display: block; font-size: 18px; }
.context-hero p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.context-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.context-metrics div { border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel-2); padding: 8px; }
.context-metrics span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.context-metrics strong { display: block; font-size: 14px; margin-top: 4px; }
.context-actions { display: grid; gap: 7px; }
.map-tooltip { position: fixed; z-index: 120; pointer-events: none; background: rgba(4,12,19,.94); border: 1px solid #36536b; color: #eef6fb; padding: 7px 9px; border-radius: 8px; font-size: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.35); max-width: 240px; }
.map-tooltip strong { display: block; font-size: 11px; }
.map-tooltip span { color: #a9bdcc; display: block; margin-top: 2px; }
/* Adaptation without page scrolling */
@media (max-width: 1450px) {
    :root { --sidebar-w: 74px; }
    .brand-copy, .nav-item > span:last-child, .world-status div { display: none; }
    .brand-block { justify-content: center; padding-left: 0; padding-right: 0; }
    .world-status { justify-content: center; padding: 9px; }
    .nav-item { justify-content: center; padding: 0; }
    .nav-item.active { box-shadow: inset 3px 0 var(--accent); }
    .topbar { grid-template-columns: minmax(220px,1.2fr) repeat(3,minmax(115px,.6fr)) 52px minmax(165px,.75fr); }
    .top-stat.compact { display: none; }
    .dashboard-core { grid-template-columns: minmax(0,1.65fr) minmax(215px,.64fr) minmax(215px,.64fr); }
}
@media (max-height: 820px) {
    :root { --topbar-h: 62px; }
    .topbar-context strong { font-size: 14px; }
    .top-stat strong { font-size: 14px; }
    #dashboardView { grid-template-rows: 43px 76px minmax(0,1fr) 145px; gap: 8px; padding-top: 10px; }
    .kpi-card { padding: 9px 12px; }
    .kpi-card strong { font-size: 20px; }
    .dashboard-card { padding: 10px 11px; }
    .card-heading { height: 36px; padding-bottom: 6px; }
    .map-card { grid-template-rows: 36px 24px minmax(0,1fr) 21px; }
    .dashboard-lower .card-heading { height: 33px; }
    .signal-grid { padding-top: 6px; }
}
@media (max-height: 690px) {
    #dashboardView { grid-template-rows: 40px 70px minmax(0,1fr); }
    .dashboard-lower { display: none; }
    .kpi-grid { grid-template-columns: repeat(4,1fr); }
    .kpi-card:nth-child(4) { display: none; }
}
@media (max-width: 1120px) {
    .topbar { grid-template-columns: minmax(210px,1fr) repeat(2,minmax(115px,.6fr)) 52px minmax(160px,.7fr); }
    .top-stat:nth-of-type(3) { display: none; }
    .kpi-grid { grid-template-columns: repeat(4,1fr); }
    .kpi-card:nth-child(4) { display: none; }
    .dashboard-core { grid-template-columns: minmax(0,1.6fr) minmax(210px,.7fr); }
    .portfolio-card { display: none; }
    .dashboard-lower { grid-template-columns: 1fr 1fr; }
    .activity-card { display: none; }
    .map-workspace-body { grid-template-columns: minmax(0,1fr) 300px; }
    .map-workspace-header { grid-template-columns: 210px 1fr auto; }
}
.is-hidden{display:none!important}

/* Interactive map + business launch v6 */
:root { --map-context-land: #142431; }
html[data-theme="light"] { --map-context-land: #d7e1e8; }
.interactive-market-map { touch-action: none; user-select: none; cursor: grab; }
.interactive-market-map.dragging { cursor: grabbing; }
.map-camera { transform-origin: 0 0; transform-box: fill-box; transition: transform .52s cubic-bezier(.2,.78,.18,1); }
.interactive-market-map.dragging .map-camera { transition: none; }
.map-ocean-hitbox { fill: transparent; pointer-events: all; cursor: zoom-out; }
.map-world-country, .map-us-state, .map-county { vector-effect: non-scaling-stroke; transition: fill .2s ease, opacity .25s ease, stroke .2s ease, filter .2s ease; }
.map-world-country { stroke: rgba(141,177,201,.38); stroke-width: .65; }
.map-world-country.enabled { stroke: rgba(183,218,239,.8); cursor: pointer; }
.map-world-country:hover { filter: brightness(1.18); }
.map-us-state { stroke: rgba(174,211,234,.62); stroke-width: .65; cursor: pointer; }
.map-us-state.inactive { cursor: default; }
.map-us-state.enabled:hover, .map-county:hover { filter: brightness(1.18); stroke: var(--text); stroke-width: 1.15; }
.map-us-state.selected { stroke: var(--accent); stroke-width: 1.8; }
.map-county { stroke: rgba(202,226,241,.74); stroke-width: .7; cursor: pointer; }
.map-county.selected { stroke: #fff; stroke-width: 2.1; filter: drop-shadow(0 0 4px rgba(67,168,255,.78)); }
.map-zoom-controls { position: absolute; right: 9px; bottom: 9px; z-index: 4; display: grid; grid-template-columns: repeat(2,30px); gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: color-mix(in srgb,var(--panel) 92%,transparent); box-shadow: var(--shadow); }
.map-zoom-controls button { width: 30px; height: 28px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--panel-2); color: var(--text); font-weight: 800; }
.map-zoom-controls button:hover { border-color: var(--accent); background: var(--accent-soft); }
.opportunity-button { width: 100%; color: var(--text); text-align: left; cursor: pointer; }
.opportunity-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.signal-grid { grid-template-columns: repeat(4,1fr); }
.signal-item { appearance: none; color: var(--text); text-align: left; cursor: pointer; }
.signal-item:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.portfolio-company-list { min-height: 0; display: grid; gap: 6px; align-content: start; overflow: hidden; }
.portfolio-company-row { appearance: none; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--panel-2); color: var(--text); padding: 7px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 8px; align-items: center; text-align: left; }
.portfolio-company-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.company-monogram { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(67,168,255,.25); font-weight: 850; }
.company-monogram.large { width: 52px; height: 52px; border-radius: 13px; font-size: 17px; }
.portfolio-company-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.portfolio-company-row strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portfolio-company-row small { margin-top: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portfolio-company-row b { color: var(--green); font-size: 11px; white-space: nowrap; }
.ready-action { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.stacked-actions { display: grid; gap: 7px; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 20px; background: rgba(0,7,13,.72); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.dialog-backdrop.open { opacity: 1; pointer-events: auto; }
.dialog-panel { width: min(720px,calc(100vw - 36px)); max-height: calc(100dvh - 36px); overflow: hidden; display: grid; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 28px 70px rgba(0,0,0,.42); transform: translateY(10px) scale(.985); transition: transform .2s ease; }
.dialog-backdrop.open .dialog-panel { transform: none; }
.launch-dialog { grid-template-rows: 72px auto minmax(0,1fr); }
.company-detail-dialog { grid-template-rows: 72px minmax(0,1fr); width: min(670px,calc(100vw - 36px)); }
.dialog-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.dialog-header h1 { margin: 3px 0 0; font-size: 23px; }
.launch-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); background: var(--panel-2); }
.launch-summary > div { min-width: 0; display: flex; flex-direction: column; }
.launch-summary span, .launch-form label > span, .company-detail-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.launch-summary strong { margin-top: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.launch-form { min-height: 0; overflow: auto; padding: 15px 18px 18px; display: grid; gap: 12px; }
.launch-form label { display: grid; gap: 6px; }
.launch-form input[type="text"], .launch-form select { width: 100%; height: 39px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2); color: var(--text); padding: 0 11px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.funding-input { display: grid; grid-template-columns: minmax(0,1fr) 105px; gap: 12px; align-items: center; }
.funding-input input { width: 100%; accent-color: var(--accent); }
.funding-input output { height: 37px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2); font-weight: 800; color: var(--green); }
.launch-form small { color: var(--muted); font-size: 10px; }
.form-error { min-height: 18px; color: var(--red); font-size: 11px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.company-detail-body { min-height: 0; overflow: auto; padding: 16px 18px 20px; }
.company-detail-hero { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.company-detail-hero > div { min-width: 0; }
.company-detail-hero strong { font-size: 15px; }
.company-detail-hero p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.company-detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin: 14px 0; }
.company-detail-grid > div { min-width: 0; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--panel-2); padding: 10px; display: flex; flex-direction: column; }
.company-detail-grid strong { margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1050px) {
    .signal-grid { grid-template-columns: repeat(2,1fr); }
    .signal-item:nth-child(n+3) { display: none; }
}
@media (max-width: 720px) {
    .launch-summary, .form-row, .company-detail-grid { grid-template-columns: 1fr; }
}
/* Closed full-map workspace must never intercept dashboard interaction. */
.map-workspace { visibility: hidden; }
.map-workspace.open { visibility: visible; }

/* Business Operations Dashboard v7 */
#businessView { grid-template-rows: 76px 42px minmax(0,1fr); gap: 9px; padding: 10px 12px 12px; }
.business-company-header { min-width:0; display:grid; grid-template-columns:minmax(330px,1.25fr) minmax(500px,1.65fr) 160px; gap:10px; align-items:stretch; }
.business-identity { min-width:0; display:flex; align-items:center; gap:11px; border:1px solid var(--border); border-radius:12px; background:linear-gradient(145deg,var(--panel),var(--panel-2)); padding:8px 12px; }
.business-logo-tile { width:58px; height:58px; flex:none; border:1px solid var(--border); border-radius:13px; background:#071421; overflow:hidden; }
.business-logo-tile img { width:100%; height:100%; object-fit:cover; }
.business-title-copy { min-width:0; }
.business-title-line { display:flex; align-items:center; gap:9px; min-width:0; }
.business-title-line h1 { margin:0; font-size:22px; letter-spacing:-.03em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.business-title-line select { min-width:34px; max-width:165px; height:28px; border:1px solid var(--border); border-radius:7px; background:var(--panel-3); color:var(--text); padding:0 7px; }
.business-title-copy p { margin:4px 0 0; color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.business-title-copy > span { display:block; margin-top:3px; color:var(--muted-2); font-size:10px; }
.business-header-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--border); border-radius:12px; background:linear-gradient(145deg,var(--panel),var(--panel-2)); overflow:hidden; }
.business-header-metrics > div { min-width:0; padding:10px 12px; display:flex; justify-content:center; flex-direction:column; border-right:1px solid var(--border-soft); }
.business-header-metrics > div:last-child { border-right:0; }
.business-header-metrics span { color:var(--muted); font-size:9px; letter-spacing:.08em; text-transform:uppercase; font-weight:800; }
.business-header-metrics strong { margin-top:5px; font-size:17px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.business-header-metrics > div:nth-child(2) strong, .business-header-metrics > div:nth-child(3) strong { color:var(--green); }
.business-header-metrics small { margin-top:4px; color:var(--muted-2); font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.run-week-button { position:relative; overflow:hidden; border:1px solid rgba(67,168,255,.45); border-radius:12px; background:linear-gradient(145deg,rgba(34,133,207,.24),var(--panel)); color:var(--text); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; font-weight:800; }
.run-week-button span { font-size:14px; }
.run-week-button small { color:var(--muted); font-weight:500; font-size:9px; }
.run-week-button:hover { border-color:var(--accent); box-shadow:0 0 20px rgba(67,168,255,.18); }
.run-week-button:disabled { opacity:.55; cursor:wait; }
.business-tabs { display:flex; align-items:stretch; min-width:0; border:1px solid var(--border); border-radius:10px; background:var(--panel); overflow:hidden; }
.business-tabs button { min-width:110px; border:0; border-right:1px solid var(--border-soft); background:transparent; color:var(--muted); padding:0 16px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.business-tabs button:hover { color:var(--text); background:var(--panel-2); }
.business-tabs button.active { color:var(--text); background:var(--accent-soft); box-shadow:inset 0 -3px var(--accent); }
.business-screen-layout { min-width:0; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:9px; }
.business-card-grid { min-width:0; min-height:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:9px; }
.business-area-card, .business-rail-card { min-width:0; min-height:0; border:1px solid var(--border); border-radius:12px; background:linear-gradient(150deg,var(--panel),color-mix(in srgb,var(--panel) 93%,var(--accent) 7%)); box-shadow:var(--shadow); overflow:hidden; }
.business-area-card { display:grid; grid-template-rows:58px minmax(0,1fr); }
.business-area-card > header { position:relative; display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:9px; padding:6px 10px; border-bottom:1px solid var(--border-soft); background:linear-gradient(90deg,rgba(67,168,255,.06),transparent); }
.business-area-card > header img { width:44px; height:44px; border-radius:9px; object-fit:cover; }
.business-area-card > header p, .business-rail-card header p { margin:0; color:var(--accent); font-size:9px; font-weight:800; letter-spacing:.11em; }
.business-area-card > header h2, .business-rail-card header h2 { margin:2px 0 0; font-size:14px; }
.business-area-card > header button, .business-card-footer button, .advisor-card button { border:1px solid var(--border); border-radius:8px; background:var(--panel-3); color:var(--accent); padding:6px 9px; font-size:10px; font-weight:750; }
.business-area-card > header button:hover, .business-card-footer button:hover, .advisor-card button:hover { border-color:var(--accent); background:var(--accent-soft); }
.business-card-body { min-height:0; display:grid; grid-template-rows:auto auto minmax(46px,1fr) auto; gap:8px; padding:9px 11px 10px; }
.business-primary-metric { display:grid; grid-template-columns:auto 1fr; align-items:end; column-gap:10px; }
.business-primary-metric span { color:var(--muted); font-size:10px; }
.business-primary-metric strong { grid-row:1/3; grid-column:2; justify-self:end; font-size:25px; letter-spacing:-.035em; }
.business-primary-metric small { color:var(--green); font-size:9px; }
.business-stat-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.business-stat-pair > div { min-width:0; padding:7px 9px; border:1px solid var(--border-soft); border-radius:8px; background:var(--panel-2); display:flex; align-items:center; justify-content:space-between; gap:8px; }
.business-stat-pair span, .workforce-summary span, .allocation-summary span, .week-result-grid span { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.05em; }
.business-stat-pair strong { font-size:12px; white-space:nowrap; }
.business-mini-chart { min-height:48px; display:flex; align-items:flex-end; gap:5px; padding:5px 3px 2px; border-bottom:1px solid var(--border-soft); }
.business-mini-chart i { flex:1; min-width:3px; border-radius:3px 3px 0 0; background:linear-gradient(180deg,var(--accent),var(--accent-2)); opacity:.78; }
.business-card-footer { min-width:0; display:flex; align-items:center; justify-content:space-between; gap:8px; color:var(--muted); font-size:9px; }
.business-card-footer span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.business-card-footer b { color:var(--green); white-space:nowrap; }
.business-progress-block { display:grid; gap:5px; }
.business-progress-block > div:first-child { display:flex; justify-content:space-between; color:var(--muted); font-size:10px; }
.business-progress-block strong { color:var(--text); }
.business-progress { height:9px; overflow:hidden; border-radius:6px; background:var(--panel-3); border:1px solid var(--border-soft); }
.business-progress i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--accent-2),var(--green)); transition:width .25s ease; }
.operations-visual { min-height:48px; display:grid; grid-template-columns:58px minmax(0,1fr); gap:9px; align-items:center; }
.operations-visual img { width:58px; height:48px; object-fit:cover; border-radius:8px; }
.operations-visual > div { display:grid; grid-template-columns:8px 1fr; column-gap:7px; align-items:center; }
.operations-visual span { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px rgba(104,211,109,.1); }
.operations-visual strong { font-size:12px; }
.operations-visual small { grid-column:2; color:var(--muted); font-size:9px; margin-top:2px; }
.workforce-body { grid-template-columns:124px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; align-items:center; }
.workforce-ring { width:108px; height:108px; justify-self:center; border-radius:50%; display:grid; place-items:center; align-content:center; background:radial-gradient(circle at center,var(--panel) 52%,transparent 54%),conic-gradient(var(--accent) 0 var(--ring,65%),var(--panel-3) var(--ring,65%) 100%); box-shadow:inset 0 0 0 1px var(--border); }
.workforce-ring strong { font-size:26px; line-height:1; }
.workforce-ring span { margin-top:4px; color:var(--muted); font-size:9px; }
.workforce-summary { display:grid; gap:8px; }
.workforce-summary > div { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-bottom:6px; border-bottom:1px solid var(--border-soft); }
.workforce-summary strong { font-size:12px; }
.workforce-body .business-card-footer { grid-column:1/3; }
.money-pair strong { color:var(--green); }
.allocation-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.allocation-summary > div { min-width:0; text-align:center; padding:7px 3px; border:1px solid var(--border-soft); border-radius:8px; background:var(--panel-2); }
.allocation-summary strong { display:block; margin-top:4px; font-size:12px; }
.allocation-strip { height:12px; border-radius:8px; overflow:hidden; display:flex; background:var(--panel-3); }
.allocation-strip i:nth-child(1){background:var(--green)} .allocation-strip i:nth-child(2){background:var(--amber)} .allocation-strip i:nth-child(3){background:var(--accent)} .allocation-strip i:nth-child(4){background:var(--purple)}
.business-action-rail { min-width:0; min-height:0; display:grid; grid-template-rows:minmax(0,1fr) 154px 124px; gap:9px; }
.business-rail-card { padding:9px; }
.business-rail-card > header { min-height:38px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--border-soft); padding:0 3px 7px; }
.business-rail-card > header > span { color:var(--accent); font-size:18px; }
.business-action-list { display:grid; gap:5px; padding-top:7px; }
.business-action-list button { position:relative; overflow:hidden; min-height:45px; display:grid; grid-template-columns:38px minmax(0,1fr) 12px; gap:7px; align-items:center; width:100%; border:1px solid var(--border-soft); border-radius:9px; background:var(--panel-2); color:var(--text); text-align:left; padding:3px 7px 3px 4px; }
.business-action-list button:hover { border-color:var(--accent); background:var(--accent-soft); transform:translateX(-1px); }
.business-action-list img { width:38px; height:38px; border-radius:8px; object-fit:cover; }
.business-action-list span { min-width:0; display:flex; flex-direction:column; }
.business-action-list strong { font-size:10px; }
.business-action-list small { color:var(--muted); font-size:8px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.business-action-list b { color:var(--accent); font-size:17px; }
.advisor-card { display:grid; grid-template-rows:38px minmax(0,1fr) 30px; }
.advisor-card #businessAdvisorText { padding:9px 5px 5px; color:var(--muted); font-size:10px; line-height:1.45; overflow:hidden; }
.advisor-card button { width:100%; }
.week-result-card { display:grid; grid-template-rows:38px auto minmax(0,1fr); }
.week-result-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding-top:8px; }
.week-result-grid > div { padding:6px 7px; border:1px solid var(--border-soft); border-radius:7px; background:var(--panel-2); }
.week-result-grid strong { display:block; margin-top:3px; font-size:11px; }
.week-result-card p { margin:7px 2px 0; color:var(--muted); font-size:9px; line-height:1.35; }

/* One-pass polished sheen on hover */
.cf-sheen-card { position:relative; overflow:hidden; transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,filter .2s ease; }
.cf-sheen-card::after { content:""; position:absolute; z-index:3; top:-90%; left:-65%; width:38%; height:280%; pointer-events:none; opacity:0; background:linear-gradient(112deg,transparent 0%,rgba(255,255,255,.02) 38%,rgba(173,224,255,.28) 50%,rgba(255,255,255,.04) 61%,transparent 100%); transform:translateX(-180%) rotate(12deg); }
.cf-sheen-card:hover { transform:translateY(-1px); border-color:rgba(90,183,255,.55); box-shadow:0 10px 24px rgba(0,0,0,.26),0 0 16px rgba(67,168,255,.11); }
.cf-sheen-card:hover::after { opacity:1; animation:cfSheenPass .75s ease-out forwards; }
@keyframes cfSheenPass { from{transform:translateX(-180%) rotate(12deg)} to{transform:translateX(520%) rotate(12deg)} }
@media (prefers-reduced-motion: reduce) { .cf-sheen-card, .cf-sheen-card::after { transition:none; animation:none!important; } }

.business-action-dialog { width:min(640px,calc(100vw - 36px)); grid-template-rows:72px minmax(0,1fr); }
.action-dialog-title { display:flex; align-items:center; gap:10px; }
.action-dialog-title img { width:48px; height:48px; object-fit:cover; border-radius:10px; }
.business-action-form { min-height:0; overflow:auto; display:grid; gap:12px; padding:15px 18px 18px; }
.business-action-description { color:var(--muted); line-height:1.5; }
.business-action-fields { display:grid; gap:11px; }
.business-action-fields label { display:grid; gap:6px; }
.business-action-fields label > span { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.07em; }
.business-action-fields input[type="number"], .business-action-fields input[type="text"], .business-action-fields select { width:100%; height:39px; border:1px solid var(--border); border-radius:9px; background:var(--panel-2); padding:0 10px; }
.business-action-fields input[type="range"] { width:100%; accent-color:var(--accent); }
.action-range-row { display:grid; grid-template-columns:minmax(0,1fr) 105px; gap:10px; align-items:center; }
.action-range-row output { height:38px; display:grid; place-items:center; border:1px solid var(--border); border-radius:8px; background:var(--panel-2); color:var(--green); font-weight:800; }
.allocation-field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.business-action-impact { min-height:48px; padding:10px 12px; border:1px solid var(--border-soft); border-radius:9px; background:var(--panel-2); color:var(--muted); line-height:1.45; }
.business-action-impact strong { color:var(--text); }
.business-card-focused { border-color:var(--accent)!important; box-shadow:0 0 0 1px rgba(67,168,255,.18),0 0 24px rgba(67,168,255,.12)!important; }

@media (max-width:1450px) {
    .business-company-header { grid-template-columns:minmax(300px,1.1fr) minmax(450px,1.5fr) 145px; }
    .business-screen-layout { grid-template-columns:minmax(0,1fr) 275px; }
    .business-action-list button { min-height:42px; }
}
@media (max-width:1180px) {
    .business-company-header { grid-template-columns:minmax(300px,1.2fr) minmax(400px,1.5fr); }
    .run-week-button { display:none; }
    .business-screen-layout { grid-template-columns:minmax(0,1fr) 245px; }
    .business-action-list small { display:none; }
}
@media (max-height:780px) {
    #businessView { grid-template-rows:66px 36px minmax(0,1fr); gap:7px; padding-top:7px; }
    .business-logo-tile { width:50px; height:50px; }
    .business-title-line h1 { font-size:19px; }
    .business-header-metrics > div { padding:7px 9px; }
    .business-area-card { grid-template-rows:50px minmax(0,1fr); }
    .business-area-card > header { grid-template-columns:38px minmax(0,1fr) auto; }
    .business-area-card > header img { width:36px; height:36px; }
    .business-card-body { gap:6px; padding:7px 9px; }
    .workforce-ring { width:88px; height:88px; }
    .business-action-rail { grid-template-rows:minmax(0,1fr) 125px 105px; gap:7px; }
    .business-action-list { gap:3px; padding-top:5px; }
    .business-action-list button { min-height:36px; }
    .business-action-list img { width:31px; height:31px; }
    .business-action-list button { grid-template-columns:31px minmax(0,1fr) 10px; }
}
/* Final viewport fit tuning */
@media (min-height:781px) {
    .business-action-rail { grid-template-rows:minmax(400px,1fr) 145px 120px; }
    .business-action-list button { min-height:40px; }
    .business-action-list img { width:34px; height:34px; }
    .business-action-list button { grid-template-columns:34px minmax(0,1fr) 12px; }
}
