/* ==========================================================================
   Site Advice — design system
   Trustworthy-tech palette: deep teal-blue primary, warm neutral grays,
   one warm amber accent used sparingly. Light default; dark via
   :root[data-theme="dark"]. prefers-color-scheme is the initial signal
   (set by theme-init.php); an explicit data-theme always wins.
   AA contrast verified in both themes for text and interactive elements.
   ========================================================================== */

/* ----------------------------------------------------------- design tokens */
:root {
  /* palette — light · calm cobalt editorial (slate neutrals, cobalt primary) */
  --bg:            #f6f7fa;
  --surface:       #ffffff;
  --surface-2:     #eef1f6;
  --text:          #131722;
  --text-muted:    #566072;
  --border:        #e3e7ef;
  --border-strong: #cbd2df;

  --primary:       #2457d6;   /* cobalt — AA: white text = 5.4:1 */
  --primary-hover: #1d47b8;
  --primary-tint:  #e9effc;   /* subtle wash behind primary elements */
  --on-primary:    #ffffff;

  --accent:        #d9542f;   /* warm coral — tiny highlights only */
  --accent-tint:   #fceae3;

  --focus:         #2457d6;
  --success:       #1c7d4d;
  --success-tint:  #e3f4ea;
  --danger:        #b3271a;
  --danger-tint:   #fbe7e5;

  --brand-teal:    #2457d6;   /* brand fill (favicon/logo) */

  /* type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
               "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --measure: 68ch;
  --read: 50rem;  /* article reading column (centered) — fixed length so it caps
                     ALL elements (big H1, hero, body) at one width, since `ch`
                     is font-size-relative and wouldn't constrain large headings */

  /* fluid scale */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.3rem + 0.75vw, 1.85rem);
  --step-3:  clamp(1.75rem, 1.5rem + 1.25vw, 2.5rem);
  --step-4:  clamp(2.1rem, 1.7rem + 2vw, 3.35rem);

  /* space + shape */
  --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: 4.5rem;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 31, 0.05), 0 1px 3px rgba(16, 32, 31, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 32, 31, 0.07), 0 2px 4px rgba(16, 32, 31, 0.05);
  --shadow-lg: 0 12px 32px rgba(16, 32, 31, 0.10);

  --container: 1120px;
  --header-h: 64px;
  --ease: cubic-bezier(0.4, 0.1, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg:            #0b0f17;
  --surface:       #121826;
  --surface-2:     #18202f;
  --text:          #e9edf5;
  --text-muted:    #9aa4b6;
  --border:        #232c3e;
  --border-strong: #34405a;

  --primary:       #6f9dff;   /* cobalt on dark — AA as link/UI text */
  --primary-hover: #8bb1ff;
  --primary-tint:  #172236;
  --on-primary:    #071023;   /* dark text on bright cobalt button */

  --accent:        #ff7d5c;
  --accent-tint:   #2b1712;

  --focus:         #8bb1ff;
  --success:       #55d29a;
  --success-tint:  #123027;
  --danger:        #ff8b7f;
  --danger-tint:   #331b19;

  --brand-teal:    #6f9dff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
@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;
  }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 var(--sp-4); }
ul, ol { margin: 0; padding: 0; }
main { flex: 1 0 auto; }

/* focus visibility everywhere */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------------------------------------------------------------- layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(var(--sp-4), 4vw, var(--sp-7));
}
.section { padding-block: var(--sp-8); }
.section--alt { background: var(--surface-2); }
.section__head { max-width: var(--measure); margin-bottom: var(--sp-5); }
.section__title { font-size: var(--step-2); margin: 0 0 var(--sp-2); }
.section__sub { color: var(--text-muted); margin: 0; font-size: var(--step-1); }
.section__cta { margin-top: var(--sp-6); }

.skip-link {
  position: absolute;
  left: var(--sp-3); top: -60px;
  background: var(--primary); color: var(--on-primary);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius);
  z-index: 100; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: var(--sp-3); text-decoration: none; }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: var(--header-h);
}
.site-header__actions { display: flex; align-items: center; gap: var(--sp-2); }

.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: var(--text); font-weight: 800; font-size: var(--step-1);
  letter-spacing: -0.02em;
  min-width: 0; /* allow the flex item to shrink without squashing the logo */
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand__mark { display: inline-flex; }
.brand--footer { font-size: var(--step-0); }
.brand__logo {
  height: 36px; width: auto; display: block;
  max-width: 100%; object-fit: contain; object-position: left center;
}
.brand--footer .brand__logo { height: 32px; }
.brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: block; }

