    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg-primary: #ffffff;
      --bg-secondary: #f4f4f2;
      --text-primary: #1a1a1a;
      --text-secondary: #6b6b68;
      --text-tertiary: #a0a09c;
      --border-light: rgba(0,0,0,0.12);
      --border-medium: rgba(0,0,0,0.25);
      --border-strong: rgba(0,0,0,0.38);
      --danger: #c0392b;
      --radius-md: 8px;
      --radius-lg: 12px;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --bg-primary: #1e1e1c;
        --bg-secondary: #2a2a27;
        --text-primary: #f0efea;
        --text-secondary: #9a9994;
        --text-tertiary: #5e5e5a;
        --border-light: rgba(255,255,255,0.10);
        --border-medium: rgba(255,255,255,0.20);
        --border-strong: rgba(255,255,255,0.32);
        --danger: #e74c3c;
      }
    }

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--bg-secondary);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 2.5rem 1rem 0;
    }

    .page-footer {
      width: 100%;
      text-align: center;
      padding: 1.5rem 1rem;
      margin-top: auto;
      font-size: 12px;
      color: var(--text-tertiary);
      font-weight: 300;
    }

    .age-app {
      width: 100%;
      max-width: 560px;
    }

    .app-header {
      text-align: center;
      margin-bottom: 2rem;
    }

    .app-title {
      font-family: 'Playfair Display', serif;
      font-size: 28px;
      font-weight: 600;
      color: var(--text-primary);
      letter-spacing: -0.5px;
    }

    .app-subtitle {
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 5px;
      font-weight: 300;
    }

    .input-card {
      background: var(--bg-primary);
      border: 0.5px solid var(--border-light);
      border-radius: var(--radius-lg);
      padding: 1.5rem;
      margin-bottom: 1.25rem;
    }

    .section-label {
      font-size: 11px;
      font-weight: 500;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--text-secondary);
      margin-bottom: 0.75rem;
    }

    .date-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1.4fr;
      gap: 10px;
    }

    .field-group {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .field-label {
      font-size: 11px;
      color: var(--text-secondary);
    }

    .field-group input {
      width: 100%;
      padding: 10px 12px;
      border-radius: var(--radius-md);
      font-family: 'DM Sans', sans-serif;
      font-size: 15px;
      color: var(--text-primary);
      background: var(--bg-secondary);
      border: 0.5px solid var(--border-light);
      outline: none;
      transition: border-color 0.15s, box-shadow 0.15s;
      -webkit-appearance: none;
      appearance: none;
    }

    .field-group input:focus {
      border-color: var(--border-strong);
      box-shadow: 0 0 0 3px rgba(120,120,120,0.1);
    }

    .field-group input.error {
      border-color: var(--danger);
    }

    .divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 1rem 0;
      color: var(--text-tertiary);
      font-size: 12px;
    }

    .divider::before, .divider::after {
      content: '';
      flex: 1;
      height: 0.5px;
      background: var(--border-light);
    }

    .toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }

    .toggle-label {
      font-size: 13px;
      color: var(--text-secondary);
    }

    .toggle-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      background: none;
      border: 0.5px solid var(--border-medium);
      border-radius: 20px;
      padding: 5px 12px;
      font-size: 12px;
      font-family: 'DM Sans', sans-serif;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.15s;
    }

    .toggle-btn:hover {
      background: var(--bg-secondary);
      border-color: var(--border-strong);
      color: var(--text-primary);
    }

    .toggle-btn.active {
      border-color: var(--border-strong);
      color: var(--text-primary);
    }

    .toggle-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--border-medium);
      transition: background 0.2s;
    }

    .toggle-dot.active {
      background: var(--text-primary);
    }

    .custom-date-wrap {
      display: none;
      margin-top: 1rem;
    }

    .error-msg {
      font-size: 12px;
      color: var(--danger);
      margin-top: 8px;
      display: none;
    }

    .calc-btn {
      width: 100%;
      padding: 13px;
      border-radius: var(--radius-md);
      background: var(--text-primary);
      color: var(--bg-primary);
      font-family: 'DM Sans', sans-serif;
      font-size: 14px;
      font-weight: 500;
      border: none;
      cursor: pointer;
      letter-spacing: 0.3px;
      transition: opacity 0.15s, transform 0.1s;
      margin-bottom: 1.25rem;
    }

    .calc-btn:hover { opacity: 0.85; }
    .calc-btn:active { transform: scale(0.99); }

    .results {
      display: none;
      animation: fadeUp 0.3s ease;
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .results.visible { display: block; }

    .big-age {
      background: var(--bg-primary);
      border: 0.5px solid var(--border-light);
      border-radius: var(--radius-lg);
      padding: 1.5rem 1.5rem 1.25rem;
      margin-bottom: 1rem;
      text-align: center;
    }

    .big-age-nums {
      display: flex;
      align-items: baseline;
      justify-content: center;
      gap: 6px;
      margin: 0.5rem 0 0.25rem;
      flex-wrap: wrap;
    }

    .age-num {
      font-family: 'Playfair Display', serif;
      font-size: 52px;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1;
    }

    .age-unit {
      font-size: 13px;
      color: var(--text-secondary);
      font-weight: 300;
      margin-right: 6px;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 1rem;
    }

    .stat-card {
      background: var(--bg-secondary);
      border-radius: var(--radius-md);
      padding: 0.85rem;
      text-align: center;
    }

    .stat-value {
      font-size: 19px;
      font-weight: 500;
      color: var(--text-primary);
      line-height: 1.2;
      font-family: 'Playfair Display', serif;
    }

    .stat-label {
      font-size: 10px;
      color: var(--text-secondary);
      margin-top: 3px;
      text-transform: uppercase;
      letter-spacing: 0.6px;
    }

    .reset-btn {
      display: block;
      width: 100%;
      padding: 9px;
      border-radius: var(--radius-md);
      background: none;
      border: 0.5px solid var(--border-medium);
      color: var(--text-secondary);
      font-family: 'DM Sans', sans-serif;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .reset-btn:hover {
      background: var(--bg-secondary);
      color: var(--text-primary);
    }

    @media (max-width: 420px) {
      .date-row { grid-template-columns: 1fr 1fr; }
      .date-row .field-group:last-child { grid-column: span 2; }
      .stats-grid { grid-template-columns: 1fr 1fr; }
      .age-num { font-size: 40px; }
    }