:root {
  --bg-1: #e6eef8;
  --bg-2: #f6eee2;
  --surface: rgba(246, 250, 254, 0.84);
  --surface-strong: rgba(247, 251, 255, 0.95);
  --surface-dark: #0d2236;
  --surface-dark-2: #102a43;
  --stroke: rgba(14, 36, 56, 0.14);
  --stroke-strong: rgba(14, 36, 56, 0.22);
  --text: #0f2438;
  --text-muted: #4c647d;
  --text-soft: #8ea7bf;
  --accent: #4f9fff;
  --accent-2: #8cc8ff;
  --cost: #ff9d4d;
  --profit: #37d07e;
  --loss: #ff7474;
  --shadow: 0 26px 56px rgba(13, 34, 54, 0.16);
  --shadow-soft: 0 16px 32px rgba(13, 34, 54, 0.11);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shell-width: 1360px;
  --ui-font: "Sora", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html.embed-mode,
body.embed-mode {
  min-height: 0;
  height: auto;
}

body {
  font-family: var(--ui-font);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(79, 159, 255, 0.18), transparent 26%),
    radial-gradient(circle at 82% 16%, rgba(255, 157, 77, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  padding: 18px;
}

body.embed-mode {
  padding: 0;
  background: transparent;
  --text-muted: #425b74;
  --shadow: 0 28px 62px rgba(12, 27, 43, 0.2);
  --shadow-soft: 0 18px 34px rgba(12, 27, 43, 0.13);
}

body.embed-mode .roi-widget {
  border-color: rgba(15, 36, 56, 0.18);
  background:
    linear-gradient(180deg, rgba(242, 247, 252, 0.98), rgba(232, 239, 246, 0.94)),
    linear-gradient(180deg, rgba(238, 244, 249, 0.94), rgba(238, 244, 249, 0.94));
  box-shadow: 0 36px 86px rgba(12, 27, 43, 0.2);
}

body.embed-mode .roi-panel {
  border-color: rgba(15, 36, 56, 0.14);
}

body.embed-mode .roi-panel--chart {
  background: linear-gradient(180deg, rgba(243, 248, 252, 0.97), rgba(234, 241, 247, 0.92));
}

body.embed-mode .roi-live,
body.embed-mode .roi-speed-select,
body.embed-mode .roi-snapshot-grid article,
body.embed-mode .roi-kpi-card,
body.embed-mode .roi-preset {
  border-color: rgba(15, 36, 56, 0.14);
  background: rgba(240, 246, 251, 0.97);
}

body.embed-mode .roi-explainer-card {
  border-color: rgba(15, 36, 56, 0.14);
  background: linear-gradient(180deg, rgba(241, 246, 251, 0.98), rgba(233, 240, 246, 0.95));
}

button,
input,
select,
summary {
  font: inherit;
}

button {
  color: inherit;
}

.roi-shell {
  width: min(100%, var(--shell-width));
  margin: 0 auto;
}

body.embed-mode .roi-shell {
  width: 100%;
}

.roi-widget {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 36, 56, 0.14);
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(240, 246, 251, 0.9)),
    linear-gradient(180deg, rgba(244, 249, 253, 0.9), rgba(244, 249, 253, 0.9));
  box-shadow: 0 34px 84px rgba(12, 27, 43, 0.17);
  backdrop-filter: blur(18px);
}

.roi-widget::before,
.roi-widget::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.roi-widget::before {
  width: 460px;
  height: 460px;
  top: -260px;
  right: -140px;
  background: radial-gradient(circle, rgba(79, 159, 255, 0.18), transparent 68%);
}

.roi-widget::after {
  width: 380px;
  height: 380px;
  bottom: -210px;
  left: -110px;
  background: radial-gradient(circle, rgba(255, 157, 77, 0.16), transparent 68%);
}

.roi-header,
.roi-main {
  position: relative;
  z-index: 1;
}

.roi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 30px 18px;
}

.roi-header-copy {
  max-width: 760px;
}