/* nav */
.nav__list { display: flex; align-items: center; gap: var(--sp-2); list-style: none; }
.nav__link {
  display: inline-block; color: var(--text); font-weight: 600;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius);
  font-size: var(--step--1);
  white-space: nowrap; /* FR/NL labels are longer — never break inside an item */
}
.nav__link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav__link.is-current { color: var(--primary); }
.nav__link.is-current::after {
  content: ""; display: block; height: 2px; margin-top: 2px;
  background: var(--primary); border-radius: 2px;
}

/* icon buttons: theme + mobile nav */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  cursor: pointer; transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: inline-flex; }
.nav-toggle { display: none; }

/* Language switcher (native <details> disclosure; DE/FR/NL reserved) */
.lang { position: relative; }
.lang__btn {
  display: inline-flex; align-items: center; gap: 0.4em; height: 40px; padding: 0 0.7rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: transparent;
  color: var(--text); cursor: pointer; font-size: var(--step--1); font-weight: 600;
  list-style: none; transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.lang__btn::-webkit-details-marker { display: none; }
.lang__btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.lang__globe { color: var(--text-muted); }
.lang__caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted); transition: transform 0.15s var(--ease); }
.lang[open] .lang__caret { transform: rotate(180deg); }
.lang__menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 190px;
  margin: 0; padding: 0.4rem; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.lang__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.55rem 0.7rem; border-radius: var(--radius); font-size: var(--step--1); color: var(--text);
}
a.lang__opt:hover { background: var(--surface-2); text-decoration: none; }
.lang__opt.is-current { color: var(--primary); font-weight: 700; background: var(--primary-tint); }
.lang__opt.is-soon { color: var(--text-muted); cursor: not-allowed; }
.lang__opt em {
  font-style: normal; font-size: 0.7em; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border);
  padding: 0.1em 0.45em; border-radius: 999px;
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 700; font-size: var(--step-0);
  padding: 0.7em 1.3em; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn__ic { flex: none; }
.inline-ic { display: inline-block; vertical-align: -0.12em; }

/* ------------------------------------------------------------------- hero */
.hero {
  background:
    radial-gradient(120% 120% at 100% 0%, var(--primary-tint) 0%, transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  display: grid; grid-template-columns: 1.4fr 0.6fr; align-items: center;
  gap: var(--sp-6); padding-block: clamp(var(--sp-6), 6vw, var(--sp-8));
}
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--step--1);
  font-weight: 700; color: var(--primary); margin: 0 0 var(--sp-3);
}
.hero__title { font-size: var(--step-4); margin: 0 0 var(--sp-4); }
.hero__accent { color: var(--accent); white-space: nowrap; /* multi-word accents („in Form“, « la santé ») stay together */ }
.hero__lede { font-size: var(--step-1); color: var(--text-muted); max-width: 46ch; margin: 0 0 var(--sp-5); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero__actions--center { justify-content: center; }
.hero__mark { display: grid; place-items: center; }
.hero__mark img { width: 100%; max-width: 460px; height: auto; }

/* Illustration panels (baked warm-cream artwork, framed so it reads intentionally in both themes) */
.illus { margin: 0; border-radius: var(--radius-lg); overflow: hidden; background: #f4f1ea; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.illus img { display: block; width: 100%; height: auto; }
.illus--tip { margin-top: var(--sp-5); }
.illus--cat { flex: 0 0 auto; width: min(300px, 60vw); }
:root[data-theme="dark"] .illus { border-color: rgba(255,255,255,0.08); }

.page-head--illus { text-align: left; }
.page-head__inner { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.page-head--illus .page-head__text { flex: 1 1 260px; }
@media (max-width: 640px) { .page-head__inner { justify-content: center; text-align: center; } }

/* TL;DR callout */
.tldr { display: flex; gap: var(--sp-3); align-items: flex-start; background: var(--primary-tint); border-left: 3px solid var(--primary); border-radius: var(--radius-lg); padding: var(--sp-4); margin: 0 0 var(--sp-5); max-width: var(--measure); }
.tldr__label { flex: 0 0 auto; font-size: var(--step--1); font-weight: 800; letter-spacing: 0.04em; color: var(--primary); margin-top: 0.1em; }
.tldr__text { margin: 0; font-size: var(--step-1); color: var(--text); }

/* FAQ */
.faq { max-width: var(--measure); margin: var(--sp-7) 0 0; padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.faq__title { font-size: var(--step-2); margin: 0 0 var(--sp-4); }
.faq__item { padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.faq__item:last-child { border-bottom: 0; }
.faq__q { font-weight: 700; margin: 0 0 var(--sp-2); color: var(--text); }
.faq__a { margin: 0; color: var(--text-muted); }

/* ---------------------------------------------------------- category grid */
.cat-grid, .tip-grid {
  list-style: none; display: grid; gap: var(--sp-4);
}
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cat-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-5); height: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.cat-card:hover {
  text-decoration: none; color: var(--text);
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.cat-card__icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 12px; background: var(--primary-tint); color: var(--primary);
}
.cat-card__label { font-weight: 700; font-size: var(--step-1); }
.cat-card__count { color: var(--text-muted); font-size: var(--step--1); }

/* ---------------------------------------------------------------- tip card */
.tip-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tip-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); height: 100%;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.tip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.tip-card__link {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5); height: 100%; color: var(--text);
}
.tip-card__link:hover { text-decoration: none; color: var(--text); }
.tip-card__head { display: flex; align-items: center; justify-content: space-between; }
.tip-card__num {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: var(--step-1);
  color: var(--accent); letter-spacing: -0.03em;
}
.tip-card__icon {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--primary-tint); color: var(--primary);
  margin-left: auto; /* keep icon flush right even when the number is hidden */
}
.tip-card__title { font-size: var(--step-1); margin: 0; }
.tip-card__summary { color: var(--text-muted); font-size: var(--step--1); margin: 0; flex: 1; }
.tip-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: auto; }
.tip-card__tag {
  align-self: flex-start; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--primary); background: var(--primary-tint);
  padding: 0.3em 0.7em; border-radius: 999px;
}

