  :root {
    --bg-1: #0b1020;
    --bg-2: #101735;
    --card: rgba(255, 255, 255, 0.055);
    --card-border: rgba(255, 255, 255, 0.1);
    --text: #eef1fb;
    --muted: #9aa3c7;
    --accent-1: #7c6cff;
    --accent-2: #3ecfe0;
    --accent-grad: linear-gradient(120deg, #7c6cff, #3ecfe0);
    --danger: #ff7d92;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: radial-gradient(1100px 600px at 80% -10%, #23306b 0%, transparent 60%),
                radial-gradient(900px 500px at -10% 110%, #14355a 0%, transparent 55%),
                linear-gradient(160deg, var(--bg-1), var(--bg-2));
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 18px 70px;
  }

  .shell { width: 100%; max-width: 680px; }

  /* ---------- Header ---------- */
  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
  }

  .brand .logo {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--accent-grad);
    display: grid; place-items: center;
    font-size: 18px;
  }

  .brand span {
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 18px;
  }

  .hero { text-align: center; margin-bottom: 34px; }

  .hero h1 {
    font-size: clamp(30px, 6.5vw, 46px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .hero h1 .grad {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .hero p {
    color: var(--muted);
    margin-top: 12px;
    font-size: 16px;
  }

  /* ---------- Card ---------- */
  .card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 28px;
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  }

  .mode-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(10, 14, 30, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 18px;
  }

  .mode-toggle button {
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .mode-toggle button.active {
    background: var(--accent-grad);
    color: #0b1020;
  }

  .input-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .input-group { flex: 1; min-width: 200px; }

  .input-group.hidden { display: none; }

  label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
  }

  input[type="date"] {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(10, 14, 30, 0.65);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    color-scheme: dark;
  }

  input[type="date"]:focus {
    outline: 2px solid var(--accent-1);
    outline-offset: 1px;
  }

  .cta {
    padding: 13px 26px;
    border: none;
    border-radius: 12px;
    background: var(--accent-grad);
    color: #0b1020;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, filter 0.12s ease;
    white-space: nowrap;
  }

  .cta:hover { filter: brightness(1.1); }
  .cta:active { transform: scale(0.97); }

  .error {
    display: none;
    margin-top: 12px;
    color: var(--danger);
    font-size: 14px;
  }

  /* ---------- Results ---------- */
  #results { display: none; margin-top: 30px; }

  .age-hero {
    text-align: center;
    padding: 26px 10px 22px;
    border-top: 1px solid var(--card-border);
  }

  .age-hero .value {
    font-size: clamp(46px, 11vw, 76px);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
  }

  .age-hero .detail {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
  }

  .age-hero .detail b { color: var(--text); }

  /* Birthday progress */
  .bday {
    margin: 8px 4px 22px;
    padding: 16px 18px;
    background: rgba(10, 14, 30, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 14px;
  }

  .bday .row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .bday .row b { color: var(--text); }

  .bar {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
  }

  .bar .fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: var(--accent-grad);
    transition: width 0.8s cubic-bezier(0.25, 1, 0.35, 1);
  }

  /* Stat grid */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .tile {
    background: rgba(10, 14, 30, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
  }

  .tile .icon { font-size: 20px; }

  .tile .num {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .tile .cap {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }

  .live-note {
    text-align: center;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--muted);
  }

  .live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #45e0a8;
    margin-right: 6px;
    animation: pulse 1.6s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }

  /* ---------- Ad slot ---------- */
  .ad-slot {
    margin-top: 32px;
    text-align: center;
  }

  .ad-slot .ad-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.6;
    margin-bottom: 8px;
  }

  /* ---------- Features ---------- */
  .features {
    margin-top: 46px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }

  .feature {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
  }

  .feature .f-icon { font-size: 22px; }

  .feature h3 { font-size: 15px; margin: 10px 0 6px; }

  .feature p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

  /* ---------- Helpful calculator guide ---------- */
  .guide {
    margin-top: 42px;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
  }
  .guide h2 { font-size: 23px; line-height: 1.3; margin-bottom: 12px; }
  .guide h3 { font-size: 17px; margin: 24px 0 8px; }
  .guide p, .guide li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
  }
  .guide p + p { margin-top: 10px; }
  .guide ul, .guide ol { padding-left: 22px; margin-top: 8px; }
  .guide li + li { margin-top: 6px; }
  .guide .example {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(10, 14, 30, 0.5);
    border: 1px solid var(--card-border);
  }

  /* ---------- FAQ ---------- */
  .faq {
    margin-top: 52px;
  }

  .faq h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-align: center;
    margin-bottom: 20px;
  }

  .faq h2 .grad {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  details {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  summary {
    cursor: pointer;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    user-select: none;
  }

  summary::-webkit-details-marker { display: none; }

  summary::after {
    content: '+';
    font-size: 20px;
    color: var(--accent-2);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  details[open] summary::after { transform: rotate(45deg); }

  details p {
    padding: 0 18px 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
  }

  footer {
    margin-top: 46px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-links {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .footer-links a {
    color: var(--muted);
    text-decoration: none;
  }

  .footer-links a:hover {
    color: var(--accent-2);
    text-decoration: underline;
  }

  @media (prefers-reduced-motion: no-preference) {
    .card, .features, .faq { animation: rise 0.5s ease both; }
    #results.show { animation: rise 0.45s ease both; }
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

/* ---------- Site nav ---------- */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 30px;
}
.site-nav .brand { margin: 0; text-decoration: none; color: inherit; }
.site-nav nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-nav nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
}
.site-nav nav a:hover, .site-nav nav a[aria-current="page"] { color: var(--accent-2); }

/* Linked feature cards (related tools, tools hub) */
a.feature { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
a.feature:hover { transform: translateY(-3px); border-color: var(--accent-2); }

/* Checkbox option under inputs */
.check {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500;
  color: var(--muted); cursor: pointer;
}
.check input { accent-color: #7c6cff; width: 16px; height: 16px; }
.hero + .card { margin-top: 0; }
.guide a { color: var(--accent-2); }

