/* ══════════════════════════════════════════════
   ProRataCalculator.uk — Design System
   Mobile-first · Dark/Light · WCAG AA+
   ══════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Brand Colors — UK/England Inspired (Navy + Red) */
  --c-primary: #1e3a5f;
  --c-primary-light: #2a5088;
  --c-primary-dark: #142842;
  --c-primary-subtle: #e8eef5;
  --c-accent: #c8102e;
  --c-accent-light: #e0213f;
  --c-error: #c8102e;
  --c-success: #22c55e;

  /* Spacing */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;

  /* Typography */
  --f-heading: 'Outfit', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 250ms var(--ease);
  --t-slow: 400ms var(--ease);

  /* Layout */
  --max-w: 1100px;
  --nav-h: 64px;
}

/* ── Light Theme (default) ── */
[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --surface-alt: #eef1f7;
  --border: #c5cdd8;
  --border-light: #e5e7eb;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --card-hover: #eef1f7;
  --code-bg: #f1f5f9;
  --input-bg: #ffffff;
  --input-border: #c5cdd8;
  --result-bg: linear-gradient(135deg, #1e3a5f 0%, #142842 100%);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg: #0f1419;
  --bg-alt: #1a2332;
  --surface: #1e293b;
  --surface-alt: #253344;
  --border: #334155;
  --border-light: #2a3a4e;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --nav-bg: rgba(15, 20, 25, 0.92);
  --card-hover: #253344;
  --code-bg: #1e293b;
  --input-bg: #1e293b;
  --input-border: #475569;
  --result-bg: linear-gradient(135deg, #142842 0%, #1e3a5f 100%);
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--c-primary-dark);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--f-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.01em;
  margin-top: var(--sp-2xl);
  margin-bottom: var(--sp-md);
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  margin-top: var(--sp-xl);
  margin-bottom: var(--sp-sm);
}

p {
  margin-bottom: var(--sp-md);
  color: var(--text-secondary);
}

strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: var(--f-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: var(--r-sm);
}

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.page-content {
  padding-top: calc(var(--nav-h) + var(--sp-xl));
  padding-bottom: var(--sp-3xl);
}

/* ── Navigation ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--t-base);
  overflow: visible;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--c-primary);
}

.nav-brand img {
  width: 28px;
  height: 28px;
}

.nav-brand .brand-accent {
  color: var(--c-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.nav-links a {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--t-fast);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--c-primary);
  background: var(--c-primary-subtle);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  background: rgba(30, 58, 95, 0.25);
}

.btn-theme {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.btn-theme:hover {
  color: var(--c-accent);
  background: var(--surface-alt);
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text);
}

/* ── Dropdown Menu ── */
.nav-dropdown {
  position: relative;
}

.nav-trigger {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--t-fast);
}

.nav-trigger:hover {
  color: var(--c-primary);
}

.nav-trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform var(--t-fast);
}

.nav-dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--sp-xs);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--t-fast);
  z-index: 200;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.dropdown-menu a:hover {
  background: var(--card-hover);
  color: var(--c-primary);
}

/* ── Hero / Page Header ── */
.page-hero {
  text-align: center;
  padding: var(--sp-2xl) 0 var(--sp-xl);
}

.page-hero h1 {
  margin-bottom: var(--sp-sm);
}

.page-hero .hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  background: var(--c-primary-subtle);
  color: var(--c-primary-dark);
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--sp-md);
}

[data-theme="dark"] .hero-badge {
  background: rgba(30, 58, 95, 0.25);
  color: var(--c-primary-light);
}

/* ── Calculator Card ── */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-xl);
  transition: box-shadow var(--t-base);
}

.calc-card:hover {
  box-shadow: var(--shadow-md);
}

.calc-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.calc-card h2 .icon {
  font-size: 1.3em;
}

/* ── Form Elements ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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;
}

.form-input[type="number"] {
  font-family: var(--f-mono);
  font-weight: 600;
}

/* ── Frequency Tabs ── */
.freq-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-alt);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: var(--sp-md);
  overflow-x: auto;
}

.freq-tab {
  flex: 1;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: calc(var(--r-md) - 2px);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.freq-tab:hover {
  color: var(--text);
}

.freq-tab.active {
  background: var(--surface);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Calculate Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--t-fast);
  text-decoration: none;
}

.btn--primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.btn--primary:hover {
  background: var(--c-primary-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(30, 58, 95, 0.4);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--card-hover);
}

.btn--full {
  width: 100%;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ── Results Panel ── */
.results-panel {
  margin-top: var(--sp-xl);
}

.results-panel.hidden {
  display: none;
}

/* Big result number */
.result-hero {
  background: var(--result-bg);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
  color: #fff;
  margin-bottom: var(--sp-lg);
}

.result-hero .label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: var(--sp-xs);
}

.result-hero .amount {
  font-family: var(--f-mono);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.result-hero .sub {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: var(--sp-xs);
}

/* Result rows */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.result-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  text-align: center;
}

