:root {
  --bg-1: #f4f8ff;
  --bg-2: #dde8ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0b63f6;
  --brand-dark: #0948b4;
  --danger: #b42318;
  --border: #d6deee;
}

body[data-theme="dark"] {
  --bg-1: #050910;
  --bg-2: #0a1324;
  --card: #0f172a;
  --text: #e5edf9;
  --muted: #9fb0c7;
  --brand: #60a5fa;
  --brand-dark: #3b82f6;
  --border: #243247;
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(148, 163, 184, 0.14);
  color: #e5edf9;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.5);
}

body[data-theme="dark"] .theme-toggle:hover {
  background: rgba(148, 163, 184, 0.22);
}

body[data-theme="dark"] .card {
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.45);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #0b1220;
  color: #e5edf9;
  border-color: #2a3a52;
}

body[data-theme="dark"] #payback-cac,
body[data-theme="dark"] #payback-arpa,
body[data-theme="dark"] #payback-gm {
  color: #000000 !important;
}

body[data-theme="dark"] #arpa,
body[data-theme="dark"] #gross-margin {
  color: #000000 !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #7f91aa;
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
  outline-color: rgba(96, 165, 250, 0.35);
  border-color: #60a5fa;
}

body[data-theme="dark"] .global-period-basis-control,
body[data-theme="dark"] .global-period-length-control,
body[data-theme="dark"] .chart-toggle,
body[data-theme="dark"] .insights-scroll-top {
  background: #121c2f;
  color: #dbeafe;
  border-color: #2a3a52;
}

body[data-theme="dark"] #payback-chart-toggle,
body[data-theme="dark"] #report-pdf-toggle,
body[data-theme="dark"] #share-results-toggle {
  background: #ffffff;
  color: #0b2a5c;
}

body[data-theme="dark"] #payback-chart-toggle svg,
body[data-theme="dark"] #report-pdf-toggle svg,
body[data-theme="dark"] #share-results-toggle svg {
  color: #0b2a5c;
  fill: currentColor;
}

body[data-theme="dark"] #share-results-toggle > span[aria-hidden="true"] {
  color: #0b2a5c !important;
  opacity: 1 !important;
}

body[data-theme="dark"] .global-period-basis-control label,
body[data-theme="dark"] .global-period-length-control label {
  color: #dbeafe;
}

body[data-theme="dark"] .global-period-basis-control select,
body[data-theme="dark"] .global-period-length-control input {
  background: #0b1220;
  color: #dbeafe;
  border-color: #304562;
}

body[data-theme="dark"] .demo-fill-toggle {
  background: #2a1520;
  color: #ffc6d5;
  border-color: rgba(244, 114, 182, 0.4);
}

body[data-theme="dark"] .demo-fill-toggle:hover {
  background: #361724;
}

body[data-theme="dark"] .where-to-fill-toggle {
  background: #132338;
  color: #cde4ff;
  border-color: rgba(96, 165, 250, 0.45);
}

body[data-theme="dark"] .where-to-fill-toggle:hover {
  background: #18304a;
}

body[data-theme="dark"] .header-helper-text {
  color: #ecfeff;
  border-color: rgba(56, 189, 248, 0.4);
  outline-color: rgba(45, 212, 191, 0.55);
  background: linear-gradient(135deg, #0369a1 0%, #15803d 100%);
}

body[data-theme="dark"] .header-helper-text .where-to-fill-toggle {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(94, 234, 212, 0.45);
  color: #dcfce7;
}

body[data-theme="dark"] .header-helper-text .where-to-fill-toggle:hover {
  background: rgba(15, 23, 42, 0.9);
}

body[data-theme="dark"] .clear-all-toggle {
  background: #331417;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

body[data-theme="dark"] .clear-all-toggle:hover {
  background: #43171b;
}

body[data-theme="dark"] .result {
  background: #0c172a;
  border-color: #243a5b;
}

body[data-theme="dark"] .result.result-filled,
body[data-theme="dark"] .result.result-filled span,
body[data-theme="dark"] .result.result-filled strong {
  color: #000000 !important;
}

body[data-theme="dark"] .insights-body {
  color: #c3d1e3;
}

body[data-theme="dark"] .insight-card {
  background: #0c172a;
  border-color: #243a5b;
}

body[data-theme="dark"] .insight-flag {
  color: #dbeafe;
}

body[data-theme="dark"] .insight-alert-critical {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

body[data-theme="dark"] .benchmark-badge {
  background: #101d32;
  border-color: #29405f;
  color: #dbeafe;
}

body[data-theme="dark"] .benchmark-badge.badge-green {
  color: #1f9d55 !important;
}

body[data-theme="dark"] .benchmark-badge.badge-yellow {
  color: #d69e2e !important;
}

body[data-theme="dark"] .benchmark-badge.badge-red {
  color: #e53e3e !important;
}

body[data-theme="dark"] .benchmark-badge.badge-neutral {
  color: #94a3b8 !important;
}

body[data-theme="dark"] .benchmark-badge.badge-green .benchmark-badge-dot {
  background: #1f9d55 !important;
}

body[data-theme="dark"] .benchmark-badge.badge-yellow .benchmark-badge-dot {
  background: #d69e2e !important;
}

body[data-theme="dark"] .benchmark-badge.badge-red .benchmark-badge-dot {
  background: #e53e3e !important;
}

body[data-theme="dark"] .benchmark-badge.badge-neutral .benchmark-badge-dot {
  background: #94a3b8 !important;
}

body[data-theme="dark"] .benchmark-card-title {
  color: #e5edf9;
}

body[data-theme="dark"] .benchmark-message {
  color: #c3d1e3;
}

body[data-theme="dark"] .tooltip,
body[data-theme="dark"] .field-tooltip,
body[data-theme="dark"] .title-master-tip,
body[data-theme="dark"] .tooltip-calc {
  background: #0b1220;
  color: #dbeafe;
  border-color: #2d4364;
  box-shadow: 0 18px 35px rgba(2, 6, 23, 0.45);
}

body[data-theme="dark"] .tooltip::before,
body[data-theme="dark"] .field-tooltip::before {
  background: #0b1220;
  border-color: #2d4364;
}

body[data-theme="dark"] .marketing-calc-grid input,
body[data-theme="dark"] .tooltip-calc input,
body[data-theme="dark"] #marketing-total-input,
body[data-theme="dark"] #sales-total-input,
body[data-theme="dark"] #revenue-total-input,
body[data-theme="dark"] #cogs-total-input {
  background: #111a2b;
  color: #e5edf9;
  border-color: #2a3a52;
}

body[data-theme="dark"] .share-modal,
body[data-theme="dark"] .payback-chart-modal {
  background: #0f172a;
  color: #e5edf9;
  border-color: #243247;
}

body[data-theme="dark"] .scenario-sim-run {
  background: #123923;
  border-color: #1f6f43;
  color: #d1fae5;
}

body[data-theme="dark"] .scenario-sim-run:hover {
  background: #15452b;
}

body[data-theme="dark"] .scenario-strategic-lab {
  background: #3b230f;
  border-color: #7c2d12;
  color: #fdba74;
  outline-color: #7c2d12;
}

body[data-theme="dark"] .scenario-strategic-lab:hover {
  background: #4a2e14;
}

body[data-theme="dark"] .scenario-strategic-lab.is-active,
body[data-theme="dark"] .scenario-strategic-lab[aria-pressed="true"] {
  background: rgba(22, 163, 74, 0.2);
  border-color: #16a34a;
  color: #86efac;
  outline-color: #16a34a;
}

body[data-theme="dark"] .scenario-graph-lab {
  background: #083344;
  border-color: #06b6d4;
  color: #a5f3fc;
  outline-color: #06b6d4;
}

body[data-theme="dark"] .scenario-graph-lab:hover {
  background: #0b4a5b;
}

body[data-theme="dark"] .scenario-graph-lab.is-active,
body[data-theme="dark"] .scenario-graph-lab[aria-pressed="true"] {
  background: #22d3ee;
  border-color: #06b6d4;
  color: #062733;
  outline-color: #06b6d4;
}

body[data-theme="dark"] .scenario-strategic-lab-state.state-off {
  background: #fdba74;
  color: #7c2d12;
  border-color: #fdba74;
}

body[data-theme="dark"] .scenario-strategic-lab-state.state-on {
  background: #86efac;
  color: #14532d;
  border-color: #86efac;
}

body[data-theme="dark"] .strategic-lab-stage {
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.38);
}

body[data-theme="dark"] .graph-lab-stage {
  background: rgba(8, 47, 73, 0.45);
  border-color: rgba(14, 116, 144, 0.55);
}

body[data-theme="dark"] .graph-lab-round-label,
body[data-theme="dark"] .graph-lab-instruction-banner,
body[data-theme="dark"] .graph-lab-prompt,
body[data-theme="dark"] .graph-lab-status,
body[data-theme="dark"] .graph-lab-points {
  color: #dbeafe;
}

body[data-theme="dark"] .graph-lab-round-banner {
  color: #e2e8f0;
}

body[data-theme="dark"] .graph-lab-success {
  background: rgba(124, 45, 18, 0.28);
  border-color: rgba(251, 146, 60, 0.7);
  color: #fdba74;
}

body[data-theme="dark"] .graph-lab-decisions {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.3);
}

