:root {
  --bg: #050816;
  --bg-elevated: #080c18;
  --bg-elevated-soft: #0b1020;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --accent-strong: #0ea5e9;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
  --danger: #f97373;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --shadow-subtle: 0 8px 25px rgba(0, 0, 0, 0.4);
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at top left, #0b1220, #020617);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Layout */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.96));
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--accent-strong), #0f172a);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.8);
}

.topbar-title-group h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.topbar-right .badge {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* Main layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr);
  gap: 20px;
  padding: 20px 24px 24px;
  max-width: 1320px;
  margin: 0 auto;
}

.panel {
  background: linear-gradient(145deg, var(--bg-elevated), #020617);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 20px;
}

.panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.panel-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Inputs */

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  color: #e5e7eb;
}

.field-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-soft);
}

.input-prefix,
.input-suffix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top left, rgba(51, 65, 85, 0.55), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.input-prefix input,
.input-suffix input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
}

.prefix,
.suffix {
  font-size: 12px;
  color: var(--text-muted);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  flex: 1;
}

/* Select */

.select-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background-color: #020617;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-main);
  font-size: 13px;
  appearance: none;
}

.select-input option {
  background-color: #020617;
  color: #e5e7eb;
}

/* Divider & subheading */

.section-subheading {
  margin: 4px 0 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.form-divider {
  height: 1px;
  margin: 10px 0 6px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(148, 163, 184, 0.5),
    transparent
  );
}

/* Growth mode row */

.mode-row {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--text-muted);
}

.mode-option input[type="radio"] {
  accent-color: var(--accent-strong);
}

.mode-option span {
  white-space: nowrap;
}

/* Implied revenue row */

.implied-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top left, rgba(51, 65, 85, 0.55), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 13px;
}

/* Buttons */

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn-primary,
.btn-secondary {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), #22c1c3);
  color: #0b1120;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.5);
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.5);
}

.btn-secondary:hover {
  border-color: rgba(148, 163, 184, 0.8);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 10px;
}

/* Assumption note */

.assumption-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at left, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.assumption-note h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.assumption-note p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Output panel */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  padding: 10px 10px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.kpi-label {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-value {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 600;
}

.kpi-tag {
  margin: 0;
  font-size: 11px;
  color: var(--text-soft);
}

/* Output actions */

.output-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

/* Chart */

.chart-card {
  margin-bottom: 14px;
  padding: 12px 12px 16px;
  border-radius: 14px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(3, 7, 18, 0.98));
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: var(--shadow-subtle);
}

.chart-header h3 {
  margin: 0 0 2px;
  font-size: 13px;
}

.chart-header p {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--text-soft);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
}

/* Summary list */

.summary-card {
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.1), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.summary-card h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.summary-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.summary-list li + li {
  margin-top: 4px;
}

/* Footer */

.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px 18px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-soft);
}

/* Responsive */

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

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

@media (max-width: 640px) {
  .topbar {
    padding-inline: 16px;
  }

  .layout {
    padding-inline: 12px;
  }

  .panel {
    padding: 14px 12px 16px;
  }

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

  .footer {
    flex-direction: column;
    gap: 4px;
    padding-inline: 12px;
  }

  .chart-wrapper {
    height: 220px;
  }
}
