/* Precedentia — editorial design system (ported from claude.ai/design handoff) */

:root {
  --bg: #0b0b0d;
  --bg-elev: #121214;
  --bg-card: #141417;
  --surface: #18181c;
  --ink: #e8e6df;
  --ink-dim: #a8a6a0;
  /* Contrast-audited against --bg / --bg-card / --bg-elev. --ink-mute carries
     labels, dates and footer copy — it must clear 4.5:1 on the darkest of the
     three (was #6b6b6b = 3.45:1 on cards, an AA failure on ~250 elements).
     #828282 cleared bg and cards but landed at 4.47 on the brand-tinted Pro
     column of the pricing table — the one surface lighter than --bg-card. */
  --ink-mute: #868686;
  --ink-faint: #6a6a70;
  --border: #1f1f22;
  --border-strong: #2a2a2e;
  --brand: #09E1AC;
  /* --brand is a fill; --brand-ink is the same brand used as text. The two
     diverge in the light theme, where the fill colour is far too light to
     read as type. */
  --brand-ink: var(--brand);
  /* Referenced by nine rules (checkout consent links, legal TOC, search) but
     never defined until now — those runs silently inherited their parent
     colour and stopped looking like links. */
  --brand-light: #5cf0cd;
  --brand-dim: #06a67f;
  --brand-glow: rgba(9, 225, 172, 0.14);
  /* Sets the 48px hero counter; #4f4bc9 measured 2.84:1 on --bg-elev, just
     under the 3:1 large-text floor. */
  --indigo: #5a56d4;
  --indigo-deep: #1c1899;
  --gold: #c9a24f;
  --rose: #c9645f;
  --warn: #f2c94c;
  --danger: #ef6c6c;
  /* Fraunces covers Latin; Vollkorn is loaded only for the Cyrillic range
     (see fonts.css) so a Russian heading keeps the same voice as a
     Romanian one instead of falling back to a system serif. */
  --font-serif: "Fraunces", "Vollkorn", Georgia, "Times New Roman", serif;
  --page-max: 1280px;
  --page-max-wide: 1440px;
  --page-pad: 32px;
}

html[data-theme="light"],
:root[data-theme="light"] {
  --bg: #f5f2ea;
  --bg-elev: #efeadf;
  --bg-card: #ffffff;
  --surface: #ede8dc;
  --ink: #121214;
  --ink-dim: #44444a;
  /* Audited against the four light surfaces (#f5f2ea / #ffffff / #ede8dc /
     #efeadf). Old values: --ink-mute 4.09:1 on --surface, --ink-faint 2.03:1. */
  --ink-mute: #636368;
  --ink-faint: #6a6759;
  --border: #dcd6c8;
  --border-strong: #c4bdac;
  --brand: #06a67f;
  /* #06a67f is 2.77:1 on parchment — fine as a button fill, unreadable as
     type. Every brand-coloured text run uses --brand-ink instead. */
  --brand-ink: #0a7357;
  /* "Light" is meaningless on parchment — the intent is accent text. */
  --brand-light: #0a7357;
  --brand-dim: #049075;
  --brand-glow: rgba(6, 166, 127, 0.1);
  /* #f2c94c / #ef6c6c are 1.42:1 and 2.67:1 on parchment. */
  --warn: #8a6108;
  --danger: #a8302b;
  --indigo: #1c1899;
  --indigo-deep: #0e0b6e;
  --rose: #a84a45;
}

/* The nav wordmark SVG uses Tailwind's .text-brand-light (near-white
   green) — unreadable on the light theme's parchment background. */
html[data-theme="light"] .pp-logo .text-brand-light,
:root[data-theme="light"] .pp-logo .text-brand-light {
  color: #0b3f33;
}

/* ============================================================
   Legacy Tailwind bridge

   Eleven templates predate the token system and still style themselves with
   the fixed dark palette from tailwind.config.js (zinc-* text, surface-*
   fills). Those values are theme-blind: on the light theme's parchment,
   .text-zinc-100 measures 1.02:1 and .text-zinc-300 measures 1.48:1.

   Binding the classes to the ink/bg scale makes that zone follow the theme
   without rewriting its markup. design.css loads after tailwind.css, so equal
   specificity resolves here. This is a bridge, not the destination — the
   templates still need porting to pp-* components.
   Affected: account/{login,signup,logout}, accounts/{profile,saved,history},
   payments/{success,fail,error}, 404, cases/_metadata_dl.
   ============================================================ */