body[data-theme="dark"] .graph-lab-decisions-title,
body[data-theme="dark"] .graph-lab-decisions-table th,
body[data-theme="dark"] .graph-lab-decisions-table td {
  color: #dbeafe;
}

body[data-theme="dark"] .graph-lab-insights,
body[data-theme="dark"] .graph-lab-badge-box {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.3);
}

body[data-theme="dark"] .graph-lab-insights-title,
body[data-theme="dark"] .graph-lab-insights-body p,
body[data-theme="dark"] .graph-lab-insight-list li,
body[data-theme="dark"] .graph-lab-insight-recommendation,
body[data-theme="dark"] .graph-lab-badge-row p {
  color: #dbeafe;
}

body[data-theme="dark"] .graph-lab-badge.tone-green {
  background: rgba(20, 83, 45, 0.4);
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.55);
}

body[data-theme="dark"] .graph-lab-badge.tone-yellow {
  background: rgba(120, 53, 15, 0.4);
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.55);
}

body[data-theme="dark"] .graph-lab-badge.tone-red {
  background: rgba(127, 29, 29, 0.42);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.55);
}

body[data-theme="dark"] .graph-lab-badge.tone-gray {
  background: rgba(51, 65, 85, 0.45);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.45);
}

body[data-theme="dark"] .graph-lab-back {
  background: #334155;
  border-color: #64748b;
  color: #e2e8f0;
}

body[data-theme="dark"] .graph-lab-back:hover {
  background: #475569;
}

body[data-theme="dark"] .graph-lab-word-sliders {
  color: #4ade80;
}

body[data-theme="dark"] .graph-lab-word-next {
  color: #fb923c;
}

body[data-theme="dark"] .strategic-lab-top-quest {
  background: #dbeafe;
  border-color: #93c5fd;
}

body[data-theme="dark"] .strategic-lab-prompt {
  color: #000000 !important;
}

body[data-theme="dark"] .strategic-lab-choice-prompt {
  color: #ffffff;
}

body[data-theme="dark"] .strategic-lab-card {
  color: #e5edf9;
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .strategic-card-high-risk,
body[data-theme="dark"] .strategic-lab-card-high-risk {
  background: rgba(127, 29, 29, 0.35);
}

body[data-theme="dark"] .strategic-card-strategic-move,
body[data-theme="dark"] .strategic-lab-card-strategic-move {
  background: rgba(20, 83, 45, 0.35);
}

body[data-theme="dark"] .strategic-card-trade-off,
body[data-theme="dark"] .strategic-lab-card-trade-off {
  background: rgba(120, 53, 15, 0.35);
}

body[data-theme="dark"] .strategic-lab-card.is-selected {
  box-shadow: 0 0 0 2px #60a5fa inset;
}

body[data-theme="dark"] .strategic-lab-outcome {
  background: rgba(15, 23, 42, 0.52);
  border-color: rgba(148, 163, 184, 0.38);
}

body[data-theme="dark"] .strategic-lab-move-log {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.42);
  color: #dbeafe;
}

body[data-theme="dark"] .strategic-lab-round-label {
  color: #93c5fd;
}

body[data-theme="dark"] .strategic-lab-final-message {
  background: rgba(2, 6, 23, 0.78);
}

body[data-theme="dark"] .strategic-lab-score-box {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.52);
}

body[data-theme="dark"] .strategic-lab-score-title,
body[data-theme="dark"] .strategic-lab-score-value,
body[data-theme="dark"] .strategic-lab-score-delta {
  color: #e2e8f0;
}

body[data-theme="dark"] .strategic-lab-bottom-row.in-panel {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.52);
}

body[data-theme="dark"] .scenario-mode-toggle {
  color: #e5edf9;
  background: #0f172a;
  border-color: #334155;
}

body[data-theme="dark"] .scenario-mode-toggle #scenario-mode-label {
  color: #e2e8f0;
  font-weight: 800;
}

body[data-theme="dark"] .scenario-mode-slider {
  background: #243247;
  border-color: #304562;
}

body[data-theme="dark"] .scenario-slide-panel.is-open {
  border-left-color: rgba(148, 163, 184, 0.2);
}

body[data-theme="dark"] .scenario-sim-summary {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: #dbeafe;
}

body[data-theme="dark"] .scenario-insights-body .insight-card {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.3);
}

body[data-theme="dark"] .scenario-insights-empty {
  color: #94a3b8;
}

body[data-theme="dark"] .share-link-input {
  background: #0b1220;
  color: #e5edf9;
  border-color: #2a3a52;
}

body[data-theme="dark"] .cookie-consent-banner {
  background: rgba(15, 23, 42, 0.97);
  border-color: #243247;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.55);
}

body[data-theme="dark"] .cookie-consent-text {
  color: #dbeafe;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  display: grid;
  place-items: center;
  padding: 8px 24px 24px;
}

header {
  position: relative;
  margin-bottom: 18px;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  margin-top: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  z-index: 8;
}

.theme-toggle:hover {
  background: rgba(30, 41, 59, 0.95);
}

