:root {
  --ink: #261a15;
  --muted: #79675d;
  --paper: rgba(255, 250, 242, 0.88);
  --line: rgba(64, 43, 32, 0.14);
  --accent: #c7793c;
  --accent-2: #f4c476;
  --girl: #e77f9e;
  --boy: #5c9fd5;
  --surprise: #d6a945;
  --green: #6e9860;
  --shadow: 0 28px 80px rgba(77, 45, 24, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Avenir Next", Verdana, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 224, 171, 0.9), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(167, 215, 231, 0.68), transparent 32%),
    radial-gradient(circle at 58% 100%, rgba(224, 150, 115, 0.24), transparent 34%),
    linear-gradient(135deg, #fff5df 0%, #f5ded1 52%, #f7ecda 100%);
}

body.theme-girl {
  --accent: var(--girl);
  --accent-2: #f8bdd0;
}

body.theme-boy {
  --accent: var(--boy);
  --accent-2: #badcf3;
}

body.theme-surprise {
  --accent: var(--surprise);
  --accent-2: #f2d784;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.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;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 58px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 38px;
  padding: 22px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.84), rgba(255, 240, 213, 0.56)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 0 9px, transparent 9px 20px);
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  right: 70px;
  top: 90px;
  width: 170px;
  height: 170px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.hero::after {
  right: -72px;
  bottom: -92px;
  width: 270px;
  height: 270px;
  background: color-mix(in srgb, var(--accent) 44%, transparent);
}

.topbar,
.hero-grid,
.stats-heading {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.top-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: end;
  padding: 92px 14px 18px;
}

.eyebrow,
.step-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.96;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.3rem, 9vw, 8.1rem);
  letter-spacing: -0.075em;
}

.hero-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.due-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.due-label,
.due-count,
label > span,
legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.due-card strong {
  display: block;
  margin: 10px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  letter-spacing: -0.06em;
}

.due-count {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 17%, #fff);
  color: var(--ink);
}

.panel {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: clamp(22px, 4vw, 40px);
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(81, 48, 25, 0.1);
}

.view-panel.is-hidden {
  display: none;
}

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

.home-choice-button {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 34px;
  color: #fffaf2;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.24), transparent 22%),
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 66%, #4b2b1f));
  box-shadow: 0 20px 42px color-mix(in srgb, var(--accent) 22%, transparent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.home-choice-button.ghost {
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 25%),
    rgba(255, 255, 255, 0.72);
}

.home-choice-button:hover,
.primary-action:hover,
.secondary-action:hover,
.date-nudge:hover,
.date-preset:hover,
.gender-card:hover {
  transform: translateY(-2px);
}

.wizard-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: stretch;
}

.wizard-side {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 20%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 22%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.84), color-mix(in srgb, var(--accent) 12%, #fff));
  border: 1px solid var(--line);
}

.wizard-side::after {
  content: "";
  position: absolute;
  left: -42px;
  bottom: -42px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.wizard-side h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4rem);
  letter-spacing: -0.055em;
}

.wizard-side p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.progress-shell {
  overflow: hidden;
  height: 12px;
  margin: 36px 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
}

.progress-shell span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.step-counter {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
}

.wizard-card {
  min-height: 520px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.74);
}

.prediction-form,
.wizard-step {
  display: grid;
  gap: 18px;
}

.wizard-step {
  display: none;
  min-height: 340px;
  align-content: center;
}

.wizard-step.is-active {
  display: grid;
  animation: stepIn 220ms ease both;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.wizard-step h3 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  letter-spacing: -0.065em;
}

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

label,
.gender-field {
  display: grid;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px;
  color: var(--ink);
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 17%, transparent);
}

.date-console {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.72), transparent 28%),
    color-mix(in srgb, var(--accent) 12%, #fff);
}

.date-display {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  gap: 14px;
  align-items: center;
}

.date-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.date-display strong {
  display: block;
  margin: 4px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.055em;
}

.date-display small {
  color: var(--muted);
  font-weight: 800;
}

.date-nudge {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--ink);
  font-size: 2rem;
  font-weight: 900;
  transition: transform 180ms ease;
}

