:root {
  --ink: #17324d;
  --muted: #5e7285;
  --paper: rgba(255, 255, 255, 0.92);
  --line: rgba(23, 50, 77, 0.12);
  --accent: #0f9d8a;
  --accent-deep: #0b7d6f;
  --gold: #f5b942;
  --rose: #ef6c57;
  --shadow: 0 24px 60px rgba(17, 46, 79, 0.14);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(245, 185, 66, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(15, 157, 138, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fdff 0%, #eff8fb 48%, #eef6f8 100%);
}

a {
  color: inherit;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  padding: 24px 0 18px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 4.3rem);
  max-width: 10ch;
}

.lede {
  max-width: 70ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.panel,
.card,
.stat-card,
.table-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel,
.chart-card,
.table-card,
.stat-card {
  padding: 24px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

.stack {
  display: grid;
  gap: 18px;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.field,
.slider {
  width: 100%;
}

.field {
  border: 1px solid rgba(23, 50, 77, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}

.field:focus,
.slider:focus {
  outline: 3px solid rgba(15, 157, 138, 0.18);
  border-color: var(--accent);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #13b4a0 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 157, 138, 0.22);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(23, 50, 77, 0.16);
}

.btn-danger {
  background: #fff5f3;
  color: #b33a2d;
  border: 1px solid rgba(239, 108, 87, 0.35);
}

.helper,
.meta {
  color: var(--muted);
}

.helper {
  font-size: 0.95rem;
  line-height: 1.65;
}

.meta {
  font-size: 0.9rem;
}

.formula {
  font-family: "Cambria Math", "STIX Two Math", Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  color: var(--ink);
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(15, 157, 138, 0.08), rgba(245, 185, 66, 0.1));
  border-radius: 18px;
  margin: 18px 0;
}

.math-var {
  font-family: "Cambria Math", "STIX Two Math", Georgia, "Times New Roman", serif;
  font-style: italic;
}

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

.kpi {
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(230, 247, 244, 0.95));
  border: 1px solid rgba(15, 157, 138, 0.12);
}

.kpi-label {
  display: block;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.progress-shell {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(23, 50, 77, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 0.2s ease;
}

.round-card {
  display: grid;
  gap: 20px;
}

.round-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 157, 138, 0.1);
  color: var(--accent-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

.allocation-card {
  padding: 20px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(15, 157, 138, 0.1), rgba(223, 244, 255, 0.88)),
    #fff;
  border: 1px solid rgba(23, 50, 77, 0.08);
}

.tradeoff-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.tradeoff-card {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.tradeoff-caption {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bucket {
  position: relative;
  width: 100%;
  max-width: 180px;
  height: 240px;
  border-radius: 28px 28px 22px 22px;
  overflow: hidden;
  border: 2px solid rgba(23, 50, 77, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(232, 242, 245, 0.95));
  box-shadow: inset 0 -10px 18px rgba(23, 50, 77, 0.06);
}

.bucket-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 8%;
  transition: height 0.2s ease;
}

.bucket-fill-today {
  background: linear-gradient(180deg, #ffd36f 0%, #f5b942 100%);
}

.bucket-fill-tomorrow {
  background: linear-gradient(180deg, #6dd5c1 0%, #0f9d8a 100%);
}

.bucket-value {
  position: absolute;
  inset: auto 0 18px;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tradeoff-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.tradeoff-arrow {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-content: center;
  padding-bottom: 36px;
}

.tradeoff-arrow-line {
  width: 70px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  position: relative;
}

.tradeoff-arrow-line::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 12px solid var(--accent);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.tradeoff-arrow-text {
  max-width: 110px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tradeoff-summary {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(223, 244, 255, 0.72));
  border: 1px solid rgba(15, 157, 138, 0.12);
  color: var(--ink);
}

.allocation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.allocation-box {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(23, 50, 77, 0.08);
}

.allocation-box strong {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.allocation-box span {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 800;
}

.slider-shell {
  display: grid;
  gap: 10px;
}

.growth-banner {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 157, 138, 0.16), rgba(245, 185, 66, 0.18));
  border: 1px solid rgba(15, 157, 138, 0.16);
  color: var(--ink);
  font-weight: 700;
}

.growth-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 157, 138, 0.12);
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 700;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.slider {
  appearance: none;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--ink);
  box-shadow: 0 6px 18px rgba(23, 50, 77, 0.24);
}

.slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--ink);
  box-shadow: 0 6px 18px rgba(23, 50, 77, 0.24);
}

.note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.results-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(245, 185, 66, 0.18);
  color: #8a6011;
  font-weight: 700;
  font-size: 0.9rem;
}

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

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.chart-card canvas {
  width: 100%;
  max-height: 360px;
}

.insight {
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.14), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(245, 185, 66, 0.22);
  color: #68480e;
}

.table-shell {
  overflow: auto;
  max-height: 580px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(23, 50, 77, 0.08);
}

th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .grid-two,
  .dashboard-grid,
  .stats-grid,
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .tradeoff-visual {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .tradeoff-arrow {
    padding-bottom: 0;
  }

  .tradeoff-arrow-line {
    width: 4px;
    height: 54px;
    background: linear-gradient(180deg, var(--gold), var(--accent));
  }

  .tradeoff-arrow-line::after {
    right: 50%;
    top: auto;
    bottom: -2px;
    transform: translateX(50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--accent);
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1120px);
    padding-top: 22px;
    padding-bottom: 30px;
  }

  .allocation-grid,
  .button-row {
    display: grid;
  }
}
