/* ============================================
   Calculator Online - Global Styles
   Modern, clean, mobile-first design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-primary-50: #eff6ff;
  --color-secondary: #111827;
  --color-accent: #2563eb;
  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;

  --color-bg: #f1f5f9;
  --color-bg-alt: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-sans:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  --container-max: 1200px;
  --container-narrow: 800px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--color-secondary);
  line-height: 1.3;
  font-weight: 700;
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo,
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--color-secondary);
  text-decoration: none;
}

.site-logo:hover,
.logo:hover {
  color: var(--color-primary);
}

.site-logo svg,
.logo svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-50);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: var(--color-bg);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-lg);
    gap: 0.25rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.75rem 1rem;
    width: 100%;
  }
}

/* --- Hero Section --- */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.hero--page {
  padding: 2.5rem 0 1.5rem;
}

.hero--page .subtitle {
  margin-bottom: 0;
}

/* --- Calculator Card --- */
.calc-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border);
}

@media (max-width: 640px) {
  .calc-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }
}

/* --- Calculator Tabs --- */
.calc-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calc-tab-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
}

.calc-tab-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.calc-tab-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.calc-tab-btn:not(.active):hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 1.25rem;
}

/* Small hint text below inputs */
.form-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
  display: block;
}

/* Read-only input (e.g. auto-computed standard deduction) */
.form-input[readonly] {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
  border-style: dashed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.form-label .optional {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:hover {
  border-color: var(--color-border-hover);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.tenure-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 0.6rem;
}

.tenure-unit-select {
  min-width: 0;
}

.form-input.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px var(--color-error-light);
}

.form-error {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 0.3rem;
  display: none;
}

.form-error.visible {
  display: block;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* --- Checkbox --- */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  text-decoration: none;
  line-height: 1.4;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-border);
  border-color: var(--color-border-hover);
}

.btn--danger {
  background: var(--color-error-light);
  color: var(--color-error);
  border: 1px solid transparent;
}

.btn--danger:hover {
  background: var(--color-error);
  color: #fff;
}

.btn--full {
  width: 100%;
}

.btn--lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* --- Results Section --- */
.results-section {
  display: none;
  margin-top: 2rem;
  animation: fadeSlideUp 0.4s ease;
}