.result-item .r-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-xs);
}

.result-item .r-value {
  font-family: var(--f-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

/* Breakdown table */
.breakdown-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--sp-lg);
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.breakdown-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table tr:last-child {
  font-weight: 700;
  background: var(--bg-alt);
}

.breakdown-table .num {
  font-family: var(--f-mono);
  font-weight: 600;
  text-align: right;
}

.breakdown-table .highlight {
  color: var(--c-primary);
}

/* ── Donut Chart ── */
.chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xl);
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}

.chart-canvas {
  width: 200px;
  height: 200px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

/* ── Breakdown Bar ── */
.breakdown-bar {
  display: flex;
  height: 32px;
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--sp-sm);
}

.breakdown-bar .seg {
  height: 100%;
  min-width: 2px;
  transition: width var(--t-slow);
}

.seg-net {
  background: var(--c-primary);
}

.seg-tax {
  background: #c8102e;
}

.seg-ni {
  background: #06b6d4;
}

.seg-other {
  background: #f59e0b;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--c-primary);
}

.breadcrumbs .sep {
  margin: 0 2px;
}

/* ── Content Cards (for articles/guides) ── */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

.content-section h2 {
  margin-top: 0;
}

.content-section ul,
.content-section ol {
  padding-left: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.content-section li {
  margin-bottom: var(--sp-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.content-section ul {
  list-style: disc;
}

.content-section ol {
  list-style: decimal;
}

/* ── Info Box ── */
.info-box {
  background: var(--c-primary-subtle);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-md) var(--sp-lg);
  margin: var(--sp-lg) 0;
  font-size: 0.9rem;
}

.info-box strong {
  color: var(--c-primary-dark);
}

[data-theme="dark"] .info-box {
  background: rgba(30, 58, 95, 0.15);
  border-left-color: var(--c-primary-light);
}

[data-theme="dark"] .info-box strong {
  color: var(--c-primary-light);
}

/* ── FAQ Section ── */
.faq-section {
  margin-top: var(--sp-xl);
}

.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-sm);
  overflow: hidden;
  transition: border-color var(--t-fast);
}

.faq-item:hover {
  border-color: var(--c-primary);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: var(--sp-md) var(--sp-lg);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  background: var(--surface);
  transition: background var(--t-fast);
}

.faq-question:hover {
  background: var(--card-hover);
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--c-primary);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-slow), padding var(--t-slow);
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 var(--sp-lg) var(--sp-lg);
}

.faq-answer p {
  font-size: 0.9rem;
  margin-bottom: var(--sp-sm);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ── Interlink Section ── */
.related-section {
  margin-top: var(--sp-2xl);
}

.related-section h2 {
  font-size: 1.2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-md) var(--sp-lg);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all var(--t-fast);
}

.related-card:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-card .rc-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--c-primary);
  margin-bottom: var(--sp-xs);
}

.related-card .rc-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Salary neighbour card accent ── */
.related-card--salary {
  border-left: 3px solid var(--c-primary);
}

.related-card--salary .rc-title {
  font-size: 1rem;
}

/* ── Hub CTA — guide pages → main tool ── */
.hub-cta {
  margin: var(--sp-xl) 0;
  padding: var(--sp-xl);
  background: linear-gradient(135deg, var(--c-primary) 0%, hsl(217 71% 35%) 100%);
  border-radius: var(--r-lg);
  color: #fff;
}

.hub-cta__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: var(--sp-xs);
}

.hub-cta__title {
  font-size: 1.4rem;
  margin: 0 0 var(--sp-sm);
  font-family: var(--f-heading);
}

.hub-cta__title a {
  color: #fff;
  text-decoration: none;
}

.hub-cta__title a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.hub-cta__desc {
  font-size: 0.9rem;
  opacity: 0.88;
  margin-bottom: var(--sp-lg);
  max-width: 520px;
  line-height: 1.6;
}

.hub-cta .btn--primary {
  background: #fff;
  color: var(--c-primary);
  font-weight: 700;
}

.hub-cta .btn--primary:hover {
  background: hsl(0 0% 92%);
}

