/*
FROZEN JS-BOUND SELECTORS - DO NOT RENAME OR REMOVE.
IDs: #landingPage, #simulationPage, #endingPage, #startupForm, #restartButton, #playAgainButton, #tryStrategyButton, #themeButton, #howToPlayButton, #muteButton, #onboardingOverlay, #startSimulationButton, #dismissOnboardingButton, #decisionButtons, #decisionResultPanel, #decisionResultTitle, #decisionResultChanges, #decisionResultInsight, #continueWeekButton, #historyList, #overviewView, #timelineView, #teamView, #productView, #marketView, #achievementsView, #timelineDetailList, #trajectoryLabel, #summarySurvived, #summaryBestWeek, #summaryWorstWeek, #summaryGrowthMoment, #teamStatusLine, #teamSizeStat, #teamCostStat, #teamMoraleStat, #teamEfficiencyStat, #teamMoraleBar, #teamEfficiencyBar, #teamStrongText, #teamWeakText, #teamRolesList, #teamActionMessage, #productStatusLine, #productHealthBadge, #productQualityStat, #productStabilityStat, #productUxStat, #productFeatureStat, #productDebtStat, #productQualityBar, #productStabilityBar, #productUxBar, #productFeatureBar, #productDebtBar, #productMonetizationModel, #productMonetizationPrice, #productMonetizationNote, #productUpgradeList, #productActionMessage, #roadmapBacklog, #roadmapProgress, #roadmapShipped, #createProductButton, #createProductForm, #cancelProductButton, #productPortfolioList, #marketStatusLine, #marketFitBadge, #marketSizeStat, #marketDemandStat, #marketCompetitionStat, #marketDifferentiationStat, #marketPricingPowerStat, #marketPressureStat, #marketSizeBar, #marketDemandBar, #marketCompetitionBar, #marketDifferentiationBar, #marketPricingPowerBar, #marketPressureBar, #marketMonetizationModel, #marketMonetizationPrice, #marketMonetizationNote, #segmentOptions, #positioningOptions, #pricingOptions, #marketActionList, #marketActionMessage, #marketReportText, #marketWedgeText, #marketRiskText, #achievementRankLine, #achievementRankBadge, #achievementsUnlockedStat, #achievementsTotalStat, #achievementsCompletionStat, #achievementsCompletionBar, #achievementsRunStat, #achievementCategoryFilters, #achievementRarityFilters, #achievementStatusFilters, #achievementGrid, #achievementToast, #weekNumber, #companyName, #companyContext, #usersStat, #revenueStat, #cashStat, #growthStat, #burnStat, #runwayStat, #runwayStatPill, #reputationStat, #qualityStat, #streakStat, #runwayLabel, #reputationLabel, #qualityLabel, #runwayBar, #reputationBar, #qualityBar, #scenarioTitle, #scenarioText, #eventBadge, #historyCount, #insightText, #decisionWeekLabel, #profileName, #profileType, #profileStyle, #profileGoal, #runwayWarningText, #sideGrowthLabel, #sideUsersLabel, #sideInsightText, #nextEventLabel, #nextEventBar, #resultToast, #endingEyebrow, #endingTitle, #endingReason, #summaryWeeks, #summaryPeakUsers, #summaryRevenue, #summaryScore, #endingInsight, #keyDecisionsList, #endingAchievementsList, #ideaInput.
Classes used/toggled by JS: .dossier-nav button, .timeline-filters button, .is-hidden, .active, .ending-failure, .ending-success, .ending-unicorn, .runway-safe, .runway-warning, .runway-danger, .gain, .loss, .decision-button, .choice-positive, .choice-negative, .choice-risk, .achievement-toast, .timeline-entry, .current-entry, .timeline-empty, .timeline-detail-entry, .entry-win, .entry-loss, .entry-mixed, .latest-entry, .achievement-empty, .achievement-card, .unlocked, .locked, .bar-danger, .bar-risk, .bar-good, .team-role-row, .health-* classes, .product-upgrade-card, .product-entity-card, .paused, .fit-* classes, .market-choice, .market-action-card, .flash-positive, .flash-negative, .flash-risk, .result-toast, .result-good, .result-bad, .result-mixed.
Data attributes consumed by JS: data-view, data-filter, data-achievement-category, data-achievement-rarity, data-achievement-status, data-action, data-role, data-upgrade, data-product-action, data-product-id, data-market-kind, data-market-key, data-market-action.
Added run archive selectors: #saveRunButton, #newRunButton, #saveStartNewRunButton, #viewRunHistoryButton, #newRunOverlay, #confirmNewRunButton, #cancelNewRunButton, #runsView, #runsArchiveLine, #runsArchiveCount, #bestRunsPanel, #compareRunA, #compareRunB, #runCompareResult, #runHistoryList, .runs-view, .run-card, .run-actions, data-run-action, data-run-id.
Added balance selectors: #burnSourceTotal, #burnTeamSource, #burnProductSource, #burnMarketingSource, #burnOptionalSource, #burnSourceNote, #stopMarketingButton, #pauseDevelopmentButton, #cutCostsButton.
Added guide selectors: #guidedTip, .guided-tip, .guide-sections, .help-tip.
Added settings selectors: #settingsButton, #sidebarSettingsButton, #settingsPanel, .settings-menu, .settings-button, .settings-panel, .sidebar-settings-toggle, data-icon.
Added HUD visual selectors: #usersStatPill, #cashStatPill, #revenueStatPill, #burnStatPill, #reputationStatPill, #productStatPill, #growthStatPill, #streakStatPill, .hud-mini.
*/

:root {
  color-scheme: dark;
  --bg: #070b12;
  --paper: #111722;
  --paper-2: #161f2d;
  --paper-3: #0d131d;
  --ink: #f5f7fb;
  --muted: #9aa7b7;
  --line: #263244;
  --line-strong: #34445c;
  --green: #54d18a;
  --amber: #f0b84d;
  --red: #ee6f73;
  --blue: #72a7ff;
  --text: var(--ink);
  --mint: var(--green);
  --rose: var(--red);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --hud-bg: rgba(13, 19, 29, 0.86);
  --focus-ring: rgba(114, 167, 255, 0.18);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --paper: #ffffff;
  --paper-2: #f0f3f8;
  --paper-3: #e8edf5;
  --ink: #182235;
  --muted: #627088;
  --line: #d8e0ec;
  --line-strong: #bdc9d9;
  --green: #138a51;
  --amber: #b87608;
  --red: #c43d48;
  --blue: #2868ca;
  --text: var(--ink);
  --mint: var(--green);
  --rose: var(--red);
  --shadow: 0 16px 38px rgba(31, 41, 55, 0.12);
  --hud-bg: rgba(255, 255, 255, 0.82);
  --focus-ring: rgba(40, 104, 202, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body::before {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 18px;
}

.screen {
  min-height: calc(100vh - 96px);
}

.is-hidden {
  display: none !important;
}

.landing-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: center;
}

.brand-panel,
.setup-card {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.brand-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 42px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.brand-panel::before {
  display: none;
}

.brand-panel > * {
  position: relative;
}

.brand-mark {
  position: absolute;
  top: 42px;
  left: 42px;
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 10px;
}

.brand-mark span {
  display: block;
  width: 34px;
  height: 94px;
  border-radius: 4px;
  background: var(--blue);
}

.brand-mark span:nth-child(2) {
  height: 132px;
  background: var(--mint);
}

.brand-mark span:nth-child(3) {
  height: 62px;
  background: var(--amber);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 0.95;
}

.intro {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.setup-card {
  border-radius: 8px;
  padding: 28px;
}

label {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

label span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  background: var(--paper-3);
  color: var(--text);
  outline: none;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 22px,
    calc(100% - 13px) 22px;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.primary-button,
.ghost-button,
.icon-button,
.decision-button {
  border: 0;
  border-radius: 8px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  background: var(--blue);
  color: #05101e;
  font-weight: 900;
}

.primary-button:hover,
.decision-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.simulation-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: calc(100vh - 30px);
}

.game-hud {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(0, 2.8fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--hud-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.game-title {
  min-width: 0;
  border-right: 1px dashed var(--line);
  padding-right: 10px;
}

.game-title > span {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 3px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-title h1 {
  margin: 0 0 2px;
  font-size: 1.35rem;
  line-height: 1;
}

.context-line {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.ghost-button {
  min-width: 84px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.icon-button {
  min-width: 96px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
}

#howToPlayButton {
  min-width: 116px;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 8, 14, 0.72);
}

:root[data-theme="light"] .onboarding-overlay {
  background: rgba(16, 24, 38, 0.32);
}

.onboarding-modal {
  width: min(560px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.onboarding-modal h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.05;
}

.onboarding-modal p {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.onboarding-modal ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.5;
}

.onboarding-modal li::marker {
  color: var(--amber);
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 20px;
}

.onboarding-actions .primary-button,
.onboarding-actions .ghost-button {
  width: auto;
  margin-top: 0;
}

.onboarding-actions .ghost-button {
  min-height: 54px;
  padding: 0 16px;
}

.guide-sections {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.guide-sections section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--paper-2);
}

.guide-sections h3 {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-sections p,
.guide-sections ul {
  margin: 0;
}

.stats-bar {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.stats-bar::-webkit-scrollbar {
  display: none;
}

.stat-pill {
  flex: 1 0 88px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--paper-3);
}

.stat-pill span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-pill strong {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
  transition:
    color 180ms ease,
    transform 180ms ease,
    text-shadow 180ms ease;
}

.streak-pill {
  border-color: var(--line-strong);
  background: var(--paper-2);
}

.runway-pill {
  border-color: var(--line-strong);
}

.runway-safe strong {
  color: var(--mint);
}

.runway-warning {
  border-color: var(--amber);
  background: var(--paper-2);
}

.runway-warning strong {
  color: var(--amber);
}

.runway-danger {
  border-color: var(--rose);
  background: var(--paper-2);
}

.runway-danger strong {
  color: var(--rose);
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.progress-strip article {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 9px;
  background: var(--paper-3);
}

.progress-strip article > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.progress-strip strong {
  font-size: 0.82rem;
}

.meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-3);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 260ms ease;
}

.bar-good {
  background: var(--mint);
}

.bar-risk {
  background: var(--amber);
}

.bar-danger {
  background: var(--rose);
}

.sim-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
  min-height: 0;
}

.left-sidebar,
.right-sidebar,
.timeline-panel,
.decision-panel,
.side-card {
  border: 1px solid var(--line);
  background: var(--paper);
}

.left-sidebar,
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.left-sidebar {
  padding: 14px;
  border-radius: 16px;
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 12px;
}

.sidebar-brand > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper-3);
  color: var(--amber);
  font-weight: 900;
}

.sidebar-brand strong {
  display: block;
  line-height: 1;
}

.sidebar-brand p,
.profile-card p,
.side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.dossier-nav {
  display: grid;
  gap: 6px;
}

.dossier-nav button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: left;
}

.dossier-nav button.active {
  border-color: var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
}

.profile-card,
.side-card {
  border-radius: 14px;
  padding: 12px;
}

.profile-card {
  margin-top: auto;
  background: var(--paper-2);
}

.profile-card > p {
  margin-bottom: 10px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-card dl,
.metrics-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-card dl div,
.metrics-card dl div {
  display: grid;
  gap: 4px;
}

.profile-card dt,
.metrics-card dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-card dd,
.metrics-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.center-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.center-view {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
  gap: 14px;
  min-height: 0;
}

.right-sidebar {
  gap: 12px;
}

.side-card {
  background: var(--paper);
}

.side-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.side-card-header span {
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.side-card-header strong {
  color: var(--ink);
  font-size: 1rem;
}

.metrics-card dd {
  display: grid;
  gap: 6px;
}

.event-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-3);
}

.event-progress span {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
  transition: width 220ms ease;
}

.timeline-panel {
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  background: var(--paper-2);
}

.timeline-header div > span {
  display: block;
  min-width: 0;
  min-height: 0;
  margin-bottom: 2px;
  place-items: initial;
  border-radius: 0;
  background: transparent;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
}

.timeline-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.timeline-header > span {
  display: grid;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--amber);
  font-weight: 900;
}

.timeline-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 350px);
  min-height: 260px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  list-style: none;
  scroll-behavior: smooth;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  position: relative;
  animation: slide-in 220ms ease both;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: -12px;
  left: 31px;
  width: 1px;
  background: var(--line);
}

.timeline-entry > div:last-child {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 4px 14px 14px 4px;
  padding: 11px 12px;
  background: var(--paper-2);
}

.timeline-entry.current-entry > div:last-child {
  border-color: var(--amber);
  border-left-color: var(--amber);
  background: var(--paper-2);
}

.week-chip {
  align-self: start;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 6px 5px;
  background: var(--paper-3);
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
}

.timeline-entry mark {
  display: inline-flex;
  margin-bottom: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--paper-3);
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-entry strong {
  display: block;
  margin-bottom: 5px;
  line-height: 1.35;
}

.timeline-entry span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.timeline-entry small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  font-size: 0.76rem;
  line-height: 1.5;
}

.timeline-entry p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.decision-panel {
  position: relative;
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.decision-panel::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 5px;
  background: var(--amber);
}

.decision-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.decision-panel h2 {
  margin-bottom: 6px;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  line-height: 1.12;
}

.decision-panel > p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.report-kicker {
  margin: 0 0 8px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.event-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--paper-3);
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
}

.decision-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.decision-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 10px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 5px 15px 15px 5px;
  padding: 11px;
  background: var(--paper-3);
  color: var(--text);
  text-align: left;
}

.decision-button i {
  grid-row: span 3;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.decision-button.choice-positive {
  border-left-color: var(--mint);
}

.decision-button.choice-negative {
  border-left-color: var(--rose);
}

.decision-button.choice-risk {
  border-left-color: var(--amber);
}

.decision-button strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.96rem;
}

.decision-button span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.decision-button em {
  display: block;
  margin-top: 9px;
  color: var(--amber);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.decision-button:hover {
  border-color: var(--amber);
  background: var(--paper-2);
}

.decision-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.decision-result-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--amber);
  border-radius: 16px;
  padding: 13px;
  background: var(--paper);
  animation: slide-in 220ms ease both;
}

.decision-result-panel h3,
.decision-result-panel p {
  margin: 0;
}

.decision-result-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.decision-result-panel > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.decision-result-panel button {
  justify-self: start;
  border: 1px solid var(--amber);
  border-radius: 12px;
  padding: 10px 13px;
  background: var(--paper-3);
  color: var(--amber);
  font-weight: 900;
}

.timeline-view {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.timeline-view-header,
.timeline-summary-grid article,
.timeline-detail-entry article,
.timeline-empty {
  border: 1px solid var(--line);
  background: var(--paper);
}

.timeline-view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  border-radius: 16px;
  padding: 14px;
}

.timeline-view-header h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.timeline-view-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.timeline-filters button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--paper-3);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.timeline-filters button.active {
  border-color: var(--amber);
  color: var(--ink);
  background: var(--paper-2);
}

.timeline-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.timeline-summary-grid article {
  border-radius: 14px;
  padding: 12px;
}

.timeline-summary-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-summary-grid strong {
  font-size: 1rem;
}

.timeline-detail-list {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 0;
  max-height: calc(100vh - 360px);
  margin: 0;
  padding: 6px 0 6px 22px;
  overflow: auto;
  list-style: none;
}

.timeline-detail-list::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 34px;
  width: 2px;
  background: var(--line-strong);
}

.timeline-detail-entry {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.timeline-node {
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--amber);
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 900;
}

.timeline-detail-entry article {
  border-left: 4px solid var(--line-strong);
  border-radius: 6px 16px 16px 6px;
  padding: 13px;
}

.timeline-detail-entry.latest-entry article {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.timeline-detail-entry.entry-win article {
  border-left-color: var(--mint);
}

.timeline-detail-entry.entry-loss article {
  border-left-color: var(--rose);
}

.timeline-detail-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.timeline-detail-top span,
.timeline-detail-top mark {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-detail-top span {
  color: var(--amber);
}

.timeline-detail-top mark {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--paper-3);
  color: var(--ink);
}

.timeline-detail-entry h3 {
  margin: 0 0 7px;
  font-size: 1.05rem;
}

.timeline-detail-entry p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.timeline-detail-entry .decision-line {
  color: var(--ink);
  font-weight: 800;
}

.timeline-detail-entry .outcome-line {
  margin-top: 5px;
}

.timeline-detail-entry small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
  line-height: 1.5;
}

.timeline-empty {
  border-radius: 16px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.team-view,
.product-view,
.market-view,
.achievements-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header,
.team-overview-grid article,
.product-overview-grid article,
.market-overview-grid article,
.achievement-overview-grid article,
.team-impact-panel,
.team-roles-panel,
.team-role-row,
.monetization-summary,
.product-upgrades-panel,
.roadmap-panel,
.product-upgrade-card,
.product-portfolio-panel,
.product-entity-card,
.market-choice-panel,
.market-actions-panel,
.market-report-panel,
.market-action-card,
.achievement-controls,
.achievement-card,
.achievement-empty {
  border: 1px solid var(--line);
  background: var(--paper);
}

.monetization-summary {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(100px, 0.25fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 16px;
  padding: 12px;
}

.monetization-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.monetization-summary strong {
  font-size: 1rem;
}

.monetization-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-radius: 16px;
  padding: 14px;
}

.team-view-header h2,
.product-view-header h2,
.market-view-header h2,
.achievements-view-header h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.team-view-header span,
.product-view-header span,
.market-view-header span,
.achievements-view-header span {
  color: var(--muted);
}

.team-overview-grid,
.product-overview-grid,
.market-overview-grid,
.achievement-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.market-overview-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.team-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-overview-grid article,
.product-overview-grid article,
.market-overview-grid article,
.achievement-overview-grid article {
  border-radius: 14px;
  padding: 12px;
}

.team-overview-grid span,
.product-overview-grid span,
.market-overview-grid span,
.achievement-overview-grid span,
.team-impact-panel span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-overview-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.product-overview-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.market-overview-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.achievement-overview-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.product-view-header > strong,
.market-view-header > strong,
.achievements-view-header > strong {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--paper-3);
  color: var(--mint);
  font-size: 0.9rem;
}