.roi-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(79, 159, 255, 0.1);
  color: #255997;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.roi-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(79, 159, 255, 0.14);
}

.roi-header h1 {
  margin: 16px 0 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.roi-subtitle {
  margin: 14px 0 0;
  max-width: 680px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.roi-header-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: 200px;
}

.roi-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(244, 249, 253, 0.92);
  border: 1px solid rgba(15, 36, 56, 0.12);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.roi-live.is-paused {
  color: var(--text-muted);
}

.roi-live.is-paused .roi-live-dot {
  background: #93a8bc;
  box-shadow: 0 0 0 6px rgba(147, 168, 188, 0.18);
}

.roi-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--profit);
  box-shadow: 0 0 0 6px rgba(55, 208, 126, 0.16);
  animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.8;
  }
}

.roi-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.roi-speed-select {
  appearance: none;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 36, 56, 0.12);
  background: rgba(244, 249, 253, 0.94);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  width: auto;
  max-width: 100%;
  padding: 0 38px 0 14px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #5a7b9a 50%),
    linear-gradient(135deg, #5a7b9a 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.roi-button {
  appearance: none;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.roi-button:hover {
  transform: translateY(-1px);
}

.roi-button:active {
  transform: translateY(0);
}

.roi-button--ghost {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(15, 36, 56, 0.09);
  box-shadow: var(--shadow-soft);
}

.roi-button--primary {
  background: linear-gradient(135deg, #133d66, #225a92);
  color: #f8fbff;
  box-shadow: 0 16px 30px rgba(19, 61, 102, 0.24);
}

.roi-progress {
  margin: 0 30px;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(79, 159, 255, 0.12), rgba(255, 157, 77, 0.12));
  border: 1px solid rgba(15, 36, 56, 0.06);
}

.roi-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cost));
  transition: width 0.08s linear;
}

.roi-main {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(390px, 0.78fr);
  grid-template-areas: "chart inputs";
  gap: 18px;
  padding: 20px 30px 30px;
  align-items: stretch;
}

.roi-panel {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 36, 56, 0.12);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.roi-panel--chart {
  grid-area: chart;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(240, 246, 251, 0.88));
}

.roi-panel--inputs {
  grid-area: inputs;
  align-self: stretch;
  width: 100%;
  height: 100%;
  max-width: 432px;
  justify-self: end;
}

.roi-panel--inputs .roi-panel-head {
  border-bottom: 0;
  padding-bottom: 14px;
}

.roi-panel--inputs .roi-panel-copy {
  font-size: 12.5px;
  line-height: 1.45;
  white-space: normal;
}

.roi-panel-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(15, 36, 56, 0.09);
}

