/* ================================================================
   StudLoanCalc — Complete Stylesheet
   ================================================================
   US student loan calculator, mobile-first responsive.
   Color scheme: Trustworthy financial blue + clean white + grays.
   ================================================================ */

/* ── CSS Custom Properties ─────────────────────── */
:root {
  --color-primary: #0B1F3B;
  --color-primary-dark: #061429;
  --color-primary-light: #D6E4F0;
  --color-primary-bg: #EEF3F9;
  --color-accent: #059669;
  --color-accent-light: #D1FAE5;
  --color-accent-dark: #047857;
  --color-warning: #D97706;
  --color-warning-light: #FEF3C7;
  --color-warning-border: #F59E0B;
  --color-danger: #DC2626;
  --color-danger-light: #FEF2F2;
  --color-danger-border: #EF4444;
  --color-twitter: #1DA1F2;
  --color-facebook: #1877F2;
  --color-reddit: #FF4500;
  --color-text: #1E293B;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFC;
  --color-bg-card: #FFFFFF;
  --color-surface: #F1F5F9;
  --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.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg-alt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Layout ────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ───────────────────────────────────── */
/* ── Site Header — Unified Clean Navigation ─── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.site-header .site-logo { color: var(--color-primary); }
.site-header .container {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  max-width: var(--max-width);
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo:hover { text-decoration: none; opacity: 0.85; }
.site-logo .logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.95rem;
  flex-shrink: 0;
}

/* ── Row 1: Brand + Trust ──────────────────────── */
.nav-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  min-height: 52px;
}
.nav-trust {
  font-size: 0.7rem;
  color: #fff;
  background: linear-gradient(135deg, #059669, #047857);
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Hamburger ─────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px; height: 32px;
  background: #f3f4f6;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle:hover { background: #e8eaed; }
.nav-toggle span {
  display: block;
  height: 2px;
  background: #555;
  border-radius: 2px;
  margin: 0 7px;
}

/* ── Rows 2+3: Shared Nav Link Base ────────────── */
.nav-calcs, .nav-info {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.nav-calcs::-webkit-scrollbar,
.nav-info::-webkit-scrollbar { display: none; }
.nav-calcs a,
.nav-info a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-calcs .nav-icon,
.nav-info .nav-icon {
  font-size: 0.9em;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Row 2: Calculator Links ───────────────────── */
.nav-calcs {
  gap: 4px;
  padding: 0 24px;
  border-top: 1px solid #f0f0f0;
}
.nav-calcs a {
  padding: 11px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  border-radius: 6px 6px 0 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav-calcs a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: #f8fafc;
}
.nav-calcs a.active {
  color: var(--color-primary);
  font-weight: 700;
  border-bottom-color: var(--color-primary);
  background: #eff6ff;
}

/* ── Row 3: Info / Secondary Links ─────────────── */
.nav-info {
  gap: 2px;
  padding: 0 24px;
  background: #fafbfc;
  border-top: 1px solid #f0f0f0;
}
.nav-info a {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 400;
  color: #6b7280;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav-info a:hover {
  color: var(--color-primary);
  border-bottom-color: #93c5fd;
  background: #f0f4f8;
}
.nav-info a.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-trust { display: none; }
  .nav-calcs, .nav-info {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0;
    justify-content: flex-start;
  }
  .nav-calcs a, .nav-info a {
    padding: 13px 20px;
    border-bottom: none;
    border-top: 1px solid #f0f0f0;
    border-radius: 0;
    font-size: 0.88rem;
  }
  .nav-calcs a:first-child,
  .nav-info a:first-child { border-top: none; }
  .nav-calcs a:hover,
  .nav-info a:hover { background: #f8fafc; }
  .nav-calcs { border-bottom: 1px solid #e5e7eb; }
  .nav-info { background: #fff; border-top: none; }
  .site-header.nav-open .nav-calcs,
  .site-header.nav-open .nav-info { display: flex; }
}

/* ── Main Content ──────────────────────────── */
.main-content {
  padding: 24px 0 80px;
}

/* ── Privacy Badge (hero area) ────────────────── */
.privacy-badge {
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 16px;
}
.privacy-badge .shield-icon { font-size: 1.1rem; }

/* ── Page Title ────────────────────────────── */
.page-hero {
  text-align: center;
  padding: 32px 0 16px;
}
.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.25;
  margin-bottom: 8px;
}
.page-hero p {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
}

/* ── Tab Navigation (Desktop) ──────────────────── */
.tab-nav-desktop {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 24px 0 0;
  padding: 4px;
  background: var(--color-surface);
  border-radius: var(--radius);
}
.tab-btn {
  flex: 1;
  min-width: 130px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.tab-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.tab-btn.active {
  background: var(--color-bg);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Tab Navigation (Mobile Dropdown) ──────────── */
.tab-nav-mobile {
  display: none;
  margin: 16px 0 0;
  position: relative;
}
.tab-select {
  width: 100%;
  padding: 14px 42px 14px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  cursor: pointer;
  font-family: var(--font-sans);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color var(--transition);
}
.tab-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ── Tab Content ────────────────────────────── */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}
.tab-content.active { display: block; }

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

.tab-inner {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 28px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

/* ── Warning Banners ───────────────────────────── */
.warning-banner {
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning-border);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.warning-banner .warn-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.warning-banner strong { display: block; margin-bottom: 2px; }

.danger-banner {
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger-border);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: #991b1b;
  line-height: 1.5;
}
.danger-banner strong { color: var(--color-danger); }

/* ── Forms ──────────────────────────────────── */
.calc-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.calc-form.single-col {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}
.form-group .label-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
}
.field-note {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.3;
}
.form-input:disabled {
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.form-group.is-disabled .field-note {
  color: var(--color-primary);
}

.form-input {
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-input.input-error {
  border-color: var(--color-danger);
}
.form-input.input-error:focus {
  box-shadow: 0 0 0 3px var(--color-danger-light);
}

.input-prefix {
  position: relative;
}
.input-prefix .prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
}
.input-prefix .form-input {
  padding-left: 28px;
}
.input-suffix {
  position: relative;
}
.input-suffix .suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  pointer-events: none;
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.error-msg {
  font-size: 0.78rem;
  color: var(--color-danger);
  min-height: 18px;
}

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.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-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-border-light);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary-bg);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.btn-danger-text {
  background: transparent;
  color: var(--color-danger);
  border: none;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-danger-text:hover {
  text-decoration: underline;
  background: var(--color-danger-light);
  border-radius: var(--radius-sm);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Results Section ──────────────────────────── */
.results-section {
  margin-top: 8px;
}

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

.result-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.result-card.highlight {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}
.result-card .card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.result-card .card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}
.result-card .card-value.savings {
  color: var(--color-accent);
}
.result-card .card-value.warning {
  color: var(--color-warning);
}

/* Comparison Table */
.compare-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 600px;
}
.compare-table thead th {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 700;
  padding: 12px 14px;
  text-align: center;
  border-bottom: 2px solid var(--color-primary);
  font-size: 0.85rem;
  white-space: nowrap;
}
.compare-table thead th:first-child {
  text-align: left;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 2;
}
.compare-table tbody td {
  padding: 10px 14px;
  text-align: center;
  border-bottom: 1px solid var(--color-border-light);
}
.compare-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  background: var(--color-bg-alt);
  position: sticky;
  left: 0;
  z-index: 1;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
}
.compare-table tbody tr:hover td {
  background: var(--color-primary-bg);
}
.compare-table .best-cell {
  color: var(--color-accent);
  font-weight: 700;
}
.compare-table .worst-cell {
  color: var(--color-text-muted);
}

/* Amortization table */
.amort-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 500px;
  overflow-y: auto;
  margin: 16px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 700px;
}
.amort-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.amort-table thead th {
  background: var(--color-text);
  color: #fff;
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
.amort-table thead th:first-child { text-align: center; }
.amort-table tbody td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--color-border-light);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.amort-table tbody td:first-child {
  text-align: center;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
}
.amort-table tbody tr:nth-child(even) { background: var(--color-bg-alt); }

/* ── Chart Container ────────────────────────── */
.chart-container {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  position: relative;
}
.chart-container canvas {
  max-height: 400px;
}

/* ── Loan Log ─────────────────────────────────── */
.log-list {
  list-style: none;
}
.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--color-bg);
  gap: 12px;
  flex-wrap: wrap;
  transition: box-shadow var(--transition);
}
.log-item:hover { box-shadow: var(--shadow-md); }
.log-item-info { flex: 1; min-width: 200px; }
.log-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}
.log-item-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.log-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.log-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}
.log-empty .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.log-empty p { font-size: 0.95rem; }