.product-view-header > strong.health-fragile {
  color: var(--amber);
}

.product-view-header > strong.health-broken {
  color: var(--rose);
}

.market-view-header > strong.fit-weak-fit {
  color: var(--rose);
}

.market-view-header > strong.fit-emerging-fit {
  color: var(--amber);
}

.market-view-header > strong.fit-strong-fit,
.market-view-header > strong.fit-category-leader {
  color: var(--mint);
}

.achievement-controls {
  display: grid;
  gap: 10px;
  border-radius: 16px;
  padding: 12px;
}

.achievement-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.achievement-filter-group button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--paper-3);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.achievement-filter-group button.active {
  border-color: var(--amber);
  color: var(--ink);
  background: var(--paper-2);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  min-height: 0;
  max-height: calc(100vh - 430px);
  overflow: auto;
}

.achievement-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border-radius: 16px;
  padding: 13px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.achievement-card.unlocked {
  border-color: var(--line-strong);
}

.achievement-card.locked {
  opacity: 0.58;
}

.achievement-card:hover {
  transform: translateY(-2px);
}

.achievement-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-3);
  color: var(--amber);
  font-weight: 900;
}

.achievement-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.achievement-card-top span,
.achievement-card-top mark,
.achievement-card small {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.achievement-card-top span {
  color: var(--amber);
}

.achievement-card-top mark {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--paper-3);
  color: var(--ink);
}

.achievement-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.achievement-card p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.achievement-card small {
  color: var(--muted);
}

.rarity-common {
  --rarity-color: var(--mint);
}

.rarity-rare {
  --rarity-color: var(--blue);
}

.rarity-epic {
  --rarity-color: var(--amber);
}

.rarity-legendary {
  --rarity-color: #ff8a4c;
}

.achievement-card.unlocked,
.achievement-toast,
.ending-achievement-pill {
  border-color: var(--rarity-color);
}

.achievement-card.unlocked .achievement-icon,
.achievement-card.unlocked .achievement-card-top mark,
.achievement-toast strong,
.ending-achievement-pill {
  color: var(--rarity-color);
}

.achievement-empty {
  grid-column: 1 / -1;
  border-radius: 16px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.product-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
  min-height: 0;
}

.product-portfolio-panel {
  display: grid;
  gap: 12px;
}

.product-portfolio-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.product-portfolio-heading button,
.create-product-actions button,
.product-entity-actions button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--paper-3);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.product-portfolio-heading button {
  border-color: var(--amber);
  color: var(--amber);
}

.create-product-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--paper-2);
}

.create-product-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.create-product-form input,
.create-product-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--paper-3);
  color: var(--ink);
}

.create-product-actions {
  display: flex;
  gap: 7px;
}

.product-portfolio-list,
.product-entity-card {
  display: grid;
  gap: 12px;
}

.product-entity-card {
  border-radius: 16px;
  padding: 13px;
}

.product-entity-card.paused {
  opacity: 0.62;
}

.product-entity-top,
.product-entity-stats,
.product-entity-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.product-entity-top span,
.product-entity-top mark,
.product-entity-stats span,
.product-entity-bars label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-entity-top h3 {
  margin: 3px 0 0;
  font-size: 1.05rem;
}

.product-entity-top mark {
  align-self: start;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--paper-3);
  color: var(--mint);
}

.product-entity-stats {
  justify-content: flex-start;
}

.product-entity-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--paper-3);
}

.product-entity-stats b {
  color: var(--ink);
}

.product-entity-stats .price-fair b {
  color: var(--mint);
}

.product-entity-stats .price-expensive b {
  color: var(--amber);
}

.product-entity-stats .price-too-expensive b {
  color: var(--rose);
}

.product-entity-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.product-entity-bars label {
  display: grid;
  gap: 5px;
}

.product-entity-bars i {
  color: var(--ink);
  font-style: normal;
}

.market-strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.market-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
  min-height: 0;
}

.product-upgrades-panel,
.roadmap-panel,
.product-portfolio-panel,
.market-choice-panel,
.market-actions-panel,
.market-report-panel {
  border-radius: 16px;
  padding: 12px;
}

.panel-heading {
  margin-bottom: 12px;
}

.panel-heading span {
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-upgrade-list {
  display: grid;
  gap: 10px;
}

.market-choice-list,
.market-action-list,
.market-report-list {
  display: grid;
  gap: 10px;
}

.product-upgrade-card,
.market-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 12px;
}

.product-upgrade-card strong,
.product-upgrade-card span,
.product-upgrade-card em,
.market-action-card strong,
.market-action-card span,
.market-action-card em {
  display: block;
}

.product-upgrade-card span,
.market-action-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-upgrade-card em,
.market-action-card em {
  margin-top: 5px;
  color: var(--amber);
  font-style: normal;
  font-weight: 900;
}

.product-upgrade-card button,
.market-action-card button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--paper-3);
  color: var(--mint);
  font-weight: 900;
}

.product-upgrade-card button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  color: var(--muted);
}

.market-choice {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: var(--paper-3);
  color: var(--ink);
  text-align: left;
}

.market-choice.active {
  border-color: var(--amber);
  background: var(--paper-2);
}

.market-choice i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.market-choice strong,
.market-choice span {
  display: block;
}

.market-choice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.market-report-list article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--paper-3);
}

.market-report-list h3 {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.market-report-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.roadmap-columns {
  display: grid;
  gap: 10px;
}

.roadmap-columns article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--paper-3);
}

.roadmap-columns h3 {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.roadmap-columns ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
}

.roadmap-columns li strong,
.roadmap-columns li small {
  display: block;
}

.roadmap-progress {
  height: 7px;
  margin: 6px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper);
}

.roadmap-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}

.team-impact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-radius: 14px;
  padding: 12px;
}

.team-impact-panel p,
.team-action-message {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.team-roles-panel {
  border-radius: 16px;
  padding: 12px;
  min-height: 0;
}

.team-roles-list {
  display: grid;
  gap: 10px;
}

.team-role-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px auto;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 12px;
}

.role-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper-3);
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
}

.role-copy strong,
.role-copy span,
.role-copy em {
  display: block;
}

.role-copy strong {
  margin-bottom: 3px;
}

.role-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.role-copy em {
  margin-top: 4px;
  color: var(--amber);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.role-count {
  display: grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 900;
}

.role-actions {
  display: flex;
  gap: 7px;
}

.role-actions button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--paper-3);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.role-actions button:first-child {
  border-color: var(--mint);
  color: var(--mint);
}

.role-actions button:last-child {
  border-color: var(--rose);
  color: var(--rose);
}

.team-action-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--amber);
  font-size: 0.9rem;
}

.insight-card {
  display: flex;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: var(--paper-2);
}

.insight-card strong {
  color: var(--amber);
  font-size: 0.82rem;
}

.insight-card span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.guided-tip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 720px;
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(74, 158, 255, 0.08);
  color: var(--accent-blue);
  font-size: 0.82rem;
  font-weight: 800;
}

.help-tip {
  position: relative;
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0;
  background: var(--paper-3);
  color: var(--amber);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.68rem;
  line-height: 1;
  vertical-align: middle;
}

.help-tip::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: min(220px, 72vw);
  transform: translateX(-50%) translateY(4px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 9px;
  background: var(--paper);
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.16);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fit-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.delta-positive {
  color: var(--mint);
}

.delta-negative {
  color: var(--rose);
}

.delta-neutral {
  color: var(--muted);
}

.flash-positive {
  color: var(--mint);
  transform: scale(1.09);
}

.flash-negative {
  color: var(--rose);
  transform: scale(1.09);
}

.flash-risk {
  color: var(--amber);
  transform: scale(1.06);
}

.result-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: min(620px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: toast-pop 260ms ease both;
}

.result-toast span {
  font-size: 0.9rem;
  font-weight: 900;
}

.result-good {
  border-color: var(--mint);
}

.result-bad {
  border-color: var(--rose);
}

.result-mixed {
  border-color: var(--amber);
}

.achievement-toast {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 35;
  display: grid;
  gap: 3px;
  min-width: min(320px, calc(100% - 36px));
  border: 1px solid var(--amber);
  border-radius: 16px;
  padding: 13px 15px;
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: achievement-unlock 320ms ease both;
}

.achievement-toast span,
.achievement-toast small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.achievement-toast strong {
  font-size: 1.02rem;
}

.ending-screen {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: calc(100vh - 56px);
}

.ending-card {
  width: min(920px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.ending-failure {
  background: var(--bg);
}

.ending-failure .ending-card {
  border-color: var(--rose);
  background: var(--paper);
}

.ending-failure .eyebrow,
.ending-failure .ending-card h1 {
  color: var(--rose);
}

.ending-success .ending-card {
  border-color: var(--mint);
}

.ending-unicorn .ending-card {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.ending-card h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 28px 0;
}

.summary-grid article {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--paper-2);
  box-shadow: none;
}

.summary-grid span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.summary-grid strong {
  font-size: clamp(1.6rem, 4vw, 2.7rem);
}

.ending-insight {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.key-decisions {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--paper-2);
}

.key-decisions h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.key-decisions ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.key-decisions li::marker {
  color: var(--amber);
  font-weight: 900;
}

.key-decisions strong,
.key-decisions span {
  display: block;
}

.key-decisions span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.ending-achievements {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--paper-2);
}

.ending-achievements h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.ending-achievements p {
  margin: 0 0 10px;
  color: var(--muted);
}

.ending-achievements div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ending-achievement-pill {
  border: 1px solid var(--rarity-color);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--paper-3);
  font-size: 0.78rem;
  font-weight: 900;
}

.ending-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gain {
  color: var(--mint);
}

.loss {
  color: var(--rose);
}

.delta-positive,
.delta-negative,
.delta-neutral {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--paper-3);
  font-weight: 900;
  animation: delta-pop 220ms ease both;
}

.delta-positive {
  color: var(--mint);
}

.delta-negative {
  color: var(--rose);
}

.delta-neutral {
  color: var(--muted);
}

.money-change i,
.delta-positive i,
.delta-negative i,
.delta-neutral i {
  font-style: normal;
  line-height: 1;
}

.money-in {
  box-shadow: 0 0 0 1px rgba(84, 209, 138, 0.12);
}

.money-out {
  box-shadow: 0 0 0 1px rgba(238, 111, 115, 0.12);
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes delta-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes achievement-unlock {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 18px, 720px);
    padding: 12px 0;
  }

  .landing-screen,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 430px;
    padding: 28px;
  }

  .brand-mark {
    top: 28px;
    left: 28px;
  }

  .game-hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  .game-title {
    grid-column: 1 / -1;
    border-right: 0;
    padding: 0;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  .sim-layout {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    order: 1;
  }

  .center-stage {
    order: 2;
  }

  .right-sidebar {
    order: 3;
  }

  .dossier-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-card dl,
  .metrics-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-hud > .icon-button,
  .game-hud > .ghost-button {
    align-self: start;
    width: 100%;
    min-width: 0;
  }

  #themeButton {
    grid-column: 1;
    grid-row: 2;
  }

  #howToPlayButton {
    grid-column: 2;
    grid-row: 2;
  }

  #muteButton {
    grid-column: 3;
    grid-row: 2;
  }

  .game-hud > .ghost-button {
    grid-column: 4;
    grid-row: 2;
  }

  .progress-strip,
  .decision-list {
    grid-template-columns: 1fr;
  }

  .timeline-view-header {
    grid-template-columns: 1fr;
  }

  .timeline-filters {
    justify-content: flex-start;
  }

  .timeline-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-overview-grid,
  .team-impact-panel,
  .monetization-summary,
  .product-overview-grid,
  .product-lab-grid,
  .create-product-form,
  .product-entity-bars,
  .market-overview-grid,
  .achievement-overview-grid,
  .market-strategy-grid,
  .market-lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-role-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .role-count,
  .role-actions {
    grid-column: 2;
  }

  .ending-actions {
    grid-template-columns: 1fr;
  }

  .timeline-list {
    max-height: 42vh;
  }
}

@media (max-width: 520px) {
  .brand-panel,
  .setup-card,
  .ending-card,
  .summary-grid article {
    padding: 18px;
  }

  h1 {
    font-size: 2.7rem;
  }

  .brand-mark {
    grid-template-columns: repeat(3, 24px);
  }

  .brand-mark span {
    width: 24px;
  }

  .stats-bar {
    width: 100%;
  }

  .stat-pill {
    flex-basis: 84px;
  }

  .timeline-entry {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 7px;
  }

  .decision-panel {
    padding: 12px;
  }

  .dossier-nav,
  .profile-card dl,
  .metrics-card dl,
  .timeline-summary-grid,
  .team-overview-grid,
  .team-impact-panel,
  .monetization-summary,
  .product-overview-grid,
  .product-lab-grid,
  .create-product-form,
  .product-entity-bars,
  .market-overview-grid,
  .achievement-overview-grid,
  .market-strategy-grid,
  .market-lab-grid,
  .product-upgrade-card,
  .market-action-card,
  .achievement-card {
    grid-template-columns: 1fr;
  }

  .onboarding-modal {
    padding: 18px;
  }

  .onboarding-actions {
    grid-template-columns: 1fr;
  }

  .timeline-detail-list {
    padding-left: 0;
  }

  .timeline-detail-list::before {
    left: 14px;
  }

  .timeline-detail-entry {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }
}

/* === REVAMP STYLES: FINAL OVERRIDES === */
:root {
  --bg-primary: #080a0e;
  --bg-secondary: #0d1117;
  --bg-tertiary: #141920;
  --border-color: #1e2a38;
  --accent-primary: #f5a623;
  --accent-green: #00ff9c;
  --accent-red: #ff4444;
  --accent-blue: #4a9eff;
  --text-primary: #e8edf2;
  --text-secondary: #7a8899;
  --text-muted: #3d4f63;
  --bg: var(--bg-primary);
  --paper: var(--bg-secondary);
  --paper-2: var(--bg-tertiary);
  --paper-3: #090d13;
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-color);
  --line-strong: rgba(245, 166, 35, 0.38);
  --green: var(--accent-green);
  --amber: var(--accent-primary);
  --red: var(--accent-red);
  --blue: var(--accent-blue);
  --mint: var(--accent-green);
  --rose: var(--accent-red);
  --text: var(--text-primary);
  --shadow: 0 0 0 1px rgba(245, 166, 35, 0.08), 0 0 18px rgba(245, 166, 35, 0.1);
  --hud-bg: rgba(8, 10, 14, 0.94);
  --focus-ring: rgba(245, 166, 35, 0.16);
  --panel-cut: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

:root[data-theme="light"],
:root.light-mode {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e4e8ef;
  --border-color: #c8d0da;
  --accent-primary: #d4870a;
  --text-primary: #0d1117;
  --text-secondary: #4a5568;
  --text-muted: #8290a3;
  --paper-3: #f8fafc;
  --line-strong: rgba(212, 135, 10, 0.42);
  --shadow: 0 0 0 1px rgba(212, 135, 10, 0.12), 0 0 18px rgba(212, 135, 10, 0.1);
  --hud-bg: rgba(255, 255, 255, 0.94);
  --focus-ring: rgba(212, 135, 10, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(245, 166, 35, 0.08), transparent 30%),
    linear-gradient(rgba(245, 166, 35, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 166, 35, 0.025) 1px, transparent 1px),
    var(--bg-primary);
  background-size: auto, 28px 28px, 28px 28px, auto;
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.08;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(245, 166, 35, 0.34) 4px);
  mix-blend-mode: screen;
}

* {
  scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

*::selection {
  background: var(--accent-primary);
  color: #050608;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.35), var(--accent-primary));
}

button,
input,
select,
textarea {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

h1,
h2,
h3,
.game-title h1,
.timeline-header h2,
.decision-panel h2,
.team-view-header h2,
.product-view-header h2,
.market-view-header h2,
.achievements-view-header h2,
.timeline-view-header h2,
.panel-heading span,
.side-card-header span,
.dossier-nav button,
.primary-button,
.ghost-button,
.icon-button {
  font-family: "Rajdhani", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.stat-pill strong,
.stat-pill span,
.week-chip,
.report-kicker,
.event-badge,
.profile-card dt,
.profile-card dd,
.metrics-card dt,
.metrics-card dd,
.timeline-entry mark,
.timeline-detail-top span,
.timeline-detail-top mark,
.timeline-summary-grid span,
.timeline-summary-grid strong,
.team-overview-grid span,
.team-overview-grid strong,
.product-overview-grid span,
.product-overview-grid strong,
.market-overview-grid span,
.market-overview-grid strong,
.achievement-overview-grid span,
.achievement-overview-grid strong,
.decision-button i,
.decision-button em,
.delta-positive,
.delta-negative,
.delta-neutral,
.money-change,
#runwayLabel,
#nextEventLabel,
#sideGrowthLabel,
#sideUsersLabel {
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.app-shell {
  width: min(1720px, calc(100% - 22px));
  padding: 10px 0 18px;
}

.landing-screen {
  position: relative;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.78fr);
  gap: 20px;
  min-height: calc(100vh - 24px);
}

.landing-screen::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -1;
  opacity: 0.42;
  background:
    radial-gradient(circle, rgba(245, 166, 35, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, transparent 49%, rgba(74, 158, 255, 0.06) 50%, transparent 51%);
  background-size: 22px 22px, 90px 90px;
  animation: hudGridDrift 16s linear infinite;
}

.brand-panel,
.setup-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background: linear-gradient(145deg, rgba(20, 25, 32, 0.98), rgba(8, 10, 14, 0.98));
  box-shadow: var(--shadow);
  clip-path: var(--panel-cut);
}

:root[data-theme="light"] .brand-panel,
:root[data-theme="light"] .setup-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(228, 232, 239, 0.98));
}

.brand-panel::before,
.brand-panel::after,
.setup-card::before,
.setup-card::after {
  content: "";
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
  border-color: rgba(245, 166, 35, 0.56);
}