.text-zinc-100, .text-zinc-200 { color: var(--ink); }
.text-zinc-300, .text-zinc-400 { color: var(--ink-dim); }
.text-zinc-500, .text-zinc-600, .text-zinc-700 { color: var(--ink-mute); }
.placeholder-zinc-600::placeholder { color: var(--ink-mute); }

/* Placeholders were the one text colour that ignored the theme: the browser
   default computed rgb(156,163,175) in both, which passes on near-black and
   measures 2.27:1 on parchment. opacity:1 because Firefox dims placeholders
   by default on top of the colour. */
input::placeholder,
textarea::placeholder { color: var(--ink-mute); opacity: 1; }

/* .text-brand is body-copy green (links, inline icons); the wordmark keeps
   its own override above. */
.text-brand { color: var(--brand-ink); }

.bg-surface-100 { background-color: var(--bg-card); }
.bg-surface-200 { background-color: var(--bg-elev); }
.bg-surface-300\/50 { background-color: var(--border); }

.border-surface-300,
.border-surface-300\/30,
.border-surface-300\/50,
.border-surface-300\/60 { border-color: var(--border); }

/* .text-brand-light is a near-white green (#E0FFE9) — legible on the dark
   theme, invisible on parchment. The wordmark rule above is more specific and
   keeps its own value. */
html[data-theme="light"] .text-brand-light,
:root[data-theme="light"] .text-brand-light { color: var(--brand-ink); }

/* The first version of this bridge covered zinc/surface/brand and stopped
   there, so the retuned --danger and --warn never reached the templates they
   were written for: the login error measured 2.47:1 on parchment — the lowest
   contrast in the product, on the one line that explains what went wrong. */
.text-red-400, .text-red-500 { color: var(--danger); }
.text-yellow-500, .text-yellow-500\/70 { color: var(--warn); }
.hover\:text-red-400:hover { color: var(--danger); }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/* GT Sectra, Tiempos and Source Serif 4 were in this stack but are not loaded
   anywhere in the project — dead entries the browser stepped straight over. */
.serif {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-feature-settings: "ss02", "ss03";
}

.sans {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

.pp-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.pp-em {
  font-style: italic;
  color: var(--brand-ink);
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
input, textarea, select, button { font-family: inherit; color: inherit; }
/* Keyboard focus. The previous pair killed `outline` on every control and
   routed the replacement through `.focusable`, a class no template ever
   applied — so nothing focusable showed focus except links, which fell back
   to Chrome's off-brand blue ring. `:focus-visible` keeps a mouse click clean
   while giving the keyboard a real target. */
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Reduced motion. Deliberately not a blanket `animation: none` — that also
   kills loading indicators and state feedback, which a visitor who dislikes
   motion still needs. Entrances are decoration, so they resolve to their final
   state; feedback keeps animating. The landing's WebGL hero is stopped in JS,
   where CSS cannot reach it. */
@media (prefers-reduced-motion: reduce) {
  .result-card,
  .legal-hero,
  .feature-reveal,
  [style*="fadeInUp"],
  [style*="legalIn"] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .pp-lift:hover { transform: none; }
}

/* Loading skeleton for the results column. A gentle opacity pulse rather than a
   travelling sheen — this appears on every search, and a sweep that crosses the
   viewport several times a minute is the kind of motion that stops being
   informative and starts being noise. */
.pp-skeleton__bar {
  background: var(--surface);
  animation: pp-skeleton 1.4s ease-in-out infinite;
}
@keyframes pp-skeleton {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-skeleton__bar { animation: none; opacity: 0.75; }
}

/* Skip link: visually removed until focused, then anchored top-left. */
.pp-skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px;
  background: var(--brand); color: #062019;
  font-size: 14px; font-weight: 500;
  transform: translateY(-200%);
}
.pp-skip-link:focus { transform: translateY(0); }

.hairline { background: var(--border); height: 1px; width: 100%; }

.pp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 2px;
  font-family: "IBM Plex Sans"; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s ease;
  letter-spacing: 0.01em; white-space: nowrap;
  text-decoration: none;
}

