/* style.css — marginaltaxcalc.ca — Ontario Payroll cluster (green) */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
  --bg:             #f5f5f0;
  --surface:        #ffffff;
  --surface-2:      #f9f9f6;
  --border:         #e0dfd8;
  --border-2:       #c8c7be;
  --text-primary:   #1a1a18;
  --text-secondary: #4a4a46;
  --text-muted:     #7a7a74;
  --accent:         #1a4f2e;
  --accent-light:   #e8f2ec;
  --accent-mid:     #2d7a47;
  --accent-hover:   #153d24;
  --red:            #c0392b;
  --amber:          #c47a00;

  --radius:     6px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-md:  0 2px 8px rgba(0,0,0,.10);
  --transition: 160ms ease;

  --max-width:     960px;
  --content-width: 760px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 600px)  { .container { padding: 0 32px; } }
@media (min-width: 900px)  { .container { padding: 0 40px; } }

/* ── Header ── */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-logo:hover { color: rgba(255,255,255,0.85); text-decoration: none; }
.logo-maple { font-size: 1.3rem; line-height: 1; }
.logo-text { font-size: 0.95rem; font-weight: 700; }
.logo-text span { font-weight: 300; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.site-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover { color: #fff; text-decoration: none; }

/* Legacy nav alias — keep for any support pages using .header-nav */
.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
}
.header-nav a {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 4px 10px;
  border-radius: var(--radius);
  transition: color 0.15s;
}
.header-nav a:hover,
.header-nav a.active {
  color: #fff;
  text-decoration: none;
}

/* ── Hero ── */
.hero {
  background: var(--accent);
  color: #fff;
  padding: 32px 20px 28px;
  border-bottom: 3px solid var(--accent-mid);
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.95);
}

.hero h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
  color: #fff;
}

.hero p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.82);
  max-width: 620px;
  line-height: 1.6;
}

/* ── Calculator card ── */
.calc-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
}
.calc-header {
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 599px) { .calc-card { padding: 0; } }
@media (max-width: 480px) { .calc-card { padding: 0 14px; } }

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.ts-item { display: flex; align-items: center; gap: 4px; }
.ts-item span { color: var(--accent-mid); font-weight: 700; }
.ts-sep { color: var(--border-2); font-size: 0.75rem; }

.calc-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}
.calc-icon { font-size: 1.2rem; }

/* ── Form ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

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

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

.form-group input {
  width: 100%;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(26,79,46,.12);
  background: var(--surface);
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-calc {
  width: 100%;
  padding: 13px 24px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  letter-spacing: .01em;
}

.btn-calc:hover  { background: var(--accent-hover); }
.btn-calc:active { transform: scale(.985); }

/* ── Error ── */
.error-msg {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: var(--red);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ── Results ── */
#results { display: none; margin-top: 24px; }

.results-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 560px) { .results-header { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-card.highlight .stat-value { color: var(--accent); }

/* Keep/Tax bar */
.split-bar-wrap { margin-bottom: 20px; }
.split-bar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.split-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.split-bar-kept {
  background: var(--accent-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  padding: 0 4px;
  transition: width 400ms ease;
  min-width: 0;
  overflow: hidden;
}
.split-bar-tax {
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  padding: 0 4px;
  transition: width 400ms ease;
  min-width: 0;
  overflow: hidden;
}

/* Breakdown table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.breakdown-table th {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
}

.breakdown-table td:last-child {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  text-align: right;
}

.breakdown-table tr.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--border-2);
  border-bottom: none;
  color: var(--accent);
  font-size: 0.95rem;
}

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

/* ── Ad slots ── */
.ad-slot {
  text-align: center;
  margin: 24px 0;
  min-height: 90px;
}
@media (max-width: 640px) {
  .ad-slot { min-height: 0; margin: 8px 0; }
  .ad-slot ins.adsbygoogle { height: 0 !important; max-height: 0 !important; overflow: hidden !important; }
}

/* ── Section content ── */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
}

@media (max-width: 599px) { .content-section { padding: 20px 16px; } }

.content-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.content-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin: 20px 0 8px;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.content-section ul,
.content-section ol {
  margin: 8px 0 12px 20px;
  color: var(--text-secondary);
}

.content-section li { margin-bottom: 6px; }

.example-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 16px 0;
  overflow-x: auto;
  display: block;
}

.example-table th,
.example-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: right;
}