.theme-toggle-icon {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.theme-toggle-label {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.container {
  width: 100%;
  max-width: 1760px;
}

h1 {
  text-align: center;
  margin: 0 0 20px;
  font-size: clamp(1.8rem, 2.5vw, 2.3rem);
}

.main-title {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.main-title-head {
  width: 100%;
  max-width: 1240px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.main-title-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-title-saas {
  color: #22c55e;
}

.main-title-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1240px;
}

.header-helper-row {
  order: 99;
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  column-gap: 8px;
  margin-top: 2px;
}

.header-helper-text {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.01em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(8, 47, 73, 0.34);
  outline: 2px solid rgba(125, 211, 252, 0.7);
  outline-offset: 0;
  background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.2);
}

.header-helper-copy {
  line-height: 1.15;
}

.header-helper-number {
  color: #22c55e;
  font-weight: 800;
  font-size: 1rem;
}

.header-helper-arrow {
  font-size: 1rem;
  line-height: 1;
  font-weight: 900;
  color: #ecfeff;
}

.header-helper-text .where-to-fill-toggle {
  margin-top: 0;
  border-color: rgba(8, 47, 73, 0.34);
  background: rgba(255, 255, 255, 0.92);
  color: #0b2a5c;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.header-helper-text .where-to-fill-toggle:hover {
  background: #ffffff;
}

.header-helper-row .where-to-fill-toggle {
  margin-top: 0;
  align-self: center;
  transform: translateY(0);
}

.header-helper-actions {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.header-helper-actions .where-to-fill-toggle {
  margin-left: 8px;
}

.header-helper-actions .global-period-basis-control {
  margin-left: 0;
}

.global-period-basis-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #eef4ff;
  color: #0b2a5c;
  width: fit-content;
}

.global-period-basis-control label {
  margin: 0;
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0b2a5c;
  white-space: nowrap;
}

.global-period-basis-control select {
  width: auto;
  min-width: 86px;
  padding: 4px 8px;
  border: 1px solid #bcd0f6;
  border-radius: 8px;
  background: #ffffff;
  color: #0b2a5c;
  font-weight: 700;
  font-size: 0.9rem;
}

.cac-period-basis-wrap {
  display: grid;
  justify-items: center;
  row-gap: 6px;
  margin: 0 0 6px;
}

.cac-period-basis-divider {
  margin: 2px auto 4px;
}

/* Header card-style wrapper for the global Period Length input */
.global-period-length-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #eef4ff;
  color: #0b2a5c;
  width: fit-content;
}

.global-period-length-control label {
  margin: 0;
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0b2a5c;
  white-space: nowrap;
}

/* Compact input so the control matches the header action button footprint */
.global-period-length-control input {
  width: 72px;
  padding: 4px 8px;
  border: 1px solid #bcd0f6;
  border-radius: 8px;
  background: #ffffff;
  color: #0b2a5c;
  font-weight: 700;
  font-size: 0.9rem;
}

.title-master-i,
.title-master-calc {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transform: none;
}

.main-title .title-master-i {
  transform: translateY(0px);
  font-size: 0.48em;
}

.title-master-tip {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  bottom: auto;
  transform: translateY(-50%);
  min-width: 240px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #9dbdff;
  background: #ffffff;
  color: #0b2a5c;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 6;
}

.title-master-tip-icon {
  width: 14px;
  height: 14px;
  margin: 0 2px;
  font-size: 9px;
  vertical-align: middle;
  transform: none;
  cursor: default;
  pointer-events: none;
}

.title-master-i:hover .title-master-tip,
.title-master-i:focus .title-master-tip,
.title-master-calc:hover .title-master-tip,
.title-master-calc:focus .title-master-tip {
  opacity: 1;
  visibility: visible;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: visible;
}

.calculators-grid > section[aria-labelledby="cac-title"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.calculators-grid > section[aria-labelledby="gross-margin-title"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.calculators-grid > section[aria-labelledby="ltv-title"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.calculators-grid > section[aria-labelledby="payback-title"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

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

.calculators-grid > .card {
  padding: 10px 12px;
}

.calculators-grid > .card .cac-title {
  margin-bottom: 7px;
}

.calculators-grid > .card form {
  gap: 6px;
  margin-top: 3px;
}

.calculators-grid > .card label {
  margin-top: 0;
}

/* Shrink top calculator cards without affecting the result boxes below */
.calculators-grid > .card .temp-hidden {
  display: none !important;
}

.secondary-cards-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.secondary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  min-height: 176px;
  padding: 12px 14px;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
}

#cac-actions-panel {
  min-height: 244px;
}

.secondary-card > button[type="submit"] {
  width: 100%;
  margin-top: 0;
}

.calculator-pairs-layout {
  display: block;
  margin-top: 16px;
}

.cac-title {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.title-detail {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 600;
}

#ltv-title .title-detail {
  font-size: 0.66em;
}

.title-alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #dc2626;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.exp-i {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #9dbdff;
  background: #eef4ff;
  font-size: 0.55em;
  line-height: 1;
  transform: translateY(-0.18em);
  color: var(--brand);
  font-weight: 700;
  cursor: help;
  user-select: none;
  padding: 0;
}

.exp-i:hover,
.exp-i:focus {
  background: #dce9ff;
  border-color: #6e9fff;
  outline: none;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
}

.tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(860px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px 34px;
  border-radius: 16px;
  border: 1px solid #2f66d5;
  background: linear-gradient(165deg, #1e56c9, #0f3f9d);
  color: #eef4ff;
  font-size: 1.16rem;
  line-height: 1.45;
  box-shadow: 0 24px 48px rgba(11, 32, 84, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transform-origin: center center;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.2s;
  z-index: 1200;
}

.tooltip::before {
  display: none;
}

.tooltip p {
  margin: 0;
}

.tooltip p + p {
  margin-top: 10px;
}

.tooltip-divider-soft {
  margin: 16px 0 0;
  border: 0;
  border-top: 1px solid rgba(238, 244, 255, 0.28);
}

.tooltip-detached-note {
  margin-top: 14px !important;
}

.tooltip strong {
  color: #ffffff;
}

.tooltip-title-green {
  color: #22c55e;
}

.tooltip strong.tooltip-title-green {
  color: #22c55e;
}

.tooltip.force-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s;
}

form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

label {
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.demo-step-label-host {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.field-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
}

.revenue-sync-toggle {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  align-self: flex-start;
  margin-top: -2px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.revenue-sync-toggle:hover {
  transform: translateY(-1px);
}

.revenue-sync-toggle.is-active,
.revenue-sync-toggle[aria-pressed="true"] {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

body[data-theme="dark"] .revenue-sync-toggle {
  border-color: #29405f;
  background: #101d32;
  color: #bfdbfe;
}

body[data-theme="dark"] .revenue-sync-toggle.is-active,
body[data-theme="dark"] .revenue-sync-toggle[aria-pressed="true"] {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

.field-optional {
  color: #64748b;
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1.2;
  align-self: center;
}

.mrr-calculator-block {
  width: 100%;
  align-items: center;
}

.mrr-calculator-title {
  margin: 0;
  font-size: 1.2em;
  font-weight: 700;
}

#mrr {
  margin-bottom: 18px;
  background: #ffffff;
  color: #0f172a;
  caret-color: #0f172a;
  border-color: var(--border);
}

#mrr::placeholder {
  color: #64748b;
}

body[data-theme="dark"] #mrr {
  background: #0b1220;
  color: #b08d57;
  caret-color: #000000;
  border-color: #2a3a52;
}

body[data-theme="dark"] #mrr::placeholder {
  color: #7f91aa;
}

#arpa-calc-revenue,
#arpa-calc-customers {
  color: #000000;
  caret-color: #000000;
}

#gm-revenue {
  color: #000000;
  caret-color: #000000;
}

body[data-theme="dark"] #arpa-calc-revenue {
  color: #000000;
  caret-color: #000000;
}

body[data-theme="dark"] #arpa-calc-customers {
  color: #000000;
  caret-color: #000000;
}

#arpa-calc-revenue::placeholder,
#arpa-calc-customers::placeholder {
  color: #000000;
}

.mrr-gm-divider {
  width: 42%;
  max-width: 180px;
  height: 1px;
  margin: 0 auto 18px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0),
    rgba(148, 163, 184, 0.45),
    rgba(148, 163, 184, 0)
  );
}

.cac-period-basis-wrap .mrr-gm-divider.cac-period-basis-divider {
  margin: 2px auto 4px;
}

.demo-step-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 4px solid #2563eb;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
  transform: translateY(-8px);
  pointer-events: none;
}

.demo-step-indicator[data-step="2"],
.demo-step-indicator[data-step="3"],
.demo-step-indicator[data-step="6"],
.demo-step-indicator[data-step="8"] {
  transform: translateY(2px);
}

.demo-auto-filled-notice {
  margin: -2px 0 8px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  color: #0b2a5c;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
}

.info-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
}

.field-exp-i {
  transform: translateY(0);
}

.field-exp-i.has-calc {
  width: 32px;
  display: inline-grid;
  grid-auto-flow: column;
  place-content: center;
  place-items: center;
  column-gap: 2px;
  padding: 0 3px;
  font-size: 0.58em;
}

.field-exp-i.has-calc::after {
  content: "";
  width: 9px;
  height: 9px;
  display: inline-block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 2v4h10V4H7zm1 7h2v2H8v-2zm3 0h2v2h-2v-2zm3 0h2v2h-2v-2zM8 14h2v2H8v-2zm3 0h2v2h-2v-2zm3 0h2v5h-2v-5zM8 17h5v2H8v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 2v4h10V4H7zm1 7h2v2H8v-2zm3 0h2v2h-2v-2zm3 0h2v2h-2v-2zM8 14h2v2H8v-2zm3 0h2v2h-2v-2zm3 0h2v5h-2v-5zM8 17h5v2H8v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.main-title .title-master-calc.field-exp-i {
  transform: none !important;
  top: 8px;
}

.main-title .title-master-calc svg {
  transform: none;
}

.calc-wrap {
  margin-left: 0;
  width: 0;
}

.calc-i {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #9dbdff;
  background: #eef4ff;
  color: var(--brand);
  cursor: help;
  user-select: none;
}

.calc-i:hover,
.calc-i:focus {
  background: #dce9ff;
  border-color: #6e9fff;
  outline: none;
}

.calc-i svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.field-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(820px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 32px;
  border-radius: 16px;
  border: 1px solid #2f66d5;
  background: linear-gradient(165deg, #1e56c9, #0f3f9d);
  color: #eef4ff;
  font-size: 1.12rem;
  line-height: 1.45;
  box-shadow: 0 24px 48px rgba(11, 32, 84, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transform-origin: center center;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.2s;
  z-index: 1200;
}

.field-tooltip::before {
  display: none;
}

.field-tooltip p {
  margin: 0;
}

.field-tooltip p + p {
  margin-top: 8px;
}

.field-tooltip strong {
  color: #ffffff;
}

.field-tooltip strong.tooltip-title-green {
  color: #22c55e;
}

.text-green {
  color: #22c55e;
  font-weight: 700;
}

.field-tooltip .tooltip-note-dark {
  color: #0f172a;
  font-weight: 700;
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 6px;
  border-radius: 6px;
}

.tooltip-note-button {
  width: 100%;
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2f66d5;
  background: #ffffff;
  color: #0b2a5c;
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
}

.tooltip-note-button:hover {
  background: #e9f1ff;
}

.marketing-calc-tooltip {
  width: min(390px, 78vw);
}

.calc-tooltip-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.calc-tooltip-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.calc-tooltip-close-label {
  color: #ffffff;
}

.calc-tooltip-close-x {
  color: #ef4444;
  font-weight: 800;
  line-height: 1;
}

.churn-calc-tooltip {
  width: min(460px, 84vw);
}

.marketing-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.marketing-calc-header p {
  margin: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}

.marketing-calc-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.marketing-add-field {
  margin-top: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.marketing-add-field:hover {
  background: rgba(255, 255, 255, 0.26);
}

.marketing-calc-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.marketing-calc-grid input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.96rem;
}

.marketing-calc-grid input::placeholder {
  color: rgba(238, 244, 255, 0.8);
}

.marketing-calc-grid input:focus {
  outline: 2px solid rgba(185, 209, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.8);
}

.calc-only-title {
  margin: 0;
  text-align: center;
}

.calc-tooltip-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.calc-tooltip-header-row .calc-only-title {
  text-align: left;
}

.marketing-total-wrap {
  margin-top: 2px;
}

#marketing-total-input {
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(11, 42, 92, 0.35);
}

#sales-total-input {
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(11, 42, 92, 0.35);
}

#revenue-total-input {
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(11, 42, 92, 0.35);
}