.pp-btn-primary { background: var(--brand); color: #062019; }
.pp-btn-primary:hover { background: #0dffc4; }
.pp-btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.pp-btn-ghost:hover { border-color: var(--ink-mute); background: var(--bg-elev); }
.pp-btn-dark { background: var(--ink); color: var(--bg); }
.pp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-family: "IBM Plex Mono"; font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--border-strong); color: var(--ink-dim);
  background: transparent;
}

.pp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 2px;
  font-family: "IBM Plex Sans"; font-size: 12px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--ink-dim);
}

.pp-dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }

.pp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.pp-divider-v { width: 1px; background: var(--border); align-self: stretch; }

.pp-rays {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
}

mark.pp-hl {
  background: var(--brand-glow);
  color: var(--brand);
  padding: 0 3px;
  border-radius: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

::selection { background: var(--brand); color: #062019; }

.pp-source-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px; border-radius: 2px;
  border: 1px solid var(--border-strong);
  font-family: "IBM Plex Mono"; font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim);
  background: transparent;
}
.pp-source-badge.md { height: 24px; font-size: 11.5px; }
.pp-source-badge__dot { width: 6px; height: 6px; display: inline-block; }
.pp-source-badge--ctedo .pp-source-badge__dot { background: var(--brand); }
.pp-source-badge--csj   .pp-source-badge__dot { background: var(--indigo); }
.pp-source-badge--ccrm  .pp-source-badge__dot { background: var(--gold); }
.pp-source-badge--echr .pp-source-badge__dot  { background: var(--brand); }
.pp-source-badge--cc   .pp-source-badge__dot  { background: var(--gold); }
.pp-source-badge--iccj .pp-source-badge__dot  { background: var(--rose); }

@keyframes pp-brand-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

.pp-lift { transition: transform 0.2s ease, border-color 0.2s ease; }
.pp-lift:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.pp-nav {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
}
.pp-nav__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.pp-nav__left,
.pp-nav__right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.pp-nav__links { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
.pp-nav__link {
  font-size: 13.5px;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.pp-nav__link:hover { color: var(--ink); }
.pp-nav__link.is-active { color: var(--ink); border-bottom-color: var(--brand); }

.pp-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.pp-logo__word {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.pp-footer { border-top: 1px solid var(--border); background: var(--bg); }
.pp-footer__inner { max-width: var(--page-max); margin: 0 auto; padding: 56px var(--page-pad) 40px; }
.pp-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
.pp-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pp-footer__col li { font-size: 13px; color: var(--ink-dim); cursor: pointer; }
.pp-footer__col li a:hover { color: var(--ink); }
.pp-footer__bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid var(--border);
}

.pp-page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-pad); }
.pp-page--wide { max-width: var(--page-max-wide); }

.pp-section { border-bottom: 1px solid var(--border); position: relative; }
.pp-section--elev { background: var(--bg-elev); }
.pp-section--hero { overflow: hidden; }
.pp-section__inner { max-width: var(--page-max); margin: 0 auto; padding: 96px var(--page-pad); position: relative; }
.pp-section__inner--tight { padding: 56px var(--page-pad); }

.pp-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -20%, var(--brand-glow), transparent 55%);
  pointer-events: none;
}

.pp-serif-display {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
}

.pp-field {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
}
.pp-field input, .pp-field textarea {
  flex: 1; background: transparent; border: none;
  color: var(--ink); font-size: 14px;
}
.pp-field input:focus:not(:focus-visible),
.pp-field textarea:focus:not(:focus-visible) { outline: none; }