.results-section.visible {
  display: block;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-title svg {
  width: 22px;
  height: 22px;
  color: var(--color-success);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.result-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.result-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.result-card.primary {
  background: var(--color-primary-50);
  border-color: var(--color-primary-light);
}

.result-card .result-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.result-card.primary .result-value {
  font-size: 2rem;
}

.result-card .result-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Date Difference Redesign --- */
.ddiff-mode-toggle {
  display: flex; gap: 0.25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.2rem; margin-bottom: 0.875rem;
}
.ddiff-mode-btn {
  flex: 1; border: none; background: transparent;
  padding: 0.4rem 0.75rem; border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}
.ddiff-mode-btn.active {
  background: var(--color-surface); color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.ddiff-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 0.75rem;
}
.ddiff-hero-value {
  font-size: 2rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1; margin-bottom: 0.3rem;
}
.ddiff-hero-sub {
  font-size: 0.82rem; color: var(--color-text-secondary); font-weight: 500;
}
.ddiff-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.875rem;
}
.ddiff-chip {
  flex: 1; min-width: 80px;
  display: flex; flex-direction: column; align-items: center;
  padding: 0.55rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.ddiff-chip-val { font-size: 0.95rem; font-weight: 700; color: var(--color-text); }
.ddiff-chip-lbl { font-size: 0.68rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.1rem; }
.ddiff-cal { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.875rem; }
.ddiff-cal-month { flex: 1; min-width: 155px; }
.ddiff-cal-mhdr {
  font-size: 0.78rem; font-weight: 700; color: var(--color-text-secondary);
  text-align: center; margin-bottom: 0.4rem;
}
.ddiff-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.ddiff-cal-dh {
  font-size: 0.6rem; font-weight: 600; color: var(--color-text-muted);
  text-align: center; padding: 0.1rem 0;
}
.ddiff-cal-day {
  font-size: 0.68rem; text-align: center; padding: 0.2rem 0.1rem;
  border-radius: 3px; color: var(--color-text-secondary);
}
.ddiff-cal-day.cal-in { background: var(--color-primary-50); color: var(--color-primary); }
.ddiff-cal-day.cal-start, .ddiff-cal-day.cal-end {
  background: var(--color-primary); color: #fff; font-weight: 700; border-radius: 4px;
}
.ddiff-cal-sep {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: var(--color-text-muted); padding: 0 0.5rem;
  align-self: center;
}
.ddiff-options-wrap {
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem; margin-bottom: 0.75rem;
}
.ddiff-options-lbl {
  display: block; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-muted); margin-bottom: 0.5rem;
}
.ddiff-options {
  display: flex; flex-wrap: wrap; gap: 1rem;
}
.ddiff-opt-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--color-text-secondary);
  cursor: pointer; font-weight: 500;
}
.ddiff-opt-label input { accent-color: var(--color-primary); }
.ddiff-adjusted {
  display: flex; align-items: baseline; gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: var(--color-success-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}
.ddiff-adjusted-val { font-size: 1.2rem; font-weight: 800; color: #065f46; }
.ddiff-adjusted-lbl { font-size: 0.8rem; color: #047857; font-weight: 500; }
@media (max-width: 480px) {
  .ddiff-hero-value { font-size: 1.65rem; }
  .ddiff-chips { gap: 0.3rem; }
  .ddiff-chip { min-width: 60px; }
}

/* --- Ovulation Calculator Results --- */
.ovul-hero {
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  text-align: center;
  margin-bottom: 0.75rem;
}
.ovul-hero-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}
.ovul-hero-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}
.ovul-hero-sub {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.ovul-row {
  display: flex;
  align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
}
.ovul-stat {
  flex: 1;
  padding: 0.85rem 0.75rem;
  text-align: center;
}
.ovul-stat + .ovul-stat {
  border-left: 1px solid var(--color-border);
}
.ovul-stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 0.2rem;
}
.ovul-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
@media (max-width: 480px) {
  .ovul-row { flex-direction: column; }
  .ovul-stat + .ovul-stat { border-left: none; border-top: 1px solid var(--color-border); }
  .ovul-hero-value { font-size: 1.65rem; }
}

/* --- Time Duration Results --- */
.tdur-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 0.875rem;
  margin-bottom: 0.75rem;
}
.tdur-hero-value {
  font-size: 2.25rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1; margin-bottom: 0.3rem;
}
.tdur-hero-sub {
  font-size: 0.82rem; color: var(--color-text-secondary); font-weight: 500;
}
.tdur-chips {
  display: flex; gap: 0.4rem; margin-bottom: 0.875rem;
}
.tdur-chip {
  flex: 1;
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 0.65rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.tdur-chip-icon {
  width: 15px; height: 15px; flex-shrink: 0;
  color: var(--color-primary); opacity: 0.7;
}
.tdur-chip-body { display: flex; flex-direction: column; min-width: 0; }
.tdur-chip-val {
  font-size: 1rem; font-weight: 700; color: var(--color-text);
  line-height: 1.2; white-space: nowrap;
}
.tdur-chip-lbl {
  font-size: 0.65rem; color: var(--color-text-muted);
  font-weight: 500; white-space: nowrap;
}
@media (max-width: 480px) {
  .tdur-hero-value { font-size: 1.75rem; }
  .tdur-chip { padding: 0.5rem 0.45rem; gap: 0.3rem; }
  .tdur-chip-icon { display: none; }
  .tdur-chip-val { font-size: 0.88rem; }
  .tdur-chip-lbl { font-size: 0.62rem; }
}

/* --- Job Entry (Work Experience) --- */
.job-entries {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.job-entry {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: border-color var(--transition-fast);
}

.job-entry:hover {
  border-color: var(--color-border-hover);
}

.job-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.job-entry-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.job-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.job-remove-btn:hover {
  color: var(--color-error);
  background: var(--color-error-light);
}

.job-remove-btn svg {
  width: 18px;
  height: 18px;
}

/* --- Work Experience Results --- */
.wexp-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 0.875rem;
  margin-bottom: 0.75rem;
}
.wexp-hero-value {
  font-size: 2.25rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1; margin-bottom: 0.25rem;
}
.wexp-hero-sub {
  font-size: 0.78rem; color: var(--color-text-muted); font-weight: 500;
}

/* Format chips */
.wexp-formats { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.wexp-format-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.wexp-format-lbl { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 500; flex-shrink: 0; }
.wexp-format-val { font-size: 0.92rem; font-weight: 700; color: var(--color-text); flex: 1; }
.wexp-copy-btn {
  background: none; border: none; cursor: pointer; padding: 0.2rem;
  color: var(--color-text-muted); border-radius: var(--radius-sm);
  transition: color var(--transition-fast); flex-shrink: 0;
}
.wexp-copy-btn:hover { color: var(--color-primary); }
.wexp-copy-btn.wexp-copied { color: var(--color-success); }

/* Stats row */
.wexp-stats-row { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.wexp-stat {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; padding: 0.5rem 0.4rem;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.wexp-stat-val { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.wexp-stat-lbl { font-size: 0.65rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.1rem; }

/* Overlap warning */
.wexp-warn {
  display: flex; align-items: flex-start; gap: 0.5rem;
  padding: 0.6rem 0.875rem;
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: var(--radius-md); margin-bottom: 0.75rem;
  font-size: 0.8rem; color: #92400e; font-weight: 500;
}
.wexp-warn-icon { width: 16px; height: 16px; flex-shrink: 0; color: #d97706; margin-top: 1px; }

/* Sections */
.wexp-section { margin-bottom: 0.75rem; }
.wexp-section-hdr {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--color-text-muted);
  margin-bottom: 0.5rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

/* Timeline */
.wexp-timeline { display: flex; flex-direction: column; gap: 0.45rem; }
.wexp-tl-row { display: flex; align-items: center; gap: 0.5rem; }
.wexp-tl-lbl {
  width: 75px; font-size: 0.73rem; font-weight: 600; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.wexp-tl-track {
  flex: 1; height: 16px; background: var(--color-bg-alt);
  border-radius: 4px; position: relative; overflow: hidden;
}
.wexp-tl-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; opacity: 0.82; }
.wexp-tl-dur {
  width: 60px; font-size: 0.7rem; font-weight: 600;
  color: var(--color-text-muted); text-align: right; flex-shrink: 0;
}

/* Breakdown table */
.wexp-table-wrap { overflow-x: auto; }
.wexp-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.wexp-table th {
  background: var(--color-bg-alt); padding: 0.45rem 0.6rem;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-text-muted);
  text-align: left; white-space: nowrap;
}
.wexp-table td { padding: 0.45rem 0.6rem; color: var(--color-text); vertical-align: middle; }
.wexp-table tbody tr:nth-child(even) { background: var(--color-bg-alt); }
.wexp-table tbody tr:hover { background: var(--color-primary-50); }

/* Copy-ready text */
.wexp-copytext-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  margin-bottom: 0.35rem; background: var(--color-surface);
}
.wexp-copytext-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wexp-copytext-lbl { font-size: 0.65rem; color: var(--color-text-muted); font-weight: 600; }
.wexp-copytext-val {
  font-size: 0.82rem; color: var(--color-text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wexp-copy-sm-btn {
  flex-shrink: 0; padding: 0.25rem 0.6rem; font-size: 0.72rem; font-weight: 600;
  background: var(--color-bg-alt); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}
.wexp-copy-sm-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.wexp-copy-sm-btn.wexp-copied { background: var(--color-success); color: #fff; border-color: var(--color-success); }

@media (max-width: 480px) {
  .wexp-hero-value { font-size: 1.75rem; }
  .wexp-tl-lbl { width: 55px; font-size: 0.68rem; }
  .wexp-tl-dur { width: 45px; font-size: 0.65rem; }
  .wexp-table th, .wexp-table td { padding: 0.35rem 0.4rem; font-size: 0.75rem; }
}

/* --- Expense Entry (Household Budget) --- */
.expense-entries {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.expense-entry {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: border-color var(--transition-fast);
}

.expense-entry:hover {
  border-color: var(--color-border-hover);
}

.expense-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.expense-entry-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.expense-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.expense-remove-btn:hover {
  color: var(--color-error);
  background: var(--color-error-light);
}

.expense-remove-btn svg {
  width: 18px;
  height: 18px;
}

.result-card.surplus {
  border-color: #10b981;
}

.result-card.surplus .result-value {
  color: #059669;
}

.result-card.deficit {
  border-color: #ef4444;
}

.result-card.deficit .result-value {
  color: #dc2626;
}

/* ---- Decision Card (comparison calculator recommendation banner) ---- */
.decision-card {
  background: var(--color-primary-50);
  border: 2px solid var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  text-align: center;
}
.decision-verdict {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.decision-saving {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.decision-reason {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ---- Comparison Table (side-by-side metric layout) ---- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.comparison-table th {
  padding: 0.65rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  text-align: center;
}
.comparison-table th.col-metric {
  text-align: left;
  color: var(--color-text-secondary);
  background: transparent;
}
.comparison-table th.col-full  { color: #2563eb; background: #eff6ff; }
.comparison-table th.col-pre   { color: #b45309; background: #fffbeb; }
.comparison-table th.col-diff  { color: var(--color-text-muted); background: transparent; }
.comparison-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  text-align: center;
}
.comparison-table td.col-metric {
  text-align: left;
  color: var(--color-text);
  font-size: 0.88rem;
}
.comparison-table td.col-full  { font-weight: 600; color: var(--color-primary); }
.comparison-table td.col-pre   { font-weight: 600; color: #b45309; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table .group-header td {
  background: var(--color-bg);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  padding: 0.45rem 0.9rem;
  border-top: 1px solid var(--color-border);
  text-align: left;
}

/* ---- Diff Badges ---- */
.diff-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.6;
}
.diff-badge--save    { background: #dcfce7; color: #166534; }
.diff-badge--cost    { background: #fee2e2; color: #991b1b; }
.diff-badge--neutral { background: var(--color-bg-alt); color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* ============================================
   Age Calculator — Enhanced Results UI
   ============================================ */

/* Summary Banner */
.age-summary-banner {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.age-summary-banner .result-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.age-summary-sub { font-size: 0.85rem; color: var(--color-text-muted); }

/* Format Toggle Chips */
.age-chips { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.age-chip {
  flex: 1;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.age-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.age-chip:not(.active):hover { border-color: var(--color-primary-light); background: var(--color-primary-50); color: var(--color-primary); }

/* Stat Strip — Exact Panel */
.age-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.age-stat-strip-item {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  text-align: center;
}
.age-stat-strip-item .stat-value {
  font-size: 1.35rem; font-weight: 800; color: var(--color-primary); line-height: 1.2; margin-bottom: 0.2rem;
}
.age-stat-strip-item .stat-label {
  font-size: 0.7rem; color: var(--color-text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
@media (max-width: 400px) {
  .age-stat-strip-item .stat-value { font-size: 1.05rem; }
}

/* Units Grid — In Units Panel */
.age-units-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.5rem; }
.age-units-note { font-size: 0.75rem; color: var(--color-text-muted); text-align: center; margin-top: 0.25rem; margin-bottom: 0.75rem; }

/* Rounded Panel */
.age-rounded-display { text-align: center; padding: 1.5rem 1rem 1rem; }
.age-rounded-number  { font-size: 4rem; font-weight: 800; color: var(--color-primary); line-height: 1; }
.age-rounded-unit    { font-size: 1.1rem; color: var(--color-text-secondary); font-weight: 600; margin-top: 0.2rem; }
.age-rounded-note    { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.35rem; margin-bottom: 0.75rem; }

/* Birthday Countdown Card */
.bday-countdown-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}
.bday-turning    { font-size: 1.35rem; font-weight: 800; color: var(--color-primary); line-height: 1.2; }
.bday-weekday    { font-size: 0.95rem; color: var(--color-text-secondary); font-weight: 600; margin-bottom: 0.75rem; }
.bday-days-left  { font-size: 2.5rem; font-weight: 800; color: var(--color-primary); line-height: 1; }
.bday-days-left-label { font-size: 0.72rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1rem; }
.bday-progress-wrap   { background: var(--color-border); border-radius: 999px; height: 8px; overflow: hidden; margin-bottom: 0.4rem; }
.bday-progress-fill   { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width 0.6s ease; }
.bday-progress-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--color-text-muted); }

/* Life Milestones */
.milestone-section { margin-bottom: 1rem; }
.milestone-toggle-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.88rem; font-weight: 700; font-family: inherit;
  background: var(--color-bg-alt); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); cursor: pointer; color: var(--color-text-secondary);
  transition: background var(--transition-fast);
}
.milestone-toggle-btn:hover { background: var(--color-primary-50); color: var(--color-primary); }
.milestone-list {
  border: 1px solid var(--color-border); border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md); overflow: hidden;
}
.milestone-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); font-size: 0.88rem;
}
.milestone-item:last-child { border-bottom: none; }
.milestone-label  { color: var(--color-text-secondary); flex: 1; }
.milestone-date   { font-weight: 700; color: var(--color-text); white-space: nowrap; }
.milestone-status { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.milestone-item.passed   .milestone-status { background: #dcfce7; color: #166534; }
.milestone-item.upcoming .milestone-status { background: var(--color-primary-50); color: var(--color-primary); }

/* --- GST Equation Display --- */
.gst-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  flex-wrap: wrap;
}

.gst-eq-item {
  text-align: center;
  min-width: 0;
  flex: 1;
}

.gst-eq-value {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
}

.gst-eq-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.gst-eq-op {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

@media (max-width: 540px) {
  .gst-equation {
    gap: 0.5rem;
    padding: 1.5rem 0.5rem;
  }
}

/* Job breakdown table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.breakdown-table th,
.breakdown-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.breakdown-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-bg);
}

.breakdown-table td {
  color: var(--color-text);
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table .total-row {
  font-weight: 700;
  background: var(--color-primary-50);
}

/* --- Content Sections --- */
.content-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border);
}

@media (max-width: 640px) {
  .content-section {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
  }
}

.content-section h2 {
  margin-top: 0;
}

.content-section ul,
.content-section ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.content-section li {
  margin-bottom: 0.4rem;
}

.content-section code {
  background: var(--color-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--color-accent);
}

/* Example box */
.example-box {
  background: var(--color-primary-50);
  border-left: 4px solid var(--color-primary);
  padding: 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}

.example-box strong {
  color: var(--color-secondary);
}

.example-box p {
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.example-box p:last-child {
  margin-bottom: 0;
}

/* Formula box */
.formula-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--color-accent);
  margin: 1rem 0;
  overflow-x: auto;
}

/* --- FAQ Section --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.1rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: color var(--transition-fast);
}

.faq-question:hover {
  color: var(--color-primary);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
  color: var(--color-text-muted);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding-bottom: 1.1rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Ad Slots --- */
.ad-slot {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin: 2rem 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  overflow: hidden;
  contain: layout style paint;
}

.ad-slot .adsbygoogle {
  display: block !important;
  width: 100%;
  min-height: 90px;
}

/* --- Calculator Grid (Home) --- */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.calc-grid-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition-base);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.calc-grid-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.calc-grid-card .card-icon {
  width: 56px;
  height: 56px;
  background: var(--color-primary-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.calc-grid-card .card-icon svg {
  width: 28px;
  height: 28px;
}

.calc-grid-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-secondary);
}

.calc-grid-card p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.calc-grid-card .card-arrow {
  margin-top: auto;
  padding-top: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.calc-grid-card:hover .card-arrow {
  opacity: 1;
}

/* --- Related Calculators --- */
.related-calcs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.related-calcs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary-50);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  transition: all var(--transition-fast);
}

.related-calcs a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-secondary);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.footer-desc {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}

/* --- Tooltip --- */
.tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--color-text-muted);
}

.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-secondary);
  color: #f1f5f9;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

.tooltip-trigger:hover::after {
  opacity: 1;
}

/* --- Page Content (static pages) --- */
.page-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 1.5rem auto 2rem;
  max-width: var(--container-narrow);
  border: 1px solid var(--color-border);
}

@media (max-width: 640px) {
  .page-content {
    padding: 1.5rem 1.25rem;
  }
}

.page-content h2 {
  margin-top: 2rem;
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content p,
.page-content li {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.page-content ul,
.page-content ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

.page-content li {
  margin-bottom: 0.3rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 1rem 0 0;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb span {
  color: var(--color-text-muted);
  margin: 0 0.4rem;
}

.breadcrumb .current {
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Print --- */
@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .btn,
  .related-calcs {
    display: none !important;
  }

  .calc-card,
  .content-section {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    background: #fff;
  }
}


/* --- Experience Layer --- */
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.07), transparent 55%),
    radial-gradient(900px 500px at 90% -10%, rgba(59, 130, 246, 0.05), transparent 50%),
    linear-gradient(180deg, #f8faff 0%, #f4f7fb 100%);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--color-secondary);
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
}

.site-header {
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

.hero {
  padding: 3.2rem 0 2.4rem;
}

.hero .container {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.94));
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-lg);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary-dark);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.1rem 0 1.2rem;
}