#cogs-total-input {
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(11, 42, 92, 0.35);
}

.marketing-equals-button {
  margin-top: 6px;
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: #1167bb;
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
}

.marketing-equals-button:hover {
  background: #0f5ca6;
}

.tooltip-calc {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  gap: 8px;
}

.tooltip-calc label {
  margin-top: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #eef4ff;
}

.tooltip-calc input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.98rem;
}

.tooltip-calc input::placeholder {
  color: rgba(238, 244, 255, 0.8);
}

.tooltip-calc input:focus {
  outline: 2px solid rgba(185, 209, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.8);
}

.tooltip-calc input[readonly] {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.65);
  color: #ffffff;
}

.tooltip-calc button {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.96rem;
}

.tooltip-calc button:hover {
  background: rgba(255, 255, 255, 0.26);
}

.tooltip-calc-feedback {
  min-height: 18px;
  font-size: 0.9rem;
  color: #eef4ff;
}

#arpa-calc-feedback {
  color: #0f172a;
  min-height: 36px;
  padding: 8px 8px;
  display: flex;
  align-items: center;
}

.info-wrap.force-open .field-tooltip,
.field-tooltip.force-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s;
}

.info-wrap.calc-wrap.force-open .field-tooltip {
  width: min(860px, 96vw);
  max-height: 88vh;
  transform: translate(-50%, -50%) scale(1) !important;
  transform-origin: center center;
  z-index: 1200;
}

.info-wrap.calc-wrap.calc-closed-manually .field-tooltip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid #b9d1ff;
  border-color: var(--brand);
}

input.input-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

input.input-invalid:focus {
  outline: 2px solid rgba(220, 38, 38, 0.25);
  border-color: #dc2626 !important;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #fff;
}

select:focus {
  outline: 2px solid #b9d1ff;
  border-color: var(--brand);
}

.period-fields {
  margin-top: 2px;
  display: grid;
  gap: 10px;
}

.period-summary {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

button {
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

.result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 10px;
  background: #eff5ff;
  border: 1px solid #d3e2ff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.result-explainer {
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 0.96rem;
  min-height: 22px;
}

.step-nav-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.next-step-button,
.back-step-button {
  display: block;
  width: fit-content;
  margin-top: 0;
  margin-left: 0;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #22c55e;
  background: linear-gradient(90deg, #0891b2 0%, #22c55e 100%);
  color: #ecfeff;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(8, 145, 178, 0.22);
}

.next-step-button:hover,
.back-step-button:hover {
  filter: brightness(1.06);
}

.step-nav-row .next-step-button {
  margin-left: auto;
}

.flash-next {
  animation: flash-next 0.36s ease-in-out 2;
}

@keyframes flash-next {
  0% {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(8, 145, 178, 0.22);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.36), 0 10px 18px rgba(8, 145, 178, 0.34);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(8, 145, 178, 0.22);
  }
}

.hidden {
  display: none;
}

.temp-hidden {
  visibility: hidden !important;
  pointer-events: none;
}

#cac-test-input-1.temp-hidden {
  min-height: 45px;
}

#gm-test-input-2.temp-hidden,
#gm-test-input-3.temp-hidden {
  min-height: 44px;
}

.chart-toggle {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #eef4ff;
  color: #0b2a5c;
  font-size: 0.92rem;
  font-weight: 700;
}

.title-chart-toggle {
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
}

#payback-chart-toggle {
  order: 7;
}

#payback-chart-toggle {
  align-items: center;
}

#payback-chart-toggle.disabled-temporary {
  display: none !important;
}

.demo-fill-toggle.disabled-temporary {
  display: none !important;
}

.payback-chart-toggle-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.05;
}

.payback-chart-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.payback-chart-toggle-green {
  color: #16a34a;
  font-weight: 800;
}

.payback-chart-toggle-line-main {
  font-size: 0.82rem;
  font-weight: 700;
  color: inherit;
}

.payback-chart-toggle-line-sub {
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #16a34a;
}

#report-pdf-toggle {
  order: 2;
}

#share-results-toggle {
  order: 3;
}

#demo-fill-toggle {
  order: 4;
}

#where-to-fill-toggle {
  order: 0;
}

#clear-all-toggle {
  order: 6;
}

#insights-scroll-top {
  order: 7;
}

.demo-fill-toggle {
  border-color: rgba(220, 38, 38, 0.45);
  background: #fff7f7;
  color: #9f1239;
}

.demo-fill-toggle:hover {
  background: #ffeaea;
}

.where-to-fill-toggle {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eef4ff;
  color: #0b2a5c;
}

.where-to-fill-toggle:hover {
  background: #e1ecff;
}

.clear-all-toggle {
  border-color: rgba(220, 38, 38, 0.55);
  background: #fff1f2;
  color: #b42318;
}

.clear-all-toggle:hover {
  background: #ffe4e6;
}

.insights-scroll-top {
  margin-top: 0;
  margin-left: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d3deee;
  background: #eef4ff;
  color: #0b2a5c;
  font-size: 0.78rem;
  font-weight: 800;
}

.ltv-view-insights {
  margin-top: 10px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.ltv-view-insights:hover {
  background: #b91c1c;
}

.chart-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.insights-panel {
  margin-top: 22px;
  width: 100%;
}

.insights-title {
  margin: 0 0 10px;
  text-align: center;
  font-size: clamp(1.8rem, 2.5vw, 2.3rem);
}

.insights-body {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0;
  color: #334155;
  font-size: 1.07rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.benchmark-panel {
  margin-top: 24px;
}

.benchmark-body {
  max-width: 1760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.benchmark-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.benchmark-card-title {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.benchmark-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d3e2ff;
  background: #eef4ff;
  color: #0b2a5c;
  font-weight: 700;
  font-size: 0.9rem;
}

.benchmark-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.benchmark-badge.badge-green {
  color: #1f9d55;
}

.benchmark-badge.badge-yellow {
  color: #d69e2e;
}

.benchmark-badge.badge-red {
  color: #e53e3e;
}

.benchmark-badge.badge-neutral {
  color: #64748b;
}

.benchmark-message {
  margin: 0;
  line-height: 1.4;
  color: #334155;
}

.insight-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d3e2ff;
  background: #f7faff;
}

.insight-block {
  margin: 0;
  line-height: 1.4;
}

.insight-divider {
  border: 0;
  border-top: 1px solid #d9e4f8;
  margin: 8px 0 10px;
}

.insight-flag {
  margin: 0 0 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #0f172a;
  text-align: left;
  padding-left: 18px;
  position: relative;
}

.insight-flag::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
}

.insight-flag:last-child {
  margin-bottom: 0;
}

.insight-alert-critical {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ef4444;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
  line-height: 1.35;
}

.site-footer {
  margin-top: 26px;
  padding: 14px 10px 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid #d9e4f8;
}

.site-footer a {
  color: #0b2a5c;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-footer a:hover {
  text-decoration: underline;
}

.flash-gray {
  animation: flash-gray 0.34s ease-in-out 5;
  animation-fill-mode: forwards;
}

@keyframes flash-gray {
  0% {
    background-color: #eef4ff;
    box-shadow: none;
  }
  50% {
    background-color: #d7deea;
    box-shadow: 0 0 0 2px #b6c0d3 inset;
  }
  100% {
    background-color: #eef4ff;
    box-shadow: none;
  }
}

.flash-clear {
  animation: flash-clear 0.34s ease-in-out 5;
}

@keyframes flash-clear {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
    transform: translateY(-1px);
    background: #fecdd3;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    transform: translateY(0);
  }
}

