/* ==========================================================================
   NS Tools Hub — Main Stylesheet
   Theme: Signal Red (#e63946) + Steel (#dee2e6), light & dark modes
   Structure:
     1. Design tokens (CSS variables)
     2. Reset & base
     3. Layout helpers
     4. Header & navigation
     5. Buttons, inputs, chips
     6. Hero
     7. Cards & grids
     8. Tool workspace components
     9. Content (articles, legal pages, FAQ)
    10. Footer, cookie banner, toast
    11. Utilities & responsive rules
   ========================================================================== */

/* 1. DESIGN TOKENS ------------------------------------------------------- */
:root {
  --red: #e63946;
  --red-600: #c92a37;
  --red-700: #a61e2a;
  --red-soft: rgba(230, 57, 70, 0.10);
  --red-glow: rgba(230, 57, 70, 0.28);
  --steel: #dee2e6;
  --steel-200: #e9ecef;
  --steel-400: #ced4da;
  --steel-600: #868e96;

  /* Light mode surfaces */
  --bg: #f3f5f7;
  --bg-accent: radial-gradient(1200px 600px at 85% -10%, rgba(230,57,70,0.10), transparent 60%),
               radial-gradient(900px 500px at -10% 10%, rgba(173,181,189,0.35), transparent 60%);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: #f8f9fa;
  --border: rgba(134, 142, 150, 0.22);
  --text: #16191d;
  --text-2: #495057;
  --text-3: #6c757d;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --container: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

/* Dark mode: follows the OS unless the visitor picked light explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1114;
    --bg-accent: radial-gradient(1200px 600px at 85% -10%, rgba(230,57,70,0.16), transparent 60%),
                 radial-gradient(900px 500px at -10% 10%, rgba(222,226,230,0.06), transparent 60%);
    --surface: rgba(28, 32, 37, 0.70);
    --surface-solid: #181c21;
    --surface-2: #1f242a;
    --border: rgba(222, 226, 230, 0.10);
    --text: #eef1f4;
    --text-2: #c3c9cf;
    --text-3: #8f98a1;
    --red-soft: rgba(230, 57, 70, 0.16);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1114;
  --bg-accent: radial-gradient(1200px 600px at 85% -10%, rgba(230,57,70,0.16), transparent 60%),
               radial-gradient(900px 500px at -10% 10%, rgba(222,226,230,0.06), transparent 60%);
  --surface: rgba(28, 32, 37, 0.70);
  --surface-solid: #181c21;
  --surface-2: #1f242a;
  --border: rgba(222, 226, 230, 0.10);
  --text: #eef1f4;
  --text-2: #c3c9cf;
  --text-3: #8f98a1;
  --red-soft: rgba(230, 57, 70, 0.16);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);
  color-scheme: dark;
}

/* 2. RESET & BASE --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
img, svg { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-600); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 750; }
h3 { font-size: 1.18rem; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 3px solid var(--red-glow); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

/* 3. LAYOUT --------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.section { padding: 64px 0; }
.section-sm { padding: 36px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head p { color: var(--text-2); font-size: 1.06rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); background: var(--red-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 4. HEADER & NAV -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), var(--red-700)); color: #fff; font-size: .82rem; font-weight: 900;
  box-shadow: 0 6px 16px var(--red-glow);
}
.brand b { color: var(--red); font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a, .nav-drop > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .94rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav-links a:hover, .nav-drop > button:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--red-soft); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--red); }
.nav-drop { position: relative; }
.nav-drop-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 270px; padding: 8px; border-radius: var(--radius); background: var(--surface-solid);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: .18s ease; list-style: none; margin: 0;
}
.nav-drop:hover .nav-drop-menu, .nav-drop:focus-within .nav-drop-menu, .nav-drop.open .nav-drop-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-drop-menu a { display: flex; width: 100%; padding: 10px 12px; }
.nav-drop-menu small { display: block; color: var(--text-3); font-weight: 500; font-size: .8rem; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--red); border-color: var(--red-glow); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-toggle { display: none; }

/* 5. BUTTONS, INPUTS, CHIPS ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-weight: 700; font-size: .95rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s;
  text-decoration: none !important; line-height: 1.2; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--red), var(--red-600)); color: #fff; box-shadow: 0 8px 20px var(--red-glow); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px var(--red-glow); background: var(--red-600); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--red); border-color: var(--red-glow); }
.btn-sm { padding: 8px 13px; font-size: .86rem; border-radius: 10px; }
.btn-block { width: 100%; }

label { font-weight: 650; font-size: .92rem; color: var(--text-2); }
.input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-solid);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: border .15s, box-shadow .15s;
}
.input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
textarea { resize: vertical; min-height: 220px; line-height: 1.6; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: .8rem; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.chip-red { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* Toggle switch (checkbox) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--steel-400); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--red); }
.switch input:checked::after { transform: translateX(18px); }
.switch span { font-weight: 600; color: var(--text); font-size: .93rem; }

/* Range slider */
input[type="range"] { width: 100%; accent-color: var(--red); height: 28px; }

/* 6. HERO ----------------------------------------------------------------- */
.hero { padding: 72px 0 48px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 .accent { background: linear-gradient(135deg, var(--red), #ff6b6b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.15rem; color: var(--text-2); max-width: 600px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero-trust { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-3); font-size: .9rem; font-weight: 600; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { width: 16px; height: 16px; color: var(--red); }
.hero-panel {
  position: relative; border-radius: var(--radius-lg); padding: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.hero-panel::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, var(--red-glow), transparent 40%, transparent 70%, rgba(173,181,189,.5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.demo-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--steel-400); }
.demo-bar i:first-child { background: var(--red); }
.demo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.page-hero { padding: 54px 0 28px; }
.page-hero p { color: var(--text-2); font-size: 1.08rem; max-width: 760px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; font-size: .86rem; color: var(--text-3); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--steel-600); }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--red); }

/* 7. CARDS ---------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tool-card { display: flex; flex-direction: column; gap: 10px; transition: transform .18s ease, box-shadow .2s, border-color .2s; color: var(--text); position: relative; overflow: hidden; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--red-glow); text-decoration: none; color: var(--text); }
.tool-card p { color: var(--text-2); margin: 0; font-size: .95rem; }
.tool-card .go { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--red); display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; }
.tool-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); }
.tool-icon svg { width: 24px; height: 24px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .tool-icon { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; }
.feature .tool-icon svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1.02rem; margin-bottom: 4px; }
.feature p { color: var(--text-2); font-size: .93rem; margin: 0; }
.guide-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); height: 100%; transition: border-color .2s, transform .18s; }
.guide-card:hover { text-decoration: none; color: var(--text); border-color: var(--red-glow); transform: translateY(-2px); }
.guide-card h3 { font-size: 1.02rem; margin: 0; }
.guide-card p { margin: 0; color: var(--text-2); font-size: .9rem; }
.guide-meta { font-size: .78rem; color: var(--text-3); font-weight: 600; display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 6px; }

/* 8. TOOL WORKSPACE ------------------------------------------------------- */
.tool-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.tool-wrap.single { grid-template-columns: 1fr; }
.tool-main { padding: 20px; }
.tool-side { display: grid; gap: 14px; position: sticky; top: 86px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.stat b { display: block; font-size: 1.55rem; font-weight: 800; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.stat.hl { background: var(--red-soft); border-color: transparent; }
.stat.hl b { color: var(--red); }
.side-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 750; margin: 0 0 10px; }
.limits { display: grid; gap: 10px; }
.limit-row { display: grid; gap: 4px; font-size: .86rem; }
.limit-row .lr-top { display: flex; justify-content: space-between; color: var(--text-2); font-weight: 600; }
.bar { height: 7px; border-radius: 999px; background: var(--steel-200); overflow: hidden; }
:root[data-theme="dark"] .bar { background: #2a3037; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); border-radius: inherit; transition: width .2s; }
.bar i.ok { background: #2f9e44; }
.density { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.density li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; font-size: .9rem; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); }
.density li span:first-child { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.density li span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.density .empty { display: block; color: var(--text-3); background: none; padding: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-weight: 650; font-size: .88rem; color: var(--text-2); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--red); box-shadow: var(--shadow); }
.case-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.case-buttons .btn { justify-content: flex-start; }
.case-buttons .btn.active { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.output-box {
  font-family: var(--mono); font-size: 1rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; word-break: break-all; min-height: 52px; color: var(--text);
}
.pw-display { display: flex; align-items: stretch; gap: 8px; }
.pw-display .output-box { flex: 1; font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 600; letter-spacing: .02em; display: flex; align-items: center; }
.strength { display: flex; align-items: center; gap: 10px; margin: 12px 0 18px; font-size: .9rem; font-weight: 650; color: var(--text-2); }
.strength .bar { flex: 1; height: 9px; }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.range-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.range-row output { min-width: 52px; text-align: center; font-weight: 800; font-size: 1.15rem; color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 6px 8px; }
.bulk-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.bulk-list li { display: flex; gap: 8px; align-items: center; }
.bulk-list code { flex: 1; font-family: var(--mono); font-size: .92rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; word-break: break-all; }
.result-list { display: grid; gap: 12px; }
.result-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.result-item header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.result-item header strong { font-size: .9rem; }
.result-item header small { color: var(--text-3); font-size: .8rem; display: block; font-weight: 500; }
.result-item .out { padding: 12px 14px; white-space: pre-wrap; word-break: break-word; min-height: 46px; font-size: 1.02rem; }
.slug-preview { font-family: var(--mono); font-size: .92rem; color: var(--text-2); word-break: break-all; margin-top: 8px; }
.slug-preview b { color: var(--red); }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.privacy-note svg { width: 18px; height: 18px; color: #2f9e44; flex-shrink: 0; margin-top: 2px; }

/* 9. CONTENT -------------------------------------------------------------- */
.prose { font-size: 1.04rem; color: var(--text-2); }
.prose h2 { margin-top: 1.8em; color: var(--text); }
.prose h3 { margin-top: 1.4em; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--text); }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); }
.prose blockquote { margin: 1.2em 0; padding: 14px 18px; border-left: 4px solid var(--red); background: var(--red-soft); border-radius: 0 12px 12px 0; color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text); background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.article-body { padding: 34px; }
.article-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-3); font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.cta-box { border-radius: var(--radius); padding: 22px; background: linear-gradient(135deg, var(--red), var(--red-700)); color: #fff; box-shadow: 0 14px 30px var(--red-glow); }
.cta-box h3 { color: #fff; margin-bottom: 6px; }
.cta-box p { color: rgba(255,255,255,.88); font-size: .93rem; }
.cta-box .btn { background: #fff; color: var(--red-700); }
.cta-box .btn:hover { color: var(--red); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-list a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-size: .92rem; font-weight: 550; }
.side-list a:hover { background: var(--red-soft); color: var(--red); text-decoration: none; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; transition: border-color .2s; }
.faq details[open] { border-color: var(--red-glow); }
.faq summary { cursor: pointer; padding: 16px 30px 16px 0; font-weight: 700; color: var(--text); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--red); font-weight: 500; transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 0 16px; color: var(--text-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; color: var(--text-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 800; }
.steps strong { color: var(--text); display: block; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.filter-bar .input { max-width: 340px; }
.legal-updated { color: var(--text-3); font-size: .9rem; font-weight: 600; }
.contact-info { display: grid; gap: 14px; }
.contact-info .feature p a { font-weight: 650; }
.form-status { margin-top: 12px; font-weight: 650; font-size: .93rem; }
.form-status.ok { color: #2f9e44; }
.form-status.err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Ad placeholder: invisible until you paste AdSense code inside */
.ad-slot { margin: 28px auto; text-align: center; }
.ad-slot:empty { display: none; }

/* 10. FOOTER, COOKIE BANNER, TOAST -------------------------------------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0 28px; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-2); font-size: .94rem; }
.footer-grid a:hover { color: var(--red); }
.footer-about p { color: var(--text-2); font-size: .93rem; margin-top: 12px; max-width: 340px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 26px; border-top: 1px solid var(--border); font-size: .86rem; color: var(--text-3); }
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80; max-width: 560px;
  padding: 18px; border-radius: var(--radius); background: var(--surface-solid); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: none;
}
.cookie-banner.show { display: block; animation: rise .3s ease; }
.cookie-banner p { font-size: .9rem; color: var(--text-2); margin-bottom: 12px; }
.cookie-banner .row { display: flex; gap: 8px; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 90;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: .25s ease; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 11. UTILITIES & RESPONSIVE --------------------------------------------- */
.muted { color: var(--text-3); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 1024px) {
  .tool-wrap, .article-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-toggle { display: grid; }
  .nav-links {
    position: fixed; top: 66px; left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch;
    padding: 16px 20px 40px; gap: 2px; background: var(--bg); overflow-y: auto;
    opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav-open .nav-links { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
  .nav-open { overflow: hidden; }
  .nav-links a, .nav-drop > button { padding: 13px 12px; font-size: 1.02rem; width: 100%; justify-content: flex-start; }
  .nav-drop-menu { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border: 0; background: none; padding: 0 0 0 10px; min-width: 0; display: none; }
  .nav-drop.open .nav-drop-menu { display: block; transform: none; }
  .nav-drop:hover .nav-drop-menu { transform: none; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }
  .hero { padding: 44px 0 28px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .opt-grid { grid-template-columns: 1fr; }
  .article-body { padding: 22px 18px; }
  .card { padding: 18px; }
  .tool-main { padding: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .stat b { font-size: 1.3rem; }
  .demo-stats { grid-template-columns: repeat(3, 1fr); }
  .toolbar .btn { flex: 1 1 auto; }
  .filter-bar .input { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .cookie-banner, .ad-slot, .tool-side, .cta-box { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Four-column stat grid (word counter) */
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .stat-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Code blocks inside guides */
.prose pre { background: #14171b; color: #e9ecef; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: .88rem; line-height: 1.55; margin: 0 0 1.2em; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
/* Dark-mode bar track */
:root[data-theme="dark"] .bar { background: #2a3037; }
/* Inline icon sizing inside small UI elements */
.eyebrow svg { width: 15px; height: 15px; flex-shrink: 0; }
.guide-meta svg { width: 14px; height: 14px; }
.nav-drop > button svg { width: 16px; height: 16px; }
/* Footer contact row (address, phone, email) */
.footer-contact { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0 0 22px; font-size: .9rem; color: var(--text-2); }
.footer-contact span { display: inline-flex; align-items: center; gap: 8px; }
.footer-contact svg { width: 16px; height: 16px; color: var(--red); flex-shrink: 0; }
.footer-contact a { color: var(--text-2); }
.footer-contact a:hover { color: var(--red); }

/* ==========================================================================
   12. RESPONSIVE HARDENING (v3)
   Mobile-first fixes for every screen from 320px phones to wide desktops.
   ========================================================================== */

/* Grid and flex children may shrink below their content width
   (prevents long words, code blocks and textareas from widening the page) */
.grid > *, .hero-grid > *, .tool-wrap > *, .article-layout > *, .footer-grid > * { min-width: 0; }
img, video, iframe, table { max-width: 100%; }
.prose { overflow-wrap: break-word; }
.prose code { overflow-wrap: anywhere; }
.prose pre { max-width: 100%; white-space: pre; -webkit-overflow-scrolling: touch; }
.output-box, .slug-preview, .bulk-list code { overflow-wrap: anywhere; }

/* Contact page layout (form + info column) */
.contact-wrap { grid-template-columns: minmax(0, 1fr) 360px; }

/* Comfortable touch targets (44px is the common accessibility guideline) */
.btn-sm { min-height: 40px; }
.nav-links a, .nav-drop > button { min-height: 40px; }
.brand { min-height: 40px; }
input[type="range"] { height: 40px; }
.seg button { min-height: 36px; }
@media (pointer: coarse) {
  .btn, .btn-sm { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .seg button { min-height: 40px; }
  .faq summary { padding-top: 18px; padding-bottom: 18px; }
  .side-list a { padding: 11px 10px; }
}

/* Large screens */
@media (min-width: 1600px) {
  :root { --container: 1280px; }
  body { font-size: 17px; }
}

/* Laptops and small desktops */
@media (max-width: 1200px) {
  .hero-grid { gap: 36px; }
}

/* Tablets: sidebars become a two-column card grid instead of a tall stack */
@media (max-width: 1024px) {
  .contact-wrap { grid-template-columns: 1fr; }
  .tool-side { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
  .article-layout .tool-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .contact-info { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .article-body { padding: 28px; }
}

/* Small tablets and large phones */
@media (max-width: 880px) {
  .hero { padding: 48px 0 32px; }
  .hero-lead { font-size: 1.06rem; }
  .hero-panel { max-width: 560px; }
  .section-head { margin-bottom: 26px; }
  .page-hero { padding: 40px 0 22px; }
}

/* Phones */
@media (max-width: 640px) {
  h1 { font-size: clamp(1.75rem, 8vw, 2.4rem); }
  h2 { font-size: clamp(1.3rem, 5.6vw, 1.6rem); }
  .page-hero p, .hero-lead { font-size: 1rem; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-trust { gap: 8px 16px; font-size: .86rem; }
  .hero-panel { padding: 16px; border-radius: var(--radius); }
  .demo-stats { gap: 8px; }
  .demo-stats .stat { padding: 10px; }
  .demo-stats .stat b { font-size: 1.15rem; }
  .demo-stats .stat span { font-size: .68rem; letter-spacing: .02em; }
  .tool-side, .article-layout .tool-side, .contact-info { grid-template-columns: 1fr; }
  textarea { min-height: 180px; }
  .toolbar { gap: 6px; }
  .toolbar .side-title { flex: 1 1 100%; margin-bottom: 4px; }
  /* Password: show the password full width, buttons underneath */
  .pw-display { flex-wrap: wrap; }
  .pw-display .output-box { flex: 1 1 100%; min-height: 64px; }
  .pw-display .btn { flex: 1 1 0; }
  .strength { flex-wrap: wrap; gap: 6px 10px; }
  .strength .bar { flex: 1 1 100%; order: 3; }
  /* Case converter: two buttons per row */
  .case-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-buttons .btn { justify-content: center; padding-left: 8px; padding-right: 8px; }
  .result-list.grid-2 { grid-template-columns: 1fr; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1 1 auto; }
  .filter-bar { gap: 10px; }
  .article-body { padding: 22px 16px; }
  .prose { font-size: 1rem; }
  .prose pre { font-size: .8rem; padding: 12px; margin-left: -4px; margin-right: -4px; }
  .prose th, .prose td { padding: 8px; font-size: .9rem; }
  .faq details { padding: 0 14px; }
  .steps li { padding-left: 46px; }
  .cta-box { padding: 18px; }
  .cta-box .btn { width: 100%; }
  .footer-contact { flex-direction: column; gap: 10px; }
  .footer-bottom { flex-direction: column; }
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 14px; }
  .cookie-banner .btn { flex: 1 1 auto; }
}

/* Very small phones (320–360px) */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .brand { font-size: 1.02rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: .74rem; }
  .nav-actions { gap: 6px; }
  .card { padding: 14px; }
  .tool-main { padding: 12px; }
  .stat { padding: 10px; }
  .stat b { font-size: 1.15rem; }
  .stat span { font-size: .68rem; }
  .demo-stats .stat span { font-size: .62rem; }
  .eyebrow { font-size: .7rem; letter-spacing: .08em; }
  .switch { padding: 10px 12px; }
  .case-buttons .btn { font-size: .8rem; }
}

/* Phones in landscape: keep the open menu scrollable and compact */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 940px) {
  .nav-links a, .nav-drop > button { padding-top: 9px; padding-bottom: 9px; }
  .hero { padding-top: 28px; }
}

/* Respect iPhone home-indicator area for fixed elements */
.cookie-banner { margin-bottom: env(safe-area-inset-bottom, 0); }
.toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* Mobile menu fix: backdrop-filter on the header creates a containing block that
   traps position:fixed children, so drop it while the menu is open. */
@media (max-width: 880px) {
  .nav-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav-links { height: calc(100dvh - 66px); bottom: auto; overscroll-behavior: contain; }
  .nav-drop-menu a span { display: flex; flex-direction: column; }
}
.nav-open .cookie-banner { display: none; }
@media (max-height: 500px) and (orientation: landscape) {
  .cookie-banner { max-width: 640px; padding: 10px 14px; }
  .cookie-banner p { font-size: .82rem; margin-bottom: 8px; }
  .cookie-banner .btn { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
}
/* Keep every label at 12px or larger on small phones */
@media (max-width: 640px) {
  .demo-stats .stat span { font-size: 12px; letter-spacing: 0; text-transform: none; }
}
@media (max-width: 360px) {
  .eyebrow { font-size: 12px; }
  .brand-mark { font-size: 12px; }
  .demo-stats .stat span { font-size: 12px; }
  .stat span { font-size: 12px; }
}

/* ==========================================================================
   13. CONTACT PAGE (no form: email, phone, office, topics, hours)
   ========================================================================== */
.contact-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.contact-card { display: flex; flex-direction: column; gap: 10px; padding: 28px; position: relative; overflow: hidden; }
.contact-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--red), var(--red-700)); opacity: .9; }
.contact-card h2 { font-size: 1.2rem; margin: 6px 0 0; }
.contact-card .muted { font-size: .93rem; margin: 0; flex: 1; }
.contact-card .btn { margin-top: 8px; }
.contact-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--red), var(--red-700)); color: #fff; box-shadow: 0 10px 22px var(--red-glow); }
.contact-icon svg { width: 26px; height: 26px; }
.contact-value { margin: 0; font-size: 1.12rem; font-weight: 750; color: var(--text); overflow-wrap: anywhere; }
.contact-value a { color: var(--text); }
.contact-value a:hover { color: var(--red); }
.contact-address { font-size: 1rem; font-weight: 650; line-height: 1.5; }
.topic-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: transform .18s ease, border-color .2s, box-shadow .2s; }
.topic-card:hover { text-decoration: none; color: var(--text); transform: translateY(-3px); border-color: var(--red-glow); box-shadow: var(--shadow-lg); }
.topic-card h3 { margin: 4px 0 0; }
.topic-card p { margin: 0; color: var(--text-2); font-size: .93rem; }
.topic-card .go { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--red); display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.topic-card .go svg { width: 16px; height: 16px; }
.topic-card .u { text-decoration: underline; text-underline-offset: 3px; }
.contact-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hours-card h2, .tips-card h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.hours-card h2 svg, .tips-card h2 svg { width: 22px; height: 22px; color: var(--red); flex-shrink: 0; }
.hours { width: 100%; border-collapse: collapse; margin: 6px 0 16px; }
.hours th, .hours td { padding: 12px 0; border-bottom: 1px solid var(--border); text-align: left; font-size: .97rem; }
.hours th { font-weight: 650; color: var(--text); }
.hours td { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.check-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.check-list svg { width: 18px; height: 18px; color: #2f9e44; flex-shrink: 0; margin-top: 3px; }
@media (max-width: 1024px) {
  .contact-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-methods .contact-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .contact-methods, .contact-split { grid-template-columns: 1fr; }
  .contact-card { padding: 22px; }
}
