/* ═══════════════════════════════════════════════
   Simulation V2 — Play Page Styles
   Student cockpit: narrative → decisions → results
   ═══════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    min-height: 100vh;
    color: #e2e8f0;
}

/* ── Accessibility: skip-to-content link, hidden until Tab-focused ── */
.skip-link {
    position: absolute; left: -9999px; top: auto;
    width: 1px; height: 1px; overflow: hidden;
    background: #4338ca; color: #fff;
    padding: 0.6rem 1.1rem; border-radius: 0 0 8px 8px;
    font-weight: 700; font-size: 0.9rem;
    text-decoration: none; z-index: 100000;
}
.skip-link:focus {
    left: 50%; top: 0; transform: translateX(-50%);
    width: auto; height: auto; overflow: visible;
    outline: 2px solid #fbbf24; outline-offset: 2px;
}

/* ── Layout shell ───────────────────────────── */
.play-shell { max-width: 1440px; margin: 0 auto; padding: 1.25rem; }

/* ── Round header ───────────────────────────── */
.round-header {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.25rem; padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 12px; border: 1px solid #4338ca;
}
.round-badge {
    background: #6366f1; color: #fff; padding: 6px 16px;
    border-radius: 20px; font-weight: 700; font-size: 0.9rem; white-space: nowrap;
}
.round-header h1 { font-size: 1.3rem; margin: 0; flex: 1; color: #e0e7ff; }
.team-badge {
    background: #312e81; border: 1px solid #4338ca;
    padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; color: #a5b4fc;
}
.header-links { display: flex; gap: 0.5rem; }
.header-links a {
    color: #a5b4fc; text-decoration: none; font-size: 0.82rem; font-weight: 600;
    padding: 4px 10px; border-radius: 6px; transition: all 0.15s;
}
.header-links a:hover { background: rgba(99,102,241,0.2); color: #e0e7ff; }

/* ── Progress bar ───────────────────────────── */
.round-progress-bar { display: flex; gap: 4px; margin-bottom: 1rem; }
.round-pip {
    flex: 1; height: 6px; border-radius: 3px; background: #1e293b;
    transition: background 0.3s;
}
.round-pip.completed { background: #6366f1; }
.round-pip.current { background: #818cf8; animation: pip-pulse 1.5s ease-in-out infinite; }
@keyframes pip-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Main grid ──────────────────────────────── */
.play-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1024px) {
    .play-grid { grid-template-columns: 1fr 1fr; }
    .play-right { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .play-grid { grid-template-columns: 1fr; }
}

/* ── Cards ──────────────────────────────────── */
.card {
    background: #1e293b; border: 1px solid #334155;
    border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem;
}
.card h3 {
    margin: 0 0 0.85rem; font-size: 0.95rem; font-weight: 700;
    color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 0.4rem;
}
.card h3 .icon { font-size: 1.1rem; }

/* ── Narrative card ─────────────────────────── */
.narrative-card { border-left: 3px solid #6366f1; }
.narrative-body { font-size: 0.9rem; color: #cbd5e1; line-height: 1.6; }
.narrative-body strong { color: #e0e7ff; }
.narrative-title { font-size: 1.05rem; font-weight: 700; color: #e0e7ff; margin-bottom: 0.5rem; }

/* ── State card (firm stats) ────────────────── */
.state-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.state-tile {
    background: #0f172a; border: 1px solid #334155; border-radius: 8px;
    padding: 0.6rem 0.75rem; text-align: center; transition: border-color 0.15s;
}
.state-tile:hover { border-color: #6366f1; }
.state-label { font-size: 0.68rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.state-value { font-size: 1.15rem; font-weight: 800; color: #e0e7ff; margin-top: 0.15rem; }
.state-delta { font-size: 0.72rem; font-weight: 600; margin-top: 0.1rem; }
.state-delta.positive { color: #34d399; }
.state-delta.negative { color: #f87171; }
.state-delta.neutral { color: #64748b; }

/* ── Decision card ──────────────────────────── */
.decision-card { border: 1.5px solid #4338ca; }
.decision-card h3 { color: #a5b4fc; }
.dv-group-label {
    font-size: 0.72rem; font-weight: 700; color: #6366f1; text-transform: uppercase;
    letter-spacing: 0.06em; margin: 1rem 0 0.35rem; padding-bottom: 0.2rem;
    border-bottom: 1px solid #1e293b;
}
.dv-group-label:first-child { margin-top: 0; }
.dv-row {
    margin-bottom: 0.85rem; padding: 0.75rem; background: #0f172a;
    border-radius: 8px; border: 1px solid #1e293b;
}
.dv-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; }
.dv-label { font-size: 0.85rem; font-weight: 600; color: #e2e8f0; }
.dv-value-display { font-size: 0.9rem; font-weight: 800; color: #a5b4fc; min-width: 70px; text-align: right; }
.dv-slider-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.dv-slider {
    flex: 1 1 auto;
    height: 8px; -webkit-appearance: none; appearance: none;
    /* Filled portion drawn via CSS var --fill-pct (0-100), updated in JS on input. */
    --fill-pct: 0%;
    background: linear-gradient(to right,
        #6366f1 0%, #6366f1 var(--fill-pct),
        #1e293b var(--fill-pct), #1e293b 100%);
    border-radius: 4px; outline: none; cursor: pointer;
    min-width: 0; transition: box-shadow 0.15s;
}
.dv-slider:focus-visible { box-shadow: 0 0 0 3px rgba(99,102,241,0.32); }
.dv-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    border-radius: 50%; background: #818cf8; border: 3px solid #e0e7ff; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.4);
    transition: transform 0.12s, background 0.12s;
}
.dv-slider::-webkit-slider-thumb:hover { background: #a5b4fc; transform: scale(1.08); }
.dv-slider::-webkit-slider-thumb:active { background: #6366f1; transform: scale(1.15); }
.dv-slider::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: #818cf8; border: 3px solid #e0e7ff; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.4);
    transition: transform 0.12s, background 0.12s;
}
.dv-slider::-moz-range-thumb:hover { background: #a5b4fc; transform: scale(1.08); }
.dv-number {
    flex: 0 0 96px;
    width: 96px;
    padding: 0.35rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e7ff;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.dv-number:focus {
    outline: none;
    border-color: #6366f1;
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
/* Hide default browser spinner arrows — slider is the discovery affordance. */
.dv-number::-webkit-outer-spin-button,
.dv-number::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
.dv-number { -moz-appearance: textfield; appearance: textfield; }
.dv-range { display: flex; justify-content: space-between; font-size: 0.68rem; color: #475569; margin-top: 0.2rem; }
/* Author's flavour text. Dim enough to stay secondary to the control, legible
   enough to actually be read — it is the only place a case explains what a
   lever means in ITS business. */
.dv-hint { font-size: 0.78rem; color: #94a3b8; margin-top: 0.4rem; line-height: 1.5; }

/* ── Creative text DV ── */
.dv-row-creative { border-left: 3px solid #f59e0b; }
.dv-prompt-text {
    font-size: 0.78rem; color: #94a3b8; line-height: 1.45;
    margin: 0.2rem 0 0.5rem;
}
.dv-textarea {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 5.5rem;
    background: #0b1220; color: #e2e8f0; font-family: inherit; font-size: 0.85rem;
    line-height: 1.5; padding: 0.6rem 0.7rem;
    border: 1px solid #334155; border-radius: 6px;
}
.dv-textarea:focus { outline: none; border-color: #f59e0b; }
.dv-value-display.over-limit { color: #f87171; }
.creative-prev-feedback {
    margin-top: 0.5rem; padding: 0.5rem 0.65rem; border-radius: 6px;
    background: #1e293b; color: #cbd5e1; font-size: 0.78rem; line-height: 1.45;
}

/* ── Visual assets ── */
.visual-assets-container {
    display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 0.25rem;
}
.visual-asset-card {
    margin: 0; flex: 0 1 200px; background: #0f172a;
    border: 1px solid #1e293b; border-radius: 8px; overflow: hidden;
}
.visual-asset-card img { display: block; width: 100%; height: auto; }
.dv-choice-image { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 5px; }
.case-art-figure { margin: 0.75rem 0 1rem; }
.case-art-figure img { display: block; width: 100%; height: auto; border-radius: 8px; }
.case-art-figure figcaption { color: #94a3b8; font-size: 0.8rem; line-height: 1.5; margin-top: 0.4rem; }
.case-art-help { margin: 0.5rem 0 1rem; }
.case-art-help summary { cursor: pointer; color: #a5b4fc; font-size: 0.85rem; }
.case-art-help p { color: #94a3b8; font-size: 0.85rem; }
.case-art-figure a:focus-visible, .visual-asset-card a:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; display: block; }
.visual-asset-card .asset-label {
    padding: 0.4rem 0.6rem; font-size: 0.75rem; color: #94a3b8; text-align: center;
}
@media (prefers-reduced-motion: reduce) {
    .visual-asset-card { transition: none; }
}

/* Budget bar — sticky to the top of the decision column when scrolled. */
.budget-bar-wrap {
    position: sticky; top: 8px; z-index: 10;
    margin-bottom: 1rem; padding: 0.75rem; background: rgba(15, 23, 42, 0.92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-radius: 8px; border: 1px solid #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.budget-bar-wrap.is-over {
    border-color: #f87171; animation: budget-shake 0.3s ease-in-out 1;
}
@keyframes budget-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
.budget-label { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 0.35rem; }
.budget-label span:first-child { color: #94a3b8; font-weight: 600; }
.budget-label .budget-val { font-weight: 700; }
.budget-val.ok { color: #34d399; }
.budget-val.warn { color: #fbbf24; }
.budget-val.over { color: #f87171; }
.budget-track { height: 8px; background: #334155; border-radius: 4px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 4px; transition: width 0.3s, background 0.3s; }

/* Submit button */
.submit-row { display: flex; gap: 0.75rem; margin-top: 1rem; }
.btn {
    padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 0.9rem; font-weight: 700; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); }
.btn-primary:disabled { background: #475569; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; border: 1.5px solid #475569; color: #94a3b8; }
.btn-outline:hover { border-color: #6366f1; color: #a5b4fc; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.submitted-banner {
    background: linear-gradient(135deg, #065f46, #064e3b); border: 1px solid #10b981;
    border-radius: 8px; padding: 1rem; text-align: center; margin-top: 0.75rem;
}
.submitted-banner .icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.submitted-banner .msg { font-size: 0.9rem; font-weight: 600; color: #a7f3d0; }

/* ── Results card ───────────────────────────── */
.results-card { border-left: 3px solid #10b981; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.kpi-tile {
    background: #0f172a; border: 1px solid #334155; border-radius: 8px;
    padding: 0.65rem 0.75rem; text-align: center;
}
.kpi-label { font-size: 0.68rem; color: #64748b; font-weight: 600; text-transform: uppercase; }

/* A title attribute nobody knows to hover is still invisible, so a metric that
   can explain itself says so with a dotted label and a help cursor. */
.kpi-tile.has-help, .trends-row.has-help { cursor: help; }
.kpi-tile.has-help .kpi-label,
.trends-row.has-help .trends-row-label {
    border-bottom: 1px dotted #475569;
    display: inline-block;
    padding-bottom: 1px;
}
.kpi-tile.has-help:hover, .trends-row.has-help:hover { border-color: #64748b; }
.kpi-tile.has-help:hover .kpi-label,
.trends-row.has-help:hover .trends-row-label { color: #94a3b8; border-bottom-color: #94a3b8; }

/* A near-flat series is drawn flat rather than rescaled to full height; dim it
   so it reads as "this barely moved" instead of as a real trend. */
.kpi-sparkline.is-flat { opacity: 0.45; }

/* Restart control in the instructor preview header. Deliberately quiet — it is
   destructive, but only ever to the instructor's own throwaway preview. */
.preview-restart-btn {
    background: #1e293b; color: #e2e8f0; border: 1px solid #334155;
    border-radius: 4px; padding: 2px 8px; font-size: 0.78rem;
    cursor: pointer; font-family: inherit;
}
.preview-restart-btn:hover:not(:disabled) { background: #334155; border-color: #64748b; }
.preview-restart-btn:disabled { opacity: 0.6; cursor: default; }

/* Creative rubric breakdown — the score has to show its working, or the
   per-dimension feedback is decoration. */.artifact-rubric { margin-top: 0.7rem; font-size: 0.78rem; }
.artifact-rubric-head {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: #64748b; font-weight: 700; margin-bottom: 0.35rem;
}
.artifact-rubric-row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 0.75rem; padding: 0.22rem 0; border-bottom: 1px solid #1e293b;
}
.artifact-rubric-row:last-of-type { border-bottom: none; }
.arr-label { color: #cbd5e1; }
.arr-weight { color: #64748b; font-size: 0.72rem; }
.arr-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.arr-good { color: #34d399; }
.arr-mid { color: #fbbf24; }
.arr-poor { color: #f87171; }
.artifact-rubric-total {
    margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid #334155;
    color: #94a3b8; font-size: 0.78rem;
}
.artifact-rubric-total strong { color: #e0e7ff; }
.kpi-value { font-size: 1.2rem; font-weight: 800; color: #e0e7ff; margin-top: 0.1rem; }
.kpi-delta { font-size: 0.72rem; font-weight: 600; margin-top: 0.1rem; }
.kpi-delta.positive { color: #34d399; }
.kpi-delta.negative { color: #f87171; }

/* ── Segment breakdown ──────────────────────── */
.segment-breakdown { margin-top: 0.75rem; }
.segment-row {
    background: #0f172a; border: 1px solid #334155; border-radius: 8px;
    padding: 0.65rem 0.85rem; margin-bottom: 0.5rem;
    cursor: pointer; transition: border-color 0.15s;
}
.segment-row:hover { border-color: #6366f1; }
.segment-row-header { display: flex; justify-content: space-between; align-items: center; }
.segment-name { font-size: 0.85rem; font-weight: 700; color: #e0e7ff; }
.segment-share { font-size: 0.82rem; font-weight: 700; color: #a5b4fc; }
.segment-details {
    margin-top: 0.5rem; padding-top: 0.5rem;
    border-top: 1px solid #1e293b;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.4rem;
}
.segment-details.collapsed { display: none; }
.seg-metric {
    background: #1e293b; border-radius: 6px; padding: 0.35rem 0.5rem; text-align: center;
}
.seg-metric-label { font-size: 0.6rem; color: #64748b; text-transform: uppercase; }
.seg-metric-val { font-size: 0.82rem; font-weight: 700; color: #cbd5e1; }

/* ── Leaderboard card ───────────────────────── */
.leaderboard-card { border-left: 3px solid #fbbf24; }
.lb-row {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem;
    border-radius: 8px; margin-bottom: 0.35rem; background: #0f172a;
    border: 1px solid #1e293b; transition: border-color 0.15s;
}
.lb-row.you { border-color: #6366f1; background: #1e1b4b; }
.lb-row:first-child { border-color: #fbbf24; background: #1c1917; }
.lb-rank { font-size: 1.2rem; font-weight: 800; width: 2.2rem; text-align: center; color: #94a3b8; }
.lb-row:first-child .lb-rank { color: #fbbf24; }
.lb-team { flex: 1; font-weight: 600; color: #e2e8f0; font-size: 0.9rem; }
.lb-team .ai-tag { font-size: 0.7rem; color: #64748b; margin-left: 0.3rem; }
.lb-val { font-weight: 700; color: #34d399; font-size: 1rem; }

/* ── Diagnostics card ───────────────────────── */
.diagnostic-item {
    background: #0f172a; border-radius: 8px; padding: 0.65rem 0.85rem;
    margin-bottom: 0.4rem; border-left: 3px solid #6366f1;
}
.diagnostic-item.warning { border-left-color: #fbbf24; }
.diagnostic-item.danger { border-left-color: #f87171; }
.diagnostic-item.success { border-left-color: #34d399; }
.diagnostic-msg { font-size: 0.85rem; color: #cbd5e1; line-height: 1.5; }
.diagnostic-label { font-size: 0.68rem; color: #64748b; font-weight: 600; text-transform: uppercase; margin-bottom: 0.15rem; }

/* ── Reflection card ────────────────────────── */
.reflection-form { display: flex; flex-direction: column; gap: 0.85rem; }
.reflection-field label {
    display: block; font-size: 0.78rem; font-weight: 600; color: #94a3b8;
    margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.reflection-field textarea {
    width: 100%; padding: 0.65rem 0.75rem; background: #0f172a; border: 1.5px solid #334155;
    border-radius: 8px; color: #e2e8f0; font-family: inherit; font-size: 0.875rem;
    resize: vertical; min-height: 60px; outline: none; transition: border-color 0.15s;
}
.reflection-field textarea:focus { border-color: #6366f1; }
.reflection-field textarea::placeholder { color: #475569; }

/* ── Round history (collapsible) ────────────── */
.history-toggle {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.5rem 0; margin-top: 0.5rem;
}
.history-toggle .chevron { transition: transform 0.2s; font-size: 0.7rem; color: #64748b; }
.history-toggle .chevron.open { transform: rotate(90deg); }
.history-toggle span { font-size: 0.82rem; color: #64748b; font-weight: 600; }
.history-content { display: none; }
.history-content.open { display: block; }
.history-round {
    background: #0f172a; border: 1px solid #1e293b; border-radius: 8px;
    padding: 0.6rem 0.85rem; margin-bottom: 0.35rem;
}
.history-round-label { font-size: 0.75rem; font-weight: 700; color: #6366f1; margin-bottom: 0.25rem; }
.history-kpis { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.78rem; color: #94a3b8; }

/* ── Toast ──────────────────────────────────── */
.toast {
    position: fixed; bottom: 2rem; right: 2rem; background: #1e293b; color: white;
    padding: 0.85rem 1.25rem; border-radius: 8px; font-size: 0.9rem;
    z-index: 9999; opacity: 0; transform: translateY(10px);
    transition: all 0.3s; pointer-events: none; max-width: 340px;
    border: 1px solid #334155;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.success { background: #065f46; border-color: #10b981; }
.toast.error { background: #7f1d1d; border-color: #f87171; }

/* ── Placeholder / Loading ──────────────────── */
.placeholder { color: #475569; font-style: italic; text-align: center; padding: 2rem; }
.loading { text-align: center; padding: 2rem; color: #64748b; }
.empty-msg { text-align: center; padding: 2rem; color: #64748b; font-style: italic; }

/* ── Waiting overlay ────────────────────────── */
.waiting-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.8);
    z-index: 100; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 1rem;
}
.waiting-overlay .spinner { font-size: 2rem; animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.waiting-overlay .msg { font-size: 1.1rem; font-weight: 600; color: #a5b4fc; }

/* --- Creative Artifact ------------------------ */
@keyframes artifact-spin { to { transform: rotate(360deg); } }
.dv-artifact { margin: 0.8rem 0; }
.artifact-empty:hover { border-color: #818cf8 !important; background: rgba(99,102,241,0.05); }

/* ═══════════════════════════════════════════════
   UX overhaul (Phase 1 + 2) — story-shaped panels
   ═══════════════════════════════════════════════ */

/* ── Group cards (replace flat .dv-group-label) ── */
.dv-group-card {
    background: #0c1424; border: 1px solid #1e293b; border-radius: 10px;
    padding: 0.75rem 0.85rem 0.85rem; margin: 0.85rem 0;
    transition: border-color 0.15s;
}
.dv-group-card:first-of-type { margin-top: 0.4rem; }
.dv-group-card:hover { border-color: #334155; }
.dv-group-card.is-collapsed .dv-group-body { display: none; }
.dv-group-card.is-collapsed .dv-group-chevron { transform: rotate(-90deg); }
.dv-group-header {
    display: flex; align-items: center; gap: 0.6rem; cursor: pointer;
    padding-bottom: 0.5rem; -webkit-user-select: none; user-select: none;
}
.dv-group-icon {
    flex: none; width: 28px; height: 28px; border-radius: 7px;
    background: #1e293b; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.dv-group-titlewrap { flex: 1; min-width: 0; }
.dv-group-name {
    font-size: 0.78rem; font-weight: 800; color: #c7d2fe; letter-spacing: 0.05em;
    text-transform: uppercase;
}
.dv-group-purpose {
    font-size: 0.74rem; color: #64748b; line-height: 1.35; margin-top: 0.1rem;
}
.dv-group-chevron {
    flex: none; color: #475569; font-size: 0.8rem; transition: transform 0.18s;
}
.dv-group-body { padding-top: 0.25rem; }
.dv-group-body .dv-row:last-child { margin-bottom: 0; }

/* ── Categorical → choice cards (grid of tiles) ── */
.dv-choice-row { margin-bottom: 0.85rem; }
.dv-choice-row .dv-label {
    display: block; font-size: 0.85rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.45rem;
}
.dv-choice-grid {
    display: grid; gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.dv-choice-grid.cards-many { /* >4 choices: scroll horizontally */
    grid-template-columns: none; display: flex; overflow-x: auto;
    padding-bottom: 0.4rem; scroll-snap-type: x mandatory;
}
.dv-choice-grid.cards-many .dv-choice-card {
    flex: 0 0 160px; scroll-snap-align: start;
}
.dv-choice-card {
    -webkit-appearance: none; appearance: none;
    background: #0f172a; border: 1.5px solid #334155; border-radius: 10px;
    padding: 0.75rem 0.65rem; cursor: pointer; text-align: center;
    color: #cbd5e1; transition: all 0.15s; font: inherit; min-height: 84px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.25rem;
}
.dv-choice-card:hover { border-color: #6366f1; background: #131c30; }
.dv-choice-card:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
.dv-choice-card.is-selected {
    border-color: #6366f1; background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
    box-shadow: 0 0 0 1px #6366f1, 0 6px 18px -8px rgba(99,102,241,0.45);
}
.dv-choice-emoji { font-size: 1.55rem; line-height: 1; }
.dv-choice-label { font-size: 0.82rem; font-weight: 700; color: #e0e7ff; line-height: 1.25; }
.dv-choice-card.is-selected .dv-choice-label { color: #ffffff; }

/* ── Sparklines (inline SVG) ── */
.kpi-sparkline { display: block; width: 100%; height: 28px; margin-top: 0.35rem; opacity: 0.85; }
.kpi-sparkline path { fill: none; stroke-width: 1.5; }
.kpi-sparkline .spark-line { stroke: #6366f1; }
.kpi-sparkline .spark-fill { fill: rgba(99,102,241,0.15); stroke: none; }
.kpi-sparkline .spark-dot { fill: #a5b4fc; }

/* Trends strip (compact right-column replacement for "Latest KPIs" duplicate) */
.trends-strip { display: flex; flex-direction: column; gap: 0.45rem; }
.trends-row {
    display: grid; grid-template-columns: 1fr auto; gap: 0.6rem;
    align-items: center;
    padding: 0.4rem 0.55rem; background: #0f172a; border: 1px solid #1e293b;
    border-radius: 7px;
}
.trends-row-meta { min-width: 0; }
.trends-row-label {
    font-size: 0.66rem; color: #64748b; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; line-height: 1.2;
}
.trends-row-value {
    font-size: 0.95rem; font-weight: 800; color: #e0e7ff; font-variant-numeric: tabular-nums;
}
.trends-row-spark { width: 80px; height: 26px; }
.trends-row-delta { font-size: 0.7rem; font-weight: 700; margin-left: 0.4rem; }
.trends-row-delta.up { color: #34d399; }
.trends-row-delta.down { color: #f87171; }
.trends-row-delta.flat { color: #64748b; }

/* ── Hero KPI tile ── */
.kpi-tile.hero {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #0b1228 0%, #131c30 100%);
    border-color: #4338ca;
    padding: 1rem 1.1rem 1.1rem;
    text-align: left;
}
.kpi-tile.hero .kpi-label {
    font-size: 0.72rem; color: #a5b4fc;
}
.kpi-tile.hero .kpi-value {
    font-size: 2.2rem; font-weight: 800; color: #ffffff; line-height: 1.05; margin-top: 0.25rem;
}
.kpi-tile.hero .kpi-delta { font-size: 0.85rem; margin-top: 0.35rem; }
.kpi-tile.hero .kpi-sparkline { height: 40px; margin-top: 0.55rem; }

/* ── Headline summary card ── */
.headline-card {
    background: linear-gradient(135deg, #0a1226 0%, #0f172a 100%);
    border: 1px solid #334155; border-left: 3px solid #6366f1;
    border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 0.85rem;
}
.headline-eyebrow {
    font-size: 0.66rem; font-weight: 700; color: #818cf8; text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 0.25rem;
}
.headline-text {
    font-size: 0.95rem; color: #e2e8f0; line-height: 1.55;
}
.headline-text .delta-up { color: #34d399; font-weight: 700; }
.headline-text .delta-down { color: #f87171; font-weight: 700; }
.headline-text strong { color: #ffffff; }

/* ── Segment story panel ── */
.segment-story { margin-top: 0.75rem; }
.segment-stack-bar {
    display: flex; height: 22px; border-radius: 6px; overflow: hidden;
    background: #0f172a; border: 1px solid #1e293b; margin-bottom: 0.5rem;
}
.segment-stack-seg {
    height: 100%; transition: filter 0.15s; cursor: default;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: rgba(255,255,255,0.85);
    overflow: hidden; white-space: nowrap;
}
.segment-stack-seg:hover { filter: brightness(1.15); }
.segment-mover {
    font-size: 0.82rem; color: #cbd5e1; line-height: 1.45;
    margin: 0.25rem 0 0.6rem;
}
.segment-mover .delta-up { color: #34d399; font-weight: 700; }
.segment-mover .delta-down { color: #f87171; font-weight: 700; }
.segment-rows-v2 { display: grid; gap: 0.4rem; }
.segment-row-v2 {
    display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center;
    gap: 0.55rem; padding: 0.4rem 0.6rem;
    background: #0f172a; border: 1px solid #1e293b; border-radius: 7px;
    font-size: 0.82rem;
}
.segment-row-v2-swatch { width: 10px; height: 10px; border-radius: 3px; }
.segment-row-v2-name { color: #e0e7ff; font-weight: 600; }
.segment-row-v2-share { color: #cbd5e1; font-variant-numeric: tabular-nums; }
.segment-row-v2-delta { font-size: 0.74rem; font-weight: 700; min-width: 48px; text-align: right; }
.segment-row-v2-delta.up { color: #34d399; }
.segment-row-v2-delta.down { color: #f87171; }
.segment-row-v2-delta.flat { color: #64748b; }

/* ── Decision-impact strip (paired decision → outcome) ── */
.impact-section {
    margin-top: 0.85rem; padding-top: 0.65rem; border-top: 1px solid #1e293b;
}
.impact-section-title {
    font-size: 0.7rem; font-weight: 700; color: #94a3b8; text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.impact-grid { display: grid; gap: 0.4rem; }
.impact-row {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.65rem; background: #0f172a; border: 1px solid #1e293b;
    border-radius: 7px;
    font-size: 0.83rem;
}
.impact-row-decision, .impact-row-outcome { min-width: 0; display: flex; flex-direction: column; }
.impact-row-decision { text-align: left; }
.impact-row-outcome { text-align: right; }
.impact-row .impact-label {
    font-size: 0.66rem; color: #64748b; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2;
}
.impact-row .impact-value {
    font-weight: 700; color: #e0e7ff; font-variant-numeric: tabular-nums; line-height: 1.25;
    margin-top: 0.1rem;
}
.impact-row .impact-arrow {
    color: #475569; font-size: 0.95rem; padding: 0 0.15rem;
}
.impact-row.is-up .impact-row-outcome .impact-value { color: #34d399; }
.impact-row.is-down .impact-row-outcome .impact-value { color: #f87171; }

/* ── Mobile/narrow viewport ── */
@media (max-width: 640px) {
    .dv-choice-grid { grid-template-columns: repeat(2, 1fr); }
    .impact-row { grid-template-columns: 1fr; gap: 0.2rem; }
    .impact-row-outcome { text-align: left; }
    .impact-row .impact-arrow { display: none; }
    .kpi-tile.hero .kpi-value { font-size: 1.7rem; }
    .budget-bar-wrap { top: 4px; }
}

/* ── Sum-to-N "info_total" mode (text-only readout, no progress bar) ── */
.dv-sum-info {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0.4rem 0 0.6rem; padding: 0.45rem 0.7rem;
    background: #0f172a; border: 1px solid #1e293b; border-radius: 6px;
    font-size: 0.78rem;
}
.dv-sum-info .sum-info-label { color: #94a3b8; font-weight: 600; }
.dv-sum-info .sum-info-val {
    color: #e0e7ff; font-weight: 700; font-variant-numeric: tabular-nums;
}
.dv-sum-info .sum-info-val.is-ok { color: #34d399; }
.dv-sum-info .sum-info-val.is-over { color: #f87171; }
.dv-sum-info .sum-info-val.is-under { color: #fbbf24; }

/* ═══════════════════════════════════════════════════
   Intelligence Center + Perceptual Map
   Ported from admin_pages/sim-play-v2.html.
   ═══════════════════════════════════════════════════ */
.mi-section { margin-top: 1rem; }
.intel-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.intel-tab {
    padding: 0.45rem 0.9rem; border: 1px solid #334155; border-radius: 6px;
    background: transparent; color: #94a3b8; font-size: 0.82rem; font-weight: 600;
    cursor: pointer;
}
.intel-tab:hover { background: #1e293b; color: #e2e8f0; }
.intel-tab.active { background: #312e81; border-color: #6366f1; color: #e0e7ff; }
.intel-panel { display: none; }
.intel-panel.active { display: block; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.data-table th, .data-table td { padding: 0.4rem 0.6rem; }
.data-table thead th {
    text-align: left; color: #94a3b8; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 2px solid #334155;
}
.data-table th.th-competitor, .data-table th.th-segment { text-align: center; color: #c7d2fe; }
.data-table td { color: #e2e8f0; border-bottom: 1px solid rgba(51, 65, 85, 0.3); }
.data-table tr.data-table-section td {
    background: #1e293b; color: #a5b4fc; font-weight: 700;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.data-table td.mi-cell-exact,
.data-table td.mi-cell-approx,
.data-table td.mi-cell-dir,
.data-table td.mi-cell-own,
.data-table td.mi-cell-hidden { text-align: center; font-weight: 600; }
.mi-cell-exact { color: #e2e8f0; }
.mi-cell-approx { color: #fbbf24; }
.mi-cell-dir { color: #94a3b8; font-style: italic; }
.mi-cell-own { color: #6ee7b7; }
.mi-cell-hidden { color: #475569; }
.mi-approx-icon { opacity: 0.7; margin-right: 0.15rem; }

.info-icon { color: #64748b; cursor: help; font-size: 0.75rem; }
.info-icon:hover { color: #a5b4fc; }

.mi-metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}
.mi-tile {
    position: relative; padding: 0.7rem 0.8rem; background: #0f172a;
    border: 1px solid #1e293b; border-radius: 8px;
}
.mi-tile-approx { border-left: 3px solid #f59e0b; }
.mi-tile-directional { border-left: 3px solid #64748b; }
.mi-tile-label { font-size: 0.72rem; color: #94a3b8; margin-bottom: 0.25rem; }
.mi-tile-value { font-size: 1.05rem; font-weight: 800; color: #e0e7ff; }
.mi-vis-badge {
    display: inline-block; margin-top: 0.3rem; padding: 0.05rem 0.4rem;
    border-radius: 10px; font-size: 0.62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.mi-vis-exact { background: #064e3b; color: #6ee7b7; }
.mi-vis-approx { background: #78350f; color: #fcd34d; }
.mi-vis-directional { background: #334155; color: #cbd5e1; }

.mi-pmap-card {
    margin-top: 1rem; padding: 0.9rem; background: #0f172a;
    border: 1px solid #1e293b; border-radius: 8px;
}
.mi-pmap-controls {
    display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 0.9rem;
}
.mi-pmap-controls label {
    display: block; font-size: 0.7rem; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.2rem;
}
.mi-pmap-controls select {
    background: #1e293b; color: #e2e8f0; border: 1px solid #334155;
    border-radius: 6px; padding: 0.35rem 0.55rem; font-size: 0.8rem;
}
.mi-pmap-canvas-wrap { max-width: 540px; margin: 0 auto; }
.mi-pmap-note {
    margin: 0.7rem 0 0; font-size: 0.72rem; color: #64748b; line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   Round debrief
   ═══════════════════════════════════════════════════ */
.db-card { margin-top: 0.5rem; }
.db-kpis { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0 1rem; }
.db-kpi {
    flex: 1 1 130px; background: #0f172a; border: 1px solid #1e293b;
    border-radius: 8px; padding: 0.65rem 0.8rem;
}
.db-kpi-label { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.db-kpi-value { font-size: 1.15rem; font-weight: 800; color: #e0e7ff; margin-top: 0.15rem; }
.db-kpi-change { font-size: 0.78rem; font-weight: 700; margin-top: 0.1rem; }
.db-up { color: #34d399; }
.db-down { color: #f87171; }
.db-flat { color: #64748b; font-weight: 500; }

.db-drivers { display: flex; flex-direction: column; gap: 0.6rem; }
.db-driver {
    background: #0f172a; border: 1px solid #1e293b;
    border-left: 3px solid #6366f1; border-radius: 8px; padding: 0.7rem 0.85rem;
}
/* Carries a full sentence now, not a model name, so no uppercase micro-type. */
.db-driver-head {
    font-size: 0.95rem; color: #e0e7ff; font-weight: 600;
    line-height: 1.5; margin-bottom: 0.55rem;
}
.db-seg {
    font-size: 0.75rem; color: #a5b4fc; font-weight: 500;
    background: #1e1b4b; border-radius: 999px; padding: 0.1rem 0.5rem;
    white-space: nowrap;
}
.db-model-note {
    margin-top: 0.5rem; font-size: 0.68rem; color: #475569;
    letter-spacing: 0.02em;
}
.db-chain { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.db-chain-part { font-size: 0.82rem; color: #e2e8f0; line-height: 1.55; }
.db-chain-label {
    display: block; font-size: 0.68rem; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.db-chain-part strong { color: #e0e7ff; margin-right: 0.3rem; }
.db-delta { color: #fbbf24; font-style: normal; font-weight: 700; margin-left: 0.3rem; }
.db-arrow { color: #475569; font-size: 1.1rem; }
.db-reading {
    margin-top: 0.5rem; font-size: 0.78rem; color: #cbd5e1;
    line-height: 1.5; border-top: 1px solid #1e293b; padding-top: 0.45rem;
}
.db-note { font-size: 0.83rem; color: #94a3b8; line-height: 1.6; margin: 0.5rem 0; }
.db-diagnostics { margin-top: 0.9rem; font-size: 0.78rem; color: #94a3b8; }
.db-diagnostics ul, .db-limits ul { margin: 0.4rem 0 0 1.1rem; padding: 0; }
.db-diagnostics li, .db-limits li { line-height: 1.6; margin-bottom: 0.2rem; }
.db-limits {
    margin-top: 0.9rem; border: 1px solid #334155;
    border-radius: 8px; padding: 0.5rem 0.85rem;
}
.db-limits summary { cursor: pointer; font-size: 0.78rem; font-weight: 700; color: #94a3b8; }
.db-limits summary:hover { color: #e2e8f0; }
.db-limits li { font-size: 0.78rem; color: #94a3b8; }