.hero-trust {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero-trust li {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.quick-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.5rem 0 1.5rem;
}

.quick-flow-link {
  display: block;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.8rem;
  color: var(--color-secondary);
  font-weight: 700;
}

.quick-flow-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), #3b82f6);
}

.btn--secondary {
  background: #fff;
}

.calc-grid-card {
  background: linear-gradient(160deg, #ffffff, #f8fffe);
}

.calc-grid-card p {
  color: var(--color-text-secondary);
}

.content-section,
.calc-card,
.page-content {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
}

@media (max-width: 900px) {
  .quick-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero .container {
    border-radius: var(--radius-lg);
  }

  .hero-trust {
    justify-content: flex-start;
  }
}


/* --- Lean UX Overrides --- */
body {
  background: #f8fafc;
}

.category-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1.4rem;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.category-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.tool-group {
  margin-bottom: 1.5rem;
}

.tool-group-head {
  margin-bottom: 0.75rem;
}

.tool-group-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.tool-group-head p {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: none;
}

.hero {
  padding: 1.5rem 0 1rem;
}

.hero .container {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0 1.25rem;
}

.hero--page {
  padding: 1rem 0 0.5rem;
}

.hero--page .subtitle {
  max-width: 56ch;
  margin: 0.4rem auto 0;
  font-size: 0.98rem;
}

.hero-eyebrow,
.hero-actions,
.hero-trust,
.quick-flow {
  display: none;
}

.calc-card,
.content-section,
.page-content {
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  background: #ffffff;
}

.calc-grid-card {
  background: #ffffff;
}

.btn--primary {
  background: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}


/* --- Ad Units --- */
.ad-slot--live {
  min-height: 250px;
  background: #fff;
  border-style: solid;
}

@media (max-width: 1024px) {
  .ad-slot--live {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .ad-slot--live {
    min-height: 120px;
  }
}

/* --- TOC --- */
.toc-section {
  padding-top: 1.25rem;
}

.toc-list {
  margin-left: 1.2rem;
}

.toc-list li {
  margin-bottom: 0.35rem;
}


/* --- Range Sliders --- */
.slider-group {
  margin-top: 0.35rem;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* --- Action Buttons (Copy, PDF) --- */
.results-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn--success {
  background: var(--color-success) !important;
  color: #fff !important;
  border-color: var(--color-success) !important;
}

.btn--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn--icon svg {
  width: 16px;
  height: 16px;
}

/* --- Chart Container --- */
.chart-container {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.chart-container canvas {
  max-height: 280px;
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* --- Amortization Schedule --- */
.schedule-toggle {
  margin-top: 1rem;
  text-align: center;
}

.schedule-container {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.schedule-container::-webkit-scrollbar {
  width: 6px;
}

.schedule-container::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 3px;
}

/* --- Print Styles Enhancement --- */
@media print {
  .chart-container {
    break-inside: avoid;
  }

  .results-actions,
  .schedule-toggle {
    display: none !important;
  }
}

/* --- Related Calculators --- */
.related-section {
  margin-top: 0.5rem;
}

/* --- EMI Split Layout (Desktop + Mobile Safe) --- */
body[data-calc-type="emi"] .calc-card,
body[data-calc-type="personal-loan"] .calc-card,
body[data-calc-type="home-loan"] .calc-card,
body[data-calc-type="car-loan"] .calc-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  column-gap: 1rem;
  row-gap: 0.85rem;
  align-items: start;
}

body[data-calc-type="emi"] .calc-card > :not(#results),
body[data-calc-type="personal-loan"] .calc-card > :not(#results),
body[data-calc-type="home-loan"] .calc-card > :not(#results),
body[data-calc-type="car-loan"] .calc-card > :not(#results) {
  grid-column: 1;
}

body[data-calc-type="emi"] .calc-card > .form-row,
body[data-calc-type="personal-loan"] .calc-card > .form-row,
body[data-calc-type="home-loan"] .calc-card > .form-row,
body[data-calc-type="car-loan"] .calc-card > .form-row {
  grid-template-columns: minmax(0, 340px);
  max-width: 340px;
  gap: 0.85rem;
}

body[data-calc-type="emi"] .calc-card > #results,
body[data-calc-type="personal-loan"] .calc-card > #results,
body[data-calc-type="home-loan"] .calc-card > #results,
body[data-calc-type="car-loan"] .calc-card > #results {
  display: block;
  grid-column: 2;
  grid-row: 1 / span 20;
  margin-top: 0;
  position: sticky;
  top: 84px;
  min-height: 240px;
}

body[data-calc-type="emi"] .calc-card > #results:not(.visible),
body[data-calc-type="personal-loan"] .calc-card > #results:not(.visible),
body[data-calc-type="home-loan"] .calc-card > #results:not(.visible),
body[data-calc-type="car-loan"] .calc-card > #results:not(.visible) {
  visibility: hidden;
  pointer-events: none;
  animation: none;
}

@media (max-width: 1024px) {
  body[data-calc-type="emi"] .calc-card,
  body[data-calc-type="personal-loan"] .calc-card,
  body[data-calc-type="home-loan"] .calc-card,
  body[data-calc-type="car-loan"] .calc-card {
    display: block;
  }

  body[data-calc-type="emi"] .calc-card > #results,
  body[data-calc-type="personal-loan"] .calc-card > #results,
  body[data-calc-type="home-loan"] .calc-card > #results,
  body[data-calc-type="car-loan"] .calc-card > #results {
    position: static;
    top: auto;
    margin-top: 1.25rem;
  }
}

/* --- Homepage Compact Flow --- */
.home-landing {
  margin-bottom: 1.25rem;
}

.home-utility-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.25rem 0 1rem;
}

.home-tool-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.home-tool-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.home-tool-card p {
  margin: 0.35rem 0 0.9rem;
  font-size: 0.9rem;
}

.home-mini-calc {
  margin-top: 0.5rem;
}

.simple-calc {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.simple-calc-display {
  padding: 0.4rem 0.2rem 0.4rem;
  min-height: 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.15rem;
}

.simple-calc-expression {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  min-height: 1rem;
}

.simple-calc-value {
  font-size: 2.1rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: 0.02em;
}

.simple-calc-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.simple-key {
  border: none;
  border-radius: 12px;
  padding: 0.55rem 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg-alt);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.simple-key:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.simple-key:active {
  transform: translateY(0);
  box-shadow: none;
}

.simple-key--action {
  background: #e5f3ff;
  color: #1d4ed8;
}

.simple-key--op {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

.simple-key--wide {
  grid-column: span 2;
  text-align: center;
}

.home-search-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.home-suggestions {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  display: none;
}

.home-suggestions.visible {
  display: block;
}

.home-suggestions li {
  border-bottom: 1px solid var(--color-border);
}

.home-suggestions li:last-child {
  border-bottom: 0;
}

.home-suggestion-link {
  display: block;
  padding: 0.65rem 0.8rem;
  color: var(--color-text);
  font-size: 0.9rem;
}

.home-suggestion-link:hover {
  background: var(--color-primary-50);
}

.home-search-help {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.home-directory {
  margin-bottom: 0.75rem;
}

.home-directory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.home-directory-head h2 {
  margin: 0;
}

.home-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ---- Directory Filter Chips ---- */
.dir-filter-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem;
}
.dir-chip {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem; font-weight: 600; font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dir-chip.active {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.dir-chip:not(.active):hover {
  border-color: var(--color-primary-light); background: var(--color-primary-50); color: var(--color-primary);
}

/* ---- Directory Cards ---- */
.dir-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex; flex-direction: column;
}
.dir-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.dir-cat-name {
  font-size: 0.92rem; font-weight: 700; color: var(--color-text);
  text-decoration: none;
}
.dir-cat-name:hover { color: var(--color-primary); }
.dir-cat-count {
  font-size: 0.7rem; font-weight: 700;
  background: var(--color-primary-50); color: var(--color-primary);
  border: 1px solid var(--color-primary-light);
  border-radius: 999px; padding: 0.1rem 0.5rem;
  white-space: nowrap; flex-shrink: 0;
}
.dir-card-list {
  list-style: none; margin: 0; padding: 0; flex: 1;
}
.dir-card-item {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.86rem;
}
.dir-card-item:last-child { border-bottom: none; }
.dir-card-item a { color: var(--color-text-secondary); text-decoration: none; flex: 1; }
.dir-card-item a:hover { color: var(--color-primary); }
.dir-badge {
  font-size: 0.6rem; font-weight: 700; padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--color-warning-light); color: var(--color-warning);
  white-space: nowrap; flex-shrink: 0;
}
.dir-card-more {
  display: inline-block; margin-top: 0.65rem;
  font-size: 0.8rem; font-weight: 600; color: var(--color-primary);
  text-decoration: none;
}
.dir-card-more:hover { text-decoration: underline; }

/* Wide card: 2-column list for large categories */
@media (min-width: 600px) {
  .dir-card--wide { grid-column: span 2; }
  .dir-card--wide .dir-card-list { columns: 2; column-gap: 1.25rem; }
  .dir-card--wide .dir-card-item { break-inside: avoid; }
}

/* Responsive grid breakpoints */
@media (max-width: 959px) {
  .home-directory-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .home-directory-grid { grid-template-columns: 1fr; }
  .dir-card--wide { grid-column: span 1; }
  .dir-card--wide .dir-card-list { columns: 1; }
}
@media (max-width: 900px) {
  .home-utility-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .home-search-input-wrap {
    grid-template-columns: 1fr;
  }
}

/* --- Homepage Enhanced Hero & Layout --- */
body.home-page .hero {
  padding: 2.75rem 0 2.25rem;
}

body.home-page .hero .container {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.94));
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-lg);
}

body.home-page .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary-dark);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

body.home-page .hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.1rem 0 1.2rem;
}