/* ---- lifecycle + conditional badges (tips) ---- */
.lifecycle {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.25em 0.6em;
  border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-muted); background: var(--surface);
  white-space: nowrap;
}
.lifecycle::before {
  content: ""; width: 0.5em; height: 0.5em; border-radius: 50%;
  background: currentColor; flex: 0 0 auto;
}
.lifecycle--plan    { color: #6b7280; }   /* decide            */
.lifecycle--build   { color: var(--primary); } /* while building */
.lifecycle--launch  { color: #0d8a6a; }   /* before go-live    */
.lifecycle--operate { color: var(--accent); }  /* keep doing     */
.lifecycle--review  { color: #7c5cd6; }   /* revisit           */
:root[data-theme="dark"] .lifecycle--plan   { color: #9aa4b6; }
:root[data-theme="dark"] .lifecycle--launch { color: #34d0a6; }
:root[data-theme="dark"] .lifecycle--review { color: #a992f0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lifecycle--plan   { color: #9aa4b6; }
  :root:not([data-theme="light"]) .lifecycle--launch { color: #34d0a6; }
  :root:not([data-theme="light"]) .lifecycle--review { color: #a992f0; }
}
a.lifecycle { text-decoration: none; transition: border-color 0.15s var(--ease); }
a.lifecycle:hover { border-color: currentColor; }
.lifecycle.is-current { color: #fff; background: var(--primary); border-color: var(--primary); }
.lifecycle.is-current::before { background: #fff; }
.lifenav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.page-head__eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-2); }
.tip-cond {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.25em 0.6em; border-radius: 999px;
  color: var(--text-muted); background: var(--surface-2); white-space: nowrap;
}

/* ---- quick wins box (category pages) ---- */
.quickwins {
  max-width: var(--read); margin: 0 0 var(--sp-6); padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 10px;
}
.quickwins__label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-2);
}
.quickwins ul { margin: 0; padding-left: 1.2rem; }
.quickwins li { margin: 0 0 0.4rem; }
.quickwins li:last-child { margin-bottom: 0; }

/* Chapter opener: plain-language definition + "if someone else handles this for you" */
.cat-intro { max-width: var(--read); margin: 0 0 var(--sp-5); font-size: var(--step-1); line-height: 1.55; color: var(--text); }
.cat-intro p { margin: 0; }
.cat-intro--note {
  font-size: var(--step-0); border-left: 3px solid var(--primary);
  padding: var(--sp-3) var(--sp-4); background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.msvo-plug-logo { display: inline-block; margin: 0 0 var(--sp-2); }
.msvo-plug-logo img { height: 30px; width: auto; display: block; }
.msvo-logo--dark { display: none; }
:root[data-theme="dark"] .msvo-logo--light { display: none; }
:root[data-theme="dark"] .msvo-logo--dark { display: block; }
.chapter-plain {
  max-width: var(--read); margin: 0 0 var(--sp-6); padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 10px;
}
.chapter-plain__label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--primary); margin: 0 0 var(--sp-2);
}
.chapter-plain p { margin: 0 0 var(--sp-3); }
.chapter-plain p:last-child { margin-bottom: 0; }

/* ---- "ask your own AI" prompt box (category pages) ---- */
.aiprompt {
  margin-top: var(--sp-8); padding: var(--sp-5);
  border: 1px solid var(--primary); border-radius: 14px; background: var(--primary-tint);
}
.aiprompt__head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.aiprompt__title { font-size: var(--step-1); margin: 0; display: inline-flex; align-items: center; gap: 0.5em; }
.aiprompt__lead { color: var(--text-muted); font-size: var(--step--1); margin: 0 0 var(--sp-3); }
.aiprompt__text {
  width: 100%; box-sizing: border-box; display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem; line-height: 1.55; padding: var(--sp-3);
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); resize: vertical;
}
.aiprompt__text:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.aiprompt__open { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: var(--sp-3) 0 0; }
.aiprompt__open-label { color: var(--text-muted); font-size: var(--step--1); margin-right: 0.2rem; }
.aiprompt__link {
  display: inline-flex; align-items: center; gap: 0.25em;
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  padding: 0.3em 0.7em; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--primary); background: var(--surface);
}
.aiprompt__link:hover { border-color: var(--primary); }
.aiprompt__ico { width: 16px; height: 16px; border-radius: 4px; background: #fff; padding: 2px; box-sizing: content-box; flex: 0 0 auto; }
.aiprompt__ext { color: var(--text-muted); font-size: 0.9em; }
.aiprompt__note { color: var(--text-muted); font-size: 0.8rem; font-style: italic; margin: var(--sp-3) 0 0; }
.aiprompt__copy.is-copied { color: var(--on-primary, #fff); background: var(--primary); border-color: var(--primary); }

/* ---- ebook landing hero ---- */
.ebook-hero { display: flex; gap: var(--sp-5); align-items: center; margin-bottom: var(--sp-6); flex-wrap: wrap; }
.ebook-hero__cover { width: 230px; height: auto; border-radius: 8px; box-shadow: 0 14px 40px rgba(19,23,34,0.22); flex: 0 0 auto; }
.ebook-hero__body { flex: 1; min-width: 240px; }
.ebook-hero__kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.3rem; }
.ebook-hero__title { margin: 0 0 var(--sp-2); }
.ebook-note { color: var(--text-muted); font-size: var(--step--1); margin-top: var(--sp-4); }
.ebook-form { margin: var(--sp-4) 0 var(--sp-2); }
.ebook-form__label { display: block; font-weight: 600; margin-bottom: var(--sp-2); }
.ebook-form__row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.ebook-form__input {
  flex: 1 1 16rem; min-width: 0; padding: 0.7rem 0.9rem; font-size: 1rem;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text);
}
.ebook-form__input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.ebook-form .btn { flex: 0 0 auto; }
.ebook-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Cloudflare Turnstile widget spacing */
.cf-turnstile { margin: var(--sp-3) 0; }
.ebook-form__turnstile { margin-top: var(--sp-3); }

/* ---- ebook teaser (tip/article pages) ---- */
.ebook-teaser {
  display: flex; gap: var(--sp-4); align-items: center;
  max-width: var(--read); margin: var(--sp-6) auto; padding: var(--sp-4) var(--sp-5);
  background: var(--primary-tint); border: 1px solid var(--border);
  border-radius: 14px;
}
.ebook-teaser__cover {
  width: 90px; height: auto; border-radius: 6px; flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(19,23,34,0.18);
}
.ebook-teaser__body { min-width: 0; }
.ebook-teaser__kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.2rem;
}
.ebook-teaser__title { font-size: var(--step-1); margin: 0 0 0.3rem; }
.ebook-teaser__text { color: var(--text-muted); font-size: var(--step--1); margin: 0 0 var(--sp-3); }
.ebook-teaser__cta { text-decoration: none; }
@media (max-width: 560px) {
  .ebook-teaser { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* -------------------------------------------------------------- page heads */
.page-head { padding-block: var(--sp-6) var(--sp-4); border-bottom: 1px solid var(--border); background: var(--surface); }
.page-head--cat, .page-head--center { text-align: center; }
.page-head--center { padding-block: var(--sp-8); border-bottom: 0; }
.page-head__icon {
  display: inline-grid; place-items: center; width: 60px; height: 60px;
  border-radius: 16px; background: var(--primary-tint); color: var(--primary);
  margin-bottom: var(--sp-3);
}
.page-head__title { font-size: var(--step-3); margin: 0 0 var(--sp-3); }
.page-head__lede { color: var(--text-muted); font-size: var(--step-1); max-width: var(--measure); margin: 0; }
.page-head--center .page-head__lede { margin-inline: auto; }
.error-code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; color: var(--primary); opacity: 0.25; margin: 0; line-height: 1; }

/* ------------------------------------------------------------ breadcrumbs */
.breadcrumbs { background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: var(--step--1); }
.breadcrumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); list-style: none; padding-block: var(--sp-3); margin-block: 0; margin-inline: auto; }
.breadcrumbs__item { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); }
.breadcrumbs__item a { color: var(--text-muted); }
.breadcrumbs__item a:hover { color: var(--primary); }
.breadcrumbs__item [aria-current] { color: var(--text); font-weight: 600; }
.breadcrumbs__sep { color: var(--border-strong); display: inline-flex; }