.payback-chart-modal {
  position: fixed;
  top: 58px;
  left: 70px;
  width: min(980px, 92vw);
  height: min(620px, 84vh);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.22);
  z-index: 40;
  resize: both;
  overflow: auto;
  animation: modal-pop 0.16s ease-out;
}

body.payback-chart-pinned .payback-chart-modal {
  resize: none;
  overflow: hidden;
}

body.payback-chart-pinned .payback-chart-header {
  cursor: default;
}

body.payback-chart-pinned #payback-chart-close {
  display: none;
}

.payback-chart-modal:fullscreen {
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  resize: none;
}

.payback-chart-modal:fullscreen::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.payback-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe6fb;
  cursor: move;
  user-select: none;
  background: #eef4ff;
}

.payback-chart-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.payback-chart-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.payback-chart-close {
  margin-top: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #c4d4f5;
  background: #ffffff;
  color: #0b2a5c;
  font-size: 0.86rem;
}

.payback-chart-download {
  background: #0b63f6;
  border-color: #0a57d7;
  color: #ffffff;
}

.payback-chart-close.payback-chart-download:hover {
  background: #0957d6;
}

.payback-chart-close:hover {
  background: #f3f7ff;
}

.payback-chart-body {
  padding: 12px;
  height: calc(100% - 46px);
  position: relative;
}

.scenario-chart-shell {
  display: flex;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.scenario-chart-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario-chart-svg-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
}

.strategic-lab-stability-box {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.8);
  color: #e5e7eb;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.strategic-lab-move-box {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.8);
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.28;
  text-align: center;
  white-space: pre-line;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.strategic-lab-stability-box.is-fragile {
  border-color: rgba(245, 158, 11, 0.75);
  color: #fde68a;
}

.strategic-lab-stability-box.is-danger {
  border-color: rgba(249, 115, 22, 0.75);
  color: #fdba74;
}

.strategic-lab-stability-box.is-critical {
  border-color: rgba(239, 68, 68, 0.8);
  color: #fca5a5;
}

.strategic-lab-stability-box.is-stabilizing {
  border-color: rgba(59, 130, 246, 0.8);
  color: #93c5fd;
}

.strategic-lab-stability-box.is-sustainable {
  border-color: rgba(34, 197, 94, 0.8);
  color: #86efac;
}

.scenario-chart-svg-host {
  height: 100%;
  min-height: 260px;
}

.strategic-lab-end-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.72);
}

.strategic-lab-end-card {
  width: min(1080px, 98%);
  min-height: min(520px, 86%);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.55);
  padding: 34px 36px;
  display: grid;
  gap: 22px;
  align-content: center;
  text-align: center;
}

.strategic-lab-end-card.is-survived {
  border-color: rgba(239, 68, 68, 0.65);
}

.strategic-lab-end-card.is-viable {
  border-color: rgba(245, 158, 11, 0.7);
}

.strategic-lab-end-card.is-sustainable {
  border-color: rgba(34, 197, 94, 0.72);
}

.strategic-lab-end-title {
  margin: 0;
  font-size: 2.9rem;
  line-height: 1.1;
  font-weight: 900;
  color: #ffffff;
}

.strategic-lab-end-text {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.25;
  font-weight: 700;
  color: #ffffff;
  white-space: pre-line;
}

.strategic-lab-end-close {
  justify-self: center;
  min-width: 132px;
  font-size: 1rem;
  font-weight: 800;
}

.strategic-lab-start-overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 3;
}

.strategic-lab-intro-card {
  width: min(860px, 95%);
  min-height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.62);
  background:
    linear-gradient(155deg, rgba(19, 9, 39, 0.96), rgba(7, 15, 40, 0.94)),
    repeating-linear-gradient(
      180deg,
      rgba(248, 113, 113, 0.07) 0,
      rgba(248, 113, 113, 0.07) 1px,
      transparent 1px,
      transparent 6px
    );
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55), inset 0 0 0 1px rgba(251, 146, 60, 0.26);
  padding: 18px;
  color: #ffe4e6;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  font-family: "Courier New", "JetBrains Mono", monospace;
  justify-items: center;
}

.strategic-lab-intro-middle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: start;
  gap: 14px;
}

.strategic-lab-intro-copy {
  width: 100%;
  max-width: 440px;
  justify-self: center;
  display: grid;
  gap: 12px;
}

.strategic-lab-intro-kicker {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fda4af;
  text-align: center;
}

.strategic-lab-intro-line {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.34;
  color: #ffe4e6;
}

.strategic-lab-intro-score {
  margin: 2px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fef3c7;
  text-align: center;
}

.strategic-lab-intro-score strong {
  color: #ffffff;
}

.strategic-lab-start {
  pointer-events: auto;
  min-width: 180px;
  min-height: 58px;
  border-radius: 10px;
  border: 1px solid #b91c1c;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 26px rgba(185, 28, 28, 0.38), inset 0 0 0 1px rgba(254, 202, 202, 0.42);
  justify-self: center;
}

.strategic-lab-start:hover {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  transform: translateY(-1px);
}

.strategic-lab-mission-card {
  width: 100%;
  max-width: 300px;
  align-self: stretch;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.65);
  background: linear-gradient(165deg, rgba(20, 83, 45, 0.9), rgba(21, 128, 61, 0.86));
  box-shadow: inset 0 0 0 1px rgba(187, 247, 208, 0.2);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  align-content: center;
  text-align: center;
}

.strategic-lab-mission-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: transparent;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.strategic-lab-mission-list {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 700;
  color: #f0fdf4;
}

.strategic-lab-mission-goodluck {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #dcfce7;
}

.strategic-lab-stage {
  margin-top: -38px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #fca5a5;
  background: #fff5f5;
  display: grid;
  gap: 8px;
  position: relative;
}

.graph-lab-stage {
  margin-top: -22px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  display: grid;
  gap: 10px;
}

.graph-lab-round-banner {
  margin: 0 0 8px;
  text-align: center;
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.05;
  color: #e2e8f0;
  text-shadow: 0 2px 14px rgba(8, 145, 178, 0.45);
}

.graph-lab-diagnosis-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.62);
  z-index: 6;
  padding: 12px;
}

.graph-lab-diagnosis-card {
  width: min(940px, 96%);
  min-height: min(480px, 92%);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.97), rgba(30, 41, 59, 0.96));
  padding: 24px;
  display: grid;
  gap: 12px;
  align-content: center;
}

.graph-lab-diagnosis-title {
  margin: 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  color: #f8fafc;
}

.graph-lab-diagnosis-metrics,
.graph-lab-diagnosis-text {
  margin: 0;
  text-align: center;
  white-space: pre-line;
  font-size: 1.15rem;
  color: #e2e8f0;
}

.graph-lab-diagnosis-result-title {
  margin: 4px 0 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: #cbd5e1;
}

.graph-lab-diagnosis-result {
  margin: 0;
  text-align: center;
  font-size: 1.42rem;
  font-weight: 900;
  color: #e2e8f0;
}

.graph-lab-diagnosis-result.is-red {
  color: #fca5a5;
}

.graph-lab-diagnosis-result.is-yellow {
  color: #fcd34d;
}

.graph-lab-diagnosis-result.is-green {
  color: #86efac;
}

.graph-lab-diagnosis-share-title {
  margin: 6px 0 0;
  text-align: center;
  font-weight: 800;
  color: #e2e8f0;
}

.graph-lab-diagnosis-actions,
.graph-lab-share-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.graph-lab-share-feedback {
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: #cbd5e1;
  min-height: 1.2em;
}

.graph-lab-diagnosis-overlay.hidden,
.graph-lab-share-options.hidden {
  display: none !important;
}

.flash-graph-round-banner {
  animation: flash-graph-round-banner 0.7s ease-in-out 2;
}

@keyframes flash-graph-round-banner {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.22;
  }
  100% {
    opacity: 1;
  }
}

.graph-lab-round-label {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f172a;
  display: none;
}