/* ── Loan Log Calculator (Tab 6) ─────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 8px 0;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.loan-preview { margin-top: 4px; }
.preview-hint {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 4px 0 0;
}
.portfolio-summary { margin-bottom: 8px; }
.portfolio-note {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 12px;
  line-height: 1.5;
}
.loan-figures {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 120px;
}
.loan-figures .fig {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.loan-figures .fig-muted {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.priority-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-accent-light, #d1fae5);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
}
.ll-actions { display: flex; }
@media (max-width: 600px) {
  .loan-figures { align-items: flex-start; }
}

/* ── Tooltip Help Icons ──────────────────────── */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  position: relative;
  vertical-align: middle;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.tooltip-trigger:hover {
  background: var(--color-primary);
  color: #fff;
}
.tooltip-trigger::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
}
.tooltip-trigger::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-text);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before { opacity: 1; }

/* ── Social Share Bar ────────────────────────── */
.share-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}
.share-section .share-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #fff;
  text-decoration: none;
}
.share-btn.twitter  { background: var(--color-twitter); }
.share-btn.facebook { background: var(--color-facebook); }
.share-btn.reddit   { background: var(--color-reddit); }
.share-btn.email    { background: var(--color-text-secondary); }
.share-btn.copy     { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.share-btn.copy:hover { color: var(--color-text); background: var(--color-border); }
.share-btn .share-icon { font-size: 1rem; }

/* ── Floating Share Bar (bottom of page) ──────────── */
.share-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  margin-top: 32px;
}
.share-bar .share-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.share-bar .share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  padding: 0;
  gap: 0;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}
.share-bar .share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: #fff; text-decoration: none; }
.share-bar .share-twitter  { background: var(--color-twitter); }
.share-bar .share-facebook { background: var(--color-facebook); }
.share-bar .share-reddit   { background: var(--color-reddit); }
.share-bar .share-email    { background: var(--color-text-secondary); }
.share-bar .share-copy     { background: var(--color-surface); color: var(--color-text); border: 1.5px solid var(--color-border); }
.share-bar .share-copy:hover { background: var(--color-border); color: var(--color-text); }