.brand-panel::before,
.setup-card::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.brand-panel::after,
.setup-card::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.setup-card::before {
  content: "[ CONFIGURE YOUR STARTUP ]";
  width: auto;
  height: auto;
  top: 18px;
  left: 24px;
  border: 0;
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.setup-card {
  padding-top: 62px;
}

.brand-mark {
  grid-template-columns: repeat(3, 22px);
  gap: 8px;
}

.brand-mark span {
  width: 22px;
  border-radius: 2px;
  box-shadow: 0 0 16px currentColor;
  animation: powerPulse 2.8s ease-in-out infinite;
}

.brand-mark span:nth-child(1) {
  color: var(--accent-blue);
  background: var(--accent-blue);
}

.brand-mark span:nth-child(2) {
  color: var(--accent-green);
  background: var(--accent-green);
  animation-delay: 0.2s;
}

.brand-mark span:nth-child(3) {
  color: var(--accent-primary);
  background: var(--accent-primary);
  animation-delay: 0.4s;
}

.eyebrow {
  color: var(--accent-primary);
  font-family: "Share Tech Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
}

.brand-panel .eyebrow::before,
.brand-panel .eyebrow::after {
  content: "◈";
  margin: 0 8px 0 0;
}

.brand-panel .eyebrow::after {
  margin: 0 0 0 8px;
}

.brand-panel h1 {
  color: var(--text-primary);
  font-family: "Rajdhani", ui-sans-serif, system-ui, sans-serif;
  text-shadow: 0 0 22px rgba(245, 166, 35, 0.25);
  text-transform: uppercase;
}

.intro,
.setup-card label span,
label {
  color: var(--text-secondary);
}

label span,
.create-product-form label {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

label span::before,
.create-product-form label::before {
  content: "▶";
  margin-right: 7px;
  color: var(--accent-primary);
  font-size: 0.72rem;
}

input,
select,
textarea {
  border-color: var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent-primary) 50%),
    linear-gradient(135deg, var(--accent-primary) 50%, transparent 50%);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.28), 0 0 15px rgba(245, 166, 35, 0.14);
}

.primary-button {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: var(--accent-primary);
  color: #080a0e;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transition: transform 0.5s ease;
}

.primary-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0 20px rgba(245, 166, 35, 0.24);
}

.primary-button:hover::after {
  transform: translateX(120%) skewX(-18deg);
}

.game-hud {
  top: 0;
  z-index: 30;
  grid-template-columns: minmax(210px, 0.78fr) auto minmax(0, 3fr) auto auto auto auto;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid rgba(245, 166, 35, 0.4);
  border-radius: 0;
  padding: 9px 10px;
  background: var(--hud-bg);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22), 0 0 18px rgba(245, 166, 35, 0.1);
  backdrop-filter: blur(12px);
}

.game-title {
  border-right: 1px solid rgba(245, 166, 35, 0.22);
  padding-right: 12px;
}

.game-title > span {
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.16em;
}

.game-title h1 {
  color: var(--text-primary);
  font-size: 1.25rem;
}

.context-line {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.mobile-stats-toggle,
.mobile-more-stats {
  display: none;
}

.stats-bar {
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

.stat-pill {
  position: relative;
  flex-basis: 94px;
  border-color: var(--border-color);
  border-radius: 0;
  padding: 8px 9px;
  background: linear-gradient(180deg, rgba(20, 25, 32, 0.96), rgba(8, 10, 14, 0.92));
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

:root[data-theme="light"] .stat-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(228, 232, 239, 0.92));
}

.stat-pill::after {
  content: "";
  position: absolute;
  top: 8px;
  right: -4px;
  width: 1px;
  height: calc(100% - 16px);
  background: rgba(245, 166, 35, 0.22);
}

.stat-pill span {
  color: var(--text-muted);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

.stat-pill strong {
  color: var(--text-primary);
  font-family: "Share Tech Mono", monospace;
  font-size: 1.18rem;
}

.week-pill strong,
#weekNumber {
  color: var(--accent-primary);
}

#revenueStat,
#cashStat,
#growthStat,
.gain {
  color: var(--accent-green);
}

#burnStat {
  color: var(--accent-red);
}

#reputationStat {
  color: var(--accent-blue);
}

.loss {
  color: var(--accent-red);
}

.runway-safe strong {
  color: var(--accent-green);
}

.runway-warning strong {
  color: var(--accent-primary);
}

.runway-danger strong {
  color: var(--accent-red);
}

.icon-button,
.ghost-button {
  position: relative;
  min-width: 88px;
  border: 1px solid rgba(245, 166, 35, 0.44);
  border-radius: 2px;
  background: rgba(13, 17, 23, 0.96);
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.05em;
}

:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .ghost-button {
  background: #fff;
}

#themeButton::before {
  content: "☀ ";
}

#muteButton::before {
  content: "♪ ";
}

#restartButton::before,
#playAgainButton::before {
  content: "↺ ";
}

.icon-button:hover,
.ghost-button:hover {
  color: #080a0e;
  background: var(--accent-primary);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.25);
}

.settings-menu {
  position: relative;
  justify-self: end;
}

.settings-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(245, 166, 35, 0.5);
  border-radius: 2px;
  background: rgba(13, 17, 23, 0.96);
  color: var(--accent-primary);
  font-size: 1rem;
}

.settings-button:hover,
.settings-button[aria-expanded="true"] {
  color: #080a0e;
  background: var(--accent-primary);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.25);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 190px;
  gap: 8px;
  border: 1px solid var(--border-color);
  padding: 10px;
  background: var(--bg-secondary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32), 0 0 14px rgba(245, 166, 35, 0.12);
}

.settings-panel .icon-button,
.settings-panel .ghost-button {
  width: 100%;
  min-width: 0;
  justify-content: start;
  text-align: left;
}

:root[data-theme="light"] .settings-button,
:root[data-theme="light"] .settings-panel {
  background: #fff;
}

.sim-layout {
  grid-template-columns: 240px minmax(0, 1fr) minmax(310px, 360px);
  gap: 10px;
}

.left-sidebar,
.right-sidebar,
.timeline-panel,
.decision-panel,
.side-card,
.timeline-view-header,
.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header,
.team-overview-grid article,
.product-overview-grid article,
.market-overview-grid article,
.achievement-overview-grid article,
.team-impact-panel,
.team-roles-panel,
.team-role-row,
.monetization-summary,
.product-upgrades-panel,
.roadmap-panel,
.product-upgrade-card,
.product-portfolio-panel,
.product-entity-card,
.market-choice-panel,
.market-actions-panel,
.market-report-panel,
.market-action-card,
.achievement-controls,
.achievement-card,
.timeline-summary-grid article,
.timeline-detail-entry article,
.decision-result-panel,
.timeline-empty {
  border-color: var(--border-color);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(20, 25, 32, 0.98), rgba(13, 17, 23, 0.98));
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.02);
}

:root[data-theme="light"] .left-sidebar,
:root[data-theme="light"] .right-sidebar,
:root[data-theme="light"] .timeline-panel,
:root[data-theme="light"] .decision-panel,
:root[data-theme="light"] .side-card,
:root[data-theme="light"] .timeline-view-header,
:root[data-theme="light"] .team-view-header,
:root[data-theme="light"] .product-view-header,
:root[data-theme="light"] .market-view-header,
:root[data-theme="light"] .achievements-view-header,
:root[data-theme="light"] .team-overview-grid article,
:root[data-theme="light"] .product-overview-grid article,
:root[data-theme="light"] .market-overview-grid article,
:root[data-theme="light"] .achievement-overview-grid article,
:root[data-theme="light"] .team-impact-panel,
:root[data-theme="light"] .team-roles-panel,
:root[data-theme="light"] .team-role-row,
:root[data-theme="light"] .monetization-summary,
:root[data-theme="light"] .product-upgrades-panel,
:root[data-theme="light"] .roadmap-panel,
:root[data-theme="light"] .product-upgrade-card,
:root[data-theme="light"] .product-portfolio-panel,
:root[data-theme="light"] .product-entity-card,
:root[data-theme="light"] .market-choice-panel,
:root[data-theme="light"] .market-actions-panel,
:root[data-theme="light"] .market-report-panel,
:root[data-theme="light"] .market-action-card,
:root[data-theme="light"] .achievement-controls,
:root[data-theme="light"] .achievement-card,
:root[data-theme="light"] .timeline-summary-grid article,
:root[data-theme="light"] .timeline-detail-entry article,
:root[data-theme="light"] .decision-result-panel,
:root[data-theme="light"] .timeline-empty {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(228, 232, 239, 0.98));
}

.left-sidebar,
.timeline-panel,
.decision-panel,
.side-card,
.team-overview-grid article,
.product-overview-grid article,
.market-overview-grid article,
.achievement-overview-grid article,
.team-impact-panel,
.monetization-summary,
.team-role-row,
.product-upgrade-card,
.product-entity-card,
.market-action-card,
.achievement-card {
  clip-path: var(--panel-cut);
}

.sidebar-brand {
  position: relative;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(245, 166, 35, 0.24);
}

.sidebar-brand::after {
  content: "◆";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  color: var(--accent-primary);
  font-size: 0.72rem;
  background: var(--bg-secondary);
  padding: 0 8px;
}

.sidebar-brand > span {
  width: 48px;
  height: 48px;
  border-color: rgba(245, 166, 35, 0.72);
  border-radius: 0;
  background: rgba(245, 166, 35, 0.12);
  color: var(--accent-primary);
  clip-path: polygon(24% 0, 76% 0, 100% 28%, 100% 72%, 76% 100%, 24% 100%, 0 72%, 0 28%);
  font-family: "Share Tech Mono", monospace;
  text-shadow: 0 0 12px rgba(245, 166, 35, 0.42);
}

.sidebar-brand strong {
  color: var(--text-primary);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-brand p {
  display: inline-flex;
  margin-top: 6px;
  border: 1px solid rgba(245, 166, 35, 0.24);
  padding: 2px 7px;
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.dossier-nav {
  gap: 4px;
}

.dossier-nav button {
  position: relative;
  min-height: 44px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 10px 12px 10px 14px;
  background: rgba(8, 10, 14, 0.32);
  color: var(--text-secondary);
}

.dossier-nav button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.12), transparent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.dossier-nav button:hover,
.dossier-nav button.active {
  border-left-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(245, 166, 35, 0.06);
}

.dossier-nav button:hover::after,
.dossier-nav button.active::after {
  opacity: 1;
}

.profile-card {
  border: 1px solid var(--border-color);
  border-radius: 0;
  background: rgba(8, 10, 14, 0.36);
  clip-path: var(--panel-cut);
}

.profile-card > p {
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
}

.profile-card dl {
  gap: 0;
  border-top: 1px solid var(--border-color);
}

.profile-card dl div {
  grid-template-columns: 0.7fr 1fr;
  gap: 8px;
  border-bottom: 1px solid rgba(30, 42, 56, 0.72);
  padding: 8px 0;
}

.profile-card dt {
  color: var(--text-muted);
}

.profile-card dd {
  color: var(--text-primary);
  text-align: right;
}

.center-view {
  grid-template-rows: minmax(280px, 0.92fr) auto;
}

.timeline-header,
.panel-heading,
.side-card-header,
.timeline-view-header,
.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header {
  position: relative;
  background:
    repeating-linear-gradient(180deg, rgba(245, 166, 35, 0.035) 0 2px, transparent 2px 5px),
    var(--bg-tertiary);
}

.timeline-header {
  border-bottom-color: rgba(245, 166, 35, 0.28);
}

.timeline-header div > span,
.side-card-header span,
.panel-heading span {
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
}

.timeline-header div > span::before,
.eyebrow::before,
.side-card-header span::before,
.panel-heading span::before {
  content: "■";
  margin-right: 8px;
  color: var(--accent-primary);
  font-size: 0.58rem;
}

.timeline-header h2,
.timeline-view-header h2,
.team-view-header h2,
.product-view-header h2,
.market-view-header h2,
.achievements-view-header h2 {
  color: var(--accent-primary);
}

.timeline-header h2::before,
.timeline-view-header h2::before,
.team-view-header h2::before,
.product-view-header h2::before,
.market-view-header h2::before,
.achievements-view-header h2::before {
  content: "[ ";
  color: var(--text-secondary);
}

.timeline-header h2::after,
.timeline-view-header h2::after,
.team-view-header h2::after,
.product-view-header h2::after,
.market-view-header h2::after,
.achievements-view-header h2::after {
  content: " ]";
  color: var(--text-secondary);
}

.timeline-header > span,
#historyCount {
  border-radius: 0;
  border: 1px solid rgba(245, 166, 35, 0.4);
  background: rgba(245, 166, 35, 0.08);
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
}

.timeline-entry {
  animation: fadeSlideUp 0.32s ease both;
}

.timeline-entry::before {
  background: rgba(245, 166, 35, 0.22);
}

.week-chip {
  border-color: rgba(245, 166, 35, 0.42);
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.06);
  color: var(--accent-primary);
}

.timeline-entry.current-entry .week-chip {
  animation: currentPulse 1.6s ease-in-out infinite;
}

.timeline-entry > div:last-child,
.timeline-detail-entry article {
  border-left-color: var(--accent-primary);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.055), rgba(20, 25, 32, 0.96));
}

:root[data-theme="light"] .timeline-entry > div:last-child,
:root[data-theme="light"] .timeline-detail-entry article {
  background: linear-gradient(90deg, rgba(212, 135, 10, 0.08), rgba(255, 255, 255, 0.96));
}

.timeline-entry mark {
  border-color: rgba(245, 166, 35, 0.38);
  border-radius: 0;
  background: rgba(245, 166, 35, 0.08);
  color: var(--accent-primary);
}

.timeline-entry mark::before {
  content: "[ ";
}

.timeline-entry mark::after {
  content: " ]";
}

.timeline-entry strong,
.decision-panel h2,
.timeline-detail-entry h3 {
  color: var(--text-primary);
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
}

.timeline-entry span,
.timeline-entry p,
.timeline-detail-entry p,
.decision-panel > p,
.decision-button span {
  color: var(--text-secondary);
}

.decision-panel {
  border-left: 3px solid var(--accent-primary);
  padding: 18px 20px;
}

.decision-panel::before {
  display: none;
}

.decision-topline .eyebrow {
  color: var(--accent-primary);
}

.decision-topline .eyebrow::before {
  content: "▶";
  font-size: 0.72rem;
}

.report-kicker,
.event-badge {
  border-color: rgba(245, 166, 35, 0.42);
  border-radius: 0;
  background: rgba(245, 166, 35, 0.08);
  color: var(--accent-primary);
}

.event-badge::before {
  content: "[ ";
}

.event-badge::after {
  content: " ]";
}

.insight-card {
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0;
  padding: 10px 12px;
  background: rgba(245, 166, 35, 0.055);
}

.insight-card strong {
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
}

.insight-card strong::before {
  content: "⚡ ";
}

.insight-card span {
  color: var(--text-secondary);
  font-style: italic;
}

.decision-list {
  gap: 12px;
}

.decision-button {
  position: relative;
  min-height: 148px;
  border-width: 1px;
  border-left-width: 1px;
  border-radius: 0;
  padding: 14px;
  background: rgba(8, 10, 14, 0.52);
  clip-path: var(--panel-cut);
  animation: fadeSlideUp 0.35s ease both;
}

.decision-button:nth-child(2) {
  animation-delay: 0.04s;
}

.decision-button:nth-child(3) {
  animation-delay: 0.08s;
}

.decision-button::after {
  content: "▶";
  position: absolute;
  right: 12px;
  bottom: 10px;
  transform: translateX(-8px);
  opacity: 0;
  color: var(--accent-primary);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.decision-button:hover {
  border-color: var(--accent-primary);
  background: rgba(245, 166, 35, 0.08);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.14);
  transform: translateY(-2px);
}

.decision-button:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.decision-button i {
  border-radius: 0;
  background: rgba(245, 166, 35, 0.1);
  color: var(--accent-primary);
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}

.decision-button strong {
  color: var(--text-primary);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.decision-button em,
.decision-result-changes span,
.result-toast span,
.timeline-entry small,
.timeline-detail-entry small {
  color: var(--text-secondary);
}

.choice-positive {
  border-bottom: 2px solid rgba(0, 255, 156, 0.42);
}

.choice-negative {
  border-bottom: 2px solid rgba(255, 68, 68, 0.46);
}

.choice-risk {
  border-bottom: 2px solid rgba(245, 166, 35, 0.48);
}

.decision-result-panel {
  border-color: rgba(245, 166, 35, 0.48);
  border-radius: 0;
  background: rgba(8, 10, 14, 0.62);
}

.decision-result-panel button {
  border-radius: 0;
  color: #080a0e;
  background: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
}

.side-card-header strong {
  color: var(--text-primary);
  font-family: "Share Tech Mono", monospace;
  font-size: 1.35rem;
}

.runway-card .side-card-header span::after {
  content: " STATUS";
}

.meter,
.event-progress {
  position: relative;
  height: 9px;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(20% - 2px), rgba(8, 10, 14, 0.8) calc(20% - 2px) 20%),
    rgba(61, 79, 99, 0.26);
}

.meter span,
.event-progress span {
  border-radius: 0;
  box-shadow: 0 0 10px currentColor;
}

.bar-good {
  background: var(--accent-green);
  color: var(--accent-green);
}

.bar-risk {
  background: var(--accent-primary);
  color: var(--accent-primary);
}

.bar-danger {
  background: var(--accent-red);
  color: var(--accent-red);
}

.metrics-card dl div {
  border-bottom: 1px solid rgba(30, 42, 56, 0.7);
  padding-bottom: 8px;
}

.metrics-card dt {
  color: var(--text-muted);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.1em;
}

.metrics-card dd,
.metrics-card strong {
  color: var(--text-primary);
  font-family: "Share Tech Mono", monospace;
}

.metrics-card dd::before {
  content: "▲ ";
  color: var(--accent-green);
}

.insight-side-card {
  border-left: 3px solid var(--accent-primary);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.08);
}

.insight-side-card .side-card-header span::before {
  content: "● ";
  animation: blinkDot 1s steps(2, end) infinite;
}

.insight-side-card p {
  color: var(--text-secondary);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.78rem;
}

.next-event-card .side-card-header span::after {
  content: " IN";
}

.timeline-view,
.team-view,
.product-view,
.market-view,
.achievements-view {
  animation: fadeSlideUp 0.28s ease both;
}

