/*!
 * TextTools365 - base layer
 * Design tokens, layout primitives, header, footer, cards, home page.
 * Tool-specific UI lives in tools.css.
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  color-scheme: light;

  /* Brand */
  --c-primary: #1d4ed8;
  --c-primary-hover: #1e40af;
  --c-primary-soft: #eff4ff;
  --c-primary-border: #c7d7fe;
  --c-secondary: #0f766e;
  --c-secondary-soft: #ecfdf5;

  /* Surfaces */
  --c-bg: #f7f8fb;
  --c-surface: #ffffff;
  --c-surface-alt: #f2f4f8;
  --c-border: #dde1ea;
  --c-border-strong: #c3c9d6;

  /* Text */
  --c-text: #12151c;
  --c-text-muted: #5a6274;
  --c-text-inverse: #ffffff;

  /* Status */
  --c-success: #15803d;
  --c-success-soft: #eafaef;
  --c-warning: #a15c07;
  --c-warning-soft: #fff5e5;
  --c-error: #b42318;
  --c-error-soft: #fdeceb;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --fs-xs: 0.78rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  /* Layout */
  --w-page: 1200px;
  --w-prose: 760px;
  --header-h: 60px;
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --c-primary: #7ea6ff;
  --c-primary-hover: #a3c0ff;
  --c-primary-soft: #16233d;
  --c-primary-border: #2c456f;
  --c-secondary: #5eddc4;
  --c-secondary-soft: #10312c;

  --c-bg: #0d1017;
  --c-surface: #151a23;
  --c-surface-alt: #1c222d;
  --c-border: #2a313d;
  --c-border-strong: #3b4453;

  --c-text: #eef1f6;
  --c-text-muted: #a3adbf;
  --c-text-inverse: #0d1017;

  --c-success: #6ee7a0;
  --c-success-soft: #10281a;
  --c-warning: #fcbf5a;
  --c-warning-soft: #2e2110;
  --c-error: #ff8f85;
  --c-error-soft: #331714;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   2. Reset / base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 var(--sp-3);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); margin-top: var(--sp-6); }
h3 { font-size: var(--fs-xl); margin-top: var(--sp-5); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-4); }

a {
  color: var(--c-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--c-primary-hover); }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.35rem; }
li { margin-bottom: var(--sp-2); }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
}
pre {
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  overflow-x: auto;
  margin: 0 0 var(--sp-4);
}
pre code { background: none; border: 0; padding: 0; }

kbd {
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  font-size: 0.8em;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-6) 0;
}

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection { background: var(--c-primary-soft); color: var(--c-text); }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.prose { max-width: var(--w-prose); }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-5); }

main { flex: 1 0 auto; padding-bottom: var(--sp-7); }

.section { margin-top: var(--sp-7); }
.section__head { margin-bottom: var(--sp-4); }
.section__head h2 { margin-top: 0; margin-bottom: var(--sp-2); }
.section__head p { color: var(--c-text-muted); margin: 0; max-width: var(--w-prose); }

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -100px;
  z-index: 100;
  background: var(--c-surface);
  color: var(--c-text);
  border: 2px solid var(--c-primary);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-4);
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--sp-3); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   4. Buttons & form controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--c-surface-alt); color: var(--c-text); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
:root[data-theme='dark'] .btn--primary { color: #0d1017; }
.btn--primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }
:root[data-theme='dark'] .btn--primary:hover { color: #0d1017; }

.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--c-surface-alt); }

.btn--sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--block { width: 100%; }

.btn__icon { width: 16px; height: 16px; flex: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--c-surface-alt); }
.icon-btn svg { width: 20px; height: 20px; }

label { font-weight: 600; font-size: var(--fs-sm); }

input[type='text'],
input[type='search'],
input[type='number'],
input[type='email'],
select,
textarea {
  font: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  min-height: 44px;
  width: 100%;
  max-width: 100%;
}
textarea { min-height: 160px; line-height: 1.6; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* ==========================================================================
   5. Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--c-surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
@supports not (backdrop-filter: blur(4px)) {
  .site-header { background: var(--c-surface); }
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--c-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex: none;
}
.brand:hover { color: var(--c-text); }
.brand__mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--c-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}
:root[data-theme='dark'] .brand__mark { color: #0d1017; }

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list li { margin: 0; }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav__link:hover { background: var(--c-surface-alt); color: var(--c-text); }
.nav__link[aria-current='page'] { color: var(--c-primary); background: var(--c-primary-soft); }

.header__actions { display: flex; align-items: center; gap: var(--sp-1); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow);
    padding: var(--sp-3) var(--sp-4);
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { min-height: 48px; padding: 0 var(--sp-2); }
  .nav-toggle { display: inline-flex; }
}