/* ── Bookmark Toast ──────────────────────────── */
.bookmark-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  background: var(--color-bg);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-xl);
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  animation: slideUp 0.4s ease;
  font-size: 0.85rem;
}
.bookmark-toast.show { display: flex; }
.bookmark-toast .toast-icon { font-size: 1.3rem; }
.bookmark-toast .toast-text { flex: 1; color: var(--color-text); }
.bookmark-toast .toast-text strong { color: var(--color-primary); }
.bookmark-toast .toast-text kbd,
.bookmark-toast .toast-kbd {
  display: inline-block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  margin: 2px 2px 0;
}
.bookmark-toast .toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.bookmark-toast .toast-close:hover { color: var(--color-text); }

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

/* ── PWA Install Banner ─────────────────────── */
.pwa-banner {
  display: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.875rem;
  position: relative;
}
.pwa-banner.show { display: block; }
.pwa-banner .pwa-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}
.pwa-banner .pwa-icon { font-size: 1.5rem; }
.pwa-banner .pwa-text { font-weight: 500; }
.pwa-banner .pwa-install-btn {
  background: #fff;
  color: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition);
}
.pwa-banner .pwa-install-btn:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}
.pwa-banner .pwa-dismiss {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}
.pwa-banner .pwa-dismiss:hover { color: #fff; }

/* ── Scenario Compare Section ────────────────── */
.compare-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--color-primary);
}
.compare-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  color: var(--color-text);
}
.compare-placeholder {
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.compare-scenarios {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.compare-scenario-card {
  flex: 1;
  min-width: 220px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
}
.compare-scenario-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}
.compare-scenario-card.best {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  box-shadow: var(--shadow-md);
}
.compare-scenario-card .scenario-rank {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.compare-scenario-card.best .scenario-rank { background: var(--color-accent); }
.compare-scenario-card .scenario-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--color-text);
}
.compare-scenario-card .scenario-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.82rem;
  border-bottom: 1px dotted var(--color-border);
}
.compare-scenario-card .scenario-stat .stat-label { color: var(--color-text-muted); }
.compare-scenario-card .scenario-stat .stat-value { font-weight: 600; color: var(--color-text); }
.compare-scenario-card .best-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.compare-select-area {
  text-align: center;
  margin-bottom: 16px;
}
.compare-select-area p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.compare-select-area .btn { margin: 4px; }

/* ── In-School & Deferment Sections (Tab 1 v2) ────── */
.in-school-section summary,
.deferment-section summary {
  font-weight: 600;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
  font-size: 0.9rem;
  list-style: none;
}
.in-school-section summary::-webkit-details-marker,
.deferment-section summary::-webkit-details-marker { display: none; }
.in-school-section summary:hover,
.deferment-section summary:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}
.in-school-section[open] summary {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.deferment-section[open] summary {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  background: var(--color-warning-light);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.in-school-section,
.deferment-section {
  margin-top: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  overflow: hidden;
}
.in-school-section[open],
.deferment-section[open] {
  padding: 0 16px 16px;
  border-color: var(--color-border);
}
.in-school-section[open] { border-color: var(--color-primary); }
.deferment-section[open] { border-color: var(--color-warning); }

/* ── Info Banner (result displays) ──────────────────── */
.info-banner {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.6;
}
.info-banner strong { color: var(--color-primary); }
.info-banner a { font-weight: 600; }
.info-banner.validation-warning {
  display: none;
  border-left-color: var(--color-warning);
  background: var(--color-warning-light);
}
.info-banner.validation-warning strong { color: var(--color-warning); }

/* ── Yearly Projection (Tab 2) ────────────────────── */
.yearly-projection-wrapper {
  margin-top: 8px;
}
.yearly-projection-wrapper .btn {
  margin-right: 4px;
  margin-bottom: 4px;
}
#yearly-projection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
#yearly-projection-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
#yearly-projection-table thead th {
  background: var(--color-text);
  color: #fff;
  padding: 8px 10px;
  text-align: right;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
#yearly-projection-table thead th:first-child { text-align: center; }
#yearly-projection-table tbody td {
  padding: 6px 10px;
  text-align: right;
  border-bottom: 1px solid var(--color-border-light);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
#yearly-projection-table tbody td:first-child {
  text-align: center;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
}
#yearly-projection-table tbody tr:nth-child(even) { background: var(--color-bg-alt); }
#yearly-projection-table tbody tr:last-child td {
  font-weight: 700;
  border-top: 2px solid var(--color-primary);
}

/* ── SAVE Forbearance Result ──────────────────────── */
#save-forb-result {
  padding: 14px 18px;
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.6;
  color: #92400e;
}
#save-forb-result strong { color: #78350f; }
#save-forb-result em { color: var(--color-text-muted); font-size: 0.85rem; }

/* ── Tax Bomb Detail Table ────────────────────────── */
#tax-bomb-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
#tax-bomb-detail thead th {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 700;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 2px solid var(--color-primary);
  font-size: 0.82rem;
}
#tax-bomb-detail tbody td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--color-border-light);
}
#tax-bomb-detail tbody tr:hover td { background: var(--color-bg-alt); }
#tax-bomb-detail p {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── 5-Column Compare Table Adjustments ───────────── */
/* Override default min-width for 6 columns (label + 5 plans) */
#tab-compare .compare-table { min-width: 750px; }
#tab-compare .compare-table thead th {
  font-size: 0.82rem;
  padding: 10px 10px;
}
#tab-compare .compare-table tbody td {
  font-size: 0.82rem;
  padding: 8px 10px;
}
#tab-compare .compare-table .best-cell {
  background: var(--color-accent-light);
  font-weight: 700;
}