.pp-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.pp-seg__btn {
  padding: 6px 12px; font-size: 11.5px; border: none; cursor: pointer;
  background: transparent; color: var(--ink-dim);
  font-family: "IBM Plex Mono"; letter-spacing: 0.08em; text-transform: uppercase;
}
.pp-seg__btn.is-active { background: var(--brand); color: #062019; }
.pp-seg__btn.is-active-dark { background: var(--ink); color: var(--bg); }

.pp-plan {
  background: transparent;
  border: 1px solid var(--border);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pp-plan.is-recommended {
  background: var(--bg-card);
  border-left-color: var(--brand-dim);
  border-right-color: var(--brand-dim);
  transform: translateY(-20px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}
.pp-plan.is-recommended::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px;
  background: var(--brand);
}
.pp-plan__badge {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #062019;
  padding: 4px 14px; font-size: 10.5px;
  font-family: "IBM Plex Mono"; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 500;
  white-space: nowrap; z-index: 2;
  box-shadow: 0 6px 20px rgba(9, 225, 172, 0.25);
}
.pp-plan__price-row { display: flex; align-items: baseline; gap: 8px; }
.pp-plan__price {
  font-family: var(--font-serif);
  font-size: 56px; font-weight: 400; line-height: 1;
  letter-spacing: -0.03em;
}
.pp-plan__suffix { font-family: "IBM Plex Mono"; font-size: 12px; color: var(--ink-mute); }
.pp-plan__feat {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; font-size: 13px;
}
/* "Not included in this plan" is information a buyer has to read, so it sits
   on --ink-mute, not the decorative --ink-faint tier. */
.pp-plan__feat--off { color: var(--ink-mute); }
.pp-plan__feat--muted { color: var(--ink-dim); }

.pp-table { border: 1px solid var(--border); background: var(--bg-card); }
.pp-table__head,
.pp-table__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
.pp-table__head { background: var(--surface); border-bottom: 1px solid var(--border); }
.pp-table__group { padding: 14px 20px; background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.pp-table__cell { padding: 14px 20px; font-size: 13px; border-left: 1px solid var(--border); }
.pp-table__cell:first-child { border-left: none; }
.pp-table__cell--center { text-align: center; }
.pp-table__cell--pro { background: color-mix(in oklab, var(--brand-glow) 30%, transparent); }

.pp-faq__row { border-bottom: 1px solid var(--border); }
.pp-faq__btn {
  width: 100%; padding: 18px 0; background: transparent; border: none;
  color: var(--ink); cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 15.5px;
}
.pp-faq__btn span:first-child { font-weight: 500; }
.pp-faq__ans { padding-bottom: 20px; font-size: 14px; color: var(--ink-dim); line-height: 1.6; max-width: 620px; display: none; }
.pp-faq__row.is-open .pp-faq__ans { display: block; }
.pp-faq__row.is-open .pp-faq__plus { display: none; }
.pp-faq__row:not(.is-open) .pp-faq__minus { display: none; }

.pp-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 18px 22px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}
.pp-result:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.pp-result__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pp-result__title {
  font-family: var(--font-serif); font-size: 20px; font-weight: 500;
  letter-spacing: -0.01em; margin: 4px 0 10px;
}
.pp-result__snip { font-size: 13.5px; color: var(--ink-dim); line-height: 1.55; margin: 0 0 14px; }
.pp-result__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pp-result__sep { width: 1px; height: 12px; background: var(--border); }

.pp-timeline { position: relative; padding-left: 18px; }
.pp-timeline::before {
  content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--border-strong);
}
.pp-timeline__item { position: relative; margin-bottom: 16px; }
.pp-timeline__item:last-child { margin-bottom: 0; }
.pp-timeline__dot {
  position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
}
.pp-timeline__item.is-active .pp-timeline__dot { background: var(--brand); border-color: var(--brand); }

.pp-cluster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Docked to the right rail rather than centred over the column: centred, it
   sat permanently on top of the judgment text — captured mid-sentence. The
   sidebar's own scroll box is shortened by the bar's height (inline
   max-height in detail.html) so its cards never scroll underneath it. */
.pp-sticky-actions {
  position: fixed; bottom: 16px; right: 24px; z-index: 30;
  background: color-mix(in oklab, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  padding: 8px 10px; display: flex; align-items: center; gap: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* ---- Case body ----------------------------------------------------------
   The judgment is the page: 95% of reading time happens here. It used to run
   the full 1018px column at ~165 characters a line, as a single <p> holding
   49,294 characters. 68ch is the measure the guide pages already use.
   The hanging-number layout for .legal-para lives in base.html; these rules
   only add rhythm and the deep-link target state. */
/* Tabs, rule and text share one width so the measure reads as a decision
   rather than a narrow paragraph stranded under a full-width rule. */
.pp-case-reader { max-width: 68ch; }
.pp-case-body { max-width: 68ch; }
.pp-case-body > p,
.pp-case-body > .legal-para { margin: 0 0 1.15em; }

/* A paragraph reached by its #p42 anchor announces itself, then stays marked
   so the reader can find their place again after scrolling. */
.pp-case-body .legal-para:target .legal-para-num { color: var(--brand-ink); }
.pp-case-body .legal-para:target {
  border-left: 2px solid var(--brand);
  margin-left: -14px; padding-left: 12px;
}
.pp-action-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: transparent; color: var(--ink);
  border: none; cursor: pointer; font-size: 12.5px;
  transition: background 0.15s;
}
.pp-action-btn:hover { background: var(--bg-elev); }
.pp-action-btn.is-active { background: var(--brand); color: #062019; }
.pp-action-btn--mute { color: var(--ink-mute); }

@media (max-width: 960px) {
  .pp-nav__links { display: none; }
  .pp-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .pp-section__inner { padding: 64px 20px; }
  .pp-footer__grid { grid-template-columns: 1fr; }
  .pp-cluster { grid-template-columns: 1fr; }
}

/* ==================== Mobile adaptation ==================== */
/* Any single overflowing element used to widen the layout viewport to
   ~600px on phones, zooming the whole site out and breaking every
   Tailwind sm:/md: utility. clip is the safety net; the real per-grid
   fixes are below. */
html, body { overflow-x: clip; }

/* Grid cells shrink below their min-content instead of widening the page. */
.pp-stats-grid > div, .pp-feature-grid > *, .pp-recent-grid > *,
.pp-steps-grid > *, .pp-how-grid > *, .pp-filter-grid > * { min-width: 0; }

/* design.css loads after tailwind.css, so `.pp-btn { display:inline-flex }`
   silently beats Tailwind's `.hidden` at equal specificity — the nav's
   "hidden sm:inline-flex" buttons never actually hid on phones. Restore
   the responsive-hide semantics for buttons that opt in. */
.pp-btn.hidden { display: none; }
@media (min-width: 640px) {
  .pp-btn.hidden.sm\:inline-flex { display: inline-flex; }
}

/* Theme toggle: sun shown in dark mode (tap → light), moon in light. */
.pp-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: 2px; color: var(--ink-dim); cursor: pointer;
}
.pp-theme-toggle:hover { color: var(--ink); border-color: var(--border-strong); }
.pp-theme-toggle__moon { display: none; }
html[data-theme="light"] .pp-theme-toggle__sun,
:root[data-theme="light"] .pp-theme-toggle__sun { display: none; }
html[data-theme="light"] .pp-theme-toggle__moon,
:root[data-theme="light"] .pp-theme-toggle__moon { display: block; }

/* Burger — the only nav affordance between 0 and 960px, where
   .pp-nav__links is hidden. */
.pp-nav__burger {
  display: none; background: transparent; border: none;
  color: var(--ink-dim); padding: 6px; cursor: pointer;
}
@media (max-width: 960px) {
  .pp-nav__burger { display: inline-flex; }
}
@media (min-width: 961px) {
  #mobile-menu { display: none; }
}

@media (max-width: 960px) {
  /* Landing grids: 3-4 fixed tracks don't fit — step down to 2. */
  .pp-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 28px; }
  .pp-stats-grid > div { border-left: none !important; }
  .pp-feature-grid { grid-template-columns: 1fr !important; }
  .pp-recent-grid, .pp-steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .pp-how-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  /* Four source cards do not fit a tablet; the last card in each row keeps a
     border only because the source order is fixed. */
  .pp-about-sources { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .pp-about-sources > div { border-right: none !important; border-bottom: 1px solid var(--border); }

  /* Pricing plans: the inline `1fr 1.1fr 1fr` ends 240px past a 390px
     viewport, and `overflow-x: clip` above then swallows the Max card —
     unreachable, not merely cramped. Stack, and cap the column so a tablet
     doesn't get one 900px-wide card. !important is required: the tracks are
     an inline style on the element. */
  .pp-plans-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px !important;          /* clears the -16px "Recomandat" badge */
    max-width: 420px;
    margin: 0 auto;
  }
  /* Lift and shadow read as depth only against neighbours in a row. */
  .pp-plan.is-recommended { transform: none; box-shadow: none; }

  .pp-faq-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
}

@media (max-width: 720px) {
  /* Uniform gutter: inline styles use 32px page padding everywhere. */
  .pp-page { padding-left: 20px !important; padding-right: 20px !important; }

  .pp-recent-grid, .pp-steps-grid, .pp-filter-grid { grid-template-columns: 1fr !important; }
  .pp-about-sources { grid-template-columns: 1fr !important; }
  .pp-steps-grid > div { border-left: none !important; }
  .pp-stats-grid > div { padding: 8px 12px !important; }
  .pp-stats-grid .serif { font-size: 36px !important; }

  /* Hero rotating counter: fixed 340px width + 48px numerals overflow. */
  #rotating-stats { width: 100% !important; }
  #rotating-stats .rs-item { gap: 8px !important; }
  #rotating-stats .rs-item > span:first-child { font-size: 32px !important; }

  /* Case page: 54px serif title reads as four screens of text on a phone. */
  .pp-detail-grid h1 { font-size: clamp(26px, 7.5vw, 38px) !important; line-height: 1.12 !important; }

  /* Pricing comparison: 2fr+1fr+1fr+1fr inside ~350px leaves ~30px of text
     per plan column ("CtEDO · CSJ · CC" one letter per line). Scroll the
     table at a legible width instead; the clipped 4th column is the hint. */
  .pp-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 520px puts the cut mid-way through the tinted Pro column instead of flush
     against Free's edge — a clean edge reads as "table ends here". */
  .pp-table__head, .pp-table__row, .pp-table__group { min-width: 520px; }
  .pp-table__cell { padding: 12px 14px; font-size: 12.5px; }

  /* FAQ wrapper sets its own 32px padding — it is not a .pp-page. */
  .pp-faq-wrap { padding: 56px 20px !important; }

  /* Search bar: let the input row wrap — the mode toggle drops to its own
     line inside the field instead of pushing the Filters button offscreen. */
  .pp-search-bar form > div:first-child { flex-wrap: wrap; }
  .pp-search-bar .pp-field { flex: 1 1 100%; flex-wrap: wrap; }
  .pp-search-bar .pp-field input { flex: 1 1 160px; min-width: 0; }

  /* Results first, filter rail second, AI panel last. */
  #results { order: 1; }
  .pp-filters-aside { order: 2; }
  .pp-ai-aside { order: 3; position: static !important; height: auto !important; min-height: 320px; }

  /* Comfortable tap targets for chips and segmented buttons. */
  .pp-chip { padding: 8px 12px; }
  .pp-seg__btn { padding: 9px 14px; }

  /* The 85vh flex-centered hero leaves a screen of dead space under the
     rotating counter on phones — let content set the height instead. */
  .min-h-\[85vh\] { min-height: 0 !important; }
  .pp-nav__inner { padding: 12px 20px; gap: 12px; }
  .pp-nav__left, .pp-nav__right { gap: 12px; }
}

/* ── Case-page conversion band ─────────────────────────────────────────────
   Shown only to anonymous readers, at the end of the case they arrived on. */
.pp-case-cta {
  max-width: 1100px;
  margin: 64px auto 0;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}
.pp-case-cta > div:first-child { flex: 1; min-width: 260px; }
.pp-case-cta__title {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 10px 0 8px;
}
.pp-case-cta__body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  margin: 0;
  max-width: 60ch;
}
.pp-case-cta__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.pp-case-cta__link {
  font-size: 13px;
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 2px;
}
.pp-case-cta__link:hover { color: var(--ink); }