.timeline-filters button,
.achievement-filter-group button,
.market-choice,
.team-role-row button,
.product-upgrade-card button,
.product-entity-card button,
.market-action-card button,
#createProductButton,
.create-product-actions button {
  min-height: 36px;
  border-radius: 0;
  border-color: var(--border-color);
  background: rgba(8, 10, 14, 0.48);
  color: var(--text-secondary);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-filters button.active,
.achievement-filter-group button.active,
.market-choice.active,
.team-role-row button:hover,
.product-upgrade-card button:hover,
.product-entity-card button:hover,
.market-action-card button:hover,
#createProductButton:hover,
.create-product-actions button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(245, 166, 35, 0.08);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.12);
}

.team-overview-grid span,
.product-overview-grid span,
.market-overview-grid span,
.achievement-overview-grid span,
.monetization-summary span,
.timeline-summary-grid span {
  color: var(--text-muted);
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.1em;
}

.team-overview-grid strong,
.product-overview-grid strong,
.market-overview-grid strong,
.achievement-overview-grid strong,
.monetization-summary strong,
.timeline-summary-grid strong {
  color: var(--text-primary);
  font-family: "Share Tech Mono", monospace;
}

.product-view-header > strong,
.market-view-header > strong,
.achievements-view-header > strong {
  border-radius: 0;
  color: var(--accent-green);
  background: rgba(0, 255, 156, 0.08);
}

.role-icon,
.achievement-icon {
  border-radius: 0;
  border-color: rgba(245, 166, 35, 0.4);
  background: rgba(245, 166, 35, 0.08);
  color: var(--accent-primary);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}

.roadmap-columns article,
.market-report-list article {
  border-color: var(--border-color);
  border-radius: 0;
  background: rgba(8, 10, 14, 0.42);
}

.achievement-card.unlocked {
  border-color: rgba(0, 255, 156, 0.35);
}

.achievement-card.locked {
  opacity: 0.62;
  filter: grayscale(0.35);
}

.timeline-detail-list::before {
  background: linear-gradient(180deg, transparent, var(--accent-primary), transparent);
}

.timeline-node {
  border-color: var(--accent-primary);
  border-radius: 0;
  color: var(--accent-primary);
  clip-path: polygon(16% 0, 100% 0, 84% 100%, 0 100%);
}

.entry-win article {
  border-left-color: var(--accent-green);
}

.entry-loss article {
  border-left-color: var(--accent-red);
}

.latest-entry article {
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.16);
}

.delta-positive,
.money-in {
  color: var(--accent-green);
}

.delta-negative,
.money-out {
  color: var(--accent-red);
}

.delta-neutral {
  color: var(--accent-primary);
}

.flash-positive {
  color: var(--accent-green) !important;
  transform: scale(1.06);
  text-shadow: 0 0 12px rgba(0, 255, 156, 0.45);
}

.flash-negative {
  color: var(--accent-red) !important;
  transform: scale(1.06);
  text-shadow: 0 0 12px rgba(255, 68, 68, 0.45);
}

.flash-risk {
  color: var(--accent-primary) !important;
  transform: scale(1.04);
}

.result-toast,
.achievement-toast {
  border-radius: 0;
  border: 1px solid rgba(245, 166, 35, 0.44);
  background: rgba(8, 10, 14, 0.94);
  color: var(--text-primary);
  box-shadow: 0 0 22px rgba(245, 166, 35, 0.16);
}

.onboarding-overlay {
  background:
    radial-gradient(circle at center, rgba(245, 166, 35, 0.12), transparent 44%),
    rgba(8, 10, 14, 0.82);
}

.onboarding-modal,
.ending-card {
  border-radius: 0;
  clip-path: var(--panel-cut);
}

.onboarding-modal h2,
.ending-card h1 {
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .game-hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-title,
  .stats-bar {
    grid-column: 1 / -1;
  }

  .sim-layout {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    position: sticky;
    top: 122px;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .sidebar-brand {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .dossier-nav {
    grid-template-columns: repeat(6, minmax(104px, 1fr));
    overflow-x: auto;
  }

  .profile-card {
    grid-column: 1 / -1;
  }

  .right-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    width: min(100% - 14px, 100%);
  }

  .landing-screen {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand-panel {
    min-height: 360px;
    text-align: center;
  }

  .brand-mark {
    left: 50%;
    transform: translateX(-50%);
  }

  .setup-card {
    padding: 58px 18px 20px;
  }

  .game-hud {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    align-items: stretch;
  }

  .game-title {
    grid-column: 1 / -1;
  }

  .mobile-more-stats {
    grid-column: 1 / -1;
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(245, 166, 35, 0.32);
    color: var(--accent-primary);
    font-family: "Share Tech Mono", monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: auto;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .mobile-stats-toggle:not(:checked) ~ .stats-bar .optional-pill,
  .mobile-stats-toggle:not(:checked) ~ .stats-bar .streak-pill {
    display: none;
  }

  .mobile-stats-toggle:checked + .mobile-more-stats {
    background: rgba(245, 166, 35, 0.08);
  }

  .stat-pill {
    flex: 0 0 92px;
  }

  .stat-pill strong {
    font-size: 1.1rem;
  }

  .game-hud > .icon-button,
  .game-hud > .ghost-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 0;
  }

  .game-hud > .icon-button::before,
  .game-hud > .ghost-button::before {
    font-size: 1rem;
  }

  #howToPlayButton::before {
    content: "?";
    font-size: 1rem;
  }

  .left-sidebar {
    top: 188px;
    grid-template-columns: 1fr;
  }

  .sidebar-brand {
    justify-content: center;
  }

  .dossier-nav {
    grid-template-columns: repeat(6, minmax(96px, 1fr));
    padding-bottom: 4px;
  }

  .profile-card dl,
  .metrics-card dl,
  .right-sidebar,
  .team-overview-grid,
  .team-impact-panel,
  .product-overview-grid,
  .market-overview-grid,
  .achievement-overview-grid,
  .monetization-summary,
  .product-lab-grid,
  .market-strategy-grid,
  .market-lab-grid,
  .timeline-summary-grid {
    grid-template-columns: 1fr;
  }

  .decision-list {
    grid-template-columns: 1fr;
  }

  .decision-button {
    min-height: 122px;
    padding: 12px;
  }

  .timeline-list,
  .timeline-detail-list,
  .achievement-grid {
    max-height: none;
  }

  .timeline-view-header,
  .product-view-header,
  .team-view-header,
  .market-view-header,
  .achievements-view-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .timeline-filters,
  .achievement-filter-group {
    justify-content: flex-start;
  }

  .onboarding-actions,
  .guide-sections,
  .ending-actions {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .decision-button:hover,
  .team-role-row:hover,
  .product-upgrade-card:hover,
  .product-entity-card:hover,
  .market-action-card:hover,
  .achievement-card:hover,
  .icon-button:hover,
  .ghost-button:hover {
    transform: none;
    box-shadow: none;
  }
}

/* === RUN ARCHIVE STYLES === */
#saveRunButton::before {
  content: "▣ ";
}

#newRunButton::before {
  content: "+ ";
}

.game-hud {
  grid-template-columns: minmax(210px, 0.78fr) auto minmax(0, 3fr) auto auto auto auto auto auto;
}

.runs-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  animation: fadeSlideUp 0.28s ease both;
}

.runs-view-header,
.best-runs-grid article,
.run-compare-panel,
.run-history-panel,
.run-card {
  border: 1px solid var(--border-color);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(20, 25, 32, 0.98), rgba(13, 17, 23, 0.98));
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.02);
}

:root[data-theme="light"] .runs-view-header,
:root[data-theme="light"] .best-runs-grid article,
:root[data-theme="light"] .run-compare-panel,
:root[data-theme="light"] .run-history-panel,
:root[data-theme="light"] .run-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(228, 232, 239, 0.98));
}

.runs-view-header,
.run-compare-panel,
.run-history-panel,
.best-runs-grid article,
.run-card {
  clip-path: var(--panel-cut);
}

.runs-view-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background:
    repeating-linear-gradient(180deg, rgba(245, 166, 35, 0.035) 0 2px, transparent 2px 5px),
    var(--bg-tertiary);
}

.runs-view-header h2 {
  margin: 0 0 6px;
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
}

.runs-view-header h2::before {
  content: "[ ";
  color: var(--text-secondary);
}

.runs-view-header h2::after {
  content: " ]";
  color: var(--text-secondary);
}

.runs-view-header span {
  color: var(--text-secondary);
}

.runs-view-header > strong {
  border: 1px solid rgba(245, 166, 35, 0.4);
  padding: 7px 11px;
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
}

.best-runs-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.best-runs-grid article,
.run-compare-panel,
.run-history-panel,
.run-card {
  padding: 12px;
}

.best-runs-grid span,
.run-card dt {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.best-runs-grid strong,
.run-card dd,
.run-card > .run-card-top > strong {
  color: var(--text-primary);
  font-family: "Share Tech Mono", monospace;
}

.best-runs-grid p,
.run-card p,
.run-compare-panel p,
.run-history-panel p {
  margin: 0;
  color: var(--text-secondary);
}

.run-compare-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.run-compare-result {
  overflow-x: auto;
}

.run-compare-result table {
  width: 100%;
  border-collapse: collapse;
}

.run-compare-result th,
.run-compare-result td {
  border-bottom: 1px solid var(--border-color);
  padding: 9px;
  color: var(--text-secondary);
  text-align: left;
}

.run-compare-result th {
  color: var(--accent-primary);
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
}

.run-compare-result td {
  font-family: "Share Tech Mono", monospace;
}

.run-history-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 510px);
  margin-top: 12px;
  overflow: auto;
}

.run-card {
  display: grid;
  gap: 12px;
}

.run-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.run-card h3 {
  margin: 6px 0;
  color: var(--text-primary);
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
}

.status-badge {
  display: inline-flex;
  border: 1px solid rgba(245, 166, 35, 0.35);
  padding: 2px 7px;
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.status-completed .status-badge {
  border-color: rgba(0, 255, 156, 0.36);
  color: var(--accent-green);
}

.status-failed .status-badge,
.status-abandoned .status-badge {
  border-color: rgba(255, 68, 68, 0.34);
  color: var(--accent-red);
}

.run-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.run-stats div {
  border: 1px solid rgba(30, 42, 56, 0.7);
  padding: 8px;
}

.run-stats dd {
  margin: 0;
}

.run-summary {
  display: none;
  border-left: 3px solid var(--accent-primary);
  padding: 10px;
  background: rgba(245, 166, 35, 0.055);
}

.run-card.is-expanded .run-summary {
  display: grid;
  gap: 6px;
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.run-actions button {
  min-height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 10px;
  background: rgba(8, 10, 14, 0.48);
  color: var(--text-secondary);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.run-actions button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(245, 166, 35, 0.08);
}

/* === BALANCE / BURN SOURCE STYLES === */
.burn-sources-card {
  gap: 12px;
}

.burn-source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.burn-source-list div {
  border: 1px solid rgba(30, 42, 56, 0.72);
  background: var(--bg-primary);
  padding: 8px;
}

.burn-source-list dt {
  color: var(--text-muted);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.burn-source-list dd {
  margin: 2px 0 0;
  color: var(--accent-red);
  font-family: "Share Tech Mono", monospace;
}

.burn-source-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.burn-source-actions button {
  min-height: 34px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.burn-source-actions button:not(:disabled):hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.14);
}

.burn-source-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

#burnSourceNote {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

@media (max-width: 1024px) {
  .game-hud {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dossier-nav {
    grid-template-columns: repeat(7, minmax(104px, 1fr));
  }

  .best-runs-grid,
  .run-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .game-hud {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
  }

  .dossier-nav {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
  }

  .game-hud > .icon-button,
  .game-hud > .ghost-button {
    font-size: 0;
  }

  #saveRunButton::before {
    content: "▣";
    font-size: 1rem;
  }

  #newRunButton::before {
    content: "+";
    font-size: 1rem;
  }

  .runs-view-header,
  .run-card-top,
  .run-compare-controls,
  .best-runs-grid,
  .run-stats {
    grid-template-columns: 1fr;
  }

  .runs-view-header {
    display: grid;
  }

  .run-history-list {
    max-height: none;
  }
}

/* === CLEAN GAME UI REFINEMENT === */
.simulation-screen {
  gap: 0;
}

.game-hud {
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 3.2fr) auto auto auto auto;
  gap: 10px;
  min-height: 78px;
  padding: 10px 18px 10px 14px;
  border-bottom-color: rgba(30, 42, 56, 0.95);
  background: #080d13;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.game-title > span {
  display: none;
}

.game-title h1 {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.context-line {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(96px, 1fr));
  gap: 8px;
  overflow: visible;
}

.stat-pill {
  display: grid;
  min-width: 0;
  min-height: 58px;
  align-content: center;
  border: 1px solid rgba(30, 42, 56, 0.92);
  border-radius: 7px;
  padding: 8px 10px;
  background: #0d131b;
  clip-path: none;
}

.stat-pill::after {
  display: none;
}

.stat-pill span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 17px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.stat-pill strong {
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  line-height: 1.05;
}

.week-pill span {
  font-size: 0;
}

.week-pill span::before {
  content: "Week";
  font-size: 0.72rem;
}

#themeButton,
#saveRunButton,
#newRunButton,
.settings-button {
  min-height: 42px;
  border-radius: 8px;
  background: #0d131b;
}

#saveRunButton,
#newRunButton {
  min-width: 94px;
}

.settings-panel {
  border-radius: 10px;
  background: #0d131b;
}

.sim-layout {
  grid-template-columns: 68px minmax(0, 1fr) minmax(286px, 330px);
  gap: 16px;
  padding-top: 14px;
  transition: grid-template-columns 240ms ease;
}

.sim-layout:has(.left-sidebar:hover),
.sim-layout:has(.left-sidebar:focus-within) {
  grid-template-columns: 228px minmax(0, 1fr) minmax(286px, 330px);
}

.left-sidebar {
  position: sticky;
  top: 92px;
  z-index: 25;
  align-self: start;
  min-height: calc(100vh - 116px);
  overflow: visible;
  border-radius: 0;
  padding: 14px 8px;
  background: #081019;
  transition: width 240ms ease, padding 240ms ease;
}

.sidebar-brand {
  justify-content: center;
  border-bottom: 0;
  padding-bottom: 12px;
}

.sidebar-brand > span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.16);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.12);
}

.sidebar-brand > div,
.profile-card {
  display: none;
}

.left-sidebar:hover .sidebar-brand > div,
.left-sidebar:focus-within .sidebar-brand > div,
.left-sidebar:hover .profile-card,
.left-sidebar:focus-within .profile-card {
  display: block;
}

.left-sidebar:hover .sidebar-brand,
.left-sidebar:focus-within .sidebar-brand {
  justify-content: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.dossier-nav {
  gap: 10px;
}

.dossier-nav button,
.sidebar-settings-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: var(--text-secondary);
  font-family: "Rajdhani", sans-serif;
  font-size: 0;
  font-weight: 700;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.dossier-nav button::before,
.sidebar-settings-toggle::before {
  content: attr(data-icon);
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  font-size: 1.35rem;
}

.left-sidebar:hover .dossier-nav button,
.left-sidebar:focus-within .dossier-nav button,
.left-sidebar:hover .sidebar-settings-toggle,
.left-sidebar:focus-within .sidebar-settings-toggle {
  gap: 8px;
  padding-right: 12px;
  font-size: 0.94rem;
}

.dossier-nav button:hover,
.sidebar-settings-toggle:hover {
  border-color: rgba(245, 166, 35, 0.2);
  background: rgba(245, 166, 35, 0.06);
  color: var(--text-primary);
}

.dossier-nav button.active {
  border-color: rgba(245, 166, 35, 0.36);
  background: rgba(245, 166, 35, 0.11);
  color: var(--accent-primary);
  box-shadow: inset 3px 0 0 var(--accent-primary), 0 0 18px rgba(245, 166, 35, 0.08);
}

.dossier-nav button::after,
.sidebar-settings-toggle::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  z-index: 80;
  transform: translateY(-50%) translateX(-4px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 9px;
  background: #0d131b;
  color: var(--text-primary);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.left-sidebar:not(:hover):not(:focus-within) .dossier-nav button:hover::after,
.left-sidebar:not(:hover):not(:focus-within) .sidebar-settings-toggle:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-settings-toggle {
  width: 100%;
  margin-top: auto;
}

.profile-card {
  margin-top: auto;
}

#overviewView.center-view {
  display: grid;
  gap: 16px;
}

.decision-panel {
  order: 1;
  border-radius: 10px;
  padding: clamp(18px, 2vw, 28px) clamp(18px, 2.4vw, 32px);
  background: #0b121a;
}

.timeline-panel {
  order: 2;
  max-height: 290px;
  overflow: hidden;
  border-radius: 10px;
  background: #0b121a;
}

.timeline-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-entry p {
  display: none;
}

.decision-panel h2 {
  max-width: 760px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.decision-panel > p {
  max-width: 780px;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.insight-card {
  width: min(560px, 100%);
  border-radius: 8px;
  background: #0d151f;
}

.decision-list {
  gap: 16px;
  margin-top: 20px;
}

.decision-button {
  min-height: 150px;
  border-radius: 9px;
  border-left-width: 1px;
  padding: 16px;
  background: #0d151f;
}

.decision-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2), 0 0 14px rgba(245, 166, 35, 0.1);
}

.right-sidebar {
  gap: 16px;
}

.side-card {
  border-radius: 10px;
  background: #0b121a;
}

.insight-side-card,
.next-event-card {
  display: none;
}

.burn-source-list {
  grid-template-columns: 1fr;
}

.burn-source-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
}

.burn-source-actions,
#burnSourceNote {
  display: none;
}