/* ── Print Buttons ──────────────────────────── */
.print-btn-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.print-btn-bottom {
  /* Superseded by the global Floating Action Button (bottom-right) which now
     provides Print on every page. Hidden to avoid overlap with the FAB. */
  display: none;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 90;
}
.print-btn-bottom .btn {
  box-shadow: var(--shadow-lg);
  padding: 14px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
}

/* ── FAQ Section ────────────────────────────── */
.faq-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}
.faq-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}
.faq-list { }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 16px 44px 16px 18px;
  text-align: left;
  background: var(--color-bg);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--font-sans);
  position: relative;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--color-bg-alt); }
.faq-question::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--color-primary);
  font-weight: 700;
}
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
  display: none;
  padding: 0 18px 16px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* Blog FAQ: always expanded (blog pages have no ui.js toggle script) */
.faq-open .faq-answer { display: block; }
.faq-open .faq-question { cursor: default; }
.faq-open .faq-question::after { content: ''; }

/* ── Footer ──────────────────────────────────── */
/* ── Site Footer (multi-column) ─────────────────── */
.site-footer {
  background: #f8fafc;
  border-top: 3px solid var(--color-accent);
  padding: 32px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 32px 24px;
  max-width: 1100px;
}

/* Brand column */
.site-footer .footer-brand { padding-right: 12px; }
.site-footer .footer-brand .brand-name {
  font-weight: 600; font-size: 1.15rem; color: var(--color-text); margin-bottom: 4px;
}
.site-footer .footer-brand .brand-desc {
  font-size: 0.78rem; line-height: 1.7; color: var(--color-text-muted); margin: 0 0 14px;
}
.footer-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-badges .badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; padding: 3px 10px; border-radius: 100px; font-weight: 500;
}
.badge-private   { background: #dbeafe; color: #1e40af; }
.badge-nodata    { background: #dcfce7; color: #166534; }
.badge-ads       { background: #fef3c7; color: #92400e; }
.footer-badges .badge svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Footer link columns */
.site-footer .footer-col h4 {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-text); margin: 0 0 12px;
}
.site-footer .footer-col ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.site-footer .footer-col li a {
  color: var(--color-text-secondary); text-decoration: none; font-size: 0.8rem;
  transition: color .15s ease;
}
.site-footer .footer-col li a:hover { color: var(--color-accent); }

/* Authority resources block (DoFollow .gov links, body) */
.authority-resources {
  background: #f4f8ff; border: 1px solid #d8e6fb; border-left: 4px solid var(--color-accent, #1f6feb);
  border-radius: 10px; padding: 18px 22px; margin: 28px auto 8px;
  max-width: var(--max-width);
}
.authority-resources h2 {
  font-size: 1.05rem; margin: 0 0 10px; color: var(--color-text, #1a2333);
}
.authority-resources ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px;
}
.authority-resources li {
  text-align: center;
}
.authority-resources li a {
  color: #134e9c; text-decoration: none; font-size: 0.9rem; font-weight: 500;
}
.authority-resources li a:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .authority-resources ul { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .authority-resources { padding: 14px 16px; }
  .authority-resources ul { grid-template-columns: 1fr; }
  .authority-resources li { text-align: left; }
}
/* Sister-site "More Free Calculators" band — full-width row, visually distinct */
.site-footer .related-calc-block {
  grid-column: 1 / -1;            /* span full width below the 4 nav columns */
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1; /* clear divider from nav columns above */
}
.site-footer .related-calc-block h4 {
  color: var(--color-text);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 10px;
}
.site-footer .related-calc-block ul {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;            /* override .footer-col vertical list */
  gap: 8px 28px;
}
.site-footer .related-calc-block li a {
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}
.site-footer .related-calc-block li a:hover { color: var(--color-accent); }

/* State "At a Glance" data callout (real, per-state, sourced) */
.glance-block {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--color-accent, #1f6feb);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 22px 0 8px;
}
.glance-block h2 { font-size: 1.05rem; margin: 0 0 8px; }
.glance-block p { margin: 0; font-size: 0.9rem; line-height: 1.65; color: var(--color-text-secondary); }
.glance-block strong { color: var(--color-text); }

.state-programs-block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0f766e;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
}
.state-programs-block h3 { font-size: 1rem; margin: 0 0 8px; color: var(--color-text); }
.state-programs-block ul { margin: 0 0 10px; padding-left: 20px; }
.state-programs-block li { margin: 6px 0; font-size: 0.9rem; line-height: 1.6; color: var(--color-text-secondary); }
.state-programs-block li strong { color: var(--color-text); }
.state-programs-block .programs-note {
  font-size: 0.82rem; line-height: 1.55; color: #64748b; margin: 6px 0 0; font-style: italic;
}
.state-programs-block a { color: #0f766e; }

/* Disclaimer card */
.footer-disclaimer-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px; font-size: 0.72rem; line-height: 1.55;
  color: var(--color-text-muted); margin-top: 8px;
}
.footer-disclaimer-card .disclaimer-icon {
  color: #d97706; font-weight: 700; margin-right: 3px;
}

/* Bottom bar */
.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid #e2e8f0;
  padding: 16px 0;
  margin-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.footer-bottom p {
  font-size: 0.72rem; color: var(--color-text-muted); margin: 0;
}

/* Last-updated dateline (deployment meta) */
.last-updated {
  grid-column: 1 / -1;
  font-size: 0.7rem; color: var(--color-text-muted);
  margin: 6px 0 0; padding-top: 8px; border-top: 1px dashed #e2e8f0;
}

/* Mobile: stack everything */
@media (max-width: 768px) {
  .site-footer .container {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .site-footer { padding: 24px 0 0; border-top-width: 2px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-badges { gap: 6px; }
}

/* ── Breadcrumb Navigation ─────────────────────── */
.breadcrumb {
  padding: 12px 0 0;
  margin-bottom: 4px;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}
.breadcrumb li { color: var(--color-text-muted); }
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 6px;
  color: var(--color-border);
}
.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--color-primary); text-decoration: underline; }
.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