.graph-lab-instruction-banner {
  margin: 0;
  margin-top: 10px;
  margin-bottom: 30px;
  font-size: 1.26rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  text-align: center;
}

.graph-lab-word-sliders {
  color: #16a34a;
}

.graph-lab-word-next {
  color: #ea580c;
}

.graph-lab-prompt {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
  text-align: center;
}

.graph-lab-status {
  margin: 0;
  font-size: 0.92rem;
  color: #0f172a;
  text-align: center;
}

.graph-lab-success {
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #c2410c;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-line;
  text-align: center;
}

.graph-lab-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.graph-lab-actions.has-back {
  justify-content: space-between;
}

.graph-lab-next {
  background: #0ea5e9;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 800;
}

.graph-lab-next:hover {
  background: #0284c7;
}

.graph-lab-back {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
  font-weight: 800;
}

.graph-lab-back:hover {
  background: #cbd5e1;
}

.graph-lab-top-action {
  font-weight: 800;
}

.graph-lab-decisions {
  margin: 2px 0 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.12);
}

.graph-lab-decisions-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.graph-lab-decisions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.graph-lab-decisions-table th,
.graph-lab-decisions-table td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.graph-lab-decisions-table tbody tr:last-child td {
  border-bottom: 0;
}

.graph-lab-insights,
.graph-lab-badge-box {
  margin: 2px 0 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.12);
}

.graph-lab-insights-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.graph-lab-insights-body p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.graph-lab-insights-body p:last-child {
  margin-bottom: 0;
}

.graph-lab-insight-list {
  margin: 0 0 8px 18px;
  padding: 0;
}

.graph-lab-insight-list li {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.graph-lab-insight-recommendation {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.graph-lab-badge-body {
  display: grid;
  gap: 8px;
}

.graph-lab-badge-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.graph-lab-badge-row p {
  margin: 0;
  font-size: 0.88rem;
}

.graph-lab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.graph-lab-badge.tone-green {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.graph-lab-badge.tone-yellow {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}

.graph-lab-badge.tone-red {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

.graph-lab-badge.tone-gray {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.graph-lab-points {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.strategic-lab-round-label {
  margin: 0;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #0b2a5c;
  background: linear-gradient(180deg, #f8f1de 0%, #e8dcc2 100%);
  text-align: left;
  font-size: 1.22rem;
  font-weight: 800;
  color: #000000 !important;
  text-shadow: none !important;
  box-shadow: inset 0 0 0 1px rgba(11, 42, 92, 0.18);
  white-space: normal;
}

.strategic-lab-top-quest {
  margin: 0 0 4px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #93c5fd;
  background: #dbeafe;
}

.strategic-lab-prompt {
  margin: 0;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.02;
  color: #000000;
  text-align: center;
}

.flash-strategic-prompt {
  animation: flash-strategic-prompt 0.42s ease-in-out 3;
}

@keyframes flash-strategic-prompt {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.28;
  }
  100% {
    opacity: 1;
  }
}

.strategic-lab-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.strategic-lab-choice-prompt {
  margin: -2px 0 0;
  color: #ffffff;
  font-weight: 900;
  font-size: 3.06rem;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

.strategic-lab-card {
  text-align: center;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  padding: 16px;
  display: grid;
  gap: 10px;
  min-height: 178px;
  justify-items: center;
}

.strategic-lab-card strong {
  font-size: 1.42rem;
}

.strategic-lab-card span {
  font-size: 1.18rem;
  line-height: 1.35;
}

.strategic-lab-card em {
  font-size: 1.16rem;
  font-style: normal;
  font-weight: 700;
}

.strategic-card-high-risk,
.strategic-lab-card-high-risk {
  background: #fef2f2;
  border-color: #fca5a5;
}

.strategic-card-strategic-move,
.strategic-lab-card-strategic-move {
  background: #f0fdf4;
  border-color: #86efac;
}

.strategic-card-trade-off,
.strategic-lab-card-trade-off {
  background: #fffbeb;
  border-color: #fcd34d;
}

.strategic-lab-card.is-selected {
  box-shadow: 0 0 0 2px #2563eb inset;
}

.strategic-lab-card:disabled {
  opacity: 0.72;
  cursor: default;
}

.strategic-lab-outcome {
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  color: #ffffff;
  min-height: 3.5em;
  display: block;
  white-space: pre-line;
}

.strategic-lab-outcome.is-recovered {
  background: #ecfdf5;
  border-color: #86efac;
  color: #ffffff;
}

.strategic-lab-outcome.is-fragile {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #ffffff;
}

.strategic-lab-outcome.is-destroyed {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ffffff;
}


.strategic-lab-outcome-good,
.strategic-lab-outcome-cac {
  color: #22c55e;
  font-weight: 900;
}

.strategic-lab-score-delta {
  margin: 2px auto 6px;
  min-width: 120px;
  width: fit-content;
  padding: 4px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.72);
  text-align: center;
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
}

.strategic-lab-score-delta.is-positive {
  color: #22c55e !important;
}

.strategic-lab-score-delta.is-negative {
  color: #ef4444 !important;
}

.strategic-lab-confetti-burst {
  position: absolute;
  left: 50%;
  top: 86px;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 4;
}

.strategic-lab-confetti-burst span {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  animation: strategic-confetti var(--d, 700ms) ease-out forwards;
}

.strategic-lab-confetti-burst.is-positive span {
  background: #22c55e;
}

.strategic-lab-confetti-burst.is-negative span {
  background: #ef4444;
}

@keyframes strategic-confetti {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), 110px) rotate(var(--r));
  }
}
.flash-strategic-outcome {
  animation: flash-strategic-outcome 0.34s ease-in-out 2;
}

@keyframes flash-strategic-outcome {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.28;
  }
  100% {
    opacity: 1;
  }
}

.strategic-lab-move-log {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px dashed #64748b;
  background: rgba(15, 23, 42, 0.04);
  font-size: 1.72rem;
  font-weight: 700;
  text-align: center;
}

.strategic-lab-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.strategic-lab-footer-controls {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}

.strategic-lab-footer-controls .scenario-chart-toolbar-right {
  gap: 18px;
}

.strategic-lab-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 2px;
}

.strategic-lab-continue {
  background: #ef4444;
  border-color: #b91c1c;
  color: #ffffff;
  font-weight: 800;
}

.strategic-lab-continue:hover {
  background: #b91c1c;
}

.strategic-lab-leave {
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 28px;
}

.payback-chart-modal:fullscreen.strategic-lab-active .payback-chart-body {
  padding: 6px 8px 8px;
}

.payback-chart-modal:fullscreen.strategic-lab-active .scenario-chart-shell {
  align-items: flex-start;
}

.payback-chart-modal:fullscreen.strategic-lab-active .scenario-chart-svg-frame {
  flex: 0 0 44vh;
  min-height: 250px;
}

.strategic-lab-bottom-row.in-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #c4d4f5;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.strategic-lab-bottom-row.in-panel .strategic-lab-actions {
  justify-content: flex-start;
}

.strategic-lab-bottom-row.in-panel .strategic-lab-footer-controls {
  margin-left: 0;
  justify-content: flex-start;
}

.strategic-lab-bottom-row.in-panel .scenario-chart-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.strategic-lab-bottom-row.in-header {
  margin: 0 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.strategic-lab-bottom-row.in-header .strategic-lab-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.strategic-lab-bottom-row.in-header .strategic-lab-footer-controls {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
}

.strategic-lab-bottom-row.in-header .scenario-chart-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.strategic-lab-bottom-row.in-header .strategic-lab-leave {
  margin-top: 0;
  margin-bottom: 0;
}

.strategic-lab-bottom-row.in-header .scenario-strategic-lab {
  color: #111827 !important;
}

.strategic-lab-bottom-row.in-header .scenario-strategic-lab.is-active,
.strategic-lab-bottom-row.in-header .scenario-strategic-lab[aria-pressed="true"] {
  color: #111827 !important;
}

.strategic-lab-bottom-row.in-header .scenario-strategic-lab .scenario-strategic-lab-state.state-on {
  color: #111827 !important;
}

.strategic-lab-bottom-row.in-header .scenario-mode-toggle #scenario-mode-label {
  color: #111827;
}

.strategic-lab-final-message {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.72);
  white-space: pre-line;
}

.strategic-lab-final-message.is-win {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.7);
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: min(820px, 88vw);
  z-index: 1200;
}

.payback-chart-modal.strategic-lab-win .payback-chart-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  pointer-events: none;
  z-index: 1100;
}