@media (max-width: 720px) {
  .pp-case-cta { margin: 48px 16px 0; padding: 24px 20px; gap: 22px; }
  .pp-case-cta__title { font-size: 21px; }
  .pp-case-cta__actions { width: 100%; }
  .pp-case-cta__actions .pp-btn { flex: 1; text-align: center; }
}

/* Pause control for the rotating hero figures. Deliberately quiet — it is an
   accessibility affordance, not a feature. */
.pp-rs-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 4px;
  border: 0;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .15s, color .15s;
}
.pp-rs-toggle:hover, .pp-rs-toggle:focus-visible { opacity: 1; color: var(--ink-mute); }
.pp-rs-toggle__play { display: none; }
.pp-rs-toggle.is-paused .pp-rs-toggle__pause { display: none; }
.pp-rs-toggle.is-paused .pp-rs-toggle__play { display: block; }
@media (prefers-reduced-motion: reduce) { .pp-rs-toggle { transition: none } }

/* Ordering control in the search bar. Sits at the weight of a caption, not a
   form field — it is a refinement, not a required input. */
.pp-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}
.pp-sort__label {
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}
.pp-sort__select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  color: var(--ink-dim);
  font: inherit;
  font-size: 11.5px;
  padding: 4px 18px 4px 2px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 7px center, right 3px center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.pp-sort__select:hover { color: var(--ink); }