.roi-panel-head--chart {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.roi-kicker {
  margin: 0;
  color: #4d6781;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.roi-panel h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.roi-panel-copy {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.roi-togglebar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.roi-chip,
.roi-preset {
  appearance: none;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 36, 56, 0.13);
  background: rgba(246, 250, 254, 0.96);
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.roi-chip:hover,
.roi-preset:hover {
  transform: translateY(-1px);
}

.roi-chip.is-active,
.roi-preset.is-active {
  background: linear-gradient(135deg, rgba(79, 159, 255, 0.14), rgba(79, 159, 255, 0.08));
  border-color: rgba(79, 159, 255, 0.28);
  color: #225a92;
  box-shadow: inset 0 0 0 1px rgba(79, 159, 255, 0.06), 0 0 0 3px rgba(79, 159, 255, 0.12);
}

.roi-preset.is-complete {
  background: linear-gradient(135deg, rgba(55, 208, 126, 0.16), rgba(55, 208, 126, 0.08));
  border-color: rgba(55, 208, 126, 0.3);
  color: #178954;
  box-shadow: inset 0 0 0 1px rgba(55, 208, 126, 0.08);
}

.roi-preset.is-complete.is-active {
  background: linear-gradient(135deg, rgba(55, 208, 126, 0.24), rgba(55, 208, 126, 0.12));
  border-color: rgba(55, 208, 126, 0.4);
  color: #127347;
  box-shadow: inset 0 0 0 1px rgba(55, 208, 126, 0.08), 0 0 0 3px rgba(55, 208, 126, 0.14);
}

.roi-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}

.roi-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.roi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.roi-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.swatch--revenue {
  background: var(--accent);
}

.swatch--cost {
  background: var(--cost);
}

.swatch--profit {
  background: rgba(55, 208, 126, 0.7);
}

.swatch--loss {
  background: rgba(255, 116, 116, 0.7);
}

.roi-chart-surface {
  position: relative;
  margin: 14px 20px 0;
  min-height: 470px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 16%, rgba(79, 159, 255, 0.18), transparent 24%),
    radial-gradient(circle at 86% 10%, rgba(255, 157, 77, 0.14), transparent 20%),
    linear-gradient(180deg, #10283f, #0b1f33);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.roi-break-banner {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  max-width: min(360px, calc(100% - 36px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f8fc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
  white-space: normal;
  backdrop-filter: blur(10px);
}

.roi-break-banner.is-warning {
  color: #ffd0d0;
}

.roi-chart {
  width: 100%;
  height: 100%;
  min-height: 470px;
  display: block;
}

.roi-plot-base {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.roi-zone-wash {
  opacity: 1;
}

.roi-zone-wash--loss {
  fill: rgba(255, 116, 116, 0.06);
}

.roi-zone-wash--profit {
  fill: rgba(55, 208, 126, 0.06);
}

.roi-grid-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.roi-grid-line--vertical {
  stroke: rgba(255, 255, 255, 0.06);
}

.roi-axis-line,
.roi-axis-tick {
  stroke: rgba(255, 255, 255, 0.26);
  stroke-width: 1.2;
}

.roi-axis-text {
  fill: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.roi-axis-title {
  fill: rgba(255, 255, 255, 0.62);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.roi-milestone-line {
  stroke: rgba(140, 200, 255, 0.32);
  stroke-width: 1.2;
  stroke-dasharray: 5 8;
}

.roi-chart-badge {
  pointer-events: none;
}

.roi-chart-badge rect {
  stroke-width: 1;
}

.roi-chart-badge__title {
  fill: rgba(255, 255, 255, 0.96);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.roi-chart-badge__subtitle {
  fill: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
}

.roi-chart-badge--loss rect {
  fill: rgba(255, 116, 116, 0.11);
  stroke: rgba(255, 116, 116, 0.3);
}

.roi-chart-badge--profit rect {
  fill: rgba(55, 208, 126, 0.11);
  stroke: rgba(55, 208, 126, 0.28);
}

.roi-chart-badge--info rect {
  fill: rgba(79, 159, 255, 0.12);
  stroke: rgba(140, 200, 255, 0.28);
}

.roi-chart-badge--info .roi-chart-badge__subtitle {
  fill: rgba(214, 234, 255, 0.78);
}

.roi-area--profit {
  fill: url(#profitGradient);
}

.roi-area--loss {
  fill: url(#lossGradient);
}

.roi-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.roi-line--revenue {
  stroke: url(#lineGlowRevenue);
  stroke-width: 4;
  filter: drop-shadow(0 0 16px rgba(79, 159, 255, 0.24));
}

.roi-line--cost {
  stroke: url(#lineGlowCost);
  stroke-width: 4;
  filter: drop-shadow(0 0 16px rgba(255, 157, 77, 0.18));
}

.roi-line--roi {
  stroke: #eff6ff;
  stroke-width: 4;
  opacity: 0;
  filter: drop-shadow(0 0 16px rgba(240, 245, 255, 0.18));
}

.roi-current-halo,
.roi-current-dot {
  opacity: 0;
  pointer-events: none;
}

.roi-current-halo {
  stroke-width: 1.5;
}

.roi-current-halo--revenue {
  fill: rgba(79, 159, 255, 0.18);
  stroke: rgba(140, 200, 255, 0.48);
}

.roi-current-halo--cost {
  fill: rgba(255, 157, 77, 0.16);
  stroke: rgba(255, 211, 138, 0.44);
}

.roi-current-halo--roi {
  fill: rgba(255, 255, 255, 0.14);
  stroke: rgba(255, 255, 255, 0.38);
}

.roi-current-dot {
  stroke-width: 2.5;
}

.roi-current-dot--revenue {
  fill: #8cc8ff;
  stroke: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 0 14px rgba(79, 159, 255, 0.45));
}

.roi-current-dot--cost {
  fill: #ffbe72;
  stroke: rgba(255, 250, 242, 0.92);
  filter: drop-shadow(0 0 14px rgba(255, 157, 77, 0.38));
}

.roi-current-dot--roi {
  fill: #ffffff;
  stroke: rgba(214, 234, 255, 0.9);
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.34));
}

.roi-zero-line,
.roi-hover-line,
.roi-current-line,
.roi-break-line {
  stroke-linecap: round;
}

.roi-zero-line {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.2;
  stroke-dasharray: 4 8;
}

.roi-current-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1.2;
  stroke-dasharray: 5 9;
}

.roi-break-line {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1.3;
  stroke-dasharray: 6 7;
  opacity: 0;
}

.roi-hover-line {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 4 8;
  opacity: 0;
}

.roi-break-pulse,
.roi-drawdown-dot,
.roi-hover-dot {
  fill: #ffffff;
  stroke-width: 2.5;
  opacity: 0;
}

.roi-break-pulse {
  stroke: #ffffff;
}

.roi-drawdown-dot {
  stroke: var(--loss);
}

.roi-hover-dot {
  stroke: var(--accent-2);
}

.roi-callout {
  fill: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0;
}

.roi-callout--muted {
  fill: rgba(255, 209, 209, 0.9);
}

.roi-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 220px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(6, 15, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
  color: #f5f9ff;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.roi-tooltip-title {
  margin: 0 0 10px;
  color: #f5f9ff;
  font-size: 13px;
  font-weight: 800;
}

.roi-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.roi-tooltip-grid p {
  margin: 0;
  display: grid;
  gap: 4px;
}

.roi-tooltip-grid span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.roi-tooltip-grid strong {
  font-size: 15px;
  font-weight: 800;
}

.roi-phase-rail {
  display: grid;
  gap: 10px;
  padding: 18px 20px 0;
}

.roi-phase-track {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.roi-phase-pill {
  position: relative;
  min-height: 72px;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(15, 36, 56, 0.08);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  flex-basis: 0;
  flex-grow: 1;
}

.roi-phase-pill.is-marker {
  flex: 0 0 132px;
}

.roi-phase-pill strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.roi-phase-pill span {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.roi-phase-pill--investment strong {
  color: #255997;
}

.roi-phase-pill--recovery strong {
  color: #986020;
}

.roi-phase-pill--profit strong {
  color: #178954;
}

.roi-phase-pill--marker {
  background: linear-gradient(135deg, rgba(19, 61, 102, 0.92), rgba(26, 87, 142, 0.92));
  color: #f8fbff;
}

.roi-phase-pill--marker span {
  color: rgba(248, 251, 255, 0.74);
}

.roi-phase-pill--marker strong {
  color: #ffffff;
}

.roi-snapshot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 20px 20px;
}

.roi-snapshot-label {
  margin: 0;
  color: #244d79;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.roi-snapshot-text {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.roi-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.roi-snapshot-grid article {
  border-radius: 16px;
  border: 1px solid rgba(15, 36, 56, 0.11);
  background: rgba(246, 250, 254, 0.92);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.roi-snapshot-grid span,
.roi-kpi-card span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roi-snapshot-grid strong,
.roi-kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.roi-explainer-card {
  margin: 0 20px 20px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 36, 56, 0.11);
  background: linear-gradient(180deg, rgba(245, 249, 253, 0.96), rgba(238, 244, 249, 0.92));
  box-shadow: var(--shadow-soft);
}

.roi-explainer-kicker {
  margin: 0;
  color: #4d6781;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.roi-explainer-card h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.roi-explainer-text {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.roi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.roi-kpi-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 36, 56, 0.11);
  background: rgba(244, 249, 253, 0.94);
  padding: 14px;
  min-height: 108px;
}

.roi-kpi-card strong {
  margin-top: 10px;
  font-size: 30px;
}

.roi-kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.roi-kpi-card--wide {
  grid-column: 1 / -1;
}

.roi-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 18px;
}

.roi-controls {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

.roi-panel--inputs .roi-presets {
  padding-top: 0;
  padding-bottom: 10px;
  flex-wrap: nowrap;
  gap: 6px;
}

.roi-panel--inputs .roi-action-row--panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(128px, 1.2fr);
  gap: 8px;
  padding: 0 20px 14px;
}

.roi-panel--inputs .roi-action-row--panel .roi-button,
.roi-panel--inputs .roi-action-row--panel .roi-speed-select {
  width: 100%;
}

.roi-panel--inputs .roi-action-row--panel .roi-speed-select {
  min-width: 128px;
  padding-left: 12px;
  padding-right: 34px;
}

.roi-panel--inputs .roi-action-row--panel .roi-button {
  min-height: 44px;
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.roi-panel--inputs .roi-action-row--panel .roi-button--primary {
  background: linear-gradient(135deg, rgba(79, 159, 255, 0.14), rgba(79, 159, 255, 0.08));
  border: 1px solid rgba(79, 159, 255, 0.28);
  color: #225a92;
  box-shadow: inset 0 0 0 1px rgba(79, 159, 255, 0.06), 0 0 0 3px rgba(79, 159, 255, 0.12);
}

.roi-panel--inputs .roi-action-row--panel .roi-button--ghost {
  background: linear-gradient(135deg, rgba(79, 159, 255, 0.09), rgba(79, 159, 255, 0.04));
  border: 1px solid rgba(79, 159, 255, 0.18);
  color: #225a92;
  box-shadow: inset 0 0 0 1px rgba(79, 159, 255, 0.04);
}

.roi-panel--inputs .roi-action-row--panel .roi-button.is-complete-tone.roi-button--primary {
  background: linear-gradient(135deg, rgba(55, 208, 126, 0.24), rgba(55, 208, 126, 0.12));
  border-color: rgba(55, 208, 126, 0.4);
  color: #127347;
  box-shadow: inset 0 0 0 1px rgba(55, 208, 126, 0.08), 0 0 0 3px rgba(55, 208, 126, 0.14);
}

.roi-panel--inputs .roi-action-row--panel .roi-button.is-complete-tone.roi-button--ghost {
  background: linear-gradient(135deg, rgba(55, 208, 126, 0.12), rgba(55, 208, 126, 0.06));
  border-color: rgba(55, 208, 126, 0.22);
  color: #127347;
  box-shadow: inset 0 0 0 1px rgba(55, 208, 126, 0.05);
}

.roi-panel--inputs .roi-controls {
  grid-template-columns: 1fr;
  align-items: start;
}

.roi-panel--inputs .roi-preset {
  flex: 1 1 0;
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(15, 36, 56, 0.055);
  border-color: rgba(15, 36, 56, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  text-align: center;
  padding: 10px 12px;
  color: #667c92;
}

.roi-panel--inputs .roi-preset.is-complete:not(.is-active) {
  background: rgba(15, 36, 56, 0.055);
  border-color: rgba(15, 36, 56, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #667c92;
}

.roi-panel--inputs .roi-preset.is-active {
  background: linear-gradient(135deg, rgba(79, 159, 255, 0.14), rgba(79, 159, 255, 0.08));
  border-color: rgba(79, 159, 255, 0.26);
  color: #225a92;
  box-shadow: inset 0 0 0 1px rgba(79, 159, 255, 0.05), 0 0 0 3px rgba(79, 159, 255, 0.1);
}

.roi-panel--inputs .roi-preset.is-complete.is-active {
  background: linear-gradient(135deg, rgba(55, 208, 126, 0.24), rgba(55, 208, 126, 0.12));
  border-color: rgba(55, 208, 126, 0.4);
  color: #127347;
  box-shadow: inset 0 0 0 1px rgba(55, 208, 126, 0.08), 0 0 0 3px rgba(55, 208, 126, 0.14);
}

.roi-preset.is-empty {
  opacity: 0.66;
}

.roi-preset:disabled {
  cursor: default;
}

.roi-compare-title {
  display: block;
  color: currentColor;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.roi-control {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.roi-control-note {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.roi-control-top,
.roi-control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.roi-control output {
  color: #255997;
  font-weight: 800;
}

.roi-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 36, 56, 0.08);
  background: linear-gradient(90deg, rgba(79, 159, 255, 0.22), rgba(79, 159, 255, 0.46));
  outline: none;
}

.roi-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: linear-gradient(135deg, #1a5a92, #4f9fff);
  box-shadow: 0 8px 18px rgba(79, 159, 255, 0.28);
  cursor: pointer;
}

.roi-controls input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: linear-gradient(135deg, #1a5a92, #4f9fff);
  box-shadow: 0 8px 18px rgba(79, 159, 255, 0.28);
  cursor: pointer;
}

.roi-control-group {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.roi-panel--inputs .roi-control-group {
  min-width: 0;
  grid-column: 1 / -1;
}

.roi-control-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.roi-button:focus-visible,
.roi-chip:focus-visible,
.roi-preset:focus-visible,
.roi-controls input:focus-visible,
.roi-speed-select:focus-visible {
  outline: 3px solid rgba(79, 159, 255, 0.28);
  outline-offset: 2px;
}

.is-positive {
  color: #178954;
}

.is-negative {
  color: #c24646;
}

@media (max-width: 1140px) {
  .roi-main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "inputs";
  }

  .roi-panel--inputs {
    max-width: none;
    justify-self: stretch;
  }

  .roi-panel--inputs .roi-panel-copy {
    white-space: normal;
  }

  .roi-panel--inputs .roi-presets {
    flex-wrap: wrap;
  }

  .roi-panel--inputs .roi-action-row--panel {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 860px) {
  body {
    padding: 12px;
  }

  .roi-header {
    padding: 22px 20px 16px;
    flex-direction: column;
  }

  .roi-header-actions {
    justify-items: start;
  }

  .roi-action-row {
    justify-content: flex-start;
  }

  .roi-progress {
    margin: 0 20px;
  }

  .roi-main {
    padding: 18px 20px 22px;
  }

  .roi-panel-head--chart,
  .roi-chart-meta,
  .roi-snapshot {
    grid-template-columns: 1fr;
  }

  .roi-panel-head--chart {
    display: grid;
  }

  .roi-kpi-grid {
    grid-template-columns: 1fr;
  }

  .roi-snapshot {
    grid-template-columns: 1fr;
  }

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

  .roi-chart-surface,
  .roi-chart {
    min-height: 420px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .roi-widget {
    border-radius: 24px;
  }

  .roi-widget::before {
    width: 320px;
    height: 320px;
    top: -190px;
    right: -120px;
  }

  .roi-widget::after {
    width: 260px;
    height: 260px;
    bottom: -160px;
    left: -90px;
  }

  .roi-header {
    gap: 16px;
    padding: 20px 16px 14px;
  }

  .roi-header h1 {
    font-size: clamp(28px, 9vw, 38px);
    letter-spacing: -0.04em;
  }

  .roi-subtitle {
    margin-top: 12px;
    max-width: none;
    font-size: 14px;
    line-height: 1.55;
  }

  .roi-header-actions {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .roi-live {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 12px;
  }

  .roi-progress {
    margin: 0 16px;
    height: 10px;
  }

  .roi-main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "inputs";
    gap: 14px;
    padding: 16px 16px 18px;
  }

  .roi-panel {
    border-radius: 20px;
  }

  .roi-panel h2 {
    font-size: 20px;
  }

  .roi-panel-copy,
  .roi-caption,
  .roi-snapshot-text,
  .roi-explainer-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .roi-chart-meta,
  .roi-panel-head,
  .roi-phase-rail,
  .roi-snapshot,
  .roi-kpi-grid,
  .roi-presets,
  .roi-controls {
    padding-left: 14px;
    padding-right: 14px;
  }

  .roi-panel-head {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .roi-chart-meta {
    display: grid;
    gap: 10px;
    align-items: start;
    padding-top: 14px;
  }

  .roi-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    font-size: 11px;
  }

  .roi-chart-surface {
    margin: 12px 14px 0;
    min-height: clamp(320px, 88vw, 390px);
    border-radius: 20px;
    touch-action: pan-y;
  }

  .roi-chart {
    min-height: clamp(320px, 88vw, 390px);
  }

  .roi-break-banner {
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 9px 12px;
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: 0.02em;
  }

  .roi-snapshot {
    gap: 14px;
    padding-top: 16px;
  }

  .roi-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .roi-snapshot-grid article {
    border-radius: 14px;
    padding: 10px;
  }

  .roi-snapshot-grid strong,
  .roi-kpi-card strong {
    margin-top: 7px;
    font-size: 20px;
  }

  .roi-explainer-card {
    margin: 0 14px 14px;
    padding: 14px;
    border-radius: 16px;
  }

  .roi-explainer-card h3 {
    font-size: 16px;
  }

  .roi-panel--inputs .roi-panel-head {
    padding-bottom: 10px;
  }

  .roi-panel--inputs .roi-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 14px 12px;
  }

  .roi-panel--inputs .roi-preset {
    min-height: 46px;
    border-radius: 14px;
    font-size: 12px;
    white-space: normal;
    line-height: 1.15;
    padding: 10px 8px;
  }

  .roi-compare-title {
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }

  .roi-panel--inputs .roi-action-row--panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 14px 12px;
  }

  .roi-panel--inputs .roi-action-row--panel .roi-speed-select {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .roi-panel--inputs .roi-action-row--panel .roi-button,
  .roi-panel--inputs .roi-action-row--panel .roi-speed-select {
    min-height: 46px;
  }

  .roi-controls {
    gap: 12px;
    padding-bottom: 14px;
  }

  .roi-control {
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(15, 36, 56, 0.08);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: var(--shadow-soft);
  }

  .roi-control-top,
  .roi-control-label-row {
    align-items: flex-start;
  }

  .roi-control-top > span:first-child,
  .roi-control-label-row > span:first-child {
    max-width: 58%;
    line-height: 1.3;
  }

  .roi-control output {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(79, 159, 255, 0.1);
    color: #1f5b93;
    font-size: 12.5px;
  }

  .roi-control-note {
    display: none;
    font-size: 11.5px;
    line-height: 1.45;
  }

  .roi-control:focus-within .roi-control-note {
    display: block;
  }

  .roi-controls input[type="range"] {
    height: 10px;
  }

  .roi-controls input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .roi-controls input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .roi-phase-track {
    flex-direction: column;
  }

  .roi-phase-pill.is-marker {
    flex: 1 1 auto;
  }

  .roi-tooltip {
    display: none;
  }
}

@media (max-width: 360px) {
  .roi-live {
    font-size: 11.5px;
  }

  .roi-legend {
    grid-template-columns: 1fr;
  }

  .roi-snapshot-grid {
    grid-template-columns: 1fr;
  }

  .roi-control-top,
  .roi-control-label-row {
    flex-direction: column;
    gap: 6px;
  }

  .roi-control-top > span:first-child,
  .roi-control-label-row > span:first-child {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }

  .roi-live-dot,
  .roi-button,
  .roi-chip,
  .roi-preset {
    animation: none !important;
    transition: none !important;
  }
}