.metrics-card dl div {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.metrics-card .meter {
  display: none;
}

:root[data-theme="light"] .game-hud,
:root[data-theme="light"] .left-sidebar,
:root[data-theme="light"] .decision-panel,
:root[data-theme="light"] .timeline-panel,
:root[data-theme="light"] .side-card,
:root[data-theme="light"] .stat-pill,
:root[data-theme="light"] .settings-button,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .decision-button,
:root[data-theme="light"] .insight-card {
  background: var(--bg-secondary);
}

@media (max-width: 1024px) {
  .game-hud {
    grid-template-columns: 1fr auto auto auto;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    overflow-x: auto;
  }

  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within) {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    position: sticky;
    top: 126px;
    min-height: auto;
  }

  .dossier-nav {
    display: flex;
    overflow-x: auto;
  }

  .dossier-nav button,
  .sidebar-settings-toggle {
    flex: 0 0 56px;
  }

  .right-sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .game-hud {
    grid-template-columns: 1fr auto auto;
  }

  .stats-bar {
    grid-template-columns: repeat(9, minmax(82px, 1fr));
    overflow-x: auto;
  }

  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within) {
    grid-template-columns: 1fr;
  }

  .right-sidebar {
    grid-template-columns: 1fr;
  }

  .decision-list {
    grid-template-columns: 1fr;
  }
}

/* === COMPACT STARTUP COMMAND HUD === */
.game-hud {
  min-height: 66px;
  padding: 8px 14px;
  grid-template-columns: minmax(150px, 0.58fr) minmax(0, 1fr) auto auto auto;
  gap: 10px;
  background: #070c12;
  border-bottom: 1px solid rgba(245, 166, 35, 0.26);
  box-shadow: none;
  backdrop-filter: none;
}

.game-title {
  min-width: 0;
}

.game-title span {
  display: none;
}

.game-title h1 {
  font-size: clamp(1.02rem, 1.25vw, 1.25rem);
  line-height: 1;
  white-space: nowrap;
}

.context-line {
  margin-top: 5px;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(68px, 1fr));
  gap: 6px;
  align-items: stretch;
  min-width: 0;
  overflow: visible;
}

.stat-pill {
  --hud-meter: 42%;
  min-width: 0;
  min-height: 48px;
  padding: 7px 8px 6px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 4px;
  column-gap: 7px;
  row-gap: 5px;
  align-items: center;
  border: 1px solid rgba(30, 42, 56, 0.95);
  border-radius: 8px;
  background: #0b1119;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  clip-path: none;
}

.stat-pill:hover {
  border-color: rgba(245, 166, 35, 0.4);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.stat-pill span {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1;
}

.stat-pill strong {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  color: var(--text-primary);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(0.98rem, 1.12vw, 1.18rem);
  line-height: 1;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-pill strong {
  color: var(--accent-primary);
}

#cashStat,
#revenueStat {
  color: var(--accent-green);
}

#burnStat {
  color: var(--accent-red);
}

#runwayStat {
  color: var(--accent-green);
}

.runway-warning #runwayStat {
  color: var(--accent-primary);
}

.runway-danger #runwayStat {
  color: var(--accent-red);
}

#reputationStat {
  color: var(--accent-blue);
}

#growthStat.gain {
  color: var(--accent-green);
}

#growthStat.loss {
  color: var(--accent-red);
}

.hud-mini {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(61, 79, 99, 0.58) 0 13px,
      transparent 13px 15px
    );
}

.hud-mini em {
  display: block;
  width: var(--hud-meter, 42%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent-blue);
  transition: width 240ms ease, background 240ms ease;
}

.week-pill .hud-mini em {
  width: 100%;
  background: var(--accent-primary);
}

.hud-good .hud-mini em {
  background: var(--accent-green);
}

.hud-risk .hud-mini em {
  background: var(--accent-primary);
}

.hud-danger .hud-mini em {
  background: var(--accent-red);
}

.hud-neutral .hud-mini em {
  background: var(--accent-blue);
}

.stat-pill .help-tip {
  width: 13px;
  height: 13px;
  min-width: 13px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.58rem;
  line-height: 1;
}

.game-hud > .icon-button,
.settings-button {
  min-height: 40px;
  height: 40px;
  border-radius: 8px;
}

.game-hud > .icon-button {
  min-width: 88px;
  padding: 0 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.settings-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

:root[data-theme="light"] .game-hud {
  background: #ffffff;
  border-bottom-color: rgba(212, 135, 10, 0.28);
}

:root[data-theme="light"] .stat-pill {
  background: #f7f9fc;
  border-color: rgba(200, 208, 218, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

:root[data-theme="light"] .stat-pill span {
  background: rgba(13, 17, 23, 0.045);
}

:root[data-theme="light"] .hud-mini {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(200, 208, 218, 0.9) 0 13px,
      transparent 13px 15px
    );
}

@media (max-width: 1280px) {
  .game-hud {
    grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr) auto auto auto;
    padding-inline: 10px;
  }

  .stats-bar {
    grid-template-columns: repeat(9, minmax(62px, 1fr));
  }

  .stat-pill {
    padding-inline: 6px;
    column-gap: 5px;
  }

  .stat-pill span {
    width: 20px;
    min-width: 20px;
  }
}

@media (max-width: 1024px) {
  .game-hud {
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(9, minmax(78px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .context-line {
    max-width: 28ch;
  }
}

@media (max-width: 768px) {
  .game-hud {
    grid-template-columns: 1fr auto auto;
  }

  .stats-bar {
    grid-template-columns: repeat(9, minmax(76px, 1fr));
  }

  .game-hud > .icon-button {
    min-width: 42px;
    width: 42px;
    padding: 0;
    overflow: hidden;
    text-indent: -999px;
  }
}

/* === PRODUCT VIEW + READABLE HUD FIX === */
.game-hud {
  z-index: 40;
  grid-template-columns: minmax(145px, 0.44fr) minmax(0, 1fr) auto auto auto;
  align-items: center;
  overflow: visible;
}

.stats-bar {
  grid-template-columns: repeat(9, minmax(82px, 1fr));
  overflow: visible;
}

.stat-pill {
  min-height: 58px;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 5px;
  padding: 8px 9px;
  align-items: stretch;
}

.stat-pill span {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  min-width: 0;
  height: auto;
  justify-content: flex-start;
  gap: 5px;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: "Rajdhani", Inter, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.stat-pill span i {
  display: inline-grid;
  min-width: 16px;
  place-items: center;
  font-style: normal;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.stat-pill span em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-pill span {
  font-size: 0.72rem;
}

.week-pill span::before,
.game-hud > .icon-button::before,
.game-hud > .ghost-button::before {
  content: none !important;
}

.stat-pill strong {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  font-size: clamp(1.05rem, 1.2vw, 1.26rem);
}

.hud-mini {
  display: none !important;
}

.stat-pill .help-tip {
  margin-left: auto;
}

#burnStat {
  font-size: clamp(0.95rem, 1vw, 1.08rem);
}

.simulation-screen[data-active-view="product"] .sim-layout {
  grid-template-columns: 68px minmax(0, 1fr);
}

.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
  grid-template-columns: 228px minmax(0, 1fr);
}

.simulation-screen[data-active-view="product"] .right-sidebar {
  display: none;
}

.simulation-screen[data-active-view="product"] .center-stage {
  min-width: 0;
}

.simulation-screen[data-active-view="product"] .product-view {
  width: 100%;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.simulation-screen[data-active-view="product"] .product-overview-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.simulation-screen[data-active-view="product"] .monetization-summary {
  grid-template-columns: minmax(160px, 0.22fr) minmax(120px, 0.16fr) minmax(0, 1fr);
}

.simulation-screen[data-active-view="product"] .product-lab-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.simulation-screen[data-active-view="product"] .product-view-header,
.simulation-screen[data-active-view="product"] .product-overview-grid,
.simulation-screen[data-active-view="product"] .monetization-summary,
.simulation-screen[data-active-view="product"] .product-lab-grid,
.simulation-screen[data-active-view="product"] .product-portfolio-panel {
  width: 100%;
}

@media (max-width: 1180px) {
  .game-hud {
    grid-template-columns: 1fr auto auto auto;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(9, minmax(92px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .simulation-screen[data-active-view="product"] .product-overview-grid,
  .simulation-screen[data-active-view="product"] .product-lab-grid,
  .simulation-screen[data-active-view="product"] .monetization-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stat-pill {
    min-height: 56px;
  }

  .stats-bar {
    grid-template-columns: repeat(9, minmax(88px, 1fr));
  }

  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    grid-template-columns: 1fr;
  }

  .game-hud > .icon-button {
    width: auto;
    min-width: 82px;
    padding: 0 10px;
    overflow: visible;
    font-size: 0.72rem;
    text-indent: 0;
  }
}

/* === GLOBAL RIGHT PANEL REMOVAL === */
.right-sidebar {
  display: none !important;
}

.settings-cost-controls {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.settings-cost-controls button {
  min-height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: "Rajdhani", Inter, sans-serif;
  font-weight: 700;
}

.settings-cost-controls button:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(245, 166, 35, 0.08);
}

.settings-cost-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sim-layout,
.sim-layout:has(.left-sidebar:hover),
.sim-layout:has(.left-sidebar:focus-within),
.simulation-screen[data-active-view="product"] .sim-layout,
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sim-layout:has(.left-sidebar:hover),
.sim-layout:has(.left-sidebar:focus-within),
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
  grid-template-columns: 228px minmax(0, 1fr);
}

.center-stage,
.center-view,
.timeline-panel,
.decision-panel {
  width: 100%;
  max-width: none;
}

#overviewView.center-view {
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: stretch;
}

.decision-list {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}

.stats-bar {
  grid-template-columns: repeat(10, minmax(78px, 1fr));
}

@media (max-width: 1180px) {
  .stats-bar {
    grid-template-columns: repeat(10, minmax(92px, 1fr));
  }
}

@media (max-width: 1024px) {
  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within),
  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    grid-template-columns: 1fr;
  }

  #overviewView.center-view,
  .decision-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-bar {
    grid-template-columns: repeat(10, minmax(88px, 1fr));
  }
}

/* === OVERVIEW VERTICAL STACK RESTORE === */
#overviewView.center-view {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: stretch;
}

#overviewView .decision-panel {
  order: 1;
}

#overviewView .timeline-panel {
  order: 2;
}

#overviewView .decision-panel,
#overviewView .timeline-panel {
  width: 100%;
}

#overviewView .decision-list {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}

#overviewView .timeline-panel {
  max-height: none;
}

#overviewView .timeline-list {
  max-height: 360px;
}

@media (max-width: 900px) {
  #overviewView .decision-list {
    grid-template-columns: 1fr;
  }
}

/* === LAUNCHLAB COMMAND CENTER — AUTHORITATIVE UI LAYER === */
:root {
  --bg-primary: #070812;
  --bg-secondary: #0d1020;
  --bg-tertiary: #151a2d;
  --paper-3: #090c18;
  --border-color: rgba(144, 154, 196, 0.18);
  --line: var(--border-color);
  --line-strong: rgba(126, 104, 255, 0.5);
  --accent-primary: #8b73ff;
  --accent-green: #37e6a1;
  --accent-red: #ff6b7c;
  --accent-blue: #59b9ff;
  --amber: #a890ff;
  --green: var(--accent-green);
  --mint: var(--accent-green);
  --red: var(--accent-red);
  --rose: var(--accent-red);
  --blue: var(--accent-blue);
  --text-primary: #f4f5ff;
  --text-secondary: #a2abc8;
  --text-muted: #737d9d;
  --ink: var(--text-primary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --hud-bg: rgba(8, 10, 22, 0.94);
  --focus-ring: rgba(139, 115, 255, 0.24);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  --card-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"],
:root.light-mode {
  --bg-primary: #f3f5fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #edf0f8;
  --paper-3: #f7f8fc;
  --border-color: rgba(54, 65, 105, 0.16);
  --line: var(--border-color);
  --line-strong: rgba(101, 78, 220, 0.42);
  --accent-primary: #654edc;
  --accent-green: #087e57;
  --accent-red: #d64157;
  --accent-blue: #1677bd;
  --amber: #654edc;
  --green: var(--accent-green);
  --mint: var(--accent-green);
  --red: var(--accent-red);
  --rose: var(--accent-red);
  --blue: var(--accent-blue);
  --text-primary: #16192a;
  --text-secondary: #5d6682;
  --text-muted: #7d86a1;
  --ink: var(--text-primary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --hud-bg: rgba(255, 255, 255, 0.96);
  --focus-ring: rgba(101, 78, 220, 0.2);
  --shadow: 0 18px 48px rgba(41, 46, 75, 0.13);
  --card-shadow: 0 10px 25px rgba(41, 46, 75, 0.08);
}

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
}

html {
  background: var(--bg-primary);
}

body {
  overflow-x: clip;
  background:
    radial-gradient(circle at 12% -5%, rgba(139, 115, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 92% 10%, rgba(89, 185, 255, 0.1), transparent 28rem),
    var(--bg-primary);
}

body::after {
  opacity: 0.025;
}

body:has(#simulationPage:not(.is-hidden)) {
  height: 100dvh;
  overflow: hidden;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.screen {
  min-height: 100svh;
}

button,
input,
select,
textarea,
[tabindex] {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px var(--focus-ring), 0 0 0 1px var(--accent-primary) !important;
}

button:not(:disabled) {
  touch-action: manipulation;
}

/* Landing / run launcher */
.landing-screen {
  width: min(1480px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 48px);
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: clamp(18px, 2.4vw, 36px);
}

.brand-panel,
.setup-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  clip-path: none;
  background:
    linear-gradient(145deg, rgba(139, 115, 255, 0.11), transparent 42%),
    linear-gradient(180deg, rgba(21, 26, 45, 0.98), rgba(10, 13, 27, 0.98));
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .brand-panel,
:root[data-theme="light"] .setup-card {
  background:
    linear-gradient(145deg, rgba(101, 78, 220, 0.09), transparent 46%),
    linear-gradient(180deg, #ffffff, #f5f6fb);
}

.brand-panel {
  min-height: 660px;
  padding: clamp(30px, 4vw, 62px);
}

.brand-panel::before {
  display: block;
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  opacity: 0.28;
  background:
    linear-gradient(rgba(139, 115, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 115, 255, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom right, black, transparent 70%);
}

.brand-panel::after {
  content: "LIVE STRATEGY SIMULATION";
  top: 28px;
  right: 30px;
  bottom: auto;
  width: auto;
  height: auto;
  border: 1px solid rgba(55, 230, 161, 0.35);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent-green);
  background: rgba(55, 230, 161, 0.07);
  font: 700 0.65rem/1 "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
}

.brand-mark {
  top: clamp(34px, 5vw, 70px);
  left: clamp(30px, 4vw, 62px);
  grid-template-columns: repeat(3, 18px);
  gap: 7px;
  transform: skewX(-8deg);
}

.brand-mark span {
  width: 18px;
  border-radius: 5px;
}

.brand-panel .eyebrow {
  margin-bottom: 14px;
  color: var(--accent-green);
}

.brand-panel h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  color: var(--text-primary);
  font-size: clamp(4rem, 8vw, 7.8rem);
  letter-spacing: -0.055em;
  text-transform: none;
  text-shadow: 0 0 42px rgba(139, 115, 255, 0.25);
}

.brand-panel h1::after {
  content: ".";
  color: var(--accent-green);
}

.brand-panel .intro {
  max-width: 680px;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
}

.continue-run-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(620px, 100%);
  margin-top: 28px;
  border: 1px solid rgba(55, 230, 161, 0.26);
  border-radius: 16px;
  padding: 14px;
  background: rgba(55, 230, 161, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.continue-run-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.continue-run-signal {
  position: relative;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 6px rgba(55, 230, 161, 0.1), 0 0 18px rgba(55, 230, 161, 0.7);
}

.continue-run-copy div {
  min-width: 0;
}

.continue-run-copy p,
.continue-run-copy strong,
.continue-run-copy span {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-run-copy p {
  margin-bottom: 3px;
  color: var(--accent-green);
  font: 700 0.64rem/1.2 "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.continue-run-copy strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.continue-run-copy span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

#continueSavedRunButton {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid rgba(55, 230, 161, 0.44);
  border-radius: 10px;
  padding: 0 14px;
  background: var(--accent-green);
  color: #07150f;
  font-family: "Rajdhani", sans-serif;
  font-weight: 800;
  letter-spacing: 0.035em;
}

#continueSavedRunButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(55, 230, 161, 0.18);
}

.setup-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 17px 14px;
  padding: clamp(62px, 6vw, 82px) clamp(22px, 3vw, 38px) clamp(24px, 3vw, 38px);
}

.setup-card::before {
  top: 28px;
  left: clamp(22px, 3vw, 38px);
  color: var(--accent-primary);
  font-size: 0.76rem;
}

.setup-card::after {
  display: none;
}

.setup-card label {
  min-width: 0;
  margin: 0;
}

.setup-card input,
.setup-card select {
  min-height: 54px;
  border-radius: 11px;
  padding-inline: 14px;
  background-color: rgba(7, 9, 20, 0.66);
}

:root[data-theme="light"] .setup-card input,
:root[data-theme="light"] .setup-card select {
  background-color: rgba(255, 255, 255, 0.86);
}

.setup-card .primary-button {
  grid-column: 1 / -1;
  min-height: 58px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent-primary), var(--accent-blue));
  color: #fff;
  box-shadow: 0 12px 30px rgba(103, 81, 230, 0.24);
}

/* Full-screen simulation shell */
.simulation-screen {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.game-hud {
  position: relative;
  top: auto;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(135px, 0.55fr) minmax(190px, 0.72fr) minmax(620px, 4fr) auto auto 42px;
  gap: 8px;
  min-width: 0;
  min-height: 78px;
  padding: 9px 12px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: var(--hud-bg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.game-title {
  min-width: 0;
  border-right: 0;
  padding: 0 6px;
}

.game-title > span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-green);
  font-size: 0.58rem;
}

.game-title h1 {
  overflow: hidden;
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.02rem, 1.3vw, 1.35rem);
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.context-line {
  max-width: 22ch;
  margin-top: 4px;
  font-size: 0.66rem;
}

.company-stage-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 5px auto;
  gap: 4px 9px;
  min-width: 0;
  border: 1px solid rgba(139, 115, 255, 0.28);
  border-radius: 11px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(139, 115, 255, 0.11), rgba(89, 185, 255, 0.05));
}

.company-stage-heading,
.company-valuation-line {
  min-width: 0;
}

.company-stage-heading span,
.company-valuation-line span {
  display: block;
  color: var(--text-muted);
  font: 700 0.55rem/1 "Share Tech Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.company-stage-heading strong,
.company-valuation-line strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-primary);
  font: 700 0.82rem/1.05 "Rajdhani", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-valuation-line {
  text-align: right;
}

.company-valuation-line strong {
  color: var(--accent-green);
  font-family: "Share Tech Mono", monospace;
}

.company-stage-meter {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(115, 125, 157, 0.22);
}

.company-stage-meter span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-blue), var(--accent-green));
  box-shadow: 0 0 12px rgba(89, 185, 255, 0.5);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.company-stage-strip > p {
  grid-column: 1 / -1;
  overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-stage-strip > p strong {
  color: var(--accent-blue);
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(10, minmax(58px, 1fr));
  gap: 5px;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.stat-pill {
  min-width: 58px;
  min-height: 56px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(20, 25, 45, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

:root[data-theme="light"] .stat-pill {
  background: rgba(243, 245, 251, 0.92);
}

.stat-pill:hover {
  border-color: rgba(139, 115, 255, 0.42);
  transform: translateY(-1px);
}

.stat-pill span {
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.stat-pill span i {
  min-width: 13px;
  font-size: 0.82rem;
}

.stat-pill strong {
  font-size: clamp(0.88rem, 1vw, 1.08rem);
}

.game-hud > .icon-button,
.settings-button {
  min-height: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: rgba(21, 26, 45, 0.78);
  color: var(--text-primary);
}

.game-hud > .icon-button {
  min-width: 78px;
  padding: 0 10px;
  font-size: 0.7rem;
}

.game-hud > .icon-button:hover,
.settings-button:hover,
.settings-button[aria-expanded="true"] {
  border-color: var(--accent-primary);
  background: rgba(139, 115, 255, 0.14);
  color: var(--text-primary);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.settings-menu {
  min-width: 0;
}

.settings-button {
  width: 40px;
  min-width: 40px;
}

.settings-panel {
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  max-width: min(300px, calc(100vw - 20px));
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 11px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
}

.settings-panel .icon-button,
.settings-panel .ghost-button,
.settings-panel .settings-cost-controls button,
#aiEventsButton {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 12px;
  text-align: left;
  text-indent: 0;
}

.ai-events-setting {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

#aiEventsButton {
  border-color: rgba(89, 185, 255, 0.36);
  color: var(--accent-blue);
}

#aiEventsButton[aria-pressed="true"] {
  border-color: rgba(55, 230, 161, 0.5);
  background: rgba(55, 230, 161, 0.09);
  color: var(--accent-green);
}

#aiStatusText {
  margin: 0;
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 0.67rem;
  line-height: 1.45;
}

.sim-layout,
.sim-layout:has(.left-sidebar:hover),
.sim-layout:has(.left-sidebar:focus-within),
.simulation-screen[data-active-view="product"] .sim-layout,
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(275px, 302px);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 10px;
  overflow: hidden;
}

.left-sidebar,
.right-sidebar {
  position: static;
  top: auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 15px;
  clip-path: none;
  background: rgba(13, 16, 32, 0.88);
  box-shadow: var(--card-shadow);
}

:root[data-theme="light"] .left-sidebar,
:root[data-theme="light"] .right-sidebar {
  background: rgba(255, 255, 255, 0.9);
}

.left-sidebar {
  z-index: 20;
  display: flex;
  padding: 9px 6px;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-brand {
  justify-content: center;
  border: 0;
  padding: 1px 0 7px;
}

.sidebar-brand > span {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(139, 115, 255, 0.4);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(139, 115, 255, 0.2), rgba(89, 185, 255, 0.08));
  color: var(--text-primary);
  box-shadow: 0 8px 20px rgba(103, 81, 230, 0.16);
}

.sidebar-brand > div,
.left-sidebar:hover .sidebar-brand > div,
.left-sidebar:focus-within .sidebar-brand > div,
.profile-card,
.left-sidebar:hover .profile-card,
.left-sidebar:focus-within .profile-card {
  display: none;
}

.dossier-nav {
  display: grid;
  gap: 5px;
}

.dossier-nav button,
.sidebar-settings-toggle,
.left-sidebar:hover .dossier-nav button,
.left-sidebar:focus-within .dossier-nav button,
.left-sidebar:hover .sidebar-settings-toggle,
.left-sidebar:focus-within .sidebar-settings-toggle {
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-direction: column;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 5px 2px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.59rem;
  line-height: 1;
  text-align: center;
}

.dossier-nav button::before,
.sidebar-settings-toggle::before {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  font-size: 1.05rem;
}

.dossier-nav button::after,
.sidebar-settings-toggle::after {
  display: none !important;
}

.dossier-nav button:hover,
.sidebar-settings-toggle:hover {
  border-color: rgba(139, 115, 255, 0.24);
  background: rgba(139, 115, 255, 0.07);
  color: var(--text-primary);
}

.dossier-nav button.active {
  border-color: rgba(139, 115, 255, 0.42);
  background: linear-gradient(145deg, rgba(139, 115, 255, 0.19), rgba(89, 185, 255, 0.06));
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--accent-primary), 0 7px 18px rgba(103, 81, 230, 0.12);
}

.sidebar-settings-toggle {
  width: 100%;
  margin-top: auto;
  flex: 0 0 auto;
}

.center-stage {
  display: block;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 2px 4px 20px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.center-view,
.timeline-view,
.team-view,
.product-view,
.market-view,
.achievements-view,
.runs-view {
  width: 100%;
  min-width: 0;
  min-height: 100%;
}

#overviewView.center-view {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
}

#overviewView .decision-panel {
  order: 1;
}

