/* ================================================================
   YWK PFAL Demo — Plant Factory Energy Optimization
   Style deep-adapted from VFED Web (vertical-farm-energy-designer/vfed-web)
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #000;
    --bg-card: #111;
    --bg-hover: #1a1a1a;
    --bg-input: #0a0a0a;
    --text: #fff;
    --text-secondary: #71717a;
    --text-muted: #71717a;
    --border: #27272a;
    --green: #22c55e;
    --orange: #f97316;
    --red: #ef4444;
    --blue: #3b82f6;
    --primary: #487980;
    --primary-hover: #5a8f96;
    --primary-rgb: 72, 121, 128;
    --secondary: #d85117;
    --secondary-rgb: 216, 81, 23;
    --font-scale: 1;
}
:root.light {
    --bg: #fafafa;
    --bg-card: #fff;
    --bg-hover: #f4f4f5;
    --bg-input: #fafafa;
    --text: #18181b;
    --text-secondary: #71717a;
    --border: #e4e4e7;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color-scheme: dark;
    font-size: calc(15px * var(--font-scale));
}
input, select, option { color-scheme: dark; font-family: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Header ── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    height: 44px;
    gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.logo svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.header-center { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
.scene-name {
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text);
    font-size: 0.8rem;
    width: 220px;
    text-align: center;
    transition: border-color 0.2s;
}
.scene-name:focus { outline: none; border-color: var(--primary); }
.scene-name::placeholder { color: var(--text-muted); }
.lang-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
}
.header-right { display: flex; align-items: center; gap: 8px; }
.preset-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text);
    font-size: 0.78rem;
    min-width: 180px;
}
.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s;
}
.theme-toggle:hover { background: var(--bg-hover); }
.share-btn {
    background: var(--primary);
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }
.share-btn:active { opacity: 0.7; }

/* ── Scene Setting Bar ── */
.scene-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 8px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.scene-group { display: flex; align-items: center; gap: 10px; }
.sb-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    white-space: nowrap;
}
.sb-fields { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-field { display: flex; align-items: center; gap: 3px; }
.sb-field label {
    font-size: 0.78rem;
    color: var(--text);
    white-space: nowrap;
}
.sb-field input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text);
    font-size: 0.78rem;
    width: 72px;
}
.sb-field input:focus { outline: none; border-color: var(--primary); }
.sb-field input.wide { width: 90px; }
.sb-field select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 6px;
    color: var(--text);
    font-size: 0.78rem;
    cursor: pointer;
}

/* ── Main Layout: Sidebar + Dashboard ── */
main { flex: 1; display: flex; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
    width: 480px;
    min-width: 320px;
    max-width: 560px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: none;
    flex-shrink: 0;
}
.splitter {
    width: 8px; margin-left: -4px; margin-right: -4px;
    cursor: col-resize; flex-shrink: 0;
    position: relative; z-index: 10;
}
.splitter::after {
    content: ''; position: absolute; left: 50%; top: 2px; bottom: 2px;
    width: 3px; background: var(--primary); opacity: 0.4; border-radius: 2px;
    transform: translateX(-50%); transition: opacity 0.15s;
}
.splitter:hover::after, .splitter.dragging::after { opacity: 1; width: 4px; }

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Sidebar Footer ── */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    flex-shrink: 0;
}
.controls { display: flex; gap: 6px; }
.btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }

/* Progress */
.progress-section { display: none; margin-top: 8px; }
.progress-section.visible { display: block; }
.progress-bar { height: 5px; background: var(--bg-input); border-radius: 3px; overflow: hidden; margin-bottom: 5px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 3px; transition: width 0.3s ease; width: 0%; }
.progress-info { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-secondary); }
.progress-spinner {
    display: inline-block; width: 10px; height: 10px;
    border: 2px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form Sections (accordion) ── */
.form-section { border-bottom: 1px solid var(--border); }
.form-section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; cursor: pointer; user-select: none;
    font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    color: var(--text);
}
.form-section-header:hover { background: var(--bg-hover); }
.form-section-header .chevron { transition: transform 0.2s; font-size: 0.6rem; }
.form-section.collapsed .chevron { transform: rotate(-90deg); }
.form-section-body {
    padding: 0 14px 10px; display: flex; flex-direction: column; gap: 6px;
    overflow: hidden; transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
    max-height: 800px; opacity: 1;
}
.form-section.collapsed .form-section-body { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }

/* ── Form Fields ── */
.form-field { display: flex; flex-direction: column; gap: 2px; }
.form-field > label { font-size: 0.76rem; color: var(--text-secondary); }
.tooltip-icon { cursor: help; font-size: 0.7rem; margin-left: 2px; opacity: 0.6; }
.field-row { display: flex; align-items: center; gap: 5px; }
.field-row input[type="number"],
.field-row input[type="text"],
.field-row select {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px 7px;
    color: var(--text);
    font-size: 0.80rem;
    min-width: 0;
}
.field-row input:focus, .field-row select:focus { outline: none; border-color: var(--primary); }
.field-row .unit { font-size: 0.7rem; color: var(--text-secondary); min-width: 28px; }

