:root {
  --bg: #f3f0e8;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #fffdf8;
  --text: #1e1c18;
  --muted: #6c655c;
  --line: rgba(30, 28, 24, 0.1);
  --accent: #f3de72;
  --accent-strong: #e0c23f;
  --shadow: 0 18px 45px rgba(37, 30, 13, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 243, 194, 0.8), transparent 32%),
    linear-gradient(180deg, #f7f3eb 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(30, 28, 24, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 28, 24, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 78%);
}

.app-shell {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.intro,
.controls,
.calculator {
  backdrop-filter: blur(14px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.intro {
  padding: 32px;
  border-radius: var(--radius-xl);
}

.eyebrow,
.step,
.scenario-kicker,
.control-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.lead {
  max-width: 640px;
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.controls,
.calculator {
  margin-top: 20px;
  padding: 24px;
  border-radius: var(--radius-xl);
}

.controls {
  display: grid;
  gap: 20px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.75);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.pill:hover span,
.pill input:focus-visible + span {
  transform: translateY(-1px);
  border-color: rgba(30, 28, 24, 0.2);
}

.pill input:checked + span {
  background: var(--text);
  color: #fffaf0;
  border-color: var(--text);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.scenario-grid {
  display: grid;
  gap: 18px;
}

.scenario-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  animation: lift-in 280ms ease both;
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.scenario-header h3 {
  margin-top: 8px;
  font-size: 1.3rem;
}

.scenario-note {
  max-width: 240px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.input-card {
  display: block;
  margin-top: 18px;
}

.input-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff3a9 0%, var(--accent) 100%);
  border: 1px solid rgba(112, 93, 10, 0.18);
}

.currency-prefix {
  font-size: 1.2rem;
  font-weight: 700;
}

.budget-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 700;
  color: var(--text);
}

.budget-input::placeholder {
  color: rgba(30, 28, 24, 0.42);
}

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

.summary-strip > div {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #f6f1e7;
  border: 1px solid rgba(30, 28, 24, 0.06);
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-strip strong {
  font-size: 1.15rem;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

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

th,
td {
  padding: 14px 8px;
  border-bottom: 1px solid rgba(30, 28, 24, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

td:nth-child(2),
th:nth-child(2) {
  text-align: right;
}

td:nth-child(3),
th:nth-child(3) {
  width: 28%;
  color: var(--muted);
}

.muted-cell {
  color: var(--muted);
}

@keyframes lift-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 24px 14px 36px;
  }

  .intro,
  .controls,
  .calculator {
    padding: 18px;
    border-radius: 22px;
  }

  .section-header,
  .scenario-header {
    display: block;
  }

  .scenario-note {
    max-width: none;
    margin-top: 10px;
  }

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

  td:nth-child(3),
  th:nth-child(3) {
    width: auto;
  }
}