#overviewView .timeline-panel {
  order: 2;
}

.decision-panel,
.timeline-panel,
.side-card,
.timeline-view-header,
.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header,
.runs-view-header,
.team-overview-grid article,
.product-overview-grid article,
.market-overview-grid article,
.achievement-overview-grid article,
.team-impact-panel,
.team-roles-panel,
.team-role-row,
.monetization-summary,
.product-upgrades-panel,
.roadmap-panel,
.product-upgrade-card,
.product-portfolio-panel,
.product-entity-card,
.market-choice-panel,
.market-actions-panel,
.market-report-panel,
.market-action-card,
.achievement-controls,
.achievement-card,
.timeline-summary-grid article,
.timeline-detail-entry article,
.decision-result-panel,
.timeline-empty,
.best-runs-grid article,
.run-compare-panel,
.run-history-panel,
.run-card {
  border-color: var(--border-color);
  border-radius: 14px;
  clip-path: none;
  background: rgba(13, 16, 32, 0.88);
  box-shadow: var(--card-shadow);
}

:root[data-theme="light"] .decision-panel,
:root[data-theme="light"] .timeline-panel,
:root[data-theme="light"] .side-card,
:root[data-theme="light"] .timeline-view-header,
:root[data-theme="light"] .team-view-header,
:root[data-theme="light"] .product-view-header,
:root[data-theme="light"] .market-view-header,
:root[data-theme="light"] .achievements-view-header,
:root[data-theme="light"] .runs-view-header,
:root[data-theme="light"] .team-overview-grid article,
:root[data-theme="light"] .product-overview-grid article,
:root[data-theme="light"] .market-overview-grid article,
:root[data-theme="light"] .achievement-overview-grid article,
:root[data-theme="light"] .team-impact-panel,
:root[data-theme="light"] .team-roles-panel,
:root[data-theme="light"] .team-role-row,
:root[data-theme="light"] .monetization-summary,
:root[data-theme="light"] .product-upgrades-panel,
:root[data-theme="light"] .roadmap-panel,
:root[data-theme="light"] .product-upgrade-card,
:root[data-theme="light"] .product-portfolio-panel,
:root[data-theme="light"] .product-entity-card,
:root[data-theme="light"] .market-choice-panel,
:root[data-theme="light"] .market-actions-panel,
:root[data-theme="light"] .market-report-panel,
:root[data-theme="light"] .market-action-card,
:root[data-theme="light"] .achievement-controls,
:root[data-theme="light"] .achievement-card,
:root[data-theme="light"] .timeline-summary-grid article,
:root[data-theme="light"] .timeline-detail-entry article,
:root[data-theme="light"] .decision-result-panel,
:root[data-theme="light"] .timeline-empty,
:root[data-theme="light"] .best-runs-grid article,
:root[data-theme="light"] .run-compare-panel,
:root[data-theme="light"] .run-history-panel,
:root[data-theme="light"] .run-card {
  background: rgba(255, 255, 255, 0.94);
}

.decision-panel {
  position: relative;
  padding: clamp(18px, 2vw, 28px);
  overflow: hidden;
}

.decision-panel::before {
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(var(--accent-primary), var(--accent-blue), var(--accent-green));
}

.decision-panel::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 115, 255, 0.11), transparent 70%);
  pointer-events: none;
}

.decision-topline,
.decision-panel > h2,
.decision-panel > p,
.objective-card,
.insight-card,
.guided-tip,
.decision-list,
.decision-result-panel {
  position: relative;
  z-index: 1;
}

.decision-panel h2 {
  max-width: 900px;
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  letter-spacing: -0.02em;
  text-transform: none;
}

.decision-panel > p {
  max-width: 900px;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.event-badge {
  border-color: rgba(255, 200, 87, 0.4);
  background: rgba(255, 200, 87, 0.08);
  color: #ffc857;
}

.objective-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(210px, 0.85fr);
  gap: 18px;
  margin: 15px 0 10px;
  border: 1px solid rgba(89, 185, 255, 0.24);
  border-radius: 13px;
  padding: 15px 16px;
  background:
    linear-gradient(120deg, rgba(89, 185, 255, 0.09), rgba(139, 115, 255, 0.07)),
    rgba(8, 12, 27, 0.64);
}

:root[data-theme="light"] .objective-card {
  background: linear-gradient(120deg, rgba(22, 119, 189, 0.07), rgba(101, 78, 220, 0.06));
}

.objective-copy > span,
.objective-progress > div:first-child > span {
  display: block;
  color: var(--accent-blue);
  font: 700 0.62rem/1.1 "Share Tech Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.objective-copy h3 {
  margin: 5px 0 4px;
  color: var(--text-primary);
  font-size: 1.08rem;
  text-transform: none;
}

.objective-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

.objective-progress {
  display: grid;
  align-content: center;
  gap: 10px;
}

.objective-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#objectiveReward {
  color: var(--accent-green);
  font-size: 0.68rem;
  text-align: right;
}

.objective-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(115, 125, 157, 0.2);
}

.objective-meter span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-primary));
  box-shadow: 0 0 14px rgba(89, 185, 255, 0.4);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.insight-card {
  width: 100%;
  max-width: 900px;
  border-color: var(--border-color);
  border-radius: 10px;
  background: rgba(21, 26, 45, 0.66);
}

:root[data-theme="light"] .insight-card {
  background: var(--bg-tertiary);
}