.strategic-lab-score-box {
  width: 168px;
  min-height: 168px;
  margin: 0 auto 10px;
  border-radius: 12px;
  border: 1px solid #c4d4f5;
  background: #ffffff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  position: relative;
  overflow: visible;
}

.strategic-lab-score-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #0f172a;
}

.strategic-lab-score-value {
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

#payback-chart-modal:not(.strategic-lab-active) .strategic-lab-score-box {
  display: none !important;
}

.strategic-lab-start-overlay.hidden,
.strategic-lab-end-overlay.hidden,
.strategic-lab-stage.hidden,
.graph-lab-stage.hidden,
.strategic-lab-prompt.hidden,
.strategic-lab-cards.hidden,
.strategic-lab-outcome.hidden,
.strategic-lab-actions.hidden,
.strategic-lab-score-box.hidden,
.strategic-lab-score-delta.hidden,
.graph-lab-points.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .strategic-lab-cards {
    grid-template-columns: 1fr;
  }

  .strategic-lab-bottom-row {
    flex-wrap: wrap;
  }

  .strategic-lab-footer-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .strategic-lab-start {
    min-width: 180px;
    min-height: 62px;
    font-size: 1.12rem;
  }

  .strategic-lab-stability-box {
    left: 8px;
    right: 8px;
    top: 8px;
    transform: none;
    max-width: none;
    font-size: 0.95rem;
  }

  .strategic-lab-move-box {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    transform: none;
    max-width: none;
    font-size: 0.9rem;
  }

  .strategic-lab-score-delta {
    font-size: 2.6rem;
    min-width: 96px;
  }

  .strategic-lab-intro-card {
    width: min(560px, 96%);
  }

  .strategic-lab-intro-middle {
    grid-template-columns: 1fr;
  }
}

.scenario-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.scenario-chart-toolbar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scenario-chart-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.scenario-sim-run {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
  font-weight: 700;
}

.scenario-sim-run:hover {
  background: #dcfce7;
}

.scenario-strategic-lab {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
  font-weight: 700;
  outline: 2px solid #fdba74;
  outline-offset: 1px;
}

.scenario-strategic-lab-state {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.scenario-strategic-lab-state.state-off {
  background: #7c2d12;
  color: #fdba74;
  border: 1px solid #9a3412;
}

.scenario-strategic-lab-state.state-on {
  background: #166534;
  color: #dcfce7;
  border: 1px solid #15803d;
}

.scenario-strategic-lab:hover {
  background: #ffedd5;
}

.scenario-strategic-lab.is-active,
.scenario-strategic-lab[aria-pressed="true"] {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
  outline-color: #16a34a;
}

.scenario-graph-lab {
  background: #dff9ff;
  border-color: #06b6d4;
  color: #0c4a6e;
  font-weight: 700;
  outline: 2px solid #06b6d4;
  outline-offset: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.scenario-graph-lab:hover {
  background: #bff4ff;
}

.scenario-graph-lab.is-active,
.scenario-graph-lab[aria-pressed="true"] {
  background: #22d3ee;
  border-color: #0891b2;
  color: #083344;
  outline-color: #0891b2;
}

.scenario-toolbar-jump {
  font-weight: 700;
}

.scenario-insights-jump {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fee2e2;
}

.scenario-insights-jump:hover {
  background: #991b1b;
}

.scenario-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.scenario-mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scenario-mode-slider {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d1d5db;
  border: 1px solid #cbd5e1;
  position: relative;
  transition: background-color 0.18s ease;
}

.scenario-mode-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
  transition: transform 0.18s ease;
}

.scenario-mode-toggle input:checked + .scenario-mode-slider {
  background: #22c55e;
  border-color: #16a34a;
}

.scenario-mode-toggle #scenario-mode-label {
  color: #0f172a;
  font-weight: 800;
}

.scenario-mode-toggle input:checked + .scenario-mode-slider::after {
  transform: translateX(20px);
}

.scenario-slide-panel {
  width: 0;
  opacity: 0;
  overflow: hidden;
  border-left: 1px solid transparent;
  padding-left: 0;
  transition: width 0.2s ease, opacity 0.2s ease, padding-left 0.2s ease, border-color 0.2s ease;
}

.scenario-slide-panel.is-open {
  width: min(300px, 34vw);
  opacity: 1;
  padding-left: 12px;
  padding-right: 8px;
  border-left-color: rgba(148, 163, 184, 0.24);
  overflow-y: auto;
}

.scenario-slide-panel h4 {
  margin: 2px 0 10px;
  font-size: 0.96rem;
}

.scenario-slider-group {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.scenario-slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scenario-slider-row label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.scenario-slider-row strong {
  font-size: 0.8rem;
}

.scenario-slide-panel input[type="range"] {
  width: 100%;
  margin: 0;
  height: 8px;
  border-radius: 999px;
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.24);
  outline: none;
}

.scenario-slide-panel input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.24);
  cursor: pointer;
}

.scenario-slide-panel input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.24);
  cursor: pointer;
}

.scenario-clear-button {
  width: 100%;
  margin: 0 0 10px;
  font-weight: 700;
}

.scenario-sim-summary {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.06);
  font-size: 0.78rem;
  line-height: 1.35;
}

.scenario-sim-summary p {
  margin: 0 0 6px;
}

.scenario-sim-summary p:last-child {
  margin-bottom: 0;
}

.scenario-insights-body {
  display: grid;
  gap: 8px;
}

.scenario-insights-body .insight-card {
  padding: 10px 11px;
  border-radius: 10px;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
}

.scenario-insights-empty {
  margin: 0;
  color: #64748b;
}

.flash-scenario-summary {
  animation: flash-scenario-summary 0.36s ease-in-out 2;
}

@keyframes flash-scenario-summary {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.scenario-benchmark-body {
  display: grid;
  gap: 8px;
}

.scenario-benchmark-card {
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
}

.scenario-benchmark-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.scenario-benchmark-message {
  margin: 6px 0 0;
}

.payback-chart-svg {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
}

.share-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
}

.share-modal-backdrop.hidden {
  display: none;
}

.share-modal {
  width: min(560px, 94vw);
  border-radius: 12px;
  border: 1px solid #d6deee;
  background: #f8fbff;
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe6fb;
  background: #eef4ff;
}

.share-modal-body {
  padding: 14px 14px 12px;
}

.share-modal-note {
  margin: 0 0 10px;
  color: #0b2a5c;
  font-weight: 700;
}

.share-link-label {
  display: block;
  margin: 0 0 6px;
  font-weight: 700;
  color: #0f172a;
}

.share-link-input {
  width: 100%;
  border: 1px solid #c9d7f3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #0f172a;
}

.share-actions-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.share-action-button {
  margin-top: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #c4d4f5;
  background: #ffffff;
  color: #0b2a5c;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.share-action-button:hover {
  background: #edf3ff;
}

.share-modal-feedback {
  min-height: 18px;
  margin: 10px 0 0;
  color: #0f766e;
  font-size: 0.9rem;
  font-weight: 700;
}

.cookie-consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #c9d7f3;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

.cookie-consent-banner.hidden {
  display: none;
}

.cookie-consent-text {
  margin: 0;
  color: #334155;
  line-height: 1.4;
  font-size: 0.92rem;
}

.cookie-consent-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-consent-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #c4d4f5;
  background: #ffffff;
  color: #0b2a5c;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}

.cookie-consent-button.primary {
  background: #0b63f6;
  border-color: #0a57d7;
  color: #ffffff;
}

.cookie-consent-button.primary:hover {
  background: #0957d6;
}

.cookie-consent-button.link:hover {
  background: #edf3ff;
}

.ratio-value-red {
  color: #b42318;
  font-weight: 700;
}

#gross-margin-retained-value {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
}

#ltv-explainer-value {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
}

#payback-explainer-value {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
}

.flash-yellow {
  animation: flash-yellow 0.45s ease-in-out 1;
  animation-fill-mode: forwards;
}

@keyframes flash-yellow {
  0% {
    background-color: inherit;
    box-shadow: none;
  }
  50% {
    background-color: #ffe680;
    box-shadow: 0 0 0 2px #ffd24d inset;
  }
  100% {
    background-color: #ffe680;
    box-shadow: 0 0 0 2px #ffd24d inset;
  }
}

.flash-green {
  animation: flash-green 0.45s ease-in-out 5;
  animation-fill-mode: forwards;
}

#gm-actions-panel .result.flash-green {
  animation-name: flash-green-soft;
}

