:root {
  --bg: #fff4fb;
  --surface: rgba(255, 249, 253, 0.84);
  --surface-strong: #fffaff;
  --border: rgba(136, 59, 110, 0.16);
  --ink: #2a1830;
  --muted: #785d7a;
  --accent: #ef476f;
  --accent-soft: #ffd5de;
  --warm: #ffb703;
  --warm-soft: #ffe9aa;
  --alert: #d6465f;
  --grid: rgba(76, 40, 73, 0.1);
  --shadow: 0 28px 70px rgba(122, 56, 107, 0.16);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 116, 163, 0.34), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(114, 224, 255, 0.28), transparent 24%),
    radial-gradient(circle at 55% 82%, rgba(255, 199, 64, 0.25), transparent 30%),
    linear-gradient(180deg, #fff8fc 0%, var(--bg) 52%, #f9eefc 100%);
}

button,
input {
  font: inherit;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(239, 71, 111, 0.22);
  outline-offset: 2px;
}

.page-glow {
  position: fixed;
  inset: auto;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(65px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.page-glow-left {
  top: -8rem;
  left: -8rem;
  background: rgba(255, 110, 160, 0.82);
}

.page-glow-right {
  top: 16rem;
  right: -10rem;
  background: rgba(89, 214, 255, 0.72);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 247, 252, 0.78)),
    var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero,
.workspace,
.charts-grid {
  animation: rise-in 0.8s ease both;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 2rem;
  padding: 2rem;
  overflow: hidden;
}

.hero-copy {
  max-width: 54rem;
}

.eyebrow,
.section-kicker,
.coach-label,
.spotlight-label {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Georgia", serif;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 0.96;
  max-width: 11ch;
}

.lede {
  margin: 1.25rem 0 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-spotlight {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.28), transparent 42%),
    radial-gradient(circle at bottom right, rgba(239, 71, 111, 0.22), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 242, 249, 0.72));
  border: 1px solid rgba(136, 59, 110, 0.12);
  border-radius: calc(var(--radius-xl) - 10px);
}

.spotlight-value {
  margin: 0;
  font-family: "Iowan Old Style", "Georgia", serif;
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 0.95;
}

.spotlight-copy {
  margin: 1rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.editor-panel,
.insights-panel,
.chart-panel {
  padding: 1.5rem;
}

.field-stack {
  display: grid;
  gap: 0.7rem;
}

.field-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.money-input,
.expense-row input {
  width: 100%;
  border: 1px solid rgba(136, 59, 110, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.money-input {
  padding: 1rem 1.1rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.expense-group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(136, 59, 110, 0.1);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading.compact {
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.section-total {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.expense-list {
  display: grid;
  gap: 0.75rem;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.9fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.expense-name,
.expense-amount {
  padding: 0.82rem 0.95rem;
}

.ghost-button,
.remove-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.ghost-button {
  margin-top: 1rem;
  padding: 0.8rem 1.1rem;
  justify-self: start;
  background: linear-gradient(135deg, rgba(239, 71, 111, 0.14), rgba(255, 183, 3, 0.16));
  color: var(--accent);
  font-weight: 600;
}

.remove-button {
  padding: 0.72rem 0.95rem;
  background: linear-gradient(135deg, rgba(214, 70, 95, 0.12), rgba(255, 154, 139, 0.14));
  color: var(--alert);
}

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

.ghost-button:hover {
  background: linear-gradient(135deg, rgba(239, 71, 111, 0.22), rgba(255, 183, 3, 0.24));
}

.remove-button:hover {
  background: linear-gradient(135deg, rgba(214, 70, 95, 0.2), rgba(255, 154, 139, 0.2));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-block {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 244, 249, 0.74));
  border: 1px solid rgba(136, 59, 110, 0.08);
}

.stat-label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.stat-value {
  margin: 0.45rem 0 0;
  font-family: "Iowan Old Style", "Georgia", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 0.95;
}

[data-tone="positive"] {
  color: var(--accent);
}

[data-tone="negative"] {
  color: var(--alert);
}

.suggestions,
.coach-note {
  margin-top: 1.5rem;
}

.allocation-rows {
  display: grid;
  gap: 0.8rem;
}

.allocation-row {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 245, 250, 0.72));
  border: 1px solid rgba(136, 59, 110, 0.08);
}

.allocation-row-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.allocation-row h3 {
  margin: 0;
  font-size: 1rem;
}

.allocation-row p {
  margin: 0;
}

.allocation-row .meta {
  color: var(--muted);
  font-size: 0.93rem;
}

.allocation-track {
  position: relative;
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(239, 71, 111, 0.08);
}

.allocation-fill,
.allocation-target {
  position: absolute;
  inset-block: 0;
  left: 0;
  border-radius: inherit;
}

.allocation-fill {
  background: linear-gradient(90deg, rgba(239, 71, 111, 0.94), rgba(255, 128, 162, 0.78));
  transition: width 320ms ease;
}

.allocation-target {
  width: 2px;
  background: var(--warm);
}

.allocation-note {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.coach-note {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(114, 224, 255, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 233, 242, 0.7), rgba(255, 249, 253, 0.45));
  border: 1px solid rgba(239, 71, 111, 0.12);
}

.coach-copy {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-chip {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  display: inline-block;
}

.legend-chip.actual {
  background: var(--accent);
}

.legend-chip.target {
  background: var(--warm);
}

.projection-caption {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.footer-note {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.94rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.axis-label,
.tick-label,
.chart-label {
  fill: var(--muted);
  font-family: "Aptos", "Trebuchet MS", sans-serif;
  font-size: 12px;
}

.grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.zero-line {
  stroke: rgba(76, 40, 73, 0.28);
  stroke-width: 1.3;
}

.bar-actual {
  fill: var(--accent);
}

.bar-target {
  fill: var(--warm);
  opacity: 0.84;
}

.bar-negative {
  fill: var(--alert);
}

.projection-area {
  fill: rgba(239, 71, 111, 0.12);
}

.projection-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.projection-dot {
  fill: var(--surface-strong);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 12ch;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .hero,
  .editor-panel,
  .insights-panel,
  .chart-panel {
    padding: 1.15rem;
  }

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

  .expense-row {
    grid-template-columns: 1fr;
  }

  .remove-button {
    justify-self: start;
  }
}