/* ── Footer ── */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
  padding: var(--sp-2xl) 0 var(--sp-lg);
  margin-top: var(--sp-3xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

.footer-brand {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: var(--sp-sm);
}

.footer-brand .brand-accent {
  color: var(--c-primary);
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: var(--sp-md);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--c-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: var(--sp-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

/* ── Footer authority citation bar ── */
.footer-authority {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-xs, 0.5rem);
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding: var(--sp-md) 0;
  margin-bottom: var(--sp-sm);
}

.footer-authority a {
  color: var(--c-primary);
  text-decoration: none;
}

.footer-authority a:hover {
  text-decoration: underline;
}

.footer-authority-sep {
  opacity: 0.4;
  padding: 0 0.25rem;
}

/* ── NLW compliance warning in results ── */
.nlw-warning {
  margin-top: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  font-size: 0.85rem;
  line-height: 1.5;
}

.nlw-warning--ok {
  background: hsl(142 52% 96%);
  border-color: hsl(142 52% 40%);
  color: hsl(142 52% 25%);
}

.nlw-warning--error {
  background: hsl(0 80% 96%);
  border-color: hsl(0 80% 50%);
  color: hsl(0 80% 30%);
}

[data-theme="dark"] .nlw-warning--ok {
  background: hsl(142 30% 15%);
  color: hsl(142 50% 75%);
}

[data-theme="dark"] .nlw-warning--error {
  background: hsl(0 30% 15%);
  color: hsl(0 70% 75%);
}

/* ── Holiday entitlement info line in results ── */
.holiday-info {
  margin-top: var(--sp-sm);
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: var(--sp-xs, 0.5rem) var(--sp-md);
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}


.page-404 {
  text-align: center;
  padding: var(--sp-3xl) 0;
}

.page-404 .big-num {
  font-family: var(--f-heading);
  font-size: 8rem;
  font-weight: 900;
  color: var(--c-primary);
  line-height: 1;
  opacity: 0.3;
}

.page-404 h1 {
  margin: var(--sp-md) 0;
}

.page-404 p {
  color: var(--text-muted);
  margin-bottom: var(--sp-xl);
}

/* ── Static Pages (Privacy, Terms, Contact) ── */
.static-page {
  max-width: 800px;
  margin: 0 auto;
}

.static-page h1 {
  margin-bottom: var(--sp-lg);
}

.static-page h2 {
  font-size: 1.2rem;
}

.static-page p,
.static-page li {
  font-size: 0.95rem;
}

.static-page ul {
  list-style: disc;
  padding-left: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.static-page li {
  margin-bottom: var(--sp-sm);
  color: var(--text-secondary);
}

/* Contact form */
.contact-info {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
  margin: var(--sp-xl) 0;
}

.contact-email {
  font-family: var(--f-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-primary);
}

/* ── Step List ── */
.step-list {
  counter-reset: steps;
  margin: var(--sp-lg) 0;
}

.step-item {
  counter-increment: steps;
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  align-items: flex-start;
}

.step-item::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.step-content h3 {
  margin-top: 0;
  font-size: 1rem;
}

.step-content p {
  margin-bottom: var(--sp-xs);
}

/* ── Action Buttons Row ── */
.action-row {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-top: var(--sp-md);
}

/* ── Formula Display ── */
.formula-box {
  background: var(--code-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  font-family: var(--f-mono);
  font-size: 0.95rem;
  text-align: center;
  margin: var(--sp-lg) 0;
  color: var(--text);
  overflow-x: auto;
}

/* ── Infographic Boxes ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-md);
  margin: var(--sp-lg) 0;
}

.info-stat {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  text-align: center;
}

.info-stat .stat-icon {
  font-size: 2rem;
  margin-bottom: var(--sp-sm);
}

.info-stat .stat-value {
  font-family: var(--f-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-primary);
}

.info-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

/* ── Comparison Table ── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: var(--sp-lg) 0;
}

.comparison-table th,
.comparison-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.comparison-table th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.8rem;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

/* ══════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ══════════════════════════════════════════════ */

/* Mobile: ≤ 768px */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    z-index: 999;
    padding: 12px 20px 20px;
    overflow-y: auto;
    max-height: calc(100vh - var(--nav-h));
    border-top: 1px solid var(--border-light);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  }

  .nav-links.open {
    display: block;
  }

  .nav-links>a,
  .nav-links .nav-trigger {
    display: block;
    padding: 14px 18px;
    border-radius: var(--r-sm);
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
  }

  .nav-links>a:hover,
  .nav-links .nav-trigger:hover {
    background: var(--surface-alt);
  }

  .nav-dropdown {
    position: static;
  }

  .nav-dropdown .dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 20px;
    min-width: unset;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: unset;
    overflow: visible;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu a {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .btn-theme {
    margin-top: var(--sp-md);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    flex-direction: column;
  }

  .breakdown-table {
    font-size: 0.8rem;
  }

  .breakdown-table th,
  .breakdown-table td {
    padding: 0.5rem 0.6rem;
  }

  .page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }
}

/* Tablet: 769px — 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Desktop: ≥ 769px */
@media (min-width: 769px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-group.full-width {
    grid-column: 1 / -1;
  }
}

/* Large Desktop */
@media (min-width: 1100px) {
  .result-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ── Print ── */
@media print {

  .site-header,
  .site-footer,
  .nav-toggle,
  .btn-theme,
  .action-row,
  .related-section,
  .faq-section {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page-content {
    padding-top: 0;
  }

  .calc-card,
  .content-section {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s var(--ease) both;
}

/* ── Skip Link (A11y) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-md);
  background: var(--c-primary);
  color: #fff;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  z-index: 1000;
  font-size: 0.85rem;
}

.skip-link:focus {
  top: var(--sp-md);
}