@keyframes flash-green {
  0% {
    background-color: inherit;
    box-shadow: none;
  }
  50% {
    background-color: #b8f5c0;
    box-shadow: 0 0 0 2px #4ade80 inset;
  }
  100% {
    background-color: #b8f5c0;
    box-shadow: 0 0 0 2px #4ade80 inset;
  }
}

@keyframes flash-green-soft {
  0% {
    background-color: inherit;
    box-shadow: none;
  }
  50% {
    background-color: #d7f4de;
    box-shadow: 0 0 0 2px #86d7a1 inset;
  }
  100% {
    background-color: #d7f4de;
    box-shadow: 0 0 0 2px #86d7a1 inset;
  }
}

.flash-purple {
  animation: flash-purple 0.45s ease-in-out 5;
  animation-fill-mode: forwards;
}

@keyframes flash-purple {
  0% {
    background-color: inherit;
    box-shadow: none;
  }
  50% {
    background-color: #c7ecff;
    box-shadow: 0 0 0 2px #0ea5e9 inset;
  }
  100% {
    background-color: #c7ecff;
    box-shadow: 0 0 0 2px #0ea5e9 inset;
  }
}

.flash-navy {
  animation: flash-navy 0.45s ease-in-out 5;
  animation-fill-mode: forwards;
}

@keyframes flash-navy {
  0% {
    background-color: inherit;
    box-shadow: none;
    color: inherit;
  }
  50% {
    background-color: #0b2a5c;
    box-shadow: 0 0 0 2px #1d4f91 inset;
    color: #ffffff;
  }
  100% {
    background-color: #0b2a5c;
    box-shadow: 0 0 0 2px #1d4f91 inset;
    color: #ffffff;
  }
}

.flash-aqua {
  animation: flash-aqua 0.45s ease-in-out 5;
  animation-fill-mode: forwards;
}

@keyframes flash-aqua {
  0% {
    background-color: inherit;
    box-shadow: none;
    color: inherit;
  }
  50% {
    background-color: #7fe7db;
    box-shadow: 0 0 0 2px #14b8a6 inset;
    color: #053a35;
  }
  100% {
    background-color: #7fe7db;
    box-shadow: 0 0 0 2px #14b8a6 inset;
    color: #053a35;
  }
}

.blink-hint-i {
  animation: blink-hint-i 0.34s ease-in-out 5;
}

@keyframes blink-hint-i {
  0% {
    background: #eef4ff;
    border-color: #9dbdff;
    color: var(--brand);
  }
  50% {
    background: #bfdbfe;
    border-color: #2563eb;
    color: #1d4ed8;
  }
  100% {
    background: #eef4ff;
    border-color: #9dbdff;
    color: var(--brand);
  }
}

.blink-hint-calc {
  animation: blink-hint-calc 0.34s ease-in-out 5;
}

@keyframes blink-hint-calc {
  0% {
    background: #eef4ff;
    border-color: #9dbdff;
    color: var(--brand);
  }
  50% {
    background: #fde68a;
    border-color: #f59e0b;
    color: #92400e;
  }
  100% {
    background: #eef4ff;
    border-color: #9dbdff;
    color: var(--brand);
  }
}

.error {
  color: var(--danger);
  margin: 10px 0 0;
  min-height: 20px;
}

.cac-amount-bold {
  font-weight: 700;
}

@media (max-width: 1400px) {
  .calculators-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .benchmark-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .benchmark-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  header {
    margin-bottom: 14px;
  }

  .calculator-pairs-layout {
    margin-top: 12px;
  }

  .calculator-pairs-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .calculator-pairs-layout > .calculators-grid,
  .calculator-pairs-layout > .secondary-cards-grid {
    display: contents;
  }

  .calculators-grid {
    grid-template-columns: 1fr;
  }

  .calculator-pairs-layout .calculators-grid > .card:nth-child(1) {
    order: 1;
  }

  .calculator-pairs-layout #cac-actions-panel {
    order: 2;
  }

  .calculator-pairs-layout .calculators-grid > .card:nth-child(2) {
    order: 3;
  }

  .calculator-pairs-layout #gm-actions-panel {
    order: 4;
  }

  .calculator-pairs-layout .calculators-grid > .card:nth-child(3) {
    order: 5;
  }

  .calculator-pairs-layout #ltv-actions-panel {
    order: 6;
  }

  .calculator-pairs-layout .calculators-grid > .card:nth-child(4) {
    order: 7;
  }

  .calculator-pairs-layout #payback-actions-panel {
    order: 8;
  }

  .calculator-pairs-layout #cac-actions-panel,
  .calculator-pairs-layout #gm-actions-panel,
  .calculator-pairs-layout #ltv-actions-panel {
    margin-bottom: 16px;
  }

  .insights-body {
    grid-template-columns: 1fr;
  }

  .benchmark-body {
    grid-template-columns: 1fr;
  }

  .benchmark-card {
    gap: 8px;
  }

  .benchmark-message {
    font-size: 0.95rem;
  }

  .site-footer {
    gap: 10px;
  }

  .payback-chart-modal {
    top: 14px;
    left: 14px;
    width: calc(100vw - 28px);
    height: calc(100vh - 28px);
  }

  .scenario-chart-shell {
    flex-direction: column;
    gap: 10px;
  }

  .scenario-chart-toolbar {
    align-items: stretch;
  }

  .scenario-slide-panel {
    width: 100%;
    max-height: 0;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid transparent;
    transition: max-height 0.2s ease, opacity 0.2s ease, padding-top 0.2s ease, border-color 0.2s ease;
  }

  .scenario-slide-panel.is-open {
    width: 100%;
    max-height: 560px;
    padding-left: 0;
    padding-top: 10px;
    padding-right: 8px;
    border-left: 0;
    border-top-color: rgba(148, 163, 184, 0.24);
    overflow-y: auto;
  }
}

@media (max-width: 520px) {
  .main-title {
    padding-top: 48px;
  }

  .theme-toggle {
    top: 2px;
    right: 50%;
    transform: translateX(50%);
  }

  .theme-toggle-label {
    font-size: 0.8rem;
  }

  .main-title {
    gap: 10px;
  }

  .main-title-head {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  .main-title-text {
    gap: 6px;
  }

  .main-title-actions {
    gap: 8px;
  }

  .header-helper-row {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
  }

  .header-helper-text {
    grid-column: 1;
  }

  .header-helper-actions {
    grid-column: 2;
    gap: 6px;
  }

  .benchmark-card-title {
    font-size: 0.95rem;
  }

  .benchmark-badge {
    font-size: 0.84rem;
    padding: 5px 9px;
    gap: 7px;
  }

  .benchmark-badge-dot {
    width: 9px;
    height: 9px;
  }

  .benchmark-message {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .payback-chart-body {
    padding: 8px;
  }

  .demo-fill-toggle,
  .where-to-fill-toggle,
  .clear-all-toggle {
    white-space: nowrap;
  }

  .chart-toggle {
    padding: 7px 10px;
    font-size: 0.82rem;
    gap: 6px;
  }

  .chart-toggle svg {
    width: 15px;
    height: 15px;
  }

  .insights-scroll-top {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .card {
    padding: 18px;
  }

  .tooltip {
    width: min(860px, 96vw);
    max-height: 88vh;
    padding: 24px 22px;
  }

  .field-tooltip {
    width: min(820px, 96vw);
    max-height: 88vh;
    padding: 22px 20px;
  }

  .calc-wrap .field-tooltip {
    width: min(860px, 96vw);
  }

  .info-wrap.calc-wrap.force-open .field-tooltip,
  .calc-wrap .field-tooltip.force-open {
    transform: translate(-50%, -50%) scale(1);
  }

  .marketing-calc-header {
    align-items: flex-start;
  }

  .marketing-calc-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 6px;
  }

  .calc-tooltip-header-row {
    align-items: flex-start;
  }

  .calc-tooltip-close {
    flex-shrink: 0;
  }

  .field-label {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .demo-step-indicator {
    width: 40px;
    height: 40px;
    border-width: 3px;
    font-size: 0.92rem;
    transform: translateY(-4px);
  }

  .demo-step-indicator[data-step="2"],
  .demo-step-indicator[data-step="3"],
  .demo-step-indicator[data-step="6"],
  .demo-step-indicator[data-step="8"] {
    transform: translateY(1px);
  }

  .demo-auto-filled-notice {
    font-size: 0.88rem;
    padding: 7px 12px;
  }

  .churn-calc-tooltip {
    width: min(860px, 96vw);
  }

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

  .cookie-consent-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cookie-consent-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cookie-consent-button {
    width: 100%;
  }
}