/* ---- Search ---- */
.search {
  position: relative;
  flex: 1 1 320px;
  max-width: 420px;
  min-width: 0;
}
.search__field { display: flex; align-items: center; position: relative; }
.search__icon {
  position: absolute;
  left: var(--sp-3);
  width: 18px; height: 18px;
  color: var(--c-text-muted);
  pointer-events: none;
}
.search__input {
  padding-left: 2.4rem;
  min-height: 40px;
  background: var(--c-surface-alt);
  border-color: var(--c-border);
  font-size: var(--fs-sm);
}
.search__results {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--sp-2);
  margin: 0;
  list-style: none;
  display: none;
}
.search__results.is-open { display: block; }
.search__results li { margin: 0; }
.search__option {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  text-decoration: none;
}
.search__option:hover,
.search__option.is-active { background: var(--c-primary-soft); color: var(--c-text); }
.search__option strong { display: block; font-size: var(--fs-sm); }
.search__option span { display: block; font-size: var(--fs-xs); color: var(--c-text-muted); }
.search__empty { padding: var(--sp-3); font-size: var(--fs-sm); color: var(--c-text-muted); }
.search__group {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  .search { order: 3; flex-basis: 100%; max-width: none; margin-bottom: var(--sp-3); }
  .site-header__bar { flex-wrap: wrap; }
}

/* ==========================================================================
   6. Breadcrumb
   ========================================================================== */
.breadcrumb { font-size: var(--fs-sm); color: var(--c-text-muted); padding: var(--sp-4) 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; }
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: var(--sp-2); }
.breadcrumb li + li::before { content: '/'; color: var(--c-border-strong); }
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb [aria-current='page'] { color: var(--c-text); font-weight: 600; }

/* ==========================================================================
   7. Cards & grids
   ========================================================================== */
.grid { display: grid; gap: var(--sp-4); }
.grid--tools { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--cats { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  text-decoration: none;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  height: 100%;
}
a.card:hover {
  border-color: var(--c-primary-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--c-text);
}
.card__top { display: flex; align-items: center; gap: var(--sp-3); }
.card__icon {
  width: 38px; height: 38px;
  flex: none;
  border-radius: var(--radius);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card__icon svg { width: 20px; height: 20px; }
.card__title { font-weight: 700; font-size: var(--fs-base); margin: 0; }
.card__text { margin: 0; font-size: var(--fs-sm); color: var(--c-text-muted); }
.card__meta { margin-top: auto; font-size: var(--fs-xs); color: var(--c-text-muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.chip-row li { margin: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.chip:hover { border-color: var(--c-primary-border); background: var(--c-primary-soft); color: var(--c-text); }

/* ==========================================================================
   8. Hero
   ========================================================================== */
.hero { padding: var(--sp-7) 0 var(--sp-5); text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin-bottom: var(--sp-4); }
.hero__lede {
  font-size: var(--fs-lg);
  color: var(--c-text-muted);
  max-width: 640px;
  margin: 0 auto var(--sp-5);
}
.hero__search { max-width: 560px; margin: 0 auto var(--sp-4); }
.hero__search .search { max-width: none; flex-basis: auto; }
.hero__search .search__input { min-height: 52px; font-size: var(--fs-base); background: var(--c-surface); }
.hero .chip-row { justify-content: center; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2) var(--sp-4);
  list-style: none;
  margin: var(--sp-5) 0 0;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
.badge-row li { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
.badge-row svg { width: 16px; height: 16px; color: var(--c-success); flex: none; }

/* ==========================================================================
   9. Notes & callouts
   ========================================================================== */
.note {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface-alt);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-4);
}
.note svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.note p { margin: 0; }
.note--privacy { background: var(--c-success-soft); border-color: transparent; color: var(--c-text); }
.note--privacy svg { color: var(--c-success); }
.note--warning { background: var(--c-warning-soft); border-color: transparent; color: var(--c-text); }
.note--warning svg { color: var(--c-warning); }
.note--info svg { color: var(--c-primary); }

/* ==========================================================================
   10. FAQ
   ========================================================================== */
.faq { max-width: var(--w-prose); }
.faq__item {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  margin-bottom: var(--sp-3);
  overflow: hidden;
}
.faq__item summary {
  cursor: pointer;
  padding: var(--sp-3) var(--sp-4);
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  min-height: 48px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '';
  width: 10px; height: 10px;
  border-right: 2px solid var(--c-text-muted);
  border-bottom: 2px solid var(--c-text-muted);
  transform: rotate(45deg);
  flex: none;
  transition: transform 0.15s ease;
}
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__body { padding: 0 var(--sp-4) var(--sp-4); }
.faq__body p:last-child { margin-bottom: 0; }

/* ==========================================================================
   11. Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; margin-bottom: var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
caption { text-align: left; padding: var(--sp-3) var(--sp-4); font-weight: 700; color: var(--c-text); border-bottom: 1px solid var(--c-border); }
th, td { padding: var(--sp-2) var(--sp-4); text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-weight: 700; background: var(--c-surface-alt); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   12. Ad slots
   ========================================================================== */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--sp-5) auto;
  width: 100%;
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-slot > span { opacity: 0.6; }
/* Reserve height so filling a slot later does not push the layout around. */
.ad-slot--leaderboard { min-height: 100px; max-width: 970px; }
.ad-slot--in-content { min-height: 250px; max-width: 728px; }
.ad-slot--footer { min-height: 250px; max-width: 728px; }
.ad-slot--sidebar { min-height: 600px; max-width: 300px; margin-top: 0; }

/* Development outline. Remove `.ads-dev` from <body> for production builds. */
.ads-dev .ad-slot {
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--c-surface-alt) 10px, var(--c-surface-alt) 20px);
}

@media (max-width: 1099px) {
  .ad-slot--sidebar { display: none; }
}

/* ==========================================================================
   13. Footer
   ========================================================================== */
.site-footer {
  flex: none;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: var(--sp-6) 0 var(--sp-5);
  font-size: var(--fs-sm);
}
.footer__grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: var(--sp-5);
}
.footer__grid h2 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin: 0 0 var(--sp-3);
}
.footer__grid ul { list-style: none; padding: 0; margin: 0; }
.footer__grid li { margin-bottom: var(--sp-2); }
.footer__grid a { color: var(--c-text); text-decoration: none; }
.footer__grid a:hover { color: var(--c-primary); text-decoration: underline; }
.footer__bottom {
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  color: var(--c-text-muted);
}
.footer__bottom p { margin: 0; }
.footer__about { color: var(--c-text-muted); max-width: 30ch; margin: 0; }