/* --------------------------------------------------------- tips index bits */
.jumpnav { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.jumpnav__link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--step--1); font-weight: 600; color: var(--text);
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface);
}
.jumpnav__link:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }

.tips-group { margin-bottom: var(--sp-7); scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }
.tips-group__title {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  font-size: var(--step-2); margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-3); border-bottom: 2px solid var(--border);
}
.tips-group__icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-tint); color: var(--primary); }
.tips-group__all { font-size: var(--step--1); font-weight: 600; margin-left: auto; }

.empty-state { color: var(--text-muted); font-size: var(--step-1); padding: var(--sp-6) 0; }

/* --------------------------------------------------------- article / prose */
.tip__header { background: var(--surface); border-bottom: 1px solid var(--border); padding-block: var(--sp-7); }
/* Article reading column: one centered width for header, media, body & nav so
   everything aligns (fixes the flush-left column + full-width prev/next mismatch). */
.tip__header-inner.container > *,
.tip__body > .prose,
.tip__body > .tldr,
.tip__body > .faq,
.tip__body > .helpful,
.tip__body > .ebook-teaser {
  max-width: var(--read);
  margin-inline: auto;
}
/* prev/next uses the full container (footer) width so the buttons get more room */
.tip__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.tip__num { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tip__cat { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 600; font-size: var(--step--1); color: var(--primary); background: var(--primary-tint); padding: 0.3em 0.8em; border-radius: 999px; }
.tip__cat:hover { text-decoration: none; }
.tip__title { font-size: var(--step-3); margin: 0 0 var(--sp-3); }
.tip__summary { font-size: var(--step-1); color: var(--text-muted); margin: 0 0 var(--sp-3); }
.tip__updated { font-size: var(--step--1); color: var(--text-muted); margin: 0; }
.tip__body { padding-block: var(--sp-7); }

.prose { max-width: var(--measure); font-size: var(--step-0); }
.prose--narrow { max-width: 64ch; }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { font-size: var(--step-2); margin-top: var(--sp-6); }
.prose h3 { font-size: var(--step-1); margin-top: var(--sp-5); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--sp-2); }
.prose li { padding-left: 0.2em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em; background: var(--surface-2); padding: 0.15em 0.4em; border-radius: 5px;
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-4); overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose blockquote {
  margin: var(--sp-5) 0; padding: var(--sp-2) var(--sp-4);
  border-left: 4px solid var(--primary); color: var(--text-muted);
  background: var(--primary-tint); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose img { border-radius: var(--radius); margin-block: var(--sp-4); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.prose th, .prose td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.prose th { font-weight: 700; }

/* helpful / cta box */
.helpful {
  max-width: var(--measure); margin-top: var(--sp-6);
  padding: var(--sp-5); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.helpful__q { font-weight: 700; margin: 0 0 var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); }
.helpful__q svg { color: var(--success); }
.helpful__cta { margin: 0; color: var(--text-muted); }

/* prev / next */
.prevnext { border-top: 1px solid var(--border); background: var(--surface); }
.prevnext__inner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); padding-block: var(--sp-5); }
.prevnext__link {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.prevnext__link:hover { text-decoration: none; color: var(--text); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.prevnext__next { flex-direction: row; text-align: right; justify-content: flex-end; }
.prevnext__label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.prevnext__title { display: block; font-weight: 600; }

/* --------------------------------------------------------------- contact */
.contact { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--sp-7); align-items: start; }
.form__row { margin-bottom: var(--sp-4); }
.form__label { display: block; font-weight: 700; margin-bottom: var(--sp-2); font-size: var(--step--1); }
.form__input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 0.7em 0.85em;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.form__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.form__input.is-invalid { border-color: var(--danger); }
.form__textarea { resize: vertical; min-height: 8em; }
.form__error { color: var(--danger); font-size: var(--step--1); margin: var(--sp-2) 0 0; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { margin-top: var(--sp-5); }
.form__note { font-size: var(--step--1); color: var(--text-muted); margin-top: var(--sp-3); }

.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4); border-radius: var(--radius-lg);
  border: 1px solid; margin-bottom: var(--sp-5);
}
.alert p { margin: var(--sp-1) 0 0; }
.alert--success { background: var(--success-tint); border-color: var(--success); }
.alert--success svg { color: var(--success); }
.alert--error { background: var(--danger-tint); border-color: var(--danger); }
.alert--error svg { color: var(--danger); }