/* Content that must exist for screen readers and search engines but would be
   redundant on screen (e.g. the search page's h1 — the sticky search field is
   the visible heading). Not display:none: that removes it from the a11y tree. */
.pp-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* "Pe scurt" — conclusion clauses. A HUDOC conclusion is a list of separate
   findings, not a sentence; setting it as one runs them together. */
.pp-facts__list { margin: 0; padding: 0; list-style: none; }
.pp-facts__list li { position: relative; padding-left: 13px; }
.pp-facts__list li + li { margin-top: 3px; }
.pp-facts__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 1px;
  background: var(--ink-faint);
}
.pp-facts__note {
  display: inline-block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* Touch targets. The links below sit at caption size, so their box has to be
   grown deliberately — an 11px label is a 14px-tall tap target otherwise.
   Padding would push the rows apart, so the extra area is claimed with a
   pseudo-element that overlays the gap instead. */
.pp-lang-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
}
.pp-lang-btn::after {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}

.pp-footer__col li a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  position: relative;
}
.pp-footer__col li a::after {
  content: "";
  position: absolute;
  inset: -10px -8px;
}
.pp-footer__col ul { gap: 4px; }

/* Inline icon set (see apps/pages/templatetags/icons.py). Baseline-aligned so
   an icon inside a sentence doesn't sit above the text. */
