/* ============================================
   AGE CALCULATOR — .ac-*
   ============================================ */

.ac-calculator {
  max-width: 900px;
  margin: 0 auto;
}

/* ---- Mode toggle ---- */
.ac-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.ac-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  min-height: 44px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.ac-mode-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ac-mode-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* ---- Inputs ---- */
.ac-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.ac-input-group {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ac-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ac-date-input {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.6rem 0.875rem;
  color: var(--text);
  width: 100%;
}

.ac-input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* ---- Error ---- */
.ac-error {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(var(--danger-rgb), 0.08);
  border: 1px solid rgba(var(--danger-rgb), 0.25);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* ---- Empty state ---- */
.ac-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.ac-empty svg {
  opacity: 0.3;
}

.ac-empty p {
  font-size: 0.95rem;
  margin: 0;
}

/* ---- Results ---- */
.ac-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---- Hero ---- */
.ac-hero {
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ac-hero-age {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.ac-hero-detail {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.ac-live-counter {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  opacity: 0.85;
}

/* ---- Stats grid ---- */
.ac-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
}

.ac-stat-card {
  padding: 1rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}

.ac-stat-card:hover {
  border-color: var(--primary);
}

.ac-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.ac-stat-value--sm {
  font-size: 1.2rem;
}

.ac-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ---- Info row ---- */
.ac-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ---- Birthday card ---- */
.ac-birthday-card,
.ac-details-card {
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ac-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.ac-bday-date {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.ac-bday-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.875rem;
}

.ac-bday-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.ac-bday-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s ease;
}

/* ---- Details list ---- */
.ac-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.ac-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.ac-detail-row dt {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.ac-detail-row dd {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 0;
  text-align: right;
}

/* ---- Actions ---- */
.ac-actions {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.ac-actions .btn {
  min-height: 44px;
  min-width: 180px;
}

/* ---- Mobile (≤ 640px) ---- */
@media (max-width: 640px) {
  .ac-mode-toggle {
    flex-direction: column;
    gap: 0.4rem;
  }

  .ac-mode-btn {
    justify-content: center;
    border-radius: var(--radius);
  }

  .ac-inputs {
    flex-direction: column;
  }

  .ac-input-group {
    min-width: 0;
  }

  .ac-hero-age {
    font-size: 2rem;
  }

  .ac-hero-detail {
    font-size: 1rem;
  }

  .ac-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ac-stat-value {
    font-size: 1.5rem;
  }

  .ac-stat-value--sm {
    font-size: 1.1rem;
  }

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

  .ac-actions .btn {
    width: 100%;
  }
}