.decision-list,
#overviewView .decision-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.decision-button {
  min-height: 148px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  background: rgba(21, 26, 45, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

:root[data-theme="light"] .decision-button {
  background: rgba(243, 245, 251, 0.95);
}

.decision-button.choice-positive {
  border-bottom: 3px solid var(--accent-green);
}

.decision-button.choice-negative {
  border-bottom: 3px solid var(--accent-red);
}

.decision-button.choice-risk {
  border-bottom: 3px solid #ffc857;
}

.decision-button:hover {
  border-color: var(--accent-primary);
  background: rgba(139, 115, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 15px 28px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(139, 115, 255, 0.14);
}

.decision-result-panel #continueWeekButton,
#createProductButton,
.market-action-card button,
.product-upgrade-card button {
  border-radius: 9px;
  background: linear-gradient(120deg, var(--accent-primary), var(--accent-blue));
  color: #fff;
  box-shadow: 0 8px 20px rgba(101, 78, 220, 0.17);
}

.timeline-panel {
  max-height: none;
  overflow: hidden;
}

#overviewView .timeline-list,
.timeline-list {
  min-height: 0;
  max-height: 280px;
}

.timeline-header {
  background: rgba(21, 26, 45, 0.55);
}

:root[data-theme="light"] .timeline-header {
  background: var(--bg-tertiary);
}

.timeline-entry > div:last-child {
  border-radius: 5px 12px 12px 5px;
  background: rgba(21, 26, 45, 0.62);
}

:root[data-theme="light"] .timeline-entry > div:last-child {
  background: var(--paper-3);
}

/* Restored intelligence rail */
.right-sidebar,
.simulation-screen[data-active-view="product"] .right-sidebar {
  display: flex !important;
  gap: 9px;
  padding: 9px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.side-card {
  position: relative;
  flex: 0 0 auto;
  border-radius: 12px;
  padding: 13px;
  overflow: hidden;
}

.side-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.runway-card::after {
  background: linear-gradient(90deg, var(--accent-green), transparent);
}

.burn-sources-card::after {
  background: linear-gradient(90deg, var(--accent-red), transparent);
}

.side-card-header span {
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.side-card-header strong {
  color: var(--text-primary);
}

.burn-source-list {
  grid-template-columns: 1fr;
}

.burn-source-list div {
  border-radius: 7px;
  background: rgba(21, 26, 45, 0.5);
}

:root[data-theme="light"] .burn-source-list div {
  background: var(--paper-3);
}

.metrics-card dl div {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.metrics-card .meter {
  display: block;
  width: 78px;
}

.insight-side-card,
.next-event-card {
  display: block;
}

.event-progress span,
.meter span {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-blue));
}

.bar-good,
.hud-good .hud-mini em {
  background: var(--accent-green) !important;
}

.bar-risk,
.hud-risk .hud-mini em {
  background: #ffc857 !important;
}

.bar-danger,
.hud-danger .hud-mini em {
  background: var(--accent-red) !important;
}

/* Promotion celebration */
.promotion-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 150;
  width: min(520px, calc(100vw - 24px));
  transform: translateX(-50%);
  border: 1px solid rgba(55, 230, 161, 0.48);
  border-radius: 16px;
  padding: 16px 20px;
  background:
    linear-gradient(120deg, rgba(55, 230, 161, 0.12), rgba(139, 115, 255, 0.13)),
    rgba(9, 12, 24, 0.97);
  color: var(--text-primary);
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-align: center;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.42), 0 0 30px rgba(55, 230, 161, 0.14);
}

:root[data-theme="light"] .promotion-toast {
  background: linear-gradient(120deg, #effcf7, #f1efff);
}

.result-toast,
.achievement-toast {
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Dialog resilience */
.onboarding-overlay {
  align-items: center;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.onboarding-modal {
  max-height: calc(100dvh - 24px);
  border-radius: 18px;
  overflow-x: hidden;
  overflow-y: auto;
}

.onboarding-actions {
  padding-bottom: 2px;
}

/* Medium command centers */
@media (max-width: 1450px) {
  .game-hud {
    grid-template-columns: minmax(150px, 1fr) minmax(190px, 1fr) auto auto 42px;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(10, minmax(78px, 1fr));
  }

  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within),
  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    grid-template-columns: 82px minmax(0, 1fr) minmax(250px, 282px);
  }

  .left-sidebar {
    padding-inline: 4px;
  }
}

@media (max-width: 1120px) {
  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within),
  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .right-sidebar,
  .simulation-screen[data-active-view="product"] .right-sidebar {
    grid-column: 2;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: auto;
    max-height: 170px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .right-sidebar .side-card {
    min-width: 220px;
  }

  .right-sidebar .insight-side-card,
  .right-sidebar .next-event-card {
    display: none;
  }

  .decision-list,
  #overviewView .decision-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: compact HUD, scrollable playfield, stable bottom command bar */
@media (max-width: 780px) {
  body:has(#simulationPage:not(.is-hidden)) {
    height: 100dvh;
  }

  .landing-screen {
    display: grid;
    width: 100%;
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand-panel {
    min-height: 500px;
    padding: 28px 22px;
  }

  .brand-panel::after {
    top: 18px;
    right: 18px;
    font-size: 0.56rem;
  }

  .brand-mark {
    top: 54px;
    left: 24px;
  }

  .brand-panel h1 {
    font-size: clamp(3.9rem, 19vw, 6rem);
  }

  .setup-card {
    grid-template-columns: 1fr;
    padding: 64px 18px 20px;
  }

  .setup-card .primary-button {
    grid-column: 1;
  }

  .continue-run-panel {
    align-items: stretch;
    flex-direction: column;
  }

  #continueSavedRunButton {
    width: 100%;
  }

  .simulation-screen {
    height: 100dvh;
    min-height: 100dvh;
  }

  .game-hud {
    grid-template-columns: minmax(0, 1fr) 40px 40px 40px;
    gap: 6px;
    min-height: 0;
    padding: 7px 8px 8px;
  }

  .game-title {
    grid-column: 1;
    grid-row: 1;
    padding-left: 2px;
  }

  .game-title > span {
    display: none;
  }

  .game-title h1 {
    font-size: 1rem;
  }

  .context-line {
    max-width: 28ch;
    font-size: 0.61rem;
  }

  .company-stage-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 7px 9px;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(10, 76px);
    gap: 5px;
    width: 100%;
    padding-bottom: 1px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .stat-pill {
    min-width: 76px;
    min-height: 51px;
    scroll-snap-align: start;
  }

  .stat-pill span {
    font-size: 0.58rem;
  }

  .stat-pill strong {
    font-size: 0.92rem;
  }

  .game-hud > .icon-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    text-indent: 0;
  }

  #saveRunButton {
    grid-column: 2;
    grid-row: 1;
  }

  #newRunButton {
    grid-column: 3;
    grid-row: 1;
  }

  #saveRunButton::after {
    content: "↥";
    font-size: 1.05rem;
  }

  #newRunButton::after {
    content: "+";
    font-size: 1.25rem;
  }

  .settings-menu {
    grid-column: 4;
    grid-row: 1;
  }

  .settings-panel {
    position: fixed;
    top: 55px;
    right: 8px;
    width: min(280px, calc(100vw - 16px));
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
  }

  .settings-panel .icon-button,
  .settings-panel .ghost-button,
  .settings-panel .settings-cost-controls button,
  #aiEventsButton {
    width: 100%;
    min-width: 0;
    font-size: 0.78rem;
    text-indent: 0;
  }

  .mobile-more-stats,
  .mobile-stats-toggle {
    display: none !important;
  }

  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within),
  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    display: block;
    min-height: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
  }

  .center-stage {
    height: 100%;
    padding: 10px 10px calc(84px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .left-sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 90;
    display: flex;
    width: 100%;
    height: calc(70px + env(safe-area-inset-bottom));
    min-height: 0;
    flex-direction: row;
    gap: 4px;
    border: 0;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding: 5px 6px env(safe-area-inset-bottom);
    overflow: hidden;
    background: rgba(8, 10, 22, 0.96);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  :root[data-theme="light"] .left-sidebar {
    background: rgba(255, 255, 255, 0.97);
  }

  .sidebar-brand,
  .profile-card {
    display: none !important;
  }

  .dossier-nav {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .dossier-nav::-webkit-scrollbar {
    display: none;
  }

  .dossier-nav button,
  .left-sidebar:hover .dossier-nav button,
  .left-sidebar:focus-within .dossier-nav button {
    flex: 0 0 64px;
    min-height: 58px;
    padding: 3px 1px;
    scroll-snap-align: start;
    font-size: 0.53rem;
  }

  .dossier-nav button::before,
  .sidebar-settings-toggle::before {
    width: 27px;
    height: 27px;
    font-size: 0.94rem;
  }

  .sidebar-settings-toggle,
  .left-sidebar:hover .sidebar-settings-toggle,
  .left-sidebar:focus-within .sidebar-settings-toggle {
    flex: 0 0 54px;
    width: 54px;
    min-height: 58px;
    margin: 0;
    padding: 3px 1px;
    font-size: 0.52rem;
  }

  .right-sidebar,
  .simulation-screen[data-active-view="product"] .right-sidebar {
    display: none !important;
  }

  .decision-panel {
    padding: 17px 15px;
  }

  .decision-panel h2 {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .objective-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .objective-progress > div:first-child {
    align-items: flex-start;
  }

  .decision-list,
  #overviewView .decision-list {
    grid-template-columns: 1fr;
  }

  .decision-button {
    min-height: 128px;
  }

  .team-overview-grid,
  .product-overview-grid,
  .market-overview-grid,
  .achievement-overview-grid,
  .timeline-summary-grid,
  .best-runs-grid,
  .simulation-screen[data-active-view="product"] .product-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-lab-grid,
  .simulation-screen[data-active-view="product"] .product-lab-grid,
  .simulation-screen[data-active-view="product"] .monetization-summary,
  .run-compare-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .brand-panel {
    min-height: 460px;
  }

  .brand-panel::after {
    display: none;
  }

  .company-valuation-line span {
    display: none;
  }

  .team-overview-grid,
  .product-overview-grid,
  .market-overview-grid,
  .achievement-overview-grid,
  .timeline-summary-grid,
  .best-runs-grid,
  .simulation-screen[data-active-view="product"] .product-overview-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-actions {
    grid-template-columns: 1fr;
  }

  .onboarding-actions .primary-button,
  .onboarding-actions .ghost-button {
    width: 100%;
  }
}

@media (max-height: 720px) {
  .onboarding-overlay {
    align-items: start;
  }

  .onboarding-modal {
    margin: 0 auto;
  }

  .guide-sections {
    gap: 8px;
  }

  .guide-sections section {
    padding: 9px 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .decision-button:hover,
  .primary-button:hover,
  #continueSavedRunButton:hover,
  .stat-pill:hover {
    transform: none;
  }
}

/* === LAUNCHLAB MINIMAL PLAY LAYER — AUTHORITATIVE ===
   Keep the weekly decision visually dominant. All JS-bound elements remain in
   the document; secondary reports live in their dedicated navigation views. */
:root {
  --simple-bg: #0f1115;
  --simple-surface: #171a20;
  --simple-surface-2: #1d2129;
  --simple-line: #2a303a;
  --simple-text: #f4f6f8;
  --simple-muted: #98a2b0;
  --simple-accent: #78a6ff;
  --simple-good: #55c993;
  --simple-warn: #e7b85c;
  --simple-bad: #e8757e;
  --simple-radius: 10px;
}

:root[data-theme="light"],
:root.light-mode {
  --simple-bg: #f4f6f8;
  --simple-surface: #ffffff;
  --simple-surface-2: #f0f2f5;
  --simple-line: #dce1e8;
  --simple-text: #1c2430;
  --simple-muted: #667182;
  --simple-accent: #356fd1;
  --simple-good: #20835f;
  --simple-warn: #a66d08;
  --simple-bad: #bc4552;
}

body,
body:has(#simulationPage:not(.is-hidden)) {
  background: var(--simple-bg);
}

body::after {
  display: none;
}

button,
input,
select,
textarea {
  border-radius: 8px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  border-color: var(--simple-accent) !important;
  outline: 3px solid color-mix(in srgb, var(--simple-accent) 24%, transparent) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}

/* A calmer launcher */
.landing-screen {
  width: min(1180px, 100%);
  gap: 20px;
  padding: clamp(16px, 3vw, 36px);
}

.brand-panel,
.setup-card {
  border-color: var(--simple-line);
  border-radius: 14px;
  background: var(--simple-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.brand-panel::before,
.brand-panel::after {
  display: none;
}

.brand-panel {
  min-height: 580px;
  padding: clamp(28px, 4vw, 48px);
}

.brand-panel h1 {
  max-width: none;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  text-shadow: none;
}

.brand-panel h1::after {
  content: none;
}

.brand-mark {
  transform: none;
}

.setup-card input,
.setup-card select {
  border-color: var(--simple-line);
  background: var(--simple-surface-2);
}

.setup-card .primary-button,
#continueSavedRunButton {
  background: var(--simple-accent);
  box-shadow: none;
}

/* Slim status header */
.simulation-screen {
  background: var(--simple-bg);
}

.simulation-screen,
.simulation-screen button,
.simulation-screen input,
.simulation-screen select {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-hud {
  min-height: 70px;
  grid-template-columns: minmax(145px, 190px) minmax(160px, 210px) minmax(480px, 1fr) auto auto 38px;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--simple-line);
  background: color-mix(in srgb, var(--simple-surface) 96%, transparent);
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.game-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 0 4px;
}

.game-title > span,
.context-line {
  display: none;
}

.game-title h1 {
  color: var(--simple-text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.company-stage-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 4px;
  align-content: center;
  gap: 7px 10px;
  border: 0;
  border-left: 1px solid var(--simple-line);
  border-radius: 0;
  padding: 2px 0 2px 14px;
  background: transparent;
}

.company-stage-heading span,
.company-valuation-line span {
  color: var(--simple-muted);
  font: 600 0.61rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.company-stage-heading strong,
.company-valuation-line strong {
  margin-top: 4px;
  color: var(--simple-text);
  font: 700 0.78rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.company-valuation-line strong {
  color: var(--simple-muted);
  font-weight: 600;
}

.company-stage-meter {
  height: 4px;
  background: var(--simple-line);
}

.company-stage-meter span,
.objective-meter span,
.event-progress span,
.meter span {
  background: var(--simple-accent);
  box-shadow: none;
  transition: width 180ms ease;
}

.company-stage-strip > p {
  display: none;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--simple-line);
  border-radius: 9px;
  background: var(--simple-surface-2);
}

.stat-pill {
  min-width: 0;
  min-height: 50px;
  justify-content: center;
  border: 0;
  border-left: 1px solid var(--simple-line);
  border-radius: 0;
  padding: 7px 9px;
  background: transparent;
  box-shadow: none;
}

.stat-pill:first-child {
  border-left: 0;
}

.stat-pill:hover {
  border-color: var(--simple-line);
  background: color-mix(in srgb, var(--simple-accent) 7%, transparent);
  transform: none;
}

.stat-pill span {
  color: var(--simple-muted);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.stat-pill span i,
.help-tip,
#productStatPill,
#growthStatPill,
#streakStatPill {
  display: none !important;
}

.week-pill {
  display: none !important;
}

#focusStatPill {
  border-left: 0;
}

.stat-pill strong {
  color: var(--simple-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.game-hud > .icon-button,
.settings-button {
  min-height: 36px;
  height: 36px;
  border-color: var(--simple-line);
  border-radius: 8px;
  background: transparent;
  color: var(--simple-muted);
  box-shadow: none;
}

.game-hud > .icon-button {
  min-width: 62px;
  padding: 0 9px;
  font-size: 0.68rem;
}

.game-hud > .icon-button:hover,
.settings-button:hover,
.settings-button[aria-expanded="true"] {
  border-color: var(--simple-accent);
  background: color-mix(in srgb, var(--simple-accent) 8%, transparent);
  color: var(--simple-text);
  box-shadow: none;
}

.settings-button {
  width: 36px;
  min-width: 36px;
}

.settings-panel {
  top: calc(100% + 7px);
  border-color: var(--simple-line);
  border-radius: var(--simple-radius);
  background: var(--simple-surface);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.settings-panel .icon-button,
.settings-panel .ghost-button,
.settings-panel .settings-cost-controls button,
#aiEventsButton {
  min-height: 38px;
  border-color: var(--simple-line);
  border-radius: 7px;
  background: transparent;
  color: var(--simple-text);
}

/* One navigation rail, one content pane */
.sim-layout,
.sim-layout:has(.left-sidebar:hover),
.sim-layout:has(.left-sidebar:focus-within),
.simulation-screen[data-active-view="product"] .sim-layout,
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
.simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.left-sidebar {
  border: 0;
  border-right: 1px solid var(--simple-line);
  border-radius: 0;
  padding: 10px 7px;
  background: var(--simple-surface);
  box-shadow: none;
}

.sidebar-brand,
.profile-card {
  display: none !important;
}

.dossier-nav {
  gap: 3px;
}

.dossier-nav button,
.sidebar-settings-toggle,
.left-sidebar:hover .dossier-nav button,
.left-sidebar:focus-within .dossier-nav button,
.left-sidebar:hover .sidebar-settings-toggle,
.left-sidebar:focus-within .sidebar-settings-toggle {
  min-height: 49px;
  border: 0;
  border-radius: 8px;
  color: var(--simple-muted);
  font-size: 0.57rem;
  font-weight: 600;
}

.dossier-nav button::before,
.sidebar-settings-toggle::before {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.dossier-nav button:hover,
.sidebar-settings-toggle:hover {
  border: 0;
  background: var(--simple-surface-2);
  color: var(--simple-text);
}

.dossier-nav button.active {
  border: 0;
  background: color-mix(in srgb, var(--simple-accent) 13%, transparent);
  color: var(--simple-accent);
  box-shadow: none;
}

.center-stage {
  height: 100%;
  padding: 18px clamp(16px, 3vw, 40px) 32px;
  background: var(--simple-bg);
  scrollbar-gutter: auto;
}

.center-view,
.timeline-view,
.team-view,
.product-view,
.market-view,
.achievements-view,
.runs-view {
  max-width: 1120px;
  min-height: 0;
  margin: 0 auto;
}

#overviewView.center-view {
  display: block;
  max-width: 920px;
}

#overviewView > .timeline-panel,
.right-sidebar,
.simulation-screen[data-active-view="product"] .right-sidebar {
  display: none !important;
}

/* Weekly decision is the primary surface */
.decision-panel {
  border: 1px solid var(--simple-line);
  border-radius: 12px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--simple-surface);
  box-shadow: none;
}

.decision-panel::before,
.decision-panel::after,
.decision-button::after,
.side-card::after {
  display: none;
}

.decision-topline {
  margin-bottom: 14px;
}

.eyebrow,
.report-kicker,
.decision-panel .eyebrow {
  color: var(--simple-muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.report-kicker {
  margin-bottom: 0;
  color: var(--simple-accent);
}

.event-badge {
  min-height: 28px;
  border-color: color-mix(in srgb, var(--simple-warn) 45%, var(--simple-line));
  padding: 0 10px;
  background: transparent;
  color: var(--simple-warn);
  font-size: 0.68rem;
}

.decision-panel h2 {
  max-width: 780px;
  margin-bottom: 8px;
  color: var(--simple-text);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.decision-panel > p {
  max-width: 760px;
  margin-bottom: 14px;
  color: var(--simple-muted);
  font-size: 0.91rem;
  line-height: 1.5;
}

.objective-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.7fr);
  gap: 16px;
  margin: 12px 0 8px;
  border: 0;
  border-left: 3px solid var(--simple-accent);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--simple-surface-2);
}

.objective-copy > span,
.objective-progress > div:first-child > span {
  color: var(--simple-muted);
  font: 600 0.61rem/1.1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.objective-copy h3 {
  margin: 4px 0 0;
  color: var(--simple-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.objective-copy p {
  display: none;
}

.objective-progress {
  gap: 7px;
}

#objectiveReward {
  color: var(--simple-good);
  font-size: 0.63rem;
  font-weight: 650;
}

.objective-meter {
  height: 5px;
  background: var(--simple-line);
}

.insight-card,
.guided-tip {
  width: 100%;
  max-width: none;
  margin: 8px 0 0;
  border: 0;
  border-radius: 6px;
  padding: 9px 11px;
  background: transparent;
  color: var(--simple-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.insight-card strong {
  color: var(--simple-muted);
  font-family: inherit;
}

.insight-card strong::before {
  content: none;
}

.insight-card span {
  color: var(--simple-muted);
  font-style: normal;
}

.guided-tip:empty {
  display: none;
}

.decision-list,
#overviewView .decision-list {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.decision-button {
  display: grid;
  grid-template-columns: 28px minmax(140px, 0.8fr) minmax(220px, 1.5fr) auto;
  gap: 8px 12px;
  min-height: 68px;
  align-items: center;
  border: 1px solid var(--simple-line);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--simple-surface-2);
  color: var(--simple-text);
  clip-path: none;
  animation: none;
  box-shadow: none;
  text-align: left;
}

.decision-button.choice-positive,
.decision-button.choice-negative,
.decision-button.choice-risk {
  border-bottom: 1px solid var(--simple-line);
  border-left-color: var(--simple-accent);
}

.decision-button:hover {
  border-color: var(--simple-accent);
  border-left-color: var(--simple-accent);
  background: color-mix(in srgb, var(--simple-accent) 7%, var(--simple-surface-2));
  transform: none;
  box-shadow: none;
}

.decision-button i {
  grid-column: 1;
  grid-row: 1;
  width: 26px;
  height: 26px;
  border: 1px solid var(--simple-line);
  border-radius: 50%;
  background: transparent;
  color: var(--simple-muted);
  clip-path: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
}

.decision-button strong {
  grid-column: 2;
  margin: 0;
  color: var(--simple-text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.decision-button span {
  grid-column: 3;
  color: var(--simple-muted);
  font-size: 0.77rem;
  line-height: 1.35;
}

.decision-button em {
  grid-column: 4;
  margin: 0;
  color: var(--simple-muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.decision-result-panel {
  margin-top: 14px;
  border: 1px solid var(--simple-line);
  border-radius: 8px;
  padding: 14px;
  background: var(--simple-surface-2);
  box-shadow: none;
}

.decision-result-panel #continueWeekButton,
#createProductButton,
.market-action-card button,
.product-upgrade-card button {
  background: var(--simple-accent);
  box-shadow: none;
}

/* Secondary tabs use the same quiet visual language */
.timeline-view-header,
.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header,
.runs-view-header,
.team-overview-grid article,
.product-overview-grid article,
.market-overview-grid article,
.achievement-overview-grid article,
.team-impact-panel,
.team-roles-panel,
.team-role-row,
.monetization-summary,
.product-upgrades-panel,
.roadmap-panel,
.product-upgrade-card,
.product-portfolio-panel,
.product-entity-card,
.market-choice-panel,
.market-actions-panel,
.market-report-panel,
.market-action-card,
.achievement-controls,
.achievement-card,
.timeline-summary-grid article,
.timeline-detail-entry article,
.timeline-empty,
.best-runs-grid article,
.run-compare-panel,
.run-history-panel,
.run-card {
  border-color: var(--simple-line);
  border-radius: var(--simple-radius);
  background: var(--simple-surface);
  box-shadow: none;
}

.timeline-view-header,
.team-view-header,
.product-view-header,
.market-view-header,
.achievements-view-header,
.runs-view-header {
  padding: 16px 18px;
}

.team-overview-grid,
.product-overview-grid,
.market-overview-grid,
.achievement-overview-grid,
.timeline-summary-grid,
.best-runs-grid {
  gap: 8px;
}

.promotion-toast,
.result-toast,
.achievement-toast {
  border-radius: 9px;
  background: var(--simple-surface);
  color: var(--simple-text);
  font-family: inherit;
  letter-spacing: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

/* Two-row header before the mobile breakpoint. */
@media (max-width: 1240px) {
  .game-hud {
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto auto 38px;
    grid-template-rows: auto auto;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .company-stage-strip {
    grid-column: 2;
    grid-row: 1;
  }

  #saveRunButton {
    grid-column: 3;
  }

  #newRunButton {
    grid-column: 4;
  }

  .settings-menu {
    grid-column: 5;
  }
}

/* Mobile: concise status rows and a stable, scrollable bottom navigation. */
@media (max-width: 780px) {
  .simulation-screen {
    height: 100dvh;
  }

  .game-hud {
    grid-template-columns: minmax(0, 1fr) 36px 36px 36px;
    grid-template-rows: 38px auto auto;
    gap: 5px;
    padding: 6px 8px 7px;
  }

  .game-title {
    grid-column: 1;
    grid-row: 1;
  }

  .game-title h1 {
    font-size: 0.96rem;
  }

  .company-stage-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 38px;
    border: 0;
    border-top: 1px solid var(--simple-line);
    border-bottom: 1px solid var(--simple-line);
    padding: 6px 2px;
  }

  .company-stage-heading span,
  .company-valuation-line span {
    display: none;
  }

  .company-stage-heading strong,
  .company-valuation-line strong {
    margin: 0;
    font-size: 0.72rem;
  }

  .company-stage-meter {
    grid-column: 1 / -1;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    width: 100%;
    overflow: hidden;
  }

  #burnStatPill,
  #revenueStatPill {
    display: none;
  }

  .stat-pill {
    min-width: 0;
    min-height: 42px;
    padding: 5px 4px;
  }

  .stat-pill span {
    font-size: 0.53rem;
  }

  .stat-pill strong {
    font-size: 0.75rem;
  }

  .game-hud > .icon-button,
  .settings-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .settings-panel {
    position: fixed;
    top: 50px;
    right: 7px;
    width: min(280px, calc(100vw - 14px));
    max-height: calc(100dvh - 126px);
    overflow-y: auto;
  }

  #saveRunButton,
  #newRunButton,
  .settings-menu {
    grid-row: 1;
  }

  #saveRunButton {
    grid-column: 2;
  }

  #newRunButton {
    grid-column: 3;
  }

  .settings-menu {
    grid-column: 4;
  }

  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within),
  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    display: block;
    padding: 0;
  }

  .center-stage {
    height: 100%;
    padding: 12px 10px calc(72px + env(safe-area-inset-bottom));
  }

  .left-sidebar {
    height: calc(62px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--simple-line);
    padding: 4px 5px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--simple-surface) 97%, transparent);
    box-shadow: none;
  }

  .dossier-nav {
    gap: 1px;
  }

  .dossier-nav button,
  .left-sidebar:hover .dossier-nav button,
  .left-sidebar:focus-within .dossier-nav button {
    flex-basis: 57px;
    min-height: 52px;
    padding: 2px 1px;
    font-size: 0.5rem;
  }

  .dossier-nav button::before,
  .sidebar-settings-toggle::before {
    width: 23px;
    height: 23px;
    font-size: 0.82rem;
  }

  .sidebar-settings-toggle,
  .left-sidebar:hover .sidebar-settings-toggle,
  .left-sidebar:focus-within .sidebar-settings-toggle {
    flex-basis: 48px;
    width: 48px;
    min-height: 52px;
    font-size: 0.48rem;
  }

  .decision-panel {
    border-radius: 10px;
    padding: 17px 14px;
  }

  .decision-panel h2 {
    font-size: clamp(1.3rem, 6vw, 1.65rem);
  }

  .objective-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .objective-progress > div:first-child {
    align-items: center;
  }

  .decision-button {
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 4px 10px;
    min-height: 0;
    padding: 11px;
  }

  .decision-button i {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: start;
  }

  .decision-button strong,
  .decision-button span,
  .decision-button em {
    grid-column: 2;
    text-align: left;
    white-space: normal;
  }

  .decision-button strong {
    grid-row: 1;
  }

  .decision-button span {
    grid-row: 2;
  }

  .decision-button em {
    grid-row: 3;
    margin-top: 3px;
  }

  .timeline-view-header,
  .team-view-header,
  .product-view-header,
  .market-view-header,
  .achievements-view-header,
  .runs-view-header {
    padding: 13px 14px;
  }
}

@media (max-width: 460px) {
  .landing-screen {
    padding: 10px;
  }

  .brand-panel {
    min-height: 430px;
    padding: 24px 20px;
  }

  .brand-panel h1 {
    font-size: clamp(3.1rem, 17vw, 4.8rem);
  }

  .settings-panel {
    top: 50px;
    right: 7px;
  }

  .objective-progress > div:first-child {
    gap: 6px;
  }

  #objectiveReward {
    max-width: 52%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .company-stage-meter span,
  .objective-meter span,
  .event-progress span,
  .meter span {
    transition: none;
  }
}

/* === MOBILE PLAY EXPERIENCE — AUTHORITATIVE === */
.mobile-more-button,
.mobile-more-backdrop,
.mobile-more-panel {
  display: none;
}

@media (max-width: 780px) {
  html,
  body,
  .app-shell {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  /* Mobile launcher: one clear idea, one clear form. */
  .landing-screen {
    min-height: 100svh;
    align-content: start;
    gap: 10px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .brand-panel {
    display: block;
    min-height: 0;
    border-radius: 16px;
    padding: 24px 20px 20px;
  }

  .brand-mark {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    gap: 5px;
    width: max-content;
    margin-bottom: 22px;
    transform: none;
  }

  .brand-mark span,
  .brand-mark span:nth-child(2),
  .brand-mark span:nth-child(3) {
    width: 7px;
    height: 28px;
    border-radius: 999px;
  }

  .brand-mark span:nth-child(2) {
    height: 38px;
  }

  .brand-mark span:nth-child(3) {
    height: 20px;
  }

  .brand-panel .eyebrow {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }

  .brand-panel h1 {
    margin-bottom: 12px;
    font-size: clamp(3rem, 15vw, 4.25rem);
    line-height: 0.95;
  }

  .brand-panel .intro {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .continue-run-panel {
    gap: 12px;
    margin-top: 20px;
    border-radius: 12px;
    padding: 12px;
  }

  .continue-run-copy p {
    font-size: 0.56rem;
  }

  #continueSavedRunButton {
    min-height: 48px;
  }

  .setup-card {
    gap: 12px;
    border-radius: 16px;
    padding: 52px 16px 18px;
  }

  .setup-card::before {
    top: 22px;
    left: 17px;
    font-size: 0.67rem;
  }

  .setup-card label {
    gap: 6px;
    margin: 0;
  }

  .setup-card label > span {
    font-size: 0.76rem;
  }

  .setup-card input,
  .setup-card select {
    min-height: 49px;
    font-size: 0.9rem;
  }

  .setup-card .primary-button {
    min-height: 52px;
  }

  /* Two-row command HUD: company + stage, then five essential stats. */
  .game-hud {
    grid-template-columns: minmax(0, 1fr) minmax(108px, 0.72fr) 40px;
    grid-template-rows: 42px 46px;
    gap: 6px 8px;
    min-height: 0;
    padding:
      max(6px, env(safe-area-inset-top))
      max(9px, env(safe-area-inset-right))
      7px
      max(9px, env(safe-area-inset-left));
  }

  .game-title {
    grid-column: 1;
    grid-row: 1;
    padding: 0;
  }

  .game-title h1 {
    overflow: hidden;
    font-size: 0.96rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .company-stage-strip {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto 4px;
    min-width: 0;
    min-height: 34px;
    gap: 6px;
    border: 0;
    border-left: 1px solid var(--simple-line);
    padding: 2px 0 2px 10px;
  }

  .company-stage-heading {
    min-width: 0;
  }

  .company-stage-heading span,
  .company-valuation-line {
    display: none;
  }

  .company-stage-heading strong {
    display: block;
    overflow: hidden;
    margin: 0;
    font-size: 0.69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .company-stage-meter {
    grid-column: 1;
    height: 4px;
  }

  #saveRunButton,
  #newRunButton {
    display: none !important;
  }

  .settings-menu {
    grid-column: 3;
    grid-row: 1;
  }

  .settings-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .stats-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    padding: 0;
    overflow: hidden;
  }

  #burnStatPill,
  #revenueStatPill {
    display: none !important;
  }

  .stat-pill {
    min-width: 0;
    min-height: 44px;
    padding: 5px 4px;
    scroll-snap-align: none;
  }

  .stat-pill span {
    overflow: hidden;
    font-size: 0.52rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stat-pill strong {
    font-size: 0.76rem;
  }

  .settings-panel {
    top: calc(max(6px, env(safe-area-inset-top)) + 46px);
    right: max(8px, env(safe-area-inset-right));
    width: min(300px, calc(100vw - 16px));
    max-height: calc(100dvh - 130px - env(safe-area-inset-bottom));
    padding: 10px;
    overscroll-behavior: contain;
  }

  .settings-panel .icon-button,
  .settings-panel .ghost-button,
  .settings-panel .settings-cost-controls button,
  #aiEventsButton {
    min-height: 44px;
  }

  /* The playfield owns scrolling; the browser page itself stays stable. */
  .sim-layout,
  .sim-layout:has(.left-sidebar:hover),
  .sim-layout:has(.left-sidebar:focus-within),
  .simulation-screen[data-active-view="product"] .sim-layout,
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:hover),
  .simulation-screen[data-active-view="product"] .sim-layout:has(.left-sidebar:focus-within) {
    display: block;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .center-stage {
    height: 100%;
    padding: 10px 10px calc(75px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .center-view,
  .timeline-view,
  .team-view,
  .product-view,
  .market-view,
  .achievements-view,
  .runs-view {
    width: 100%;
    gap: 10px;
  }

  /* Five calm bottom destinations. Secondary reports live in More. */
  .left-sidebar {
    height: calc(64px + env(safe-area-inset-bottom));
    gap: 2px;
    padding: 4px 5px env(safe-area-inset-bottom);
    overflow: hidden;
    background: color-mix(in srgb, var(--simple-surface) 96%, transparent);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
  }

  .dossier-nav {
    flex: 4 1 0;
    gap: 1px;
    overflow: hidden;
    scroll-snap-type: none;
  }

  .dossier-nav button[data-view="timeline"],
  .dossier-nav button[data-view="runs"],
  .dossier-nav button[data-view="achievements"] {
    display: none !important;
  }

  .dossier-nav button,
  .left-sidebar:hover .dossier-nav button,
  .left-sidebar:focus-within .dossier-nav button,
  .mobile-more-button {
    min-width: 0;
    min-height: 56px;
    flex: 1 1 0;
    border: 0;
    border-radius: 8px;
    padding: 3px 1px;
    background: transparent;
    color: var(--simple-muted);
    font-size: 0.51rem;
    font-weight: 650;
    text-align: center;
  }

  .dossier-nav button::before,
  .mobile-more-button::before {
    content: attr(data-icon);
    display: grid;
    width: 27px;
    height: 27px;
    margin: 0 auto 3px;
    place-items: center;
    border-radius: 7px;
    font-size: 0.9rem;
  }

  .dossier-nav button.active,
  .mobile-more-button.active,
  .mobile-more-button[aria-expanded="true"] {
    background: color-mix(in srgb, var(--simple-accent) 13%, transparent);
    color: var(--simple-accent);
  }

  .mobile-more-button {
    display: block;
    flex: 1 1 0;
  }

  .sidebar-settings-toggle {
    display: none !important;
  }

  /* More is a real mobile sheet, not another squeezed navigation row. */
  .mobile-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 94;
    display: block;
    background: rgba(3, 6, 12, 0.58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .mobile-more-panel {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    z-index: 95;
    display: grid;
    gap: 13px;
    max-height: min(68dvh, 560px);
    overflow-y: auto;
    border: 1px solid var(--simple-line);
    border-radius: 18px;
    padding: 16px;
    background: var(--simple-surface);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
    overscroll-behavior: contain;
  }

  .mobile-more-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-more-panel > header span {
    color: var(--simple-accent);
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .mobile-more-panel h2 {
    margin: 2px 0 0;
    color: var(--simple-text);
    font-size: 1.2rem;
  }

  #mobileMoreCloseButton {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border: 1px solid var(--simple-line);
    border-radius: 50%;
    background: var(--simple-surface-2);
    color: var(--simple-text);
    font-size: 1.35rem;
  }

  .mobile-more-links {
    display: grid;
    gap: 7px;
  }

  .mobile-more-links button {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 2px 10px;
    min-height: 58px;
    align-items: center;
    border: 1px solid var(--simple-line);
    border-radius: 10px;
    padding: 9px 11px;
    background: var(--simple-surface-2);
    color: var(--simple-text);
    text-align: left;
  }

  .mobile-more-links button.active {
    border-color: var(--simple-accent);
    background: color-mix(in srgb, var(--simple-accent) 10%, var(--simple-surface-2));
  }

  .mobile-more-links button > span {
    grid-row: 1 / span 2;
    font-size: 1.05rem;
    text-align: center;
  }

  .mobile-more-links strong {
    font-size: 0.82rem;
  }

  .mobile-more-links small {
    color: var(--simple-muted);
    font-size: 0.68rem;
  }

  .mobile-more-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-more-actions button {
    min-height: 46px;
    border: 1px solid var(--simple-line);
    border-radius: 9px;
    padding: 6px;
    background: transparent;
    color: var(--simple-muted);
    font-size: 0.68rem;
    font-weight: 650;
  }

  .mobile-more-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
  }

  /* Weekly choice remains the largest and first surface. */
  .decision-panel {
    border-radius: 12px;
    padding: 15px 13px;
  }

  .decision-topline {
    margin-bottom: 10px;
  }

  .decision-panel h2 {
    margin-bottom: 7px;
    font-size: clamp(1.25rem, 6vw, 1.55rem);
    line-height: 1.18;
  }

  .decision-panel > p {
    margin-bottom: 11px;
    font-size: 0.83rem;
    line-height: 1.45;
  }

  .objective-card {
    gap: 7px;
    margin: 9px 0 5px;
    padding: 9px 10px;
  }

  .objective-copy h3 {
    font-size: 0.82rem;
  }

  .objective-progress > div:first-child {
    align-items: center;
  }

  #objectiveReward {
    max-width: 58%;
    text-align: right;
  }

  .insight-card {
    display: block;
    margin-top: 5px;
    padding: 7px 1px;
  }

  .insight-card strong {
    display: none;
  }

  .insight-card span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .guided-tip {
    display: none !important;
  }

  .decision-list,
  #overviewView .decision-list {
    gap: 7px;
    margin-top: 10px;
  }

  .decision-button {
    min-height: 76px;
    padding: 10px;
  }

  .decision-button span {
    font-size: 0.74rem;
  }

  .decision-button em {
    font-size: 0.65rem;
  }

  .decision-result-panel #continueWeekButton {
    width: 100%;
    min-height: 48px;
  }

  .decision-result-changes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .decision-result-changes > b {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow: hidden;
    padding: 5px 8px;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #overviewView:has(.decision-result-panel:not(.is-hidden)) {
    padding-bottom: 170px;
  }

  /* Secondary screens collapse cleanly and share the playfield scroll. */
  .timeline-view-header,
  .team-view-header,
  .product-view-header,
  .market-view-header,
  .achievements-view-header,
  .runs-view-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    border-radius: 11px;
    padding: 13px;
  }

  .timeline-view-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .timeline-filters,
  .achievement-filter-group {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .timeline-filters::-webkit-scrollbar,
  .achievement-filter-group::-webkit-scrollbar {
    display: none;
  }

  .timeline-filters button,
  .achievement-filter-group button {
    flex: 0 0 auto;
    min-height: 38px;
  }

  .team-overview-grid,
  .product-overview-grid,
  .market-overview-grid,
  .achievement-overview-grid,
  .timeline-summary-grid,
  .best-runs-grid,
  .simulation-screen[data-active-view="product"] .product-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .team-overview-grid article,
  .product-overview-grid article,
  .market-overview-grid article,
  .achievement-overview-grid article,
  .timeline-summary-grid article,
  .best-runs-grid article {
    min-width: 0;
    padding: 10px;
  }

  .timeline-detail-list,
  .achievement-grid,
  .run-history-list {
    max-height: none;
    overflow: visible;
  }

  .timeline-detail-list {
    padding-left: 2px;
  }

  .timeline-detail-list::before,
  .timeline-node {
    display: none;
  }

  .timeline-detail-entry {
    grid-template-columns: 1fr;
  }

  .timeline-detail-entry article {
    border-radius: 9px;
    padding: 11px;
  }

  .product-lab-grid,
  .market-lab-grid,
  .market-strategy-grid,
  .simulation-screen[data-active-view="product"] .product-lab-grid,
  .create-product-form,
  .run-compare-controls {
    grid-template-columns: 1fr;
  }

  .monetization-summary,
  .simulation-screen[data-active-view="product"] .monetization-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monetization-summary > p {
    grid-column: 1 / -1;
  }

  .product-portfolio-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-portfolio-heading button,
  .create-product-actions,
  .create-product-actions button {
    width: 100%;
  }

  .product-upgrade-card,
  .market-action-card {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .product-upgrade-card button,
  .market-action-card button {
    width: 100%;
    min-height: 44px;
  }

  .team-role-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 10px;
  }

  .role-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .role-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .role-count {
    grid-column: 3;
    grid-row: 1;
  }

  .role-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-actions button {
    min-height: 43px;
  }

  .product-entity-bars {
    grid-template-columns: 1fr;
  }

  .product-entity-actions button {
    min-height: 42px;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .run-card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .run-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-actions button {
    min-height: 42px;
  }

  .onboarding-overlay {
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .onboarding-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    margin: auto;
    overflow-y: auto;
    border-radius: 15px;
    padding: 18px;
    overscroll-behavior: contain;
  }

  .result-toast,
  .achievement-toast {
    top: auto;
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-width: none;
    min-width: 0;
    pointer-events: none;
    transform: none;
  }

  .result-toast {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    animation: mobile-toast-pop 220ms ease both;
  }

  .result-toast > span {
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:has(.result-toast:not(.is-hidden)) .achievement-toast:not(.is-hidden) {
    bottom: calc(164px + env(safe-area-inset-bottom));
  }

  .promotion-toast {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    max-width: none;
    pointer-events: none;
    transform: none;
  }
}

@keyframes mobile-toast-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .game-hud {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.72fr) 38px;
  }

  .settings-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .stat-pill {
    padding-inline: 2px;
  }

  .mobile-more-actions {
    grid-template-columns: 1fr;
  }

  .mobile-more-actions button {
    min-height: 44px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .primary-button,
  .ghost-button,
  .product-portfolio-heading button,
  .create-product-actions button,
  .product-entity-actions button,
  .market-choice,
  .timeline-filters button,
  .achievement-filter-group button {
    min-height: 44px;
  }
}

/* Keep market choice copy in the content column instead of the icon column. */
.market-choice > i {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.market-choice > strong {
  grid-column: 2;
  grid-row: 1;
}

.market-choice > span {
  grid-column: 2;
  grid-row: 2;
}

@media (max-width: 780px) {
  .settings-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .settings-panel > *,
  .settings-panel .icon-button,
  .settings-panel .ghost-button,
  .settings-panel .settings-cost-controls,
  .settings-panel .settings-cost-controls button,
  .settings-panel .ai-events-setting,
  #howToPlayButton,
  #aiEventsButton {
    width: 100%;
    min-width: 0;
  }

  .settings-panel .ai-events-setting,
  .settings-panel .settings-cost-controls {
    grid-column: 1;
  }

  #themeButton,
  #howToPlayButton,
  #muteButton,
  #restartButton {
    grid-column: 1;
    grid-row: auto;
  }

  .settings-panel .settings-cost-controls {
    grid-template-columns: 1fr;
  }
}
