/**
 * SelfEmpTaxCalc.com — Global Styles v2
 * Color: Navy + Emerald Green (finance-trust palette)
 * Includes: layout, hero, tabs, forms, tooltips, share, dark mode, print
 */

/* ===========================================================
   CSS VARIABLES (light/dark)
   =========================================================== */
:root {
  /* Brand */
  --brand-navy: #0f2b46;
  --brand-emerald: #059669;
  --brand-emerald-dark: #047857;
  --brand-emerald-light: #d1fae5;
  --brand-gold: #d97706;
  --brand-gold-light: #fef3c7;

  /* Neutral */
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-focus: #059669;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-sm: 6px;
}

/* Dark mode */
body.dark {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-focus: #10b981;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.15);
}

/* ===========================================================
   RESET & BASE
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  transition: background 0.3s, color 0.3s;
}
a { color: var(--brand-emerald); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
strong { font-weight: 600; }

/* ===========================================================
   HEADER
   =========================================================== */
.header {
  background: linear-gradient(135deg, #0a3d2e 0%, #059669 50%, #10b981 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-home-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.header-logo {
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand-emerald);
}
.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Platform calculator pages use .site-header */
.site-header {
  background: linear-gradient(135deg, #0a3d2e 0%, #059669 50%, #10b981 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-header .logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.site-header .logo span { color: #a7f3d0; font-weight: 400; }
.site-header .top-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.site-header .top-nav a {
  color: #a7f3d0;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: background 0.2s;
  text-decoration: none;
}
.site-header .top-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.header nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.header nav a {
  color: #a7f3d0;
  margin-left: 0;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.header nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dark mode toggle button */
.btn-dark-toggle {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s;
}
.btn-dark-toggle:hover { background: rgba(255,255,255,0.25); }

/* ===========================================================
   HERO SECTION
   =========================================================== */
.hero {
  background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 40%, #f0fdf4 100%);
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid #a7f3d0;
}
body.dark .hero {
  background: linear-gradient(160deg, #022c22 0%, #064e3b 40%, #0f172a 100%);
  border-bottom-color: #064e3b;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
body.dark .hero h1 { color: #6ee7b7; }
.hero p {
  font-size: 1.1rem;
  color: #047857;
  max-width: 720px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}
body.dark .hero p { color: #a7f3d0; }

/* Trust badges */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1.5px solid #a7f3d0;
  border-radius: 50px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #065f46;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}
body.dark .trust-badge {
  background: #064e3b;
  border-color: #059669;
  color: #a7f3d0;
}
.trust-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5,150,105,0.15);
}
.trust-badge .badge-icon { font-size: 1.1rem; }

/* As Featured In bar */
.as-featured {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(5,150,105,0.2);
}
.as-featured > span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #6b7280;
  display: block;
  margin-bottom: 0.6rem;
}
body.dark .as-featured { border-top-color: rgba(16,185,129,0.2); }
body.dark .as-featured > span { color: #94a3b8; }
.as-featured-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}
.as-featured-logos span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #047857;
  opacity: 0.85;
}
body.dark .as-featured-logos span { color: #6ee7b7; }

/* ===========================================================
   DISCLAIMER BANNER
   =========================================================== */
.disclaimer-banner {
  background: var(--brand-gold-light);
  border-bottom: 1px solid var(--brand-gold);
  color: #92400e;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  text-align: center;
}
body.dark .disclaimer-banner {
  background: #422006;
  border-bottom-color: #78350f;
  color: #fcd34d;
}

/* ===========================================================
   LAYOUT CONTAINER
   =========================================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem;
}

/* ===========================================================
   TAB NAVIGATION
   =========================================================== */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin: 0 auto 1.5rem;
  max-width: 1100px;
  padding: 0 1.2rem;
}
.tab-btn {
  padding: 0.65rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  font-weight: 500;
}
.tab-btn.active, .tab-btn:hover {
  color: var(--brand-emerald);
  border-bottom-color: var(--brand-emerald);
  font-weight: 600;
}

.tab-select {
  display: none;
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  background: var(--bg-input);
  color: var(--text);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===========================================================
   FORMS
   =========================================================== */
.calc-form {
  display: grid;
  gap: 1rem;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.form-group {
  flex: 1;
  min-width: 200px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: var(--text);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}
.form-group small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.form-group input[type="range"] {
  padding: 0;
  accent-color: var(--brand-emerald);
  height: 6px;
}

/* Buttons */
.btn-primary {
  background: var(--brand-emerald);
  color: #fff;
  border: none;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--brand-emerald-dark); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--border);
  color: var(--text);
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #d1d5db; }
body.dark .btn-secondary:hover { background: #475569; }

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: none;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand-emerald);
  color: var(--brand-emerald);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover {
  background: var(--brand-emerald);
  color: #fff;
}

/* Sample data button */
.btn-sample {
  background: transparent;
  border: 1.5px dashed var(--brand-emerald);
  color: var(--brand-emerald);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-sample:hover {
  background: var(--brand-emerald-light);
  border-style: solid;
}
body.dark .btn-sample:hover {
  background: rgba(5,150,105,0.15);
}

/* ===========================================================
   RESULT TABLES
   =========================================================== */
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-card h3 {
  margin-bottom: 0.75rem;
  color: var(--brand-navy);
  font-size: 1.05rem;
}
body.dark .result-card h3 { color: #6ee7b7; }

/* Read More internal link */
.read-more-link {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}
.read-more-link a {
  color: var(--brand-emerald);
  text-decoration: none;
  font-weight: 500;
}
.read-more-link a:hover {
  text-decoration: underline;
  color: var(--brand-emerald-dark);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}
.result-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.result-table .val {
  text-align: right;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.95rem;
}
.result-table .total-row {
  background: var(--brand-emerald-light);
  font-weight: 700;
}
body.dark .result-table .total-row {
  background: rgba(5,150,105,0.15);
}
.result-table .section-row {
  background: var(--border);
  font-weight: 600;
}
.result-table .recommend-row {
  background: #dcfce7;
  color: #166534;
}
.result-table .saving-row { background: #dcfce7; }
body.dark .result-table .saving-row { background: rgba(5,150,105,0.12); color: #6ee7b7; }
.result-table .loss-row { background: #fee2e2; }
body.dark .result-table .loss-row { background: rgba(220,38,38,0.12); }
.result-table .tip-row {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  font-style: italic;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===========================================================
   PRINT BUTTONS
   =========================================================== */
.print-bar {
  display: flex;
  gap: 0.75rem;
  margin: 1rem auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 1100px;
  padding: 0 1.2rem;
}
.print-bar button {
  background: var(--brand-emerald);
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}
.print-bar button:hover { background: var(--brand-emerald-dark); }

/* ===========================================================
   SHARE BAR
   =========================================================== */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 2rem 0 1rem;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.share-bar .share-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.share-btn:active { transform: scale(0.96); }
.share-btn.twitter { background: #1da1f2; color: #fff; }
.share-btn.facebook { background: #1877f2; color: #fff; }
.share-btn.linkedin { background: #0a66c2; color: #fff; }
.share-btn.reddit { background: #ff4500; color: #fff; }
.share-btn.email { background: #6b7280; color: #fff; }
.share-btn.copy { background: var(--border); color: var(--text); }
.share-btn.copy.copied { background: var(--brand-emerald); color: #fff; }

/* ===========================================================
   TOOLTIP (inline help)
   =========================================================== */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  margin-left: 0.3rem;
  position: relative;
  transition: background 0.2s;
}
.tooltip-trigger:hover {
  background: var(--brand-emerald);
  color: #fff;
}
.tooltip-trigger .tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-navy);
  color: #fff;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 400;
  white-space: normal;
  width: 240px;
  max-width: 90vw;
  text-align: left;
  line-height: 1.5;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: none;
}
.tooltip-trigger:hover .tooltip-text { display: block; }
body.dark .tooltip-trigger .tooltip-text {
  background: #e2e8f0;
  color: #0f172a;
}

/* ===========================================================
   FAQ ACCORDION
   =========================================================== */
.faq-section {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.faq-section h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: var(--border); }
.faq-question .faq-arrow {
  transition: transform 0.25s;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.faq-question.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.faq-answer.open {
  max-height: 600px;
  padding: 0 1rem 0.75rem;
}

/* ===========================================================
   FEEDBACK "Was this helpful?"
   =========================================================== */
.feedback-bar {
  text-align: center;
  padding: 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.feedback-bar span { margin-right: 0.5rem; }
.feedback-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  margin: 0 0.2rem;
}
.feedback-btn:hover { border-color: var(--brand-emerald); background: var(--brand-emerald-light); }
.feedback-btn.selected { border-color: var(--brand-emerald); background: var(--brand-emerald); color: #fff; }
body.dark .feedback-btn:hover { background: rgba(5,150,105,0.15); }
body.dark .feedback-btn.selected { background: var(--brand-emerald); }

/* ===========================================================
   PWA INSTALL BANNER
   =========================================================== */
.pwa-banner {
  display: none;
  background: var(--brand-emerald);
  color: #fff;
  padding: 0.6rem 1.2rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
}
.pwa-banner.show { display: block; }
.pwa-banner button {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
}
.pwa-banner button:hover { background: rgba(255,255,255,0.35); }
.pwa-banner .pwa-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.footer {
  background: var(--brand-navy);
  color: #c7d2fe;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}
.footer a { color: #93c5fd; }
body.dark .footer { background: #020617; }

/* Newsletter signup box (inside footer) */
.newsletter-box {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  padding: 1.25rem;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
}
.newsletter-box h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.newsletter-box p {
  color: #a5b4fc;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.newsletter-box small {
  display: block;
  color: #94a3b8;
  font-size: 0.72rem;
  margin-top: 0.5rem;
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.9rem;
  min-width: 0;
}
.newsletter-form input[type="email"]::placeholder {
  color: #94a3b8;
}
.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--brand-emerald);
  background: rgba(255,255,255,0.15);
}
.newsletter-form button {
  padding: 0.55rem 1.25rem;
  background: var(--brand-emerald);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.newsletter-form button:hover {
  background: var(--brand-emerald-dark);
}

/* ===========================================================
   TOAST / SNACKBAR (for copy link feedback)
   =========================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--brand-navy);
  color: #fff;
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===========================================================
   RESPONSIVE — MOBILE
   =========================================================== */
@media (max-width: 768px) {
  .hero { padding: 1.8rem 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.95rem; }
  .trust-badge { font-size: 0.75rem; padding: 0.35rem 0.75rem; }

  .tab-nav { display: none; }
  .tab-select { display: block; }

  .header-title { font-size: 1rem; }
  .header nav a { font-size: 0.78rem; padding: 0.25rem 0.4rem; }

  .container { padding: 1rem 0.75rem; }
  .form-group { min-width: 100%; }
  .result-table { font-size: 0.85rem; }
  .result-table .val { font-size: 0.85rem; }

  .share-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .share-btn { font-size: 0.78rem; padding: 0.4rem 0.7rem; }

  .print-bar { justify-content: center; }
}

@media (max-width: 480px) {
  .trust-badges { gap: 0.4rem; }
  .trust-badge { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
  .hero h1 { font-size: 1.3rem; }
}

/* ===========================================================
   PRINT STYLES
   =========================================================== */
@media print {
  .header, .footer, .tab-nav, .tab-select, .print-bar,
  .disclaimer-banner, .hero, .trust-badges, .share-bar,
  .btn-primary, .btn-secondary, .btn-outline, .btn-sample,
  .btn-dark-toggle, .faq-section, .feedback-bar, .pwa-banner,
  .toast, input, select, textarea, button:not(.print-keep) {
    display: none !important;
  }

  .tab-panel { display: none !important; }
  .tab-panel.active, .print-target {
    display: block !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.4;
  }

  .result-card {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
    page-break-inside: avoid;
  }
  .result-table { font-size: 9pt; }
  .result-table .val { font-size: 9pt; }

  .print-section { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }

  .print-header { display: block !important; text-align: center; margin-bottom: 1.5rem; }
  .print-footer { display: block !important; text-align: center; font-size: 8pt; color: #666; margin-top: 2rem; border-top: 1px solid #ccc; padding-top: 0.75rem; }
}

/* ===========================================================
   RESULT COMPONENTS (used by Tab 7, 8, 9 JS-generated HTML)
   =========================================================== */
.result-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}
.result-section h3 {
  margin-bottom: 0.75rem;
  color: var(--brand-navy);
  font-size: 1.05rem;
}
body.dark .result-section h3 { color: #6ee7b7; }

.result-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.result-item.section-row {
  background: var(--border);
  margin: 0 -0.5rem;
  padding: 0.45rem 0.5rem;
}
.result-label { font-weight: 500; color: var(--text-secondary); }
.result-value { font-weight: 700; color: var(--text); font-family: 'SF Mono','Fira Code','Courier New',monospace; }

.result-banner {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.highlight-row {
  background: var(--brand-emerald-light);
  font-weight: 700;
}
body.dark .highlight-row { background: rgba(5,150,105,0.2); }

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table-scroll th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--border);
  font-weight: 600;
  white-space: nowrap;
}
.table-scroll td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.form-section-divider {
  margin: 1.25rem 0 0.25rem;
  padding-top: 1rem;
  border-top: 1.5px dashed #d1d5db;
}
body.dark .form-section-divider {
  border-top-color: #4b5563;
}

/* Screen only */
.print-header, .print-footer { display: none; }