/* ----------------------------------------------------------------- adslot */
.adslot { max-width: var(--measure); margin: var(--sp-6) 0; }
.adslot--reserved {
  min-height: 120px; display: grid; place-items: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--surface-2) 10px, var(--surface-2) 20px);
}
.adslot__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

/* ----------------------------------------------------------------- footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: var(--sp-7); }
.site-footer__grid {
  display: grid; grid-template-columns: 1.7fr 1.4fr 1.1fr 1.1fr; gap: var(--sp-6);
  padding-block: var(--sp-7);
}
.site-footer__tagline { color: var(--text-muted); font-size: var(--step--1); max-width: 34ch; margin-top: var(--sp-3); }
.site-footer__heading { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 var(--sp-3); }
.site-footer__col ul { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.site-footer__col a { color: var(--text); font-size: var(--step--1); display: inline-flex; align-items: center; gap: var(--sp-2); }
.site-footer__col a:hover { color: var(--primary); }
.site-footer__bottom { border-top: 1px solid var(--border); font-size: var(--step--1); color: var(--text-muted); }
.site-footer__bottom-inner {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); justify-content: space-between; align-items: center;
  padding-block: var(--sp-4) var(--sp-6);
}
.site-footer__bottom p { margin: 0; }
.site-footer__copy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer__copy a:hover { color: var(--primary); }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.site-footer__legal a { color: var(--text-muted); }
.site-footer__legal a:hover { color: var(--primary); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__mark { display: none; }
  .contact { grid-template-columns: 1fr; gap: var(--sp-5); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
  }
  .nav__list { flex-direction: column; align-items: stretch; padding: var(--sp-3); gap: var(--sp-1); }
  .nav__link { padding: var(--sp-3); font-size: var(--step-0); }
  .nav__link.is-current::after { display: none; }
  body.nav-open .nav { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .prevnext__inner { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .site-footer__bottom-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------- byline + author page */