.pp-icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.pp-icon--lead { margin-right: 6px; }
.pp-icon--block { display: block; margin: 0 auto 12px; vertical-align: baseline; }
.pp-icon--brand { color: var(--brand); }
.pp-icon--mute { color: var(--ink-mute); }
.pp-icon--faint { color: var(--ink-faint); }
.pp-icon--warn { color: var(--warn); }

/* ── Account & payment zone ────────────────────────────────────────────────
   These pages were the last ones still written in the pre-redesign utility
   classes (rounded-xl, zinc-*, surface-*). A visitor who pays lands here, so
   it was the one place where the product visibly changed identity mid-flow.
   Same tokens, same square corners, same type scale as the rest. */
.pp-acct {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.pp-acct__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.pp-acct__tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.pp-acct__tab:hover { color: var(--ink); }
.pp-acct__tab.is-active { color: var(--ink); border-bottom-color: var(--brand); }

.pp-acct__title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 28px;
}

.pp-acct__card {
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  padding: 24px;
}
.pp-acct__section + .pp-acct__section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Definition rows: label left, value right, aligned on a common baseline. */
.pp-dl { margin: 0; display: grid; gap: 9px; }
.pp-dl__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.pp-dl__row dt { font-size: 13px; color: var(--ink-mute); }
.pp-dl__row dd { margin: 0; font-size: 13px; color: var(--ink); text-align: right; }
.pp-dl__row dd.is-num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.pp-dl__row dd.is-brand { color: var(--brand-ink); font-weight: 500; }
.pp-dl__row dd.is-warn { color: var(--warn); }

/* A quiet destructive action: cancel, revoke. Never a red button — these are
   reversible-by-support, not catastrophic, and a red button here reads as a
   threat on a page the customer just paid to reach. */
.pp-linkbtn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--ink-mute);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pp-linkbtn:hover { color: var(--ink); }
.pp-linkbtn--danger:hover { color: var(--danger); }