body.home-page .hero-trust {
  display: flex;
  list-style: none;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.9rem;
  padding: 0;
}

body.home-page .hero-trust li {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

body.home-page .category-nav {
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  body.home-page .hero .container {
    border-radius: var(--radius-lg);
  }

  body.home-page .hero-actions {
    justify-content: flex-start;
  }
}

/* ============================================
   Share Utils — Share Calculator & Share My Result
   ============================================ */

/* ---- Share Calculator Bar ---- */
.share-calc-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.share-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ---- Social Buttons ---- */
.share-social-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.share-btn:hover,
.share-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  outline: none;
}
.share-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.share-btn--wa:hover  { background: #25d366; border-color: #25d366; color: #fff; }
.share-btn--x:hover   { background: #000;    border-color: #000;    color: #fff; }
.share-btn--li:hover  { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.share-btn--fb:hover  { background: #1877f2; border-color: #1877f2; color: #fff; }
.share-btn--copy:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Native share: hidden on desktop, shown on mobile */
.share-btn--native {
  display: none;
  width: auto;
  height: auto;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  gap: 0.35rem;
  background: var(--color-primary-50);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}
.share-btn--native:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

@media (max-width: 600px) {
  .share-btn--wa,
  .share-btn--x,
  .share-btn--li,
  .share-btn--fb,
  .share-btn--copy { display: none; }
  .share-btn--native { display: inline-flex; }
}
@media (min-width: 601px) {
  .share-btn--native { display: none !important; }
}

/* ---- Share My Result Section ---- */
.share-result-section {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 1rem;
}
.share-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.share-result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
.privacy-toggle input {
  accent-color: var(--color-primary);
  cursor: pointer;
}
.share-pdf-btn {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---- Toast Notification ---- */
.share-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.75rem);
  background: #1e293b;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Print / PDF Header ---- */
.print-share-header {
  display: none;
  font-size: 0.75rem;
  color: #555;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Hide share UI in print, show print header */
@media print {
  .share-calc-bar,
  .share-result-section,
  .share-toast {
    display: none !important;
  }
  .print-share-header {
    display: block !important;
  }
}

/* ── CTC Hike Calculator Redesign ────────────────────── */
.ctc-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem 1rem;
  margin-bottom: 0.875rem;
  display: flex; flex-direction: column; align-items: center;
}
.ctc-hike-badge {
  display: inline-flex; align-items: center;
  background: #d1fae5; color: #065f46;
  border: 1px solid #a7f3d0; border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem; font-weight: 700;
  margin-bottom: 0.45rem;
}
.ctc-hero-value {
  font-size: 2rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1; margin-bottom: 0.2rem;
  cursor: default;
}
.ctc-hero-lbl {
  font-size: 0.75rem; font-weight: 700; color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem;
}
.ctc-hero-ctx {
  font-size: 0.82rem; color: var(--color-text-muted); font-weight: 500;
}

/* Bar chart */
.ctc-bars {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.875rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.ctc-bar-row {
  display: grid;
  grid-template-columns: 56px 1fr 72px;
  align-items: center; gap: 0.6rem;
}
.ctc-bar-nm {
  font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 600;
}
.ctc-bar-track {
  height: 9px; background: var(--color-bg-alt); border-radius: 999px; overflow: hidden;
}
.ctc-bar-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.ctc-bar-fill--old { background: #94a3b8; }
.ctc-bar-fill--new { background: var(--color-primary); }
.ctc-bar-amt {
  font-size: 0.75rem; font-weight: 700; color: var(--color-text);
  text-align: right; cursor: default;
}

/* Comparison table */
.ctc-cmp {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 0.875rem;
}
.ctc-cmp-head {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  background: var(--color-bg-alt);
  padding: 0.4rem 1rem;
  font-size: 0.7rem; font-weight: 700; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ctc-cmp-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--color-border);
  align-items: center;
}
.ctc-cmp-lbl {
  font-size: 0.82rem; color: var(--color-text-secondary); font-weight: 500;
}
.ctc-cmp-old {
  font-size: 0.85rem; color: var(--color-text-muted); font-weight: 600;
  text-decoration: line-through; cursor: default;
}
.ctc-cmp-new {
  font-size: 0.88rem; color: var(--color-primary); font-weight: 700;
  display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.ctc-cmp-new > span:first-child { cursor: default; }
.ctc-delta {
  font-size: 0.68rem; font-weight: 700;
  background: #d1fae5; color: #065f46;
  border-radius: 999px; padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* Increase chips */
.ctc-inc-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.5rem; margin-bottom: 0.875rem;
}
.ctc-inc-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.65rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.ctc-inc-val {
  font-size: 1rem; font-weight: 800; color: #059669; cursor: default;
}
.ctc-inc-lbl {
  font-size: 0.7rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.15rem;
}
@media (max-width: 480px) {
  .ctc-hero-value { font-size: 1.65rem; }
  .ctc-bar-row { grid-template-columns: 48px 1fr 60px; }
  .ctc-cmp-head, .ctc-cmp-row { padding: 0.4rem 0.75rem; }
}

/* ── Hike Impact Calculator Redesign ────────────────────── */
.hi-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem 1rem;
  margin-bottom: 0.75rem;
}
.hi-hero-value {
  font-size: 2rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1; margin-bottom: 0.2rem;
  cursor: default;
}
.hi-hero-lbl {
  font-size: 0.75rem; font-weight: 700; color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem;
}
.hi-hero-ctx {
  font-size: 0.82rem; color: var(--color-text-muted); font-weight: 500;
}

/* At-a-glance strip */
.hi-glance {
  display: flex; align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  margin-bottom: 0.75rem;
}
.hi-glance-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
}
.hi-glance-div {
  width: 1px; height: 2rem; background: var(--color-border); flex-shrink: 0;
}
.hi-glance-val {
  font-size: 0.95rem; font-weight: 800; color: var(--color-text); cursor: default;
}
.hi-glance-val--green { color: #059669; }
.hi-glance-lbl {
  font-size: 0.68rem; color: var(--color-text-muted); font-weight: 500; text-align: center;
}

/* Chart wrapper */
.hi-chart-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.75rem 0.5rem;
  margin-bottom: 0.75rem;
}
.hi-chart-wrap canvas { display: block; }

/* Actions */
.hi-actions { margin-bottom: 0.625rem; }

/* Breakdown toggle */
.hi-breakdown-toggle { text-align: center; margin-bottom: 0.75rem; }

@media (max-width: 480px) {
  .hi-hero-value { font-size: 1.65rem; }
  .hi-glance-val { font-size: 0.82rem; }
  .hi-glance { padding: 0.6rem 0.25rem; }
}

/* ── Salary In-Hand Calculator Redesign ──────────────────── */
.sih-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 0.75rem;
}
.sih-hero-badge {
  font-size: 0.72rem; font-weight: 700; color: var(--color-primary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem;
}
.sih-hero-val {
  font-size: 2.25rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1; cursor: default;
}
.sih-hero-annual {
  font-size: 0.78rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.3rem;
}

/* Secondary chips */
.sih-chips { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.sih-chip {
  flex: 1; padding: 0.65rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}
.sih-chip-val { font-size: 1.05rem; font-weight: 700; color: var(--color-text); cursor: default; }
.sih-chip--red .sih-chip-val { color: #dc2626; }
.sih-chip-lbl { font-size: 0.7rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.15rem; }
.sih-chip-annual { font-size: 0.65rem; color: var(--color-text-muted); margin-top: 0.1rem; }

/* Formula row */
.sih-formula {
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}
.sih-fml-item { display: flex; flex-direction: column; align-items: center; gap: 0.12rem; }
.sih-fml-val { font-size: 0.88rem; font-weight: 700; color: var(--color-text); }
.sih-fml-lbl { font-size: 0.6rem; color: var(--color-text-muted); font-weight: 500; }
.sih-fml-op { font-size: 1rem; font-weight: 600; color: var(--color-text-muted); }
.sih-fml-item--result .sih-fml-val { color: var(--color-primary); }
.sih-fml-item--result .sih-fml-lbl { color: var(--color-primary); }

/* Donut chart */
.sih-chart-wrap {
  display: flex; justify-content: center;
  margin-bottom: 0.75rem;
  max-width: 220px; margin-left: auto; margin-right: auto;
}
.sih-chart-wrap canvas { max-width: 100%; }

@media (max-width: 480px) {
  .sih-hero-val { font-size: 1.85rem; }
  .sih-chips { gap: 0.3rem; }
  .sih-chip { padding: 0.5rem 0.4rem; }
}

/* ── Calorie Calculator Redesign ─────────────────────────── */
.cal-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 0.625rem;
}
.cal-hero-badge {
  font-size: 0.72rem; font-weight: 700; color: var(--color-primary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem;
}
.cal-hero-val {
  font-size: 2.25rem; font-weight: 800;
  color: var(--color-primary); line-height: 1.1;
}
.cal-hero-ctx {
  font-size: 0.78rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.35rem;
}

/* BMR secondary row */
.cal-secondary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}
.cal-sec-lbl-wrap { display: flex; flex-direction: column; gap: 0.1rem; }
.cal-sec-label { font-size: 0.78rem; font-weight: 600; color: var(--color-text-secondary); }
.cal-sec-hint { font-size: 0.65rem; color: var(--color-text-muted); }
.cal-sec-val { font-size: 1.15rem; font-weight: 800; color: var(--color-text); }

@media (max-width: 480px) {
  .cal-hero-val { font-size: 1.85rem; }
  .cal-secondary { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .cal-sec-val { font-size: 1.05rem; }
}

/* ── Fuel Cost Calculator Redesign ──────────────────────── */
.fcc-hero {
  text-align: center;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 0.75rem;
}
.fcc-hero-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 0.2rem;
}
.fcc-hero-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.fcc-hero-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.fcc-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0.875rem 0;
}
.fcc-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.fcc-recurring-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.fcc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}
.fcc-stat-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 0.15rem;
}
.fcc-stat-label {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
@media (max-width: 480px) {
  .fcc-hero-value { font-size: 1.85rem; }
  .fcc-stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
  .fcc-stat { padding: 0.5rem 0.3rem; }
  .fcc-stat-value { font-size: 0.88rem; }
  .fcc-stat-label { font-size: 0.62rem; }
}