.byline { font-size: var(--step--1); color: var(--text-muted); margin: 0; display: flex; flex-wrap: wrap; gap: 0.5em; align-items: center; }
.byline__author { color: var(--primary); font-weight: 600; }
.byline__sep { color: var(--border-strong); }
.site-footer__muted { color: var(--text-muted); }

.author-head { border-bottom: 1px solid var(--border); padding-block: var(--sp-8); background: var(--surface); }
.author-head__inner { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-6); align-items: start; max-width: var(--measure); }
.author-avatar {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 1.9rem;
  letter-spacing: -0.02em; box-shadow: var(--shadow-md); flex: 0 0 auto;
}
.author-avatar--photo { object-fit: cover; background: none; box-shadow: var(--shadow-md); }
.author-name { font-size: var(--step-3); margin: 0.1em 0 var(--sp-4); }
.author-bio { max-width: none; }
.author-bio p { margin: 0 0 var(--sp-3); }
.author-specialties { list-style: none; padding: 0; margin: var(--sp-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.author-specialties li {
  font-size: var(--step--1); color: var(--text-muted); background: var(--surface-2);
  border: 1px solid var(--border); padding: 0.3em 0.8em; border-radius: 999px;
}
.author-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

.author-list { list-style: none; padding: 0; margin: 0; }
.author-list li { border-bottom: 1px solid var(--border); }
.author-list a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; }
.author-list a:hover { text-decoration: none; }
.author-list a:hover .author-list__title { color: var(--primary); }
.author-list__title { font-weight: 500; }
.author-list__date { font-size: var(--step--1); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.author-list--cols { columns: 2; column-gap: var(--sp-7); }
.author-list--cols li { break-inside: avoid; }
.author-list--cols a { justify-content: flex-start; }
@media (max-width: 640px) {
  .author-head__inner { grid-template-columns: 1fr; }
  .author-list--cols { columns: 1; }
}

/* CTA row (skill download page, etc.) */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0; }

/* ---------------------------------------------------- print citation + watermark note */
/* The per-article source line is print-only (hidden on screen; the on-copy text
   watermark is handled in site.js and renders nothing here). */
.doc-cite { display: none; }

/* --------------------------------------------------------------- print / PDF */
@media print {
  /* Force a clean light theme regardless of the on-screen toggle. */
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --bg: #fff; --surface: #fff; --surface-2: #f4f4f4;
    --text: #111; --text-muted: #444; --border: #ccc; --border-strong: #bbb;
    --primary: #14458c; --primary-hover: #14458c; --primary-tint: #eef2f9;
    --accent: #a3341f; --on-primary: #fff;
    --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  }
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #111 !important; }
  body { font-size: 11.5pt; line-height: 1.5; }

  /* Drop chrome, controls, ads, and non-content blocks. */
  .site-header, .site-footer, .breadcrumbs, .prevnext, .helpful, .adslot,
  .section__cta, .cta-row, .skip-link, .lang, .icon-btn, .theme-toggle,
  .nav, .nav-toggle, .illus, .page-head figure { display: none !important; }

  main { flex: none; }
  .container, .tip__body, .tip__header, .tip__header-inner,
  .prose, .tldr, .faq, .page-head {
    max-width: none !important; margin: 0 !important;
    padding-inline: 0 !important; border: 0 !important; background: #fff !important;
  }
  .tip__header, .tip__body { padding-block: 0 !important; }

  a { color: #111 !important; text-decoration: underline; }
  /* Reveal destination of content links in the printout. */
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")"; font-size: 0.85em; color: #555; word-break: break-all;
  }

  .tip__num { color: #14458c !important; }
  .tip__cat { background: none !important; border: 1px solid #ccc; color: #111 !important; }
  .tldr { background: #f4f4f4 !important; border: 1px solid #ccc; border-left: 3px solid #888; }
  .tldr__label { color: #14458c !important; }
  .prose pre, .prose code { background: #f6f6f6 !important; color: #111 !important; border: 1px solid #ddd; }
  .prose pre { white-space: pre-wrap; word-wrap: break-word; }

  h1, h2, h3 { break-after: avoid; }
  .faq__item, .prose pre, .prose blockquote, figure, table, .tldr { break-inside: avoid; }

  /* Print-only source citation. */
  .doc-cite {
    display: block; margin-top: 2em; padding-top: 0.8em;
    border-top: 1px solid #ccc; font-size: 9.5pt; color: #333;
  }
}

/* ------------------------------------------------------------------- search */
.topsearch {
  display: inline-flex; align-items: center; gap: 0.5em; height: 40px; padding: 0 0.7rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--text-muted); font-size: var(--step--1); cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.topsearch:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.topsearch__ic { color: var(--text-muted); }
kbd, .topsearch__kbd, .cmdk__esc {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.72em;
  border: 1px solid var(--border); border-radius: 5px; padding: 0.1em 0.42em;
  color: var(--text-muted); background: var(--surface-2); line-height: 1.4;
}
.topsearch__cmd { font-size: 1.05em; }

/* /search/ page form + results */
.searchform {
  display: flex; align-items: center; gap: 0.5rem; max-width: var(--read);
  margin: var(--sp-4) auto 0; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 0.5rem 0.5rem 0.5rem 1rem; box-shadow: var(--shadow-sm);
}
.searchform:focus-within { border-color: var(--primary); }
.searchform__ic { color: var(--text-muted); display: inline-flex; }
.searchform__input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: var(--step-1); color: var(--text); }
.searchform__btn { flex: 0 0 auto; }
.s-count, .s-hint { max-width: var(--read); margin-inline: auto; color: var(--text-muted); }
.s-count { font-size: var(--step--1); margin-bottom: var(--sp-4); }
.s-list { max-width: var(--read); margin-inline: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.s-result {
  display: block; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease);
}
.s-result:hover, .s-result.is-active { border-color: var(--primary); background: var(--primary-tint); text-decoration: none; }
.s-result__meta { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.s-result__type { font-weight: 700; color: var(--primary); }
.s-result__title { display: block; font-weight: 600; color: var(--text); margin-top: 2px; }
.s-result__sum { display: block; color: var(--text-muted); font-size: var(--step--1); margin-top: 2px; }

/* ⌘K command palette overlay */
.cmdk { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; }
.cmdk[hidden] { display: none; }
.cmdk__backdrop { position: absolute; inset: 0; background: rgba(9, 13, 20, 0.45); backdrop-filter: blur(2px); }
.cmdk__panel {
  position: relative; margin-top: 12vh; width: min(92vw, 620px); max-height: 72vh;
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.cmdk__bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.cmdk__ic { color: var(--text-muted); flex: 0 0 auto; }
.cmdk__input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: var(--step-1); color: var(--text); }
.cmdk__results { overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem; display: flex; flex-direction: column; gap: 2px; }
.cmdk__results:empty { display: none; }
.cmdk__results .s-result { border: 0; border-radius: 10px; background: none; padding: var(--sp-3); }
.cmdk__results .s-result.is-active, .cmdk__results .s-result:hover { background: var(--primary-tint); }
.cmdk__count { margin: 0; padding: 0.6rem 1rem; font-size: var(--step--1); color: var(--text-muted); }
.cmdk__results:not(:empty) + .cmdk__count { border-top: 1px solid var(--border); }
body.cmdk-open { overflow: hidden; }

/* Collapse the search field to its icon well before the nav gets tight —
   the longer FR/NL menu labels need the width (they must never wrap). */
@media (max-width: 1080px) {
  .topsearch__label, .topsearch__kbd { display: none; }
  .topsearch { padding: 0; width: 40px; justify-content: center; }
}

/* --- Glossary tooltips (dashed underline, hover/focus bubble) -------------- */
:root {
  --gloss-bg: #24303c;
  --gloss-fg: #f5f7fa;
}
:root[data-theme="dark"] {
  --gloss-bg: #e8ecf1;
  --gloss-fg: #17202a;
}
.gloss,
.prose a.gloss {
  color: inherit;
  text-decoration: underline dashed var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: help;
  position: relative;
}
.gloss:hover,
.gloss:focus-visible,
.prose a.gloss:hover,
.prose a.gloss:focus-visible {
  color: var(--primary);
  text-decoration-style: solid;
}
.gloss::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(320px, 82vw);
  background: var(--gloss-bg);
  color: var(--gloss-fg);
  padding: .55rem .7rem;
  border-radius: 8px;
  font-size: .8125rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  pointer-events: none;
  z-index: 60;
}
.gloss:hover::after,
.gloss:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .gloss::after { transition: none; }
}
/* Glossary entry anchors: land below the sticky header, flash the entry */
[id^="g-"] { scroll-margin-top: calc(var(--header-h, 64px) + 14px); }
[id^="g-"]:target {
  background: var(--accent-tint);
  border-radius: 6px;
  box-shadow: 0 0 0 6px var(--accent-tint);
}

/* --- Draft banner (review-gated pages, e.g. German legal texts) ------------ */
.draft-note {
  margin: 0 0 var(--sp-5);
  padding: .7rem 1rem;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: var(--accent-tint);
  font-size: .9375rem;
}