.pp-code {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 12px;
  word-break: break-all;
}
.pp-note {
  border: 1px solid var(--brand-dim);
  background: var(--brand-glow);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.pp-note__label {
  display: flex;
  align-items: center;
  font-size: 11.5px;
  color: var(--brand-ink);
  margin: 0 0 8px;
}
.pp-hint { font-size: 11.5px; color: var(--ink-mute); line-height: 1.6; margin: 12px 0 0; }
.pp-hint code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--ink-dim);
}

/* Centred outcome pages: payment success/failure, 404. */
.pp-outcome {
  max-width: 520px;
  margin: 0 auto;
  padding: 88px 24px 120px;
  text-align: center;
}
.pp-outcome__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  margin-bottom: 24px;
}
.pp-outcome__title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
}
.pp-outcome__body {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-dim);
  margin: 0 0 28px;
}
.pp-outcome__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.pp-empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--ink-mute);
}
.pp-empty__title { font-size: 15px; color: var(--ink-dim); margin: 0 0 6px; }
.pp-empty__body { font-size: 13px; margin: 0 0 20px; }

@media (max-width: 640px) {
  .pp-acct { padding: 36px 16px 72px; }
  .pp-acct__card { padding: 18px 16px; }
  .pp-acct__title { font-size: 27px; }
  .pp-dl__row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .pp-dl__row dd { text-align: left; }
  .pp-outcome { padding: 56px 20px 88px; }
}

/* Row items in the account lists (saved cases, search history). Same card
   language as a search result, at list density. */
.pp-listrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
}
.pp-listrow + .pp-listrow { border-top: 0; }
.pp-listrow:hover { border-color: var(--border-strong); background: var(--bg-elev); }
.pp-listrow__main { flex: 1; min-width: 0; }
.pp-listrow__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.pp-listrow__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pp-listrow__sub { font-size: 11.5px; color: var(--ink-mute); margin: 5px 0 0; }
.pp-listrow__aside {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-mute);
  white-space: nowrap;
  flex-shrink: 0;
}
.pp-listrow__act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px -8px -10px 0;
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}
.pp-listrow__act:hover { color: var(--danger); }
.pp-tag {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--border);
  padding: 2px 6px;
}

/* ── Authentication ────────────────────────────────────────────────────────
   The narrowest page in the product, and the one a first-time visitor is most
   likely to abandon. Everything here is sized for a single column of decisions:
   provider, divider, two fields, one button. */
.pp-auth { max-width: 400px; margin: 0 auto; padding: 72px 24px 96px; }
.pp-auth__head { text-align: center; margin-bottom: 32px; }
.pp-auth__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--brand-dim);
  background: var(--brand-glow);
  margin-bottom: 18px;
}
.pp-auth__title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 8px;
}
.pp-auth__sub { font-size: 13.5px; color: var(--ink-mute); margin: 0; }

.pp-auth__provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--ink-dim);
  font-size: 13.5px;
  text-decoration: none;
  margin-bottom: 20px;
}
.pp-auth__provider:hover { color: var(--ink); background: var(--bg-elev); }

.pp-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.pp-auth__divider::before,
.pp-auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.pp-auth__divider span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.pp-auth__form { display: grid; gap: 16px; }
.pp-auth__label {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 7px;
}
.pp-auth__input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.pp-auth__input:hover { border-color: var(--ink-faint); }
.pp-auth__input[aria-invalid="true"] { border-color: var(--danger); }
.pp-auth__error {
  display: flex;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--danger);
  margin: 7px 0 0;
  line-height: 1.5;
}
.pp-auth__hint { font-size: 11.5px; color: var(--ink-mute); margin: 7px 0 0; line-height: 1.5; }
.pp-auth__foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-mute);
  margin: 24px 0 0;
}
.pp-auth__foot a { color: var(--brand-ink); text-decoration: none; }
.pp-auth__foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .pp-auth { padding: 44px 20px 80px; }
  .pp-auth__title { font-size: 26px; }
}

/* Indicative conversion under the MDL price. Deliberately quieter than the
   billing terms below it: it is a reading aid for visitors outside Moldova,
   not a second price. */
.pp-plan__approx {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-top: 5px;
}
.pp-plans-note {
  max-width: 62ch;
  margin: 28px auto 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-mute);
  text-align: center;
}