/* ── Static Pages ───────────────────────────── */
.static-page {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 36px;
  margin: 24px auto;
  max-width: var(--max-width);
}
.static-page h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.static-page h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.static-page h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 20px 0 8px;
}
.static-page p {
  margin-bottom: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.static-page ul, .static-page ol {
  margin: 0 0 14px 24px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.static-page li { margin-bottom: 6px; }
.static-page .methodology-block {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}
.static-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.875rem;
}
.static-page table th,
.static-page table td {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  text-align: left;
}
.static-page table th {
  background: var(--color-surface);
  font-weight: 600;
}

/* ── Blog Pages ──────────────────────────────── */
.blog-post {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 36px;
  margin: 24px auto;
  max-width: var(--max-width);
}
.blog-post h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}
.blog-post .post-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.blog-post h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.blog-post h3 { font-size: 1.1rem; font-weight: 700; margin: 24px 0 8px; }
.blog-post p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--color-text-secondary);
}
.blog-post ul, .blog-post ol {
  margin: 0 0 16px 24px;
  line-height: 1.8;
  color: var(--color-text-secondary);
}
.blog-post li { margin-bottom: 6px; }
.blog-post blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 12px 18px;
  margin: 16px 0;
  background: var(--color-primary-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.blog-post .references-section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--color-border);
}
.blog-post .references-section h2 {
  font-size: 1.1rem;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 12px;
}
.blog-post .references-section ol {
  font-size: 0.85rem;
}
.blog-post .references-section a {
  word-break: break-all;
}

/* ── Spinner ──────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 404 Page ──────────────────────────────── */
.not-found {
  text-align: center;
  padding: 80px 20px;
}
.not-found h1 { font-size: 5rem; font-weight: 800; color: var(--color-primary); }
.not-found p { font-size: 1.1rem; color: var(--color-text-secondary); margin: 16px 0 24px; }

/* ── Loan Multi-Entry ──────────────────────── */
.loan-entries { margin-bottom: 16px; }
.loan-entry {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.loan-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.loan-entry-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
}
.loan-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.add-loan-btn {
  margin-top: 8px;
}

/* ── Strategy Winner Card ──────────────────── */
.winner-card {
  background: var(--color-accent-light);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  margin-bottom: 20px;
}
.winner-card .winner-icon { font-size: 2rem; margin-bottom: 8px; }
.winner-card .winner-title { font-size: 1.1rem; font-weight: 700; color: var(--color-accent); }
.winner-card .winner-detail { font-size: 0.9rem; color: var(--color-text-secondary); margin-top: 4px; }

/* ── Home: calculator card grid ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.calc-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.calc-card:hover,
.calc-card:focus {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
  border-color: var(--color-primary);
  text-decoration: none;
}
.calc-card-icon { font-size: 2rem; line-height: 1; }
.calc-card h3 {
  margin: .6rem 0 .4rem;
  font-size: 1.1rem;
  color: var(--color-primary);
}
.calc-card p {
  margin: 0;
  font-size: .9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ── Responsive: Tablet ────────────────────── */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-nav { justify-content: flex-start; }

  .page-hero h1 { font-size: 1.5rem; }
  .page-hero p { font-size: 0.9rem; }

  .tab-nav-desktop { display: none; }
  .tab-nav-mobile { display: block; }

  .calc-form {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tab-inner { padding: 16px; }

  .static-page, .blog-post { padding: 20px; }
  .static-page h1, .blog-post h1 { font-size: 1.4rem; }

  .compare-table-wrapper { margin: 12px -16px; }
  .amort-table-wrapper { margin: 12px -16px; border-radius: 0; }

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

  .print-btn-bottom .btn { padding: 12px 18px; font-size: 0.85rem; }
  .print-btn-bottom { bottom: 10px; right: 10px; }

  .share-bar { gap: 6px; padding: 10px 12px; }
  .share-bar .share-btn { width: 34px; height: 34px; font-size: 0.9rem; }

  #yearly-projection-table { font-size: 0.7rem; }
  #tax-bomb-detail table { font-size: 0.7rem; }
  #tab-compare .compare-table { min-width: 650px; }
}

/* ── Responsive: Phone ──────────────────────── */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { padding: 0 12px; }

  .site-logo { font-size: 1.15rem; }
  .site-nav a { padding: 5px 10px; font-size: 0.8rem; }

  .page-hero { padding: 20px 0 8px; }
  .page-hero h1 { font-size: 1.3rem; }
  .results-grid { grid-template-columns: 1fr; }

  .tab-inner { padding: 14px; }
  .warning-banner { font-size: 0.8rem; padding: 10px 14px; }

  .log-item { flex-direction: column; align-items: flex-start; }
  .log-item-actions { width: 100%; justify-content: flex-end; }

  .loan-entry-grid {
    grid-template-columns: 1fr;
  }

  .print-btn-top { justify-content: center; }

  .share-bar .share-label { display: none; }
  #tab-compare .compare-table { min-width: 500px; font-size: 0.75rem; }
}

