:root {
  color-scheme: light;
  --bg: #f2eee4;
  --paper: #fcfaf4;
  --surface: rgba(255, 250, 243, 0.88);
  --ink: #18211f;
  --muted: #687370;
  --line: #d5d0c3;
  --pine: #1d4b45;
  --pine-soft: #dcefeb;
  --maple: #c95c31;
  --maple-soft: #fee9df;
  --gold: #b88a20;
  --gold-soft: #f7edca;
  --shadow: 0 28px 70px rgba(42, 39, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 88px;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 92, 49, 0.12), transparent 34%),
    radial-gradient(circle at top right, rgba(29, 75, 69, 0.12), transparent 30%),
    linear-gradient(135deg, #f3efe6 0%, #ece5d9 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto auto 12% 8%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  inset: 10% 6% auto auto;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1580px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.site-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: rgba(8, 9, 13, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(38, 42, 58, 0.78);
}

.site-logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: #b7bfd2;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 180ms ease;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav-cta {
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4b45, #2b6a63);
  color: #fff !important;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  margin-bottom: 28px;
}

.hero-copy,
.hero-rules {
  background: var(--surface);
  border-radius: 30px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow,
.section-eyebrow,
.insight-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine);
}

.hero h1,
.section-head h2 {
  margin: 0;
}

.hero h1 {
  max-width: 760px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.8rem, 5vw, 4.9rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-rules {
  display: grid;
  gap: 14px;
  align-content: start;
}

.rule-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(213, 208, 198, 0.92);
  display: grid;
  gap: 8px;
}

.rule-card strong {
  font-size: 1rem;
}

.rule-card span {
  color: var(--muted);
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(460px, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.controls {
  padding: 22px;
}

.results {
  padding: 20px;
  display: grid;
  gap: 20px;
}

#calculator-form {
  display: grid;
  gap: 18px;
}

.section-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(214, 208, 196, 0.9);
  border-radius: 26px;
  padding: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 1.15rem;
  line-height: 1.2;
}

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

.field {
  display: grid;
  gap: 8px;
}

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

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 252, 246, 0.96);
  color: var(--ink);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 4px rgba(29, 75, 69, 0.12);
}

.input-shell {
  position: relative;
}

.input-shell em {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.input-shell input,
.input-shell select {
  padding-right: 44px;
}

.subsection {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(213, 208, 198, 0.9);
}

.subsection-head {
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pine);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(213, 208, 198, 0.9);
  background: rgba(255, 252, 246, 0.96);
  font-size: 0.92rem;
  font-weight: 600;
}

.check-row input {
  width: auto;
  margin: 0;
}

.is-hidden {
  display: none;
}

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

.insight-card {
  min-height: 180px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(213, 208, 198, 0.9);
}

.insight-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.insight-copy,
.warning-list,
.fine-print {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.warning-list {
  display: grid;
  gap: 8px;
}

.warning-item {
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--gold-soft);
  color: #6d591d;
}

.warning-item.warning-neutral {
  background: var(--pine-soft);
  color: var(--pine);
}

.fine-print {
  margin: 16px 0 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.summary-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(214, 208, 196, 0.9);
  background: rgba(255, 252, 246, 0.96);
}

.summary-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.05;
}

.summary-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 8px;
}

.principal-swatch {
  background: var(--pine);
}

.interest-swatch {
  background: var(--maple);
}

.yearly-chart {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: center;
}

.chart-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.chart-stack {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(104, 115, 112, 0.12);
}

.chart-principal {
  background: var(--pine);
}

.chart-interest {
  background: var(--maple);
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.toggle-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-button,
.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.toggle-button {
  padding: 10px 14px;
  background: rgba(24, 33, 31, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.toggle-button.is-active {
  background: var(--pine);
  color: #fff;
  box-shadow: 0 16px 30px rgba(29, 75, 69, 0.18);
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 13px 18px;
  font-weight: 700;
}

.primary-button {
  background: var(--pine);
  color: #fff;
  box-shadow: 0 16px 30px rgba(29, 75, 69, 0.18);
}

.secondary-button {
  background: rgba(29, 75, 69, 0.1);
  color: var(--pine);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.table-wrap {
  max-height: 760px;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(213, 208, 198, 0.9);
  background: rgba(255, 252, 246, 0.96);
}

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

.schedule-table th,
.schedule-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(213, 208, 198, 0.8);
  text-align: right;
  white-space: nowrap;
}

.schedule-table th:first-child,
.schedule-table td:first-child,
.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  text-align: left;
}

.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f3ea;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.schedule-table tbody tr:last-child td {
  border-bottom: 0;
}

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

@media (max-width: 760px) {
  body {
    padding-top: 76px;
  }

  .site-topbar {
    padding: 14px 16px;
  }

  .site-nav {
    gap: 14px;
  }

  .site-nav a {
    font-size: 0.84rem;
  }

  .page-shell {
    padding: 20px 14px 32px;
  }

  .hero-copy,
  .hero-rules,
  .controls,
  .results {
    padding: 16px;
  }

  .section-card {
    padding: 16px;
  }

  .field-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

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

  .chart-meta {
    flex-direction: column;
  }
}

@media print {
  body {
    padding-top: 0;
  }

  .site-topbar {
    display: none !important;
  }
}