/* Choice fields (binary select) */
.choice-grid { display: flex; gap: 6px; }
.choice-grid select { flex: 1; }

/* ── Dashboard ── */
.dashboard { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── Panel Headers ── */
.panel-label {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px; background: var(--bg-card);
    border-bottom: 2px solid var(--primary); flex-shrink: 0;
    font-size: 0.82rem; font-weight: 600; color: var(--primary);
    letter-spacing: 0.02em;
}
.panel-label svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.8; }
.dashboard > .panel-label {
    border-bottom-color: var(--secondary); color: var(--secondary);
}

/* ── Mode Tabs ── */
.mode-tabs {
    display: flex; gap: 0; padding: 6px 16px 0;
    border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--bg-card);
}
.mode-tab {
    background: transparent; border: none; color: var(--text-secondary);
    padding: 8px 20px; border-radius: 8px 8px 0 0; font-size: 0.78rem; cursor: pointer;
    font-weight: 500; transition: all 0.15s;
    border: 1px solid transparent; border-bottom: none;
}
.mode-tab:hover { color: var(--text); background: var(--bg-hover); }
.mode-tab.active {
    color: var(--text); background: var(--bg);
    border-color: var(--border); border-bottom-color: var(--bg);
}
.mode-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.mode-view:not(.active) { display: none !important; }