.example-table th {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.example-table td:first-child { text-align: left; font-weight: 600; }

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ── FAQ ── */
.faq-list { margin: 0; padding: 0; list-style: none; }

details {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

details:first-child { border-top: 1px solid var(--border); }

summary {
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 12px;
}

details[open] summary::after { content: '−'; }

details p {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger span + span { margin-top: 6px; }
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Mobile nav overlay ── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}
.mobile-nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Mobile nav panel ── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 58px;
  right: 0;
  width: 260px;
  max-width: 80vw;
  height: calc(100vh - 58px);
  background: var(--accent);
  z-index: 105;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.mobile-nav.active {
  display: block;
  transform: translateX(0);
}
.mobile-nav a {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  text-decoration: none;
  transition: color 0.15s;
}
.mobile-nav a:hover { color: #fff; }

/* ── Related section ── */
.related-section {
  margin-bottom: 28px;
}
.related-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.related-grid,
.related-manual {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.related-card:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.rc-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.rc-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Related tools (legacy aliases) ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tool-card:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.tool-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Footer ── */
.site-footer {
  background: var(--accent);
  color: rgba(255,255,255,0.7);
  padding: 28px 20px;
  margin-top: 20px;
  font-size: 0.82rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 12px;
}

.footer-col p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.55;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.8);
  font-size: 0.82rem;
  margin-bottom: 6px;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 2px; }

.footer-brand .logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-bottom: 10px;
  display: block;
}


.more-tools-link {
  display: block;
  margin-bottom: 8px;
}
.more-tools-title { font-weight: 700 !important; color: #ffffff !important; font-size: 0.88rem; }
.subtext {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.3;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
}
.footer-bottom a { color: rgba(255,255,255,0.65); }
.footer-bottom a:hover { color: #fff; }

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

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Inner pages ── */
.page-body {
  max-width: var(--content-width);
  margin: 32px auto;
  padding: 0 24px;
}

.page-hero {
  background: var(--accent);
  color: #fff;
  padding: 36px 0 28px;
  text-align: center;
}

.page-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-hero p {
  opacity: .85;
  max-width: 540px;
  margin: 0 auto;
  font-size: 1rem;
}

.page-content {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px;
}

@media (min-width: 600px)  { .page-content { padding: 0 32px; } }

.page-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 10px;
}

.page-content p,
.page-content ul,
.page-content ol { color: var(--text-secondary); margin-bottom: 12px; }

.page-content ul,
.page-content ol { margin-left: 20px; }

.page-content li { margin-bottom: 6px; }

.page-content a { color: var(--accent); }
.page-content a:hover { color: var(--accent-hover); }

/* ─── INFO-BOX ───────────────────────────────────────────────────────────────── */
.info-box {
  background: var(--accent-light);
  border: 1px solid #b8d8c4;
  border-left: 4px solid var(--accent-mid);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.info-box a { font-size: 0.875rem; }

/* ─── CONTACT FORM ───────────────────────────────────────────────────────────── */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.contact-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(45,122,71,0.12);
}
.contact-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

/* ─── SUBMIT BUTTON ──────────────────────────────────────────────────────────── */
.calc-btn {
  display: inline-block;
  width: 100%;
  padding: 13px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  text-align: center;
}
.calc-btn:hover {
  background: var(--accent-hover);
}

/* ─── RESPONSIVE — gold-standard-aligned breakpoints ─────────────────── */

/* 1280px */
@media (max-width: 1280px) {
  .footer-grid { gap: 24px; }
}

/* 1100px */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr; gap: 20px; }
}

/* 1024px — hamburger breakpoint */
@media (max-width: 1024px) {
  .hamburger { display: flex; flex-direction: column; justify-content: center; gap: 0; }
  .site-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* 834px */
@media (max-width: 834px) {
  .hero h1 { font-size: clamp(1.2rem, 3.5vw, 1.8rem); }
  .hero p { font-size: 0.9rem; }
}

/* 820px */
@media (max-width: 820px) {
  .form-grid { gap: 12px 16px; }
}

/* 768px */
@media (max-width: 768px) {
  .hero { padding: 24px 16px 20px; }
  .page-content { padding: 24px 16px 48px; }
  .page-hero { padding: 22px 0 18px; }
  .page-hero h1 { font-size: 1.2rem; }
  .content-section { padding: 20px 16px; }
  .trust-strip { font-size: 0.75rem; }
  .ts-sep { display: none; }
}

/* 640px */
@media (max-width: 640px) {
  .main-content { padding: 16px 14px 40px; }
  .ad-slot { min-height: 0; margin: 8px 0; }
  .ad-slot ins.adsbygoogle { height: 0 !important; max-height: 0 !important; overflow: hidden !important; }
}

/* 480px */
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-brand { grid-column: unset; }
  .header-inner { padding: 0 14px; }
  .site-logo .logo-text { font-size: 0.85rem; }
}

/* 430px */
@media (max-width: 430px) {
  .form-grid { grid-template-columns: 1fr; }
  .related-grid, .related-manual, .tools-grid { grid-template-columns: 1fr; }
}

/* 390px */
@media (max-width: 390px) {
  .hero h1 { font-size: 1.15rem; }
}

/* 375px */
@media (max-width: 375px) {
  .site-logo .logo-text { font-size: 0.8rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* 360px */
@media (max-width: 360px) {
  .header-inner { padding: 0 10px; }
  .hero { padding: 18px 12px 16px; }
}

/* 320px */
@media (max-width: 320px) {
  html { font-size: 14px; }
  .site-logo .logo-text { font-size: 0.75rem; }
  .mobile-nav { width: 100%; max-width: 100vw; }
}

/* ─── OVERFLOW CONTAINMENT ───────────────────────────────────────────────────── */
html, body { overflow-x: hidden; max-width: 100vw; }
img, video, iframe, embed, object { max-width: 100%; }
table { table-layout: auto; }
pre, code, textarea, input { max-width: 100%; box-sizing: border-box; }
