/* Styles for the server-rendered pages (/tools, /tools/:slug, /alternatives/:slug).
   Tokens, type scale and dark-mode rules are copied from site/index.html.
   Keep the :root blocks in step with that file. No gradients, no shadows. */
:root {
  color-scheme: light;
  --paper: #f3f4f6;
  --surface: #ffffff;
  --ink: #1b1f24;
  --muted: #555d68;
  --rule: #d3d8de;
  --rule-strong: #7d8692;
  --marker: #f2c230;
  --mark-line: #fce8a0;
  --meter-edge: #1b1f24;
  --action: #0f766e;
  --action-ink: #ffffff;
  --value: #0f5f59;
  --lineno: #6b737e;
  --focus: #1b1f24;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #14171c;
    --surface: #1b1f26;
    --ink: #e4e7eb;
    --muted: #9aa3ae;
    --rule: #2b313a;
    --rule-strong: #6e7783;
    --marker: #e3b341;
    --mark-line: #4a3d14;
    --meter-edge: #e3b341;
    --action: #5cc2b3;
    --action-ink: #0b1f1c;
    --value: #8fd4c9;
    --lineno: #858e99;
    --focus: #e4e7eb;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14171c;
  --surface: #1b1f26;
  --ink: #e4e7eb;
  --muted: #9aa3ae;
  --rule: #2b313a;
  --rule-strong: #6e7783;
  --marker: #e3b341;
  --mark-line: #4a3d14;
  --meter-edge: #e3b341;
  --action: #5cc2b3;
  --action-ink: #0b1f1c;
  --value: #8fd4c9;
  --lineno: #858e99;
  --focus: #e4e7eb;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
/* overflow-wrap is inherited: a long unbroken URL or database value breaks
   inside its block instead of pushing the page past a 360px screen. A <pre>
   keeps white-space: pre, so the compose file still scrolls in its own box. */
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); overflow-wrap: anywhere; }
a { color: var(--action); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
code, pre { font-family: var(--mono); }
p code, dd code { font-size: 0.9em; padding: 0.1em 0.35em; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface); overflow-wrap: anywhere; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: 16px; }

.skip { position: absolute; left: 16px; top: -100px; padding: 8px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 4px; }
.skip:focus { top: 8px; }

.site { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-top: 24px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 20px; font-weight: 600; font-size: 16px; }

.page { padding-block: 32px 72px; }
.page h1 { margin: 0 0 16px; max-width: 22ch; font-size: clamp(34px, 7vw, 50px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; overflow-wrap: anywhere; }
.page h2 { margin: 0 0 12px; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.lede { margin: 0 0 16px; max-width: 34em; font-size: 20px; line-height: 1.5; }
.intro { max-width: 40em; margin: 0 0 32px; color: var(--muted); }
.crumbs { margin: 0 0 16px; font-size: 15px; }
.block { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--rule); }

.spec { max-width: 58rem; margin: 24px 0 0; }
.spec > div { display: grid; gap: 4px 32px; padding: 20px 0; border-top: 1px solid var(--rule); }
.spec > div:last-child { border-bottom: 1px solid var(--rule); }
.spec dt { font-weight: 700; }
.spec dd { max-width: 38em; margin: 0; overflow-wrap: anywhere; }
.spec dd p { margin: 0 0 8px; }
.spec dd p:last-child { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 12px; max-width: 58rem; margin: 16px 0; padding: 0; }
.stats div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.note { max-width: 40em; margin: 8px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.filters-label { margin-right: 8px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--rule-strong); border-radius: 4px; background: transparent; color: var(--ink); font: 500 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.count, .empty { margin: 0; color: var(--muted); font-size: 15px; }
.empty { margin-top: 20px; color: var(--ink); font-size: 17px; }
.notice { max-width: 40em; margin: 0 0 20px; padding: 12px 16px; border: 1px dashed var(--rule-strong); border-radius: 4px; background: var(--surface); }

.entries { max-width: 58rem; margin: 20px 0 0; padding: 0; list-style: none; border-bottom: 1px dashed var(--rule-strong); }
.entry { display: grid; gap: 16px 24px; padding: 24px 0; border-top: 1px dashed var(--rule-strong); }
.entry-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.entry h2, .entry h3 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: 0; }
.entry p { margin: 6px 0 0; }
.reason, .meta { color: var(--muted); }
.meta { font-size: 15px; }

.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.bars { display: inline-flex; gap: 2px; }
.bars span { width: 8px; height: 15px; border: 1.5px solid var(--rule-strong); border-radius: 2px; }
.badge[data-level="1"] .bars span:nth-child(-n+1),
.badge[data-level="2"] .bars span:nth-child(-n+2),
.badge[data-level="3"] .bars span { background: var(--marker); border-color: var(--meter-edge); }

.status { max-width: 40em; margin: 0 0 16px; padding: 12px 16px; border: 1.5px solid var(--rule-strong); border-radius: 4px; background: var(--surface); }
.status strong { display: block; }
.status[data-status="ok"] { border-color: var(--action); }
.status[data-status="failed"] { border-color: var(--meter-edge); border-style: dashed; border-width: 2px; }
.status[data-status="unvalidated"], .status[data-status="none"] { border-style: dashed; }

.panel { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 6px; }
.file { min-width: 0; max-width: 58rem; }
.file-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.file-bar code { font-size: 14px; overflow-wrap: anywhere; }
.flag { display: inline-block; padding: 1px 8px; border: 1px dashed var(--rule-strong); border-radius: 3px; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.file pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
pre:focus-visible { outline-offset: -3px; }
.copy { min-height: 34px; margin-left: auto; padding: 6px 14px; border: 1px solid var(--rule-strong); border-radius: 4px; background: transparent; color: var(--ink); font: 600 14px/1.2 var(--sans); cursor: pointer; }

.foot { padding-block: 24px 48px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); }

@media (min-width: 720px) {
  .wrap { padding-inline: 32px; }
  .page { padding-block: 48px 96px; }
  .spec > div { grid-template-columns: 14rem minmax(0, 1fr); }
  .entry { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
}