/* ── Education View (Tab 1) ── */
.education-view { overflow-y: auto; }
.edu-container { max-width: 860px; margin: 0 auto; padding: 20px 28px 40px; display: flex; flex-direction: column; gap: 14px; }
.edu-hero {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px 24px; display: flex; flex-direction: column; gap: 8px;
}
.edu-hero h2 { font-size: 1.15rem; font-weight: 600; }
.edu-hero .sub { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }
.edu-hero .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.edu-badge {
    background: rgba(var(--primary-rgb), 0.12); border: 1px solid rgba(var(--primary-rgb), 0.4);
    color: var(--primary); border-radius: 20px; padding: 3px 12px; font-size: 0.74rem; font-weight: 500;
}
.edu-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 20px; display: flex; flex-direction: column; gap: 10px;
}
.edu-card h3 {
    font-size: 0.92rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.edu-card h3 .step-no {
    background: var(--primary); color: #fff; border-radius: 6px; width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; flex-shrink: 0;
}
.edu-card p, .edu-card li { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.65; }
.edu-card ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.edu-card .highlight { color: var(--text); font-weight: 500; }
.edu-card .accent { color: var(--primary); font-weight: 600; }
.edu-card .accent-2 { color: var(--secondary); font-weight: 600; }
.edu-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.edu-metric {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.edu-metric .m-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.edu-metric .m-value { font-size: 1.1rem; font-weight: 600; color: var(--primary); }
.edu-metric .m-note { font-size: 0.68rem; color: var(--text-secondary); }
.edu-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.edu-flow .f-node {
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    padding: 6px 12px; font-size: 0.74rem; font-weight: 500; white-space: nowrap;
}
.edu-flow .f-node.primary { border-color: rgba(var(--primary-rgb), 0.5); color: var(--primary); }
.edu-flow .f-node.secondary { border-color: rgba(var(--secondary-rgb), 0.5); color: var(--secondary); }
.edu-flow .f-arrow { color: var(--text-secondary); font-size: 0.75rem; }

/* ── Comparison View (Tab 2) ── */
.compare-view { overflow-y: auto; }
.compare-container { padding: 14px 18px 32px; display: flex; flex-direction: column; gap: 12px; }
.compare-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--text-secondary); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-swatch.baseline { background: rgba(107, 114, 128, 0.7); }
.legend-swatch.current { background: rgba(72, 121, 128, 0.7); }

/* Metric Cards (dual: baseline vs current) */
.metrics-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: var(--bg-card); flex-shrink: 0;
}
.metrics-row.no-border { border-bottom: none; }
.metric-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 10px 14px;
    display: flex; flex-direction: column; gap: 3px;
}
.metric-card .label { font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-card .value { font-size: 1.25rem; font-weight: 600; color: var(--text); }
.metric-card .unit { font-size: 0.72rem; color: var(--text-secondary); }
.metric-card.best { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.metric-card .delta {
    display: inline-flex; align-items: center; gap: 3px; font-size: 0.72rem; font-weight: 500;
    border-radius: 4px; padding: 1px 6px; width: fit-content; margin-top: 2px;
}
.delta.good { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.delta.bad { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.delta.neutral { color: var(--text-secondary); background: rgba(113, 113, 122, 0.1); }

/* Comparison dual metrics block */
.compare-metrics {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch;
}
.cmp-col { display: flex; flex-direction: column; gap: 10px; }
.cmp-col-header {
    display: flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}
.cmp-col-header.baseline { color: var(--text-secondary); }
.cmp-col-header.current { color: var(--primary); border-bottom-color: var(--primary); }
.cmp-col .metrics-row { padding: 0; border-bottom: none; grid-template-columns: repeat(2, 1fr); gap: 6px; background: transparent; }
.cmp-col .metric-card { padding: 8px 10px; }
.cmp-col .metric-card .value { font-size: 1rem; }
.cmp-vs {
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
    color: var(--text-muted); font-weight: 600; padding: 0 4px; align-self: center;
}

/* Charts Grid (2×2) */
.charts-grid {
    flex: 1; display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px; min-height: 0; overflow: hidden;
}
.chart-panel {
    border: 1px solid var(--border); background: var(--bg-card);
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.chart-panel .panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
    font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.chart-panel .panel-body { flex: 1; padding: 4px 8px; min-height: 0; position: relative; overflow: hidden; }
.chart-panel .panel-body canvas { display: block; }

/* Chart overlays */
.chart-overlay {
    position: absolute; inset: 8px 14px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg-card); border-radius: 6px; border: 1px solid var(--border);
    gap: 10px; z-index: 10;
}
.chart-overlay.hidden { display: none !important; }
.loading-spinner {
    width: 28px; height: 28px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite;
}
.error-btn { background: var(--primary); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.78rem; }

/* Comparison results table */
.compare-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow: auto; }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.results-table th, .results-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.results-table th { color: var(--text-secondary); font-weight: 600; background: var(--bg-hover); }
.results-table tr:last-child td { border-bottom: none; }
.results-table td.kpi-name { font-weight: 500; color: var(--text); }
.results-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.results-table td.delta-cell { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-cell.good { color: var(--red); }
.delta-cell.bad { color: var(--red); }
.delta-cell.neutral { color: var(--text-secondary); }

/* ── Toast ── */
#toast-container { position: fixed; bottom: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; }
.toast {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 14px; display: flex; align-items: center; justify-content: space-between;
    gap: 10px; min-width: 260px; max-width: 380px;
    animation: slideIn 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
.toast.dismissing { animation: slideIn 0.3s ease reverse; }
.toast-content { color: var(--text); font-size: 0.8rem; }
.toast-dismiss { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; }
.toast-dismiss:hover { color: var(--text); }
.toast-error { border-left: 3px solid var(--red); }
.toast-success { border-left: 3px solid var(--green); }
.toast-warning { border-left: 3px solid var(--orange); }
.toast-info { border-left: 3px solid var(--blue); }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-body {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px 24px;
    max-width: 520px; width: 90%; max-height: 80vh;
    overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 0.95rem; font-weight: 600; }
.modal-close {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text); font-size: 0.9rem;
    width: 28px; height: 28px; display: flex; align-items: center;
    justify-content: center; cursor: pointer;
}
.modal-close:hover { background: var(--bg-hover); }
.modal-field { display: flex; flex-direction: column; gap: 3px; }
.modal-field > label { font-size: 0.76rem; color: var(--text-secondary); }
.modal-field input, .modal-field select {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 4px; padding: 5px 7px; color: var(--text);
    font-size: 0.80rem;
}
.modal-field input:focus, .modal-field select:focus { outline: none; border-color: var(--primary); }
.modal-field-row { display: flex; align-items: center; gap: 6px; }
.modal-field-row .unit { font-size: 0.7rem; color: var(--text-secondary); }
.modal-field-row .field-row { flex: 1; }
.modal-actions { display: flex; gap: 6px; padding-top: 4px; }

/* ── Section Summary Card ── */
.sec-summary {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.sec-summary:hover { background: var(--bg-hover); }
.sec-summary .sec-icon {
    font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0;
}
.sec-summary .sec-meta { flex: 1; min-width: 0; }
.sec-summary .sec-name {
    font-size: 0.8rem; font-weight: 600; margin-bottom: 2px;
}
.sec-summary .sec-vals {
    font-size: 0.72rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sec-fields { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sb-item { display: flex; align-items: center; gap: 2px; font-size: 0.7rem; }
.sb-item label { color: var(--text-secondary); white-space: nowrap; font-size: 0.68rem; }
.sb-inline {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 3px; padding: 2px 4px; color: var(--text);
    font-size: 0.72rem; width: 62px;
}
.sb-inline:focus { outline: none; border-color: var(--primary); }
.sb-u { font-size: 0.62rem; color: var(--text-secondary); }
.sec-gear {
    background: transparent; border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-secondary);
    font-size: 0.85rem; width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.sec-gear:hover { background: var(--bg-hover); color: var(--text); }

/* Scenario fixed-info card (top of sidebar) */
.scenario-info {
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; background: var(--bg);
}
.scenario-info .info-row { display: flex; justify-content: space-between; font-size: 0.74rem; }
.scenario-info .info-row .k { color: var(--text-secondary); }
.scenario-info .info-row .v { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.scenario-info .info-row .v.primary { color: var(--primary); font-weight: 600; }

/* Responsive fallback */
@media (max-width: 1100px) {
    .metrics-row { grid-template-columns: repeat(2, 1fr); }
    .compare-metrics { grid-template-columns: 1fr; }
    .cmp-vs { display: none; }
}
