:root {
  color-scheme: dark;
  --bg: #0d1220;
  --panel: rgba(24, 33, 55, .88);
  --panel2: rgba(34, 45, 72, .92);
  --text: #f8fafc;
  --muted: #aab4c5;
  --gold: #facc15;
  --pink: #fb7185;
  --blue: #38bdf8;
  --green: #34d399;
  --line: rgba(255,255,255,.11);
  --shadow: 0 20px 50px rgba(0,0,0,.35);
}

body.young-mode {
  --bg: #210f18;
  --panel: rgba(62, 24, 43, .90);
  --panel2: rgba(92, 36, 61, .94);
  --text: #fff7fb;
  --muted: #e5b8ca;
  --gold: #f9a8d4;
  --pink: #fb7185;
  --blue: #f0abfc;
  --green: #fda4af;
  --line: rgba(255, 192, 218, .18);
  --shadow: 0 20px 55px rgba(60, 8, 32, .55);

  background:
    radial-gradient(circle at top left, rgba(244, 114, 182, .28), transparent 38%),
    radial-gradient(circle at top right, rgba(190, 24, 93, .24), transparent 35%),
    linear-gradient(160deg, #210f18, #3a1427 55%, #1b0b14);
}

body.young-mode h1 {
  color: #fbcfe8;
  text-shadow: 0 0 22px rgba(244, 114, 182, .35);
}

body.young-mode .main-card {
  border-color: rgba(244, 114, 182, .42);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,.18), transparent 35%),
    radial-gradient(circle at top right, rgba(251,113,133,.16), transparent 33%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.shell { width: min(1050px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 45px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin: 0 0 6px; font-size: .82rem; }
h1 { margin: 0; font-size: clamp(2rem, 7vw, 4.3rem); line-height: .95; }
h2 { margin: 0 0 14px; font-size: 1.25rem; }
.muted, .label { color: var(--muted); }
.label { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: .78rem; }
.grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.card {
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.main-card { border-color: rgba(250,204,21,.32); }
.feature { font-size: clamp(1.5rem, 5vw, 2.7rem); font-weight: 800; }
.feature small { display: block; font-size: 1rem; color: var(--muted); font-weight: 500; margin-top: 8px; line-height: 1.4; }
.summary { font-size: 1.1rem; line-height: 1.5; }
.pill, input {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 700;
}
.pill { cursor: pointer; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
input { width: min(260px, 100%); outline: none; }
.list { display: grid; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.date-badge {
  background: rgba(250,204,21,.13);
  color: var(--gold);
  border: 1px solid rgba(250,204,21,.22);
  border-radius: 16px;
  padding: 9px 7px;
  text-align: center;
  font-weight: 800;
}
.date-badge span { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; }
.name { font-size: 1.12rem; font-weight: 800; }
.meta { color: var(--muted); margin-top: 3px; }
.tag { justify-self: end; border-radius: 999px; padding: 8px 11px; font-weight: 800; background: rgba(56,189,248,.12); color: var(--blue); white-space: nowrap; }
.tag.milestone { background: rgba(250,204,21,.16); color: var(--gold); }
.compact .row { grid-template-columns: 1fr auto; }
.months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.month-card { background: rgba(255,255,255,.055); border: 1px solid var(--line); border-radius: 18px; padding: 15px; }
.month-card h3 { margin: 0 0 10px; color: var(--gold); }
.month-card div { padding: 6px 0; color: var(--muted); }
.today { outline: 2px solid var(--green); border-radius: 16px; padding-inline: 8px; }
#confetti { position: fixed; inset: 0; pointer-events: none; }
@media (max-width: 760px) {
  .grid, .months { grid-template-columns: 1fr; }
  .hero, .section-head { align-items: stretch; flex-direction: column; }
  .row { grid-template-columns: 58px 1fr; }
  .tag { grid-column: 2; justify-self: start; }
}
@media print {
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ddd; background: white; }
  .pill, input, #confetti { display: none; }
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 15px 0;
}

.actions button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: bold;
  cursor: pointer;
}

/* Force normal screen layout */
#birthdayList,
#milestoneList {
  display: grid;
  gap: 10px;
  column-count: initial;
}

#milestoneList .row {
  display: grid;
  grid-template-columns: 1fr auto;
}

/* ===========================
   PRINT LAYOUT
   =========================== */

@media print {
  .no-print,
  .pill,
  input,
  #confetti,
  #searchBox {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 10.5pt;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .hero {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 26pt;
  }

  h2 {
    font-size: 14pt;
    margin-bottom: 8px;
  }

  .card {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    break-inside: avoid;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  #birthdayList {
    display: block;
    column-count: 2;
    column-gap: 22px;
  }

  #birthdayList .row {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 8px;
    padding: 6px 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .date-badge {
    padding: 5px;
    border-radius: 10px;
  }

  .name {
    font-size: 10.5pt;
  }

  .meta {
    font-size: 9pt;
  }

  .tag {
    padding: 4px 7px;
    font-size: 9pt;
  }

  #monthList,
  #monthList * {
    display: none !important;
  }
}