/* ── Related Posts (blog cross-links) ──────── */
.related-posts {
  margin: 2.5rem 0 0;
  padding: 1.5rem;
  background: var(--color-surface, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
}
.related-posts h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.related-list a { color: var(--color-primary, #1d4ed8); text-decoration: none; font-weight: 600; }
.related-list a:hover { text-decoration: underline; }
.related-all { margin: 1rem 0 0; }
.related-all a { color: var(--color-primary, #1d4ed8); font-weight: 600; }

/* ── Blog Index ────────────────────────────── */
.article-card {
  display: block;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1rem;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.article-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.article-card h2 { font-size: 1.2rem; margin: 0 0 .4rem; color: var(--color-primary, #1d4ed8); }
.article-card p { margin: 0; color: var(--color-text-muted, #64748b); font-size: .95rem; }

/* ── State Guides Grid ──────────────────────── */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 1.5rem 0 2rem;
}
.state-card {
  display: block;
  padding: 16px 18px;
  background: var(--color-surface, #fff);
  border: 0.5px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.state-card:hover {
  border-color: var(--color-primary, #1d4ed8);
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
}
.state-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.state-abbr {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.state-card-name {
  font-size: 15px; font-weight: 600;
  color: var(--color-text, #1e293b);
}
.state-card-plan {
  font-size: 12.5px;
  color: var(--color-text-muted, #64748b);
  margin: 0 0 10px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.state-card-links {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
}
.state-card-link-guide {
  color: var(--color-primary, #1d4ed8);
  font-weight: 600;
}
.state-card-link-official {
  color: var(--color-text-muted, #94a3b8);
}

@media (max-width: 600px) {
  .state-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .state-card { padding: 12px 14px; }
  .state-abbr { width: 32px; height: 32px; font-size: 11.5px; }
  .state-card-name { font-size: 14px; }
  .state-card-plan { font-size: 12px; }
}

/* ── Calculator guide (in-page explainer) ─── */
.calc-guide {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  line-height: 1.75;
}
.calc-guide h2 {
  font-size: 1.45rem;
  margin: 1.8rem 0 0.8rem;
  color: var(--color-primary);
}
.calc-guide h3 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.5rem;
}
.calc-guide p { margin: 0 0 0.9rem; color: var(--color-text); }
.calc-guide ul, .calc-guide ol { margin: 0 0 1rem 1.25rem; }
.calc-guide li { margin: 0 0 0.5rem; }
.calc-guide dl { margin: 0 0 1rem; }
.calc-guide dt { font-weight: 700; margin-top: 0.6rem; }
.calc-guide dd { margin: 0 0 0.4rem 0; color: var(--color-text-secondary); }
.guide-source, .guide-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 8px 8px 0;
}

/* ── Jump to calculator link ── */
.jump-calc {
  text-align: center;
  margin: 18px 0 0;
}
.jump-calc a {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
}
.jump-calc a:hover { opacity: 0.9; }

/* ── Print Styles ──────────────────────────── */
/* ──────────────────────────────────────────────
   Floating Action Button (FAB) — print / share / top
   ────────────────────────────────────────────── */
.fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.fab-main {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.fab-main:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.fab-main:active { transform: translateY(0) scale(.96); }
.fab-main-icon { display: inline-block; font-weight: 300; transition: transform .25s ease; }
.fab.open .fab-main-icon { transform: rotate(45deg); }

.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.fab.open .fab-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 6px 6px 8px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, background .15s ease;
}
.fab-item:hover { transform: translateX(-3px); background: var(--color-bg-alt); }
.fab-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  background: var(--color-bg-card);
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.fab-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.fab-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  max-width: min(92vw, 420px);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity .25s ease, transform .25s ease;
}
.fab-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .fab { right: 16px; bottom: 16px; }
  .fab-main { width: 52px; height: 52px; }
  .fab-toast { bottom: 22px; font-size: .85rem; }
}

@media print {
  /* 1. CRITICAL: Neutralize ALL positioned elements to prevent blank first page */
  * { position: static !important; }

  /* 2. Fully collapse sticky header */
  .site-header {
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: none !important;
  }

  /* 3. Hide all non-content elements */
  .site-footer,
  .tab-nav-desktop,
  .tab-nav-mobile,
  .print-btn-top,
  .print-btn-bottom,
  .privacy-badge,
  .faq-section,
  .site-nav,
  .add-loan-btn,
  .btn-danger-text,
  .log-item-actions,
  .spinner,
  .share-section,
  .share-bar,
  .bookmark-toast,
  .pwa-banner,
  .fab,
  .fab-toast,
  .fab-main,
  .fab-menu,
  .tooltip-trigger,
  .in-school-section,
  .deferment-section,
  .info-banner,
  .yearly-projection-wrapper,
  #save-rap-result,
  #save-forb-result,
  #tax-bomb-detail,
  #deferment-result,
  #in-school-result,
  .compare-select-area button,
  #input-validation-banner {
    display: none !important;
  }

  /* 4. Tab visibility: only active tab shows */
  .tab-content:not(.active) {
    display: none !important;
  }
  .tab-content.active {
    display: block !important;
    page-break-inside: avoid;
  }

  /* 5. Body & layout resets */
  body, html {
    background: #fff;
    color: #000;
    font-size: 11pt;
    margin: 0;
    padding: 0;
  }
  .main-content { padding: 0; }
  .container { max-width: 100%; padding: 0; }

  /* 6. Title/hero section */
  .page-hero {
    page-break-after: avoid;
    padding: 8px 0 4px;
  }
  .page-hero h1 { font-size: 18pt; margin-bottom: 4px; }
  .page-hero p { font-size: 10pt; color: #333; }

  /* 7. Content area styling */
  .tab-inner {
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
    page-break-inside: avoid;
  }

  /* 8. Results & tables */
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .result-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
  .compare-table-wrapper { overflow-x: visible; }
  .amort-table-wrapper {
    overflow-x: visible;
    max-height: none;
    overflow-y: visible;
    border: 1px solid #ccc;
  }
  .amort-table { min-width: auto; font-size: 8pt; }

  /* 9. Charts & forms */
  .chart-container canvas {
    max-height: 300px;
    page-break-inside: avoid;
  }
  .calc-form { grid-template-columns: repeat(2, 1fr); }
  .warning-banner, .danger-banner {
    border: 1px solid #ccc;
    background: #fff;
    page-break-inside: avoid;
  }

  /* 10. Links */
  a { color: #000; text-decoration: underline; }

  @page { margin: 1.5cm; }
}

/* ── Homepage Content Sections (SEO / E-E-A-T) ── */
.home-section { margin: 2.5rem 0; }
.home-section h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--color-border);
}
.home-prose { color: var(--color-text-secondary); line-height: 1.7; font-size: 1rem; }
.home-prose p { margin: 0 0 1rem; }
.home-prose p:last-child { margin-bottom: 0; }
.home-prose strong { color: var(--color-text); }
.home-prose a { color: var(--color-primary); font-weight: 600; }

/* Which-tool grid */
.use-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.use-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.use-card h3 { margin: 0 0 .4rem; font-size: 1.02rem; color: var(--color-primary); }
.use-card p { margin: 0; font-size: .9rem; color: var(--color-text-secondary); line-height: 1.5; }
.use-card a { font-weight: 600; }

/* Blog teasers */
.blog-teasers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

/* State teasers */
.state-teasers {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.2rem;
}
.state-teasers a {
  display: inline-block;
  padding: .5rem .95rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: .9rem;
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.state-teasers a:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Methodology / trust box */
.method-box {
  background: var(--color-primary-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-top: 1.2rem;
}
.method-box p { margin: 0 0 .8rem; color: var(--color-text-secondary); line-height: 1.65; font-size: .98rem; }
.method-box p:last-child { margin-bottom: 0; }
.method-box a { color: var(--color-primary); font-weight: 600; }

/* ── Related Resources (calculator pages, above footer) ── */
.related-resources {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem;
  background: var(--color-surface);
  border-top: 3px solid var(--color-primary);
}
.related-resources h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--color-text);
  margin: 0 0 1.4rem; text-align: center;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  max-width: 1100px;
  margin: 0 auto;
}
.related-col {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.4rem 1.2rem;
}
.related-col h3 {
  font-size: .95rem; color: var(--color-primary); font-weight: 700;
  margin: 0 0 .9rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase; letter-spacing: .04em;
}
.related-col ul { list-style: none; margin: 0; padding: 0; }
.related-col li { margin: 0 0 .6rem; }
.related-col li:last-child { margin-bottom: 0; }
.related-col a {
  color: var(--color-text-secondary); text-decoration: none;
  font-weight: 500; font-size: .92rem; transition: color .15s;
  display: inline-block;
  line-height: 1.55;
}
.related-col a:hover { color: var(--color-primary); text-decoration: underline; }
@media (max-width: 768px) {
  .related-grid { grid-template-columns: 1fr; gap: 1rem; }
  .related-resources { padding: 1.5rem 0; }
}

/* ================================================================
   Dark / Night Mode — scoped to screen so print stays light
   ================================================================ */
@media screen {
  :root[data-theme="dark"] {
    --color-primary: #93C5FD;
    --color-primary-dark: #0B1F3B;
    --color-primary-light: #3B82F6;
    --color-primary-bg: #16233A;
    --color-accent: #34D399;
    --color-accent-light: #0E3B2E;
    --color-accent-dark: #10B981;
    --color-warning: #FBBF24;
    --color-warning-light: #3A2E0E;
    --color-warning-border: #B45309;
    --color-danger: #F87171;
    --color-danger-light: #3A1719;
    --color-danger-border: #B91C1C;
    --color-twitter: #60A5FA;
    --color-facebook: #60A5FA;
    --color-reddit: #F87171;
    --color-text: #E6EDF5;
    --color-text-secondary: #AEBAC9;
    --color-text-muted: #7C8A9C;
    --color-border: #2A3645;
    --color-border-light: #1E2832;
    --color-bg: #0E1726;
    --color-bg-alt: #131F30;
    --color-bg-card: #16223A;
    --color-surface: #1C2A40;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -2px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.55), 0 4px 6px -4px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 10px 10px -5px rgba(0,0,0,0.4);
  }

  /* Hardcoded-chrome overrides for dark mode */
  :root[data-theme="dark"] .site-header { background: var(--color-bg); border-bottom-color: var(--color-border); }
  :root[data-theme="dark"] .nav-toggle { background: var(--color-surface); border-color: var(--color-border); }
  :root[data-theme="dark"] .nav-toggle:hover { background: var(--color-border); }
  :root[data-theme="dark"] .nav-toggle span { background: var(--color-text-muted); }
  :root[data-theme="dark"] .nav-calcs { border-top-color: var(--color-border-light); }
  :root[data-theme="dark"] .nav-calcs a { color: var(--color-text-secondary); }
  :root[data-theme="dark"] .nav-calcs a:hover { background: var(--color-surface); }
  :root[data-theme="dark"] .nav-calcs a.active { background: var(--color-primary-bg); }
  :root[data-theme="dark"] .nav-info { background: var(--color-bg-alt); border-top-color: var(--color-border-light); }
  :root[data-theme="dark"] .nav-info a { color: var(--color-text-muted); }
  :root[data-theme="dark"] .nav-info a:hover { background: var(--color-surface); border-bottom-color: var(--color-primary-light); }
  :root[data-theme="dark"] .warning-banner { color: var(--color-warning); }
  :root[data-theme="dark"] .danger-banner { color: var(--color-danger); }
  :root[data-theme="dark"] .btn-primary { background: #2563EB; color: #fff; }
  :root[data-theme="dark"] .btn-primary:hover { background: #1D4ED8; }
  :root[data-theme="dark"] .logo-icon { background: linear-gradient(135deg, #1E3A5F, var(--color-accent)); }
  :root[data-theme="dark"] .amort-table thead th { background: var(--color-surface); color: var(--color-text); }
  :root[data-theme="dark"] select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
  :root[data-theme="dark"] .pwa-banner { background: var(--color-surface); color: var(--color-text); }
  :root[data-theme="dark"] .pwa-banner .pwa-install-btn { background: var(--color-accent); color: #04231A; }

  /* Footer dark mode */
  :root[data-theme="dark"] .site-footer { background: #131f30; border-top-color: var(--color-accent-dark); }
  :root[data-theme="dark"] .footer-disclaimer-card {
    background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);
  }
  :root[data-theme="dark"] .badge-private   { background: #1e3a5f; color: #93c5fd; }
  :root[data-theme="dark"] .badge-nodata    { background: #0f2b1a; color: #6ee7b7; }
  :root[data-theme="dark"] .badge-ads       { background: #3b2e0a; color: #fcd34d; }
  :root[data-theme="dark"] .footer-bottom { border-top-color: var(--color-border); }

  @media (max-width: 768px) {
    :root[data-theme="dark"] .nav-calcs a:hover,
    :root[data-theme="dark"] .nav-info a:hover { background: var(--color-surface); }
    :root[data-theme="dark"] .nav-calcs { border-bottom-color: var(--color-border); }
    :root[data-theme="dark"] .nav-info { background: var(--color-bg); }
    :root[data-theme="dark"] .nav-calcs a,
    :root[data-theme="dark"] .nav-info a { border-top-color: var(--color-border-light); }
  }

  /* Moon / sun theme toggle (injected after Terms) */
  .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 6px 9px;
    margin-left: 2px;
    border-radius: 6px 6px 0 0;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    transition: background-color .15s ease, color .15s ease;
  }
  .theme-toggle:hover { background: var(--color-surface); color: var(--color-primary); }

  /* Logo .com accent */
  .logo-tld { color: var(--color-accent); font-weight: 600; }
  /* Wordmark wrapper keeps StudLoanCalc + .com as one flex child (no flex gap between them) */
  .logo-word { white-space: nowrap; }

  /* Smooth theme transition */
  body, .site-header, .nav-calcs a, .nav-info a, .btn, .form-input, .calc-card,
  .chart-container, table, th, td, .card, .warning-banner, .danger-banner,
  .info-banner, .site-footer, .result-box, .pwa-banner {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  }
}

/* ===== Interest Deduction Calculator (interest-deduction.html) ===== */
.calc-box {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.calc-box h2 { margin-top: 0; }
.calc-sub { color: #64748b; font-size: .95rem; margin-top: .25rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.field { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; }
.field select, .field input {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px; background: var(--color-bg-alt, #f8fafc); color: var(--color-text, #0f172a);
}
.field .input-prefix { font-weight: 600; color: #64748b; font-size: .85rem; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.result-card {
  background: var(--color-bg-alt, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px; padding: 1.1rem 1.25rem; margin: 1rem 0;
}
.result-head { margin-bottom: .6rem; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: .75rem 1.5rem; }
.result-item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--color-border, #e2e8f0); }
.result-item .rl { color: #64748b; font-size: .9rem; }
.result-item .rv { font-weight: 700; font-size: 1.1rem; }
.result-badge { display: inline-block; padding: .3rem .75rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.badge-good { background: #dcfce7; color: #166534; }
.badge-bad { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef9c3; color: #854d0e; }
.result-note { color: #64748b; font-size: .9rem; margin: .6rem 0 0; }
.result-foot { color: #64748b; font-size: .8rem; margin: .6rem 0 0; }
.calc-note { color: #64748b; font-size: .8rem; margin-top: .5rem; }
.chart-wrap { margin: 1rem 0; max-width: 100%; }
.calc-guide .table-scroll { overflow-x: auto; margin: 1rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { border: 1px solid var(--color-border, #e2e8f0); padding: .55rem .7rem; text-align: left; }
.data-table thead th { background: var(--color-bg-alt, #f1f5f9); }
.data-table tbody tr:nth-child(even) { background: var(--color-bg-alt, #f8fafc); }