.date-range {
  width: 100%;
  accent-color: var(--accent);
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.date-preset,
.secondary-action,
.primary-action {
  border: 0;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.date-preset,
.secondary-action {
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-weight: 800;
}

.primary-action {
  padding: 13px 20px;
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #5f3726));
  box-shadow: 0 12px 25px color-mix(in srgb, var(--accent) 25%, transparent);
  font-weight: 900;
}

.gender-field {
  border: 0;
  margin: 0;
  padding: 0;
}

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

.gender-card {
  position: relative;
  min-height: 180px;
  padding: 22px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.gender-card input {
  position: absolute;
  opacity: 0;
}

.gender-card:has(input:checked) {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(70, 38, 24, 0.16);
}

.gender-card.girl:has(input:checked) {
  background: linear-gradient(135deg, var(--girl), #b84a72);
}

.gender-card.boy:has(input:checked) {
  background: linear-gradient(135deg, var(--boy), #276c9d);
}

.gender-card.surprise:has(input:checked) {
  background: linear-gradient(135deg, var(--surprise), #9b7922);
}

.summary-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.summary-box span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-box strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.summary-box p {
  margin: 0;
  color: var(--muted);
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.submit-action {
  display: none;
}

.submit-action.is-visible {
  display: inline-flex;
}

.step-error {
  min-height: 22px;
  margin: 0;
  color: #9a321f;
  font-weight: 800;
}

.alert,
.success,
.empty-state {
  border-radius: 24px;
  padding: 16px 18px;
}

.alert {
  margin-bottom: 16px;
  background: #ffe7df;
  color: #8d2d18;
}

.alert p {
  margin: 0;
}

.success {
  margin-bottom: 18px;
  background: #e9f6dd;
  color: #44632d;
  font-weight: 900;
}

.stats-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
}

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

.stat-cards article,
.insight-card,
.timeline-card,
.table-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
}

.stat-cards article {
  padding: 18px;
}

.stat-cards span,
.stat-cards small {
  color: var(--muted);
}

.stat-cards strong {
  display: block;
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.8rem;
  letter-spacing: -0.05em;
}

.main-timeline {
  margin-top: 16px;
  padding: 22px;
}

.timeline-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.timeline-head h3,
.insight-card h3,
.table-card h3 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.045em;
}

.timeline-head span {
  color: var(--muted);
  font-weight: 800;
}

.axis-timeline {
  display: grid;
  gap: 24px;
}

.timeline-axis {
  position: relative;
  height: 88px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.78), rgba(255,255,255,0.46)),
    repeating-linear-gradient(90deg, transparent 0 9%, rgba(38, 26, 21, 0.06) 9% 9.4%);
  border: 1px solid var(--line);
}

.timeline-axis::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 44px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b9895d, var(--accent), #a16f45);
}

.term-marker {
  position: absolute;
  left: var(--term-pos);
  top: 10px;
  transform: translateX(-50%);
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

.term-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 42px;
  background: var(--ink);
}

.date-node {
  position: absolute;
  left: var(--pos);
  top: 34px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}

.date-node b {
  font-size: 0.85rem;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent),
    rgba(255, 249, 239, 0.82);
  border: 1px solid rgba(64, 43, 32, 0.08);
}

.timeline-date strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.timeline-date span {
  color: var(--muted);
}

.timeline-votes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vote-chip {
  display: inline-grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 16px;
  background: #fff;
  border-left: 5px solid var(--surprise);
}

.vote-chip.girl {
  border-left-color: var(--girl);
}

.vote-chip.boy {
  border-left-color: var(--boy);
}

.vote-chip.surprise {
  border-left-color: var(--surprise);
}

.vote-chip b {
  color: var(--ink);
  font-size: 0.9rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.insight-card,
.table-card {
  padding: 20px;
}

.gender-bars {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 48px;
  gap: 10px;
  align-items: center;
}

.bar-row span,
.bar-row strong {
  font-weight: 900;
}

.bar {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #eadfce;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar i.girl {
  background: var(--girl);
}

.bar i.boy {
  background: var(--boy);
}

.bar i.surprise {
  background: var(--surprise);
}

.name-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.name-cloud span {
  padding: 9px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  font-weight: 800;
}

.name-cloud b {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
}

.table-card {
  margin-top: 16px;
}

.prediction-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.prediction-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) 1fr;
  gap: 16px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border-left: 6px solid var(--surprise);
}

.prediction-row.girl {
  border-left-color: var(--girl);
}

.prediction-row.boy {
  border-left-color: var(--boy);
}

.prediction-row strong,
.prediction-row b {
  display: block;
}

.prediction-row span,
.prediction-row small {
  color: var(--muted);
}

.prediction-row em {
  display: block;
  margin-top: 8px;
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero-grid,
  .home-choice,
  .wizard-layout,
  .field-row,
  .stat-cards,
  .insight-grid,
  .timeline-item,
  .prediction-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    border-radius: 28px;
  }

  .hero-grid {
    padding-top: 62px;
  }

  .topbar,
  .stats-heading,
  .timeline-head {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-side {
    min-height: auto;
  }

  .wizard-card {
    min-height: auto;
  }

  .wizard-step {
    min-height: 320px;
  }

  .gender-grid,
  .date-display {
    grid-template-columns: 1fr;
  }

  .date-nudge {
    width: 100%;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }
}