/* ==========================================================================
   14. Toasts
   ========================================================================== */
.toast-stack {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  animation: toast-in 0.18s ease-out;
}
.toast--success { border-left-color: var(--c-success); }
.toast--error { border-left-color: var(--c-error); }
.toast--warning { border-left-color: var(--c-warning); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   14b. Analytics consent
   ========================================================================== */
/* Docked to the bottom of the viewport. It is fixed, so while it is up the page
   gets matching bottom padding (.has-consent) — otherwise it would sit on top
   of whatever is at the end of a tool page. Sits below the toast stack. */
.consent {
  position: fixed;
  z-index: 190;
  inset: auto 0 0 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  animation: consent-in 0.2s ease-out;
}
.consent[hidden] { display: none; }
/* Set by main.js only while the banner is up, so the reserved space disappears
   the moment the visitor answers. */
body.has-consent { padding-bottom: var(--consent-height, 7rem); }
.consent__inner {
  max-width: var(--w-page, 1200px);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.consent__text { flex: 1 1 auto; min-width: 0; }
.consent__title {
  font-size: var(--fs-base);
  margin: 0 0 var(--sp-1);
}
.consent__text p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  max-width: var(--w-prose);
}
.consent__actions {
  flex: 0 0 auto;
  display: flex;
  gap: var(--sp-2);
}
@keyframes consent-in {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 720px) {
  .consent__inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
    padding: var(--sp-4);
  }
  .consent__actions > .btn { flex: 1 1 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { animation: none; }
}

/* ==========================================================================
   15. 404 & misc pages
   ========================================================================== */
.page-head { padding: var(--sp-6) 0 var(--sp-4); }
.page-head h1 { margin-bottom: var(--sp-3); }
.page-head p { color: var(--c-text-muted); font-size: var(--fs-lg); max-width: var(--w-prose); margin: 0; }

.error-page { text-align: center; padding: var(--sp-8) 0; }
.error-page__code {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1;
  margin: 0 0 var(--sp-3);
}

.updated { font-size: var(--fs-sm); color: var(--c-text-muted); }

/* Editorial placeholder marker for policy text the site owner must review. */
.placeholder-note {
  border-left: 4px solid var(--c-warning);
  background: var(--c-warning-soft);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}

/* ==========================================================================
   16. Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  a.card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .toast-stack, .tool-actions, .breadcrumb { display: none !important; }
  body { background: #fff; }
}
