/*
 * Linkumori website styles.
 * Clean product-page look: Inter type, white and light-grey sections,
 * large centred headlines, rounded tiles and pill buttons.
 * Inter and JetBrains Mono are served from assets/fonts (SIL OFL 1.1), so the
 * site makes no font requests to other hosts.
 */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --tile: #ffffff;
  --text: #1d1d1f;
  --text-2: #616166;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --field: #8e8e93;
  --field-bg: #ffffff;
  --field-line: #86868b;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23616166' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  --link: #1d4ed8;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --accent: #2563eb;
  --on-blue: #ffffff;
  --strike: #c4001a;
  --strike-wash: #fff1f2;
  --keep: #1d7a35;
  --keep-wash: #eaf6ec;
  --warn: #8a5300;
  --warn-wash: #fff4e0;
  --dark: #000000;
  --dark-text: #f5f5f7;
  --dark-text-2: #a1a1a6;
  --code-bg: #f5f5f7;
  --code-text: #1d1d1f;
  --code-key: #326d74;
  --code-str: #c41a16;
  --code-num: #1c00cf;
  --code-lit: #9b2393;
  --nav-bg: rgb(255 255 255 / 72%);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 6%);
  --shadow: 0 4px 24px rgb(0 0 0 / 8%);
  --shadow-lg: 0 30px 80px -20px rgb(0 0 0 / 25%), 0 8px 24px rgb(0 0 0 / 6%);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --max: 1080px;
  --max-wide: 1240px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #101012;
    --tile: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8e8e93;
    --line: #38383c;
    --line-soft: #2a2a2d;
    --field: #6e6e73;
    --field-bg: #1c1c1e;
    --field-line: #636366;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a1a1a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
    --link: #60a5fa;
    --blue: #2563eb;
    --blue-hover: #3b82f6;
    --accent: #3b82f6;
    --strike: #ff6b7a;
    --strike-wash: #3a1218;
    --keep: #5fd47a;
    --keep-wash: #0f2a17;
    --warn: #ffc464;
    --warn-wash: #2e2208;
    --dark: #0b0b0c;
    --code-bg: #1c1c1e;
    --code-text: #dfdfe0;
    --code-key: #67b7a4;
    --code-str: #fc6a5d;
    --code-num: #d0bf69;
    --code-lit: #fc5fa3;
    --nav-bg: rgb(22 22 23 / 72%);
    --shadow-sm: 0 2px 8px rgb(0 0 0 / 40%);
    --shadow: 0 4px 24px rgb(0 0 0 / 40%);
    --shadow-lg: 0 30px 80px -20px rgb(0 0 0 / 70%), 0 8px 24px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #101012;
  --tile: #1c1c1e;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #8e8e93;
  --line: #38383c;
  --line-soft: #2a2a2d;
  --field: #6e6e73;
  --field-bg: #1c1c1e;
  --field-line: #636366;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a1a1a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  --link: #60a5fa;
  --blue: #2563eb;
  --blue-hover: #3b82f6;
  --accent: #3b82f6;
  --strike: #ff6b7a;
  --strike-wash: #3a1218;
  --keep: #5fd47a;
  --keep-wash: #0f2a17;
  --warn: #ffc464;
  --warn-wash: #2e2208;
  --dark: #0b0b0c;
  --code-bg: #1c1c1e;
  --code-text: #dfdfe0;
  --code-key: #67b7a4;
  --code-str: #fc6a5d;
  --code-num: #d0bf69;
  --code-lit: #fc5fa3;
  --nav-bg: rgb(22 22 23 / 72%);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 40%);
  --shadow: 0 4px 24px rgb(0 0 0 / 40%);
  --shadow-lg: 0 30px 80px -20px rgb(0 0 0 / 70%), 0 8px 24px rgb(0 0 0 / 40%);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html { scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--font);
  letter-spacing: -0.011em;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

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

code, pre, kbd { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; font-variant-ligatures: none; font-feature-settings: normal; }

:not(pre) > code {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 0.12em 0.4em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--r-sm);
  padding: 22px 24px;
  overflow-x: auto;
  line-height: 1.6;
  margin: 24px 0;
  font-size: 14px;
}
pre code { font-size: inherit; }
pre .k { color: var(--code-key); }
pre .s { color: var(--code-str); }
pre .n { color: var(--code-num); }
pre .l { color: var(--code-lit); }

/* Code listings, as in Apple's developer documentation: a soft panel with a language bar */
.codeblock { background: var(--code-bg); border-radius: var(--r); margin: 24px 0; overflow: hidden; }
.codeblock pre { margin: 0; background: transparent; border-radius: 0; padding: 6px 22px 22px; }
.codeblock-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 0 22px; }
.codeblock-lang { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
/* Mermaid diagrams, rendered ahead of time by scripts/make-diagrams.mjs. */
.diagram { margin: 28px 0; padding: 28px 24px 18px; background: var(--bg-alt); border-radius: var(--r); }
.diagram-scroll { overflow-x: auto; }
.diagram img { display: block; width: min(var(--w), max(100%, calc(var(--w) * 0.7))); max-width: none; height: auto; margin: 0 auto; }
.diagram-links { margin-top: 14px; font-size: 13px; }
.diagram details { margin-top: 10px; }
.diagram summary { cursor: pointer; font-size: 13px; color: var(--text-2); width: max-content; }
.diagram summary:hover { color: var(--text); }
.diagram .codeblock { margin: 12px 0 0; background: var(--tile); }
.copy-code {
  font: 400 13px/1 var(--font); letter-spacing: -0.01em; color: var(--link); background: transparent;
  border: 0; border-radius: 8px; padding: 6px 10px; min-height: 28px; cursor: pointer;
}
.copy-code:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.section.alt .codeblock, .section.alt pre { background: var(--tile); }

::selection { background: color-mix(in srgb, var(--blue) 25%, transparent); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px;
}
.skip:focus { left: 16px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.mono { font-family: var(--mono); letter-spacing: 0; }

/* ---------- Global nav ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.site-header .container { max-width: var(--max-wide); display: flex; align-items: center; gap: 16px; height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.brand-ver { display: none; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) {
  color: var(--text); opacity: .8; font-size: 13px; letter-spacing: -0.01em;
  padding: 8px 11px; border-radius: 8px;
}
.nav a:not(.btn):hover { opacity: 1; text-decoration: none; }
.nav a[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav .gh { display: inline-flex; align-items: center; gap: 6px; }
.nav .gh svg { width: 15px; height: 15px; }
.nav .nav-cta { margin-left: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: transparent; border: 0; border-radius: 999px; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

@media (max-width: 980px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .nav {
    display: none; position: absolute; top: 52px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); padding: 12px 22px 28px;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { font-size: 22px; font-weight: 600; padding: 12px 0; opacity: 1; border-radius: 0; }
  .nav .gh svg { width: 20px; height: 20px; }
  .nav .nav-cta { margin: 18px 0 0; align-self: flex-start; min-height: 44px; padding: 11px 22px; font-size: 17px; }
  .nav .icon-btn { position: absolute; top: -43px; right: 60px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 11px 22px; border-radius: 999px;
  font: 400 17px/1.2 var(--font); letter-spacing: -0.022em; cursor: pointer;
  border: 1px solid transparent; text-decoration: none !important;
}
.btn-sm { min-height: 28px; padding: 4px 12px; font-size: 12px; letter-spacing: -0.01em; }
.btn-primary, .btn-accent { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover, .btn-accent:hover { background: var(--blue-hover); color: var(--on-blue); }
.btn-line { background: transparent; color: var(--link); border-color: var(--link); }
.btn-line:hover { background: var(--blue); color: var(--on-blue); }
.btn:disabled, .link-btn:disabled { opacity: .5; pointer-events: none; }
.more { font-size: 17px; color: var(--link); display: inline-flex; align-items: center; }
.more::after { content: "›"; font-size: 1.2em; line-height: 1; margin-left: 4px; transform: translateY(-1px); }
.arrow { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }

/* ---------- Form fields ---------- */

/* Text boxes, text areas and menus in the demo and the tools share one look, modelled on
   apple.com's form fields: 12px corners, a grey hairline, a solid blue ring on focus and
   44px tap targets. Each tool sets its own size and type. */
:is(.tool textarea, .tool select, .sim-form input, .cv-input, .cv-field input) { color: var(--text); background-color: var(--field-bg); border: 1px solid var(--field-line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
:is(.tool textarea, .tool select, .sim-form input, .cv-input, .cv-field input):focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 55%, transparent); }
:is(.tool textarea, .sim-form input, .cv-input, .cv-field input)::placeholder { color: var(--text-3); opacity: 1; }
:is(.tool textarea, .tool select, .sim-form input, .cv-input, .cv-field input):disabled { opacity: .5; cursor: not-allowed; }
.cv-input[type="search"] { appearance: none; -webkit-appearance: none; }
/* Menus draw their own chevron, so they look the same in every browser and in both themes. */
.tool select {
  appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; cursor: pointer;
  background-image: var(--chevron); background-position: right 16px center; background-size: 12px 12px; background-repeat: no-repeat;
}

/* ---------- Type ---------- */

.eyebrow { display: block; font-size: 21px; font-weight: 600; letter-spacing: 0.005em; color: var(--text-2); margin-bottom: 8px; }
.display {
  font-size: clamp(44px, 8vw, 96px); line-height: 1.04; font-weight: 700;
  letter-spacing: -0.03em; margin: 0; text-wrap: balance;
}
.headline {
  font-size: clamp(36px, 5.6vw, 64px); line-height: 1.06; font-weight: 700;
  letter-spacing: -0.028em; margin: 0; text-wrap: balance;
}
.subhead {
  font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; font-weight: 500;
  letter-spacing: -0.01em; color: var(--text-2); margin: 18px auto 0; max-width: 680px; text-wrap: pretty;
}
/* Accent from the logo: its blue, and its four-point sparkle used once, in the hero. */
.accent { color: var(--accent); }
.accent { position: relative; white-space: nowrap; }
/* Sits off the end of the word like the star off the logo's link, without changing line height. */
.spark { position: absolute; top: 0.06em; right: -0.36em; width: 0.28em; height: 0.28em; color: var(--accent); }

/* ---------- Sections ---------- */

.section { padding: 120px 0; }
.section.alt { background: var(--bg-alt); }
.section.dark { background: var(--dark); color: var(--dark-text); }
.section.dark .subhead, .section.dark .eyebrow { color: var(--dark-text-2); }
.sec-intro { text-align: center; max-width: 840px; margin: 0 auto 64px; }
@media (max-width: 734px) { .section { padding: 80px 0; } .sec-intro { margin-bottom: 44px; } }

/* ---------- Hero ---------- */

.hero { padding: 80px 0 0; text-align: center; overflow: hidden; }
.badge-new {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  font-size: 14px; color: var(--text-2); padding: 5px 14px 5px 5px; border-radius: 999px;
  background: var(--bg-alt);
}
.badge-new:hover { text-decoration: none; color: var(--text); }
.badge-new b { font-weight: 600; color: var(--on-blue); background: var(--blue); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.hero .subhead { max-width: 640px; }
.hero .actions { justify-content: center; margin-top: 34px; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 26px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 15px; height: 15px; color: var(--keep); flex: none; }

/* Browser window product shot */
.stage { position: relative; margin: 72px auto 0; max-width: 1040px; padding: 0 22px 1px; }
.stage::before {
  content: ""; position: absolute; inset: 10% 4% 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 70%);
  filter: blur(40px);
}
.window {
  position: relative; z-index: 1; text-align: left;
  background: var(--tile); border-radius: 14px 14px 0 0; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-bottom: 0;
}
.window-top { background: var(--bg-alt); border-bottom: 1px solid var(--line-soft); padding: 10px 14px 12px; }
.window-tabs { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.window-tabs .dots { display: flex; gap: 7px; }
.window-tabs .dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window-tabs .dots i:nth-child(2) { background: #febc2e; }
.window-tabs .dots i:nth-child(3) { background: #28c840; }
.window-tab {
  display: inline-flex; align-items: center; gap: 8px; max-width: 240px;
  background: var(--tile); border-radius: 8px; padding: 5px 12px; font-size: 12.5px; color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.window-tab::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--line); flex: none; }
.window-bar { display: flex; align-items: center; gap: 10px; }
.window-bar .nav-dots { display: flex; gap: 14px; color: var(--text-3); font-size: 18px; line-height: 1; padding: 0 4px; }
.address {
  flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px;
  background: var(--tile); border-radius: 10px; padding: 9px 14px; min-height: 40px;
  border: 1px solid var(--line-soft);
}
.address .lock { color: var(--text-3); flex: none; margin-top: 3px; }
.address .lock svg { width: 13px; height: 13px; display: block; }
.ext-icon { width: 30px; height: 30px; flex: none; position: relative; display: grid; place-items: center; }
.ext-icon img { width: 22px; height: 22px; }
.ext-icon .count {
  position: absolute; right: -6px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--blue); color: var(--on-blue); font: 600 11px/18px var(--font); text-align: center; letter-spacing: 0;
}
.specimen-url { font: 14.5px/1.55 var(--mono); letter-spacing: 0; color: var(--text); word-break: break-all; min-width: 0; }
.specimen-url .p { border-radius: 4px; transition: color .35s, background-color .35s; }
.specimen-url .p.hit { color: var(--strike); background: var(--strike-wash); text-decoration: line-through; text-decoration-thickness: 2px; }
.window-body { padding: 0 44px 48px; display: grid; gap: 32px; }
.window-body .skel { padding-top: 40px; }
@media (min-width: 760px) { .window-body { grid-template-columns: 1.45fr 1fr; } }
@media (max-width: 600px) { .window-body { padding: 24px 20px 28px; } .window-bar .nav-dots { display: none; } }
.skel { display: grid; gap: 12px; align-content: start; }
.skel i { display: block; height: 12px; border-radius: 6px; background: var(--line-soft); }
.skel i.h { height: 28px; width: 72%; margin-bottom: 10px; background: var(--line); }
.skel i:nth-child(3) { width: 92%; } .skel i:nth-child(4) { width: 84%; } .skel i:nth-child(6) { width: 58%; }
.skel .img { height: 132px; border-radius: 14px; background: linear-gradient(135deg, var(--line-soft), var(--bg-alt)); margin-top: 10px; }
/* The real extension popup (html/popup.html on main), dropping down from the toolbar icon. */
/* Right edge 10px from the window edge, so the pointer (centre 29px in) sits under the toolbar icon. */
.popup-shot { justify-self: end; width: min(320px, 100%); margin: -28px -34px 0 0; position: relative; }
.popup-shot img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.popup-shot::before {
  content: ""; position: absolute; top: -7px; right: 12px; width: 14px; height: 14px; transform: rotate(45deg);
  background: var(--bg-alt); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
}
@media (max-width: 759px) { .popup-shot { justify-self: center; margin: 0; } .popup-shot::before { display: none; } .window-body .skel { display: none; } }

/* Light and dark captures follow the site theme, including the manual toggle. */
.theme-dark-only { display: none !important; }
:root[data-theme="dark"] .theme-light-only { display: none !important; }
:root[data-theme="dark"] .theme-dark-only { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-light-only { display: none !important; }
  :root:not([data-theme="light"]) .theme-dark-only { display: block !important; }
}

/* ---------- Highlights ---------- */

.highlights { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.highlight { background: var(--tile); border-radius: var(--r-lg); padding: 34px 30px 36px; }
.highlight strong { display: block; font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; }
.highlight span { display: block; margin-top: 10px; color: var(--text-2); }

/* ---------- Feature grid ---------- */

.features { display: grid; gap: 52px 44px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.feature .ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--link); margin-bottom: 18px;
}
.feature .ico svg { width: 23px; height: 23px; }
.feature h3 { font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.feature p { margin: 0; color: var(--text-2); }

/* ---------- Bento tiles ---------- */

.bento { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile.w4 { grid-column: 1 / -1; } }
@media (min-width: 1068px) { .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); } .tile { grid-column: span 2; } .tile.w3 { grid-column: span 3; } .tile.w4 { grid-column: span 4; } }
.tile { background: var(--tile); border-radius: var(--r-lg); padding: 36px 34px 38px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.tile .kicker { font-size: 14px; font-weight: 600; color: var(--link); }
.tile h3 { font-size: 28px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; margin: 6px 0 10px; text-wrap: balance; }
.tile p { margin: 0; color: var(--text-2); }
.tile .ui { margin-top: auto; padding-top: 30px; }

.ui-card { background: var(--bg-alt); border-radius: 16px; padding: 6px 18px; font-size: 14px; }
.ui-card .row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.ui-card .row:last-child { border-bottom: 0; }
.ui-card .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-card code { background: transparent; padding: 0; font-size: 13px; }
.toggle { width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); }
.toggle.on { background: #34c759; }
.toggle.on::after { transform: translateX(16px); }
.pill { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--tile); color: var(--text-2); white-space: nowrap; letter-spacing: 0; }
.pill.ok { background: var(--keep-wash); color: var(--keep); }
.pill.wait { background: var(--warn-wash); color: var(--warn); }
.pill.acc { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--link); }
.stack { display: grid; gap: 8px; }
.stack .layer { background: var(--bg-alt); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.stack .layer:nth-child(2) { margin: 0 10px; }
.stack .layer:nth-child(3) { margin: 0 20px; background: var(--blue); color: var(--on-blue); }

.list-plain { list-style: none; padding: 0; margin: 56px 0 0; display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.list-plain h3 { font-size: 17px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.02em; }
.list-plain p { margin: 0; color: var(--text-2); font-size: 15px; }

/* ---------- Demo ---------- */

.demo { display: grid; background: var(--tile); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
@media (min-width: 900px) { .demo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.demo-pane { padding: 32px; min-width: 0; }
.demo-pane + .demo-pane { background: var(--bg-alt); }
.demo .lbl { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em; }
.demo .code-field textarea {
  width: 100%; min-height: 156px; resize: vertical;
  font: 14px/1.6 var(--mono); letter-spacing: 0; color: var(--text);
  padding: 14px 16px; white-space: pre-wrap; word-break: break-all;
}
/* The clean URL sits in the same pane as the input, tinted green, wrapping at URL separators. */
.url-out {
  font: 14px/1.6 var(--mono); letter-spacing: 0; padding: 14px 16px;
  background: var(--keep-wash); color: var(--text); overflow-wrap: anywhere; min-height: 82px;
}
.code-field.is-output:focus-within { border-color: var(--line); box-shadow: none; }
.code-field-bar .link-btn { min-height: 28px; padding: 5px 12px; font-size: 13px; font-weight: 400; }
.demo-removed-lbl { margin-top: 24px; }
@media (max-width: 600px) { .demo-pane { padding: 20px; } }
.removed { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; min-height: 26px; }
.chip { font: 12.5px/1 var(--mono); letter-spacing: 0; padding: 6px 10px; border-radius: 999px; background: var(--strike-wash); color: var(--strike); text-decoration: line-through; }
.demo-note { font-size: 14px; color: var(--text-2); margin: 18px 0 0; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.samples button, .link-btn {
  font: 400 14px/1 var(--font); letter-spacing: -0.01em; padding: 8px 14px; min-height: 32px; border-radius: 999px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--field); color: var(--text);
}
.samples button:hover, .link-btn:hover { border-color: var(--link); color: var(--link); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 15px; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; }

/* ---------- Privacy (dark) ---------- */

.shield { width: 84px; height: 84px; margin: 0 auto 28px; display: block; color: var(--dark-text); }
.privacy-cols { display: grid; gap: 44px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 80px; }
.privacy-cols h3 { font-size: 21px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.02em; }
.privacy-cols p { margin: 0; color: var(--dark-text-2); }
.privacy-cols > div { border-top: 1px solid #424245; padding-top: 24px; }
.section.dark a { color: #60a5fa; }

/* ---------- Tables ---------- */

/* Doc tables, as in Apple's developer documentation: one rounded outline, row rules only */
.table-wrap { overflow-x: auto; margin: 28px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; letter-spacing: -0.006em; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); white-space: nowrap; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
tbody tr:hover > * { background: color-mix(in srgb, var(--bg-alt) 55%, transparent); }
/* Code inside a table reads as plain monospace, without a chip behind it. It may break
   anywhere, so a long example wraps instead of running past the table's edge. */
.prose .table-wrap td code, .prose .table-wrap th code, td code, th code { background: transparent; box-shadow: none; padding: 0; border-radius: 0; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
/* The first column names the thing the row is about: keep it on one line, in the accent colour */
.prose .table-wrap td:first-child code { white-space: nowrap; color: var(--code-key); font-weight: 500; }
/* On a phone, a two-column table (name, then what it means) stacks each row: the
   name on top, its description under it. Wider tables scroll sideways instead. */
@media (max-width: 640px) {
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) thead { display: none; }
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) :is(tbody, tr, td) { display: block; }
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) tr:last-child { border-bottom: 0; }
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) td { padding: 0; border: 0; }
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) td:first-child { margin-bottom: 4px; font-weight: 600; }
  .prose .table-wrap table:has(> thead th:nth-child(2):last-child) td:first-child code { white-space: normal; }
}

/* Comparison, in a compare-page style: product columns, plain marks, hairlines */
.compare-wrap { max-width: 860px; margin: 0 auto; }
.compare-wrap .table-wrap { border: 0; background: transparent; border-radius: 0; margin: 0; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.compare { font-size: 17px; table-layout: fixed; }
.compare col.c-feat { width: auto; }
.compare col.c-prod { width: 26%; }
.compare thead th { background: transparent; color: var(--text); padding: 0 12px 28px; text-align: center; vertical-align: bottom; white-space: normal; border-bottom: 1px solid var(--line); }
.compare thead th:first-child { text-align: left; }
.compare .prod { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.compare .prod.us .prod-name { color: var(--accent); }
.compare .prod-name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.compare .prod-note { font-size: 14px; font-weight: 400; color: var(--text-2); }
.compare tbody th { font-weight: 400; color: var(--text); text-align: left; }
.compare td { text-align: center; }
.compare tbody th, .compare td { border-bottom: 1px solid var(--line); padding: 18px 12px; vertical-align: middle; }
.compare tr.group th { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); padding: 56px 12px 16px; border-bottom: 1px solid var(--text); }
.mark-yes, .mark-no { display: inline-grid; place-items: center; width: 24px; height: 24px; }
.mark-yes { color: var(--link); }
.mark-yes svg { width: 22px; height: 22px; }
.mark-no { color: var(--text-3); font-size: 20px; }
@media (max-width: 600px) {
  .compare { font-size: 15px; }
  .compare col.c-prod { width: 23%; }
  .compare tbody th, .compare td { padding: 14px 8px; }
  .compare .prod-name { font-size: 17px; }
  .compare .prod-note { display: none; }
  .compare tr.group th { font-size: 20px; padding-top: 40px; }
}

/* ---------- CLN ---------- */

.cln-grid { display: grid; gap: 20px; }
@media (min-width: 980px) { .cln-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.cln-card { background: var(--tile); border-radius: var(--r-lg); padding: 34px 32px; }
.cln-card h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 18px; }
.cln-code { display: flex; min-width: 0; }
.cln-code .codeblock { flex: 1; margin: 0; border-radius: var(--r-lg); }
.cln-code pre { padding: 8px 32px 30px; }
.cln-code .codeblock-bar { padding: 14px 18px 0 32px; }
.stages { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.stages li { counter-increment: s; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.stages li:last-child { border-bottom: 0; }
.stages li::before {
  content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--link); font-size: 13px; font-weight: 600; margin-top: 1px;
}
.stages code { background: transparent; padding: 0; font-size: 14.5px; font-weight: 500; }
.stages small { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.cln-points { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 20px; }
.cln-points div { background: var(--tile); border-radius: var(--r-lg); padding: 28px; }
.cln-points b { display: block; font-size: 19px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.02em; }
.cln-points span { color: var(--text-2); font-size: 15px; }

/* ---------- Closing CTA ---------- */

.cta { text-align: center; }
.cta img { width: 104px; height: 104px; margin: 0 auto 28px; display: block; }
.cta .actions { justify-content: center; margin-top: 32px; }

/* ---------- Callouts ---------- */

.callout { position: relative; background: color-mix(in srgb, var(--blue) 6%, var(--bg)); border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line-soft)); border-radius: var(--r); padding: 18px 22px 18px 52px; margin: 28px 0; font-size: 15.5px; line-height: 1.65; }
.callout::before {
  content: "i"; position: absolute; left: 20px; top: 20px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue); color: var(--on-blue); font: 700 12px/20px var(--font); text-align: center; font-style: normal;
}
.callout p { margin: 0.4em 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout ul { margin: 0.5em 0; }

/* ---------- Docs ---------- */

.overline { display: block; font-size: 17px; font-weight: 600; color: var(--link); letter-spacing: -0.01em; }
.doc-hero { background: var(--bg-alt); padding: 72px 0 56px; }
.doc-hero .container { max-width: var(--max-wide); }
.doc-hero h1 { font-size: clamp(36px, 5.5vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -0.028em; margin: 8px 0 32px; max-width: 20ch; text-wrap: balance; }
.doc-facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0; }
.doc-facts dt { font-size: 13px; color: var(--text-2); }
.doc-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.status-final { display: inline-flex; align-items: center; gap: 6px; color: var(--keep); }
.status-final::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.docs { max-width: var(--max-wide); display: grid; gap: 40px; padding-top: 56px; padding-bottom: 120px; }
@media (min-width: 1040px) { .docs { grid-template-columns: 240px minmax(0, 1fr); gap: 72px; } }
.toc { font-size: 14px; letter-spacing: -0.01em; }
@media (min-width: 1040px) { .toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 24px; } }
.toc details { background: var(--bg-alt); border-radius: var(--r); padding: 0 18px; }
@media (min-width: 1040px) { .toc details { background: transparent; padding: 0; } }
.toc summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 14px 0; }
@media (min-width: 1040px) { .toc summary { pointer-events: none; list-style: none; padding-top: 2px; } .toc summary::-webkit-details-marker { display: none; } }
.toc ol { list-style: none; margin: 0; padding: 0 0 12px; }
/* Sections, with their subsections hanging off a hairline rail */
.toc ol ol { margin: 2px 0 8px 10px; padding: 0; border-left: 1px solid var(--line-soft); }
.toc a { display: block; padding: 5px 10px; margin: 1px 0; color: var(--text-2); border-radius: 8px; line-height: 1.4; }
.toc > details > ol > li > a { color: var(--text); font-weight: 500; }
.toc ol ol a { font-size: 13px; margin-left: -1px; padding-left: 13px; border-radius: 0 8px 8px 0; border-left: 1px solid transparent; }
.toc a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.toc a.active { color: var(--link); background: color-mix(in srgb, var(--blue) 9%, transparent); }
.toc ol ol a.active { border-left-color: var(--link); }
.toc .h-num { display: inline-block; min-width: 1.6em; color: var(--text-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.toc ol ol .h-num { min-width: 2.1em; }
.toc code { background: transparent; padding: 0; font-size: 0.92em; color: inherit; }

.prose { min-width: 0; max-width: 760px; font-size: 16.5px; line-height: 1.7; letter-spacing: -0.008em; color: var(--text); }
.prose p, .prose li { text-wrap: pretty; }
.prose p { margin: 0 0 1.05em; }
.prose strong { font-weight: 600; }

/* Sections: a hairline above each, the section number set apart */
.prose h2 { font-size: clamp(26px, 3vw, 31px); line-height: 1.2; font-weight: 650; letter-spacing: -0.024em; margin: 80px 0 18px; }
.prose > h2 { padding-top: 36px; border-top: 1px solid var(--line-soft); }
.prose > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 20px; line-height: 1.3; font-weight: 620; letter-spacing: -0.018em; margin: 48px 0 10px; }
.prose h4 { font-size: 16.5px; font-weight: 620; margin: 32px 0 8px; }
.prose h2 + h3 { margin-top: 28px; }
.h-num { margin-right: 0.45em; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Lists: small round markers; a bold lead-in reads as the item's title */
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.2em; }
.prose li { margin: 0.45em 0; padding-left: 0.2em; }
.prose ul > li::marker { color: var(--text-3); font-size: 0.85em; }
.prose ol > li::marker { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.prose li > strong:first-child { color: var(--text); }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0.6em; }

/* Inline code: a hairline chip, quieter than the text around it */
.prose :not(pre) > code {
  font-size: 0.84em; padding: 0.14em 0.42em; border-radius: 6px;
  background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--text);
}
.prose a code { color: var(--link); }
.prose h2 code, .prose h3 code { font-size: 0.86em; font-weight: 600; background: transparent; box-shadow: none; padding: 0; }

.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose a.anchor { text-decoration: none; color: var(--text-3); margin-left: 8px; opacity: 0; font-weight: 400; }
.prose h2:hover a.anchor, .prose h3:hover a.anchor, .prose a.anchor:focus { opacity: 1; }
.doc-src { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }

/* "Earlier 1.0 text" and "1.0 final", above the CLN documents */
.terms { border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin: 0 0 40px; }
.prose .terms-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 14px; padding: 0; }
.terms dl { display: grid; gap: 16px 32px; margin: 0; }
@media (min-width: 700px) { .terms dl { grid-template-columns: 1fr 1fr; } }
.terms dt { font-size: 15px; font-weight: 600; }
.terms div:last-child dt { color: var(--link); }
.terms dd { margin: 4px 0 0; font-size: 15px; color: var(--text-2); }
.terms code { white-space: nowrap; }

/* Sort-key tables: (stage, orderGroup, order, rank, arrayIndex) as five columns */
th.sk-group { text-align: center; border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; }
th.sk { text-align: center; font-weight: 400; padding: 8px 10px 10px; }
th.sk code { background: transparent; padding: 0; font-size: 12.5px; color: var(--text-2); }
td.sk { text-align: center; padding-left: 10px; padding-right: 10px; font: 14px/1.4 var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-table thead tr:first-child th, .ro-table thead tr:first-child th { vertical-align: bottom; }

/* ---------- How rules work (rules.html) ---------- */

.rx-lede { font-size: 21px; line-height: 1.45; color: var(--text-2); margin: 0 0 8px; }
.prose .rx-lede + h2 { margin-top: 48px; }
.rx-note { font-size: 15px; color: var(--text-2); }
.rx-legend { font-size: 14px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Where each rule came from. Always labelled in text, never colour alone. */
.rx-tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0; padding: 3px 9px; border-radius: 999px; background: var(--bg-alt); color: var(--text-2); white-space: nowrap; }
.rx-tag.rx-o-builtin { background: var(--bg-alt); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.rx-tag.rx-o-remote { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--link); }
.rx-tag.rx-o-cache { background: var(--warn-wash); color: var(--warn); }
.rx-tag.rx-o-custom { background: var(--keep-wash); color: var(--keep); }

/* Pipeline */
.rx-flow { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 10px; grid-template-columns: 1fr; counter-reset: none; }
@media (min-width: 820px) { .rx-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; } }
.rx-flow li { position: relative; background: var(--bg-alt); border-radius: var(--r); padding: 18px 16px 18px; margin: 0; }
@media (min-width: 820px) {
  .rx-flow li { border-radius: 0; margin-right: 14px; }
  .rx-flow li:first-child { border-radius: var(--r) 0 0 var(--r); }
  .rx-flow li:last-child { border-radius: 0 var(--r) var(--r) 0; margin-right: 0; }
  .rx-flow li:not(:last-child)::after {
    content: ""; position: absolute; top: 0; right: -14px; width: 14px; height: 100%;
    background: var(--bg-alt); clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
}
.rx-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: var(--on-blue); font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.rx-flow b { display: block; font-size: 15px; letter-spacing: -0.015em; }
.rx-flow small { display: block; font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.4; }

/* Sources */
.rx-sources { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 24px 0; }
@media (min-width: 600px) { .rx-sources { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rx-source { border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.prose .rx-source h3 { font-size: 17px; margin: 12px 0 6px; }
.rx-source p { margin: 0; font-size: 15px; color: var(--text-2); }

.rx-steps { padding-left: 1.3em; }
.rx-steps li { margin: 8px 0; }

/* Explorer */
.rx-explorer { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 28px 0; }
@media (min-width: 900px) { .rx-explorer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.rx-controls { padding: 22px; display: grid; gap: 16px; align-content: start; background: var(--bg-alt); }
.rx-seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.rx-seg[hidden] { display: none; }
.rx-seg legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 7px; }
.rx-opts { display: flex; flex-wrap: wrap; gap: 2px; background: var(--line-soft); border-radius: 10px; padding: 2px; }
.rx-seg label { flex: 1 1 auto; position: relative; cursor: pointer; }
.rx-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rx-seg span { display: block; text-align: center; font-size: 14px; padding: 7px 12px; border-radius: 8px; color: var(--text); white-space: nowrap; }
.rx-seg input:checked + span { background: var(--bg); box-shadow: 0 1px 3px rgb(0 0 0 / 14%); font-weight: 600; }
.rx-seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.rx-result { padding: 22px 24px 24px; min-width: 0; }
.rx-summary { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 16px; }
.rx-stack { display: grid; gap: 6px; margin-bottom: 18px; }
.rx-layer { border-radius: 12px; padding: 12px 16px; background: var(--bg-alt); }
.rx-layer b { display: block; font-size: 15px; }
.rx-layer small { display: block; font-size: 13px; margin-top: 2px; opacity: .85; }
.rx-layer.rx-o-custom { background: var(--keep-wash); color: var(--keep); }
.rx-layer.rx-o-remote { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--link); }
.rx-layer.rx-o-cache { background: var(--warn-wash); color: var(--warn); }
.rx-layer.rx-o-builtin { box-shadow: inset 0 0 0 1px var(--line); }
.rx-layer.rx-merged + .rx-layer.rx-merged { margin-top: -6px; border-top-left-radius: 0; border-top-right-radius: 0; border-top: 1px dashed var(--line); }
.rx-stack .rx-merged:has(+ .rx-merged) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.rx-empty { color: var(--text-2); font-size: 15px; text-align: center; border: 1px dashed var(--line); background: transparent; }
.rx-path { margin: 0; padding-left: 1.3em; font-size: 15px; color: var(--text-2); }
.rx-path li { margin: 5px 0; }

@media (min-width: 820px) { .rx-flow.rx-flow-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Merge diagrams */
.rx-merge { display: grid; gap: 10px; align-items: center; margin: 24px 0 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .rx-merge { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.15fr); } }
.rx-prov { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-width: 0; }
.rx-prov-out { border-color: var(--text-3); }
.rx-prov-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: var(--bg-alt); }
.rx-prov-head code { background: transparent; padding: 0; font-size: 12.5px; }
.rx-defaults { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--text-2); }
.rx-defaults code { background: transparent; padding: 0; font-size: 12px; color: var(--text); }
.rx-prov ul { list-style: none; margin: 0; padding: 6px 0; }
.rx-prov li { margin: 0; padding: 7px 12px 7px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; border-left: 3px solid transparent; }
.rx-prov li code { background: transparent; padding: 0; font-size: 13px; }
.rx-prov li small { font-size: 12px; color: var(--text-2); }
.rx-prov li.rx-o-builtin { border-left-color: var(--line); }
.rx-prov li.rx-o-remote { border-left-color: var(--blue); }
.rx-prov li.rx-o-custom { border-left-color: var(--keep); }
.rx-prov li.rx-gone code { text-decoration: line-through; color: var(--text-3); }
.rx-prov li.rx-gone small { color: var(--strike); }
.rx-plus, .rx-arrow { text-align: center; font-size: 22px; color: var(--text-3); line-height: 1; }
@media (max-width: 759px) { .rx-arrow { transform: rotate(90deg); } }

.rx-version { font-size: 15px; color: var(--text-2); border-left: 3px solid var(--line); padding: 2px 0 2px 14px; }
.rx-version .rx-tag { margin-right: 6px; }
.rx-callout { border-radius: var(--r); padding: 16px 20px; margin: 20px 0; background: var(--warn-wash); color: var(--text); font-size: 16px; }
.rx-callout b { color: var(--warn); }

/* Case galleries on rules.html */
.prose.prose-wide { max-width: 940px; }
.rx-tag.rx-o-off { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.cases { margin: 20px 0 8px; }
.cases-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cases-nav button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 14px 6px 6px;
  font: 400 14px/1.2 var(--font); letter-spacing: -0.01em; text-align: left;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer;
}
.cases-nav button:hover { border-color: var(--text-3); }
.cases-nav button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cases-nav-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; background: var(--bg-alt); color: var(--text-2); font-size: 12px; font-weight: 600; }
.cases-nav button[aria-selected="true"] .cases-nav-num { background: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
.case { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 22px 20px; margin: 0 0 16px; }
.cases.is-picker .case:not(.is-active) { display: none; }
.case-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.case-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: var(--on-blue); font-size: 13px; font-weight: 600; flex: none; }
.prose .case-head h4 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.case-trigger { list-style: none; margin: -4px 0 18px; padding: 12px 14px; display: grid; gap: 8px; background: var(--bg-alt); border-radius: var(--r-sm); }
.case-trigger li { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 14px; color: var(--text-2); }
.case-trigger .dm-who { flex: none; min-width: 74px; text-align: center; }
.case-body { display: grid; gap: 14px; }
@media (min-width: 900px) { .case-body { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; } }
.case-inputs, .case-out { display: grid; gap: 14px; min-width: 0; align-content: start; }
.case-in, .case-out > *, .case-json { min-width: 0; }
.case-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.case .codeblock { margin: 0; border-radius: var(--r-sm); }
.case .codeblock pre { font-size: 12.5px; padding: 4px 16px 16px; }
.case .codeblock-bar { padding: 8px 8px 0 16px; }
.case-text { margin: 0; font-size: 14px; color: var(--text-2); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.case-arrow { font-size: 22px; color: var(--text-3); text-align: center; padding-top: 34px; }
@media (max-width: 899px) { .case-arrow { padding: 0; transform: rotate(90deg); } }
.case-runs { display: grid; gap: 10px; }
.case-json summary { cursor: pointer; font-size: 14px; color: var(--link); padding: 4px 0; list-style-position: inside; }
.case-json[open] summary { margin-bottom: 8px; }
.case-explain { margin: 16px 0 0; font-size: 15px; color: var(--text-2); }
.rx-prov-off { border-style: dashed; }
.rx-prov-name { font-size: 13px; font-weight: 600; }
.rx-prov-head small { font-size: 12px; color: var(--text-2); }
.rx-prov-caption { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 8px 12px 0; background: var(--bg-alt); }
.rx-row-tag { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* Automatic or user-started defaults merges */
.dm-compare { display: grid; gap: 14px; margin: 20px 0 8px; }
@media (min-width: 760px) { .dm-compare { grid-template-columns: 1fr 1fr; } }
.dm-col { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.prose .dm-col h4 { margin: 10px 0 8px; font-size: 18px; }
.dm-col p { margin: 8px 0 0; font-size: 15px; }
.dm-who { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.dm-auto { background: var(--bg-alt); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.dm-you { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--link); }
.prose .dm-sub { font-size: 17px; margin: 32px 0 6px; }
.dm-notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.dm-notes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin: 0; color: var(--text-2); }
.dm-notes code { background: transparent; padding: 0; color: var(--text); }
.dm-notes b { color: var(--text); font-weight: 600; }

/* Which-sources cards */
.src-cases { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 20px 0; }
.src-case { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; align-content: start; }
.src-settings { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.src-settings div { display: inline-flex; gap: 5px; align-items: baseline; font-size: 12px; background: var(--bg-alt); border-radius: 999px; padding: 4px 10px; }
.src-settings dt { color: var(--text-2); }
.src-settings dd { margin: 0; font-weight: 600; }
.src-stack { display: grid; gap: 4px; }
.src-stack .rx-layer { padding: 9px 12px; }
.src-stack .rx-layer b { font-size: 14px; }
.src-result { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }

/* Run-order tool */
.tool { background: var(--bg-alt); border-radius: var(--r-lg); padding: 26px; margin: 28px 0; }
.tool textarea {
  width: 100%; min-height: 280px; font: 13px/1.55 var(--mono); letter-spacing: 0;
  padding: 14px 16px; resize: vertical; tab-size: 2;
}
/* Code text areas look like an editor pane: a label bar over unwrapped, scrollable code,
   with the focus ring around the whole pane. */
.code-field { background: var(--field-bg); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.code-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 55%, transparent); }
.code-field-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--text) 3%, transparent); font-size: 13px; font-weight: 600; }
.code-field-bar > label { white-space: nowrap; }
.code-field-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--text-2); }
.code-field textarea, .code-field textarea:focus { display: block; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--code-text); white-space: pre; overflow: auto; overflow-wrap: normal; }
.tool-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 16px 0; font-size: 15px; }
.tool-bar label { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; cursor: pointer; }
.tool-bar input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--blue); }
.tool-bar select { font: 15px/1.4 var(--font); letter-spacing: -0.01em; padding: 8px 40px 8px 14px; min-height: 40px; }
.tool .table-wrap { background: var(--bg); }
.ro-table { font-size: 15px; }
.ro-table th, .ro-table td { padding: 12px 14px; vertical-align: top; }
.ro-table td:first-child { width: 44px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ro-pos { display: block; font: 13.5px/1.4 var(--mono); letter-spacing: 0; color: var(--text); white-space: nowrap; }
.ro-name { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.ro-name.ro-text { font: 13px/1.4 var(--mono); letter-spacing: 0; }
.ro-table td.ro-notes { font-size: 14px; color: var(--text-2); }
.ro-table.no-notes .ro-notes { display: none; }
.tool-msg { font-size: 14px; margin: 8px 0; color: var(--text-2); }
.tool-msg.err { color: var(--strike); }
.tool-msg ul { margin: 6px 0; padding-left: 1.2em; }
.tool-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }

/* Run-order simulation */
.sim { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.prose .sim-title { font-size: 17px; font-weight: 620; margin: 0 0 4px; }
.sim-form { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.tool .sim-form .btn { flex: none; min-height: 44px; padding: 0 20px; font-size: 15px; }
.sim-form input { flex: 1 1 auto; min-width: 0; min-height: 44px; font: 14px/1.5 var(--mono); letter-spacing: 0; padding: 10px 16px; }
.sim-player { background: var(--field-bg); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
/* Transport controls: one segmented bar of icon buttons, like a media player. */
.sim-controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg-alt); }
.sim-btn { display: grid; place-items: center; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; }
.sim-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.sim-btn[data-sim="play"] { background: var(--blue); color: var(--on-blue); }
.sim-btn[data-sim="play"]:hover { background: var(--blue-hover); }
.sim-btn[data-sim="play"] svg { fill: currentColor; }
.sim-btn:disabled { color: var(--text-3); opacity: .5; cursor: default; background: transparent; }
.sim-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.sim-caption { margin: 12px 0 8px; font-size: 14px; color: var(--text-2); }
.prose .sim-url { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg-alt); box-shadow: none; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; word-break: normal; }
.sim-url del { background: var(--strike-wash); color: var(--strike); text-decoration: line-through; }
.sim-url ins { background: var(--keep-wash); color: var(--keep); text-decoration: none; }
.sim-final { margin: 14px 0 0; padding: 12px; border-radius: var(--r); background: var(--keep-wash); }
.prose .sim-result { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--keep); }
.sim-result b { font-weight: inherit; }
.prose .sim-final .sim-url { background: var(--field-bg); }
.prose .sim-timeline { list-style: none; margin: 12px 0 0; padding: 4px; max-height: 280px; overflow-y: auto; background: var(--field-bg); border: 1px solid var(--line); border-radius: var(--r); }
.prose .sim-timeline li { margin: 0; padding: 0; }
.sim-timeline button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; font: 400 14px/1.45 var(--font); letter-spacing: -0.01em; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.sim-timeline button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.sim-timeline .is-unchanged button { color: var(--text-3); }
.sim-timeline .is-current button { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--link); font-weight: 600; }
.sim-timeline button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.ro-table tr.is-sim > td { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.ro-table tr.is-sim > td:first-child { box-shadow: inset 3px 0 0 var(--blue); }

/* ---------- AdGuard → CLN converter (converter.html) ---------- */

.cv-tool > .tool-bar:last-child { margin-bottom: 0; }
.tool .btn-sm { min-height: 32px; padding: 6px 16px; font-size: 14px; }
.cv-sources { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cv-source { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.cv-source.is-over { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent); }
.cv-source-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cv-source-actions { display: flex; gap: 8px; flex: none; }
.cv-source-name { flex: 1 1 4em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.cv-source-head .link-btn { min-height: 28px; padding: 5px 12px; font-size: 13px; }
.cv-input, .cv-field select, .cv-field input { width: 100%; min-height: 44px; font: 15px/1.4 var(--font); letter-spacing: -0.01em; padding: 10px 16px; }
.cv-input[type="url"], .cv-field input[type="text"] { font: 14px/1.5 var(--mono); letter-spacing: 0; }
.cv-field select { padding-right: 40px; }
.cv-list-field { margin-top: 10px; }
.tool .cv-list-field textarea.cv-list { min-height: 130px; margin: 0; }
.cv-list-field .code-field-bar { padding-top: 6px; padding-bottom: 6px; }
.cv-file-btn { position: relative; display: inline-flex; align-items: center; }
.cv-file-btn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.cv-list-hint { margin-top: 8px; }
.cv-msg { margin: 10px 0 0; }
.cv-msg.is-ok { color: var(--keep); }
.cv-msg.is-err { color: var(--strike); }
.cv-msg.is-busy { color: var(--link); }
.cv-hint { display: block; font-size: 13px; line-height: 1.5; font-weight: 400; color: var(--text-2); }
.cv-hint code, .cv-check code { font-size: 0.92em; }

.cv-fields { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.cv-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cv-field > label { font-size: 14px; font-weight: 600; }
.cv-checks { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.cv-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.cv-check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--blue); }
.cv-check input:disabled + span { opacity: .5; }
.cv-check b { display: block; font-weight: 600; margin-bottom: 2px; }
.cv-convert-bar { margin: 22px 0 0; }
.cv-convert-bar .tool-msg { margin: 0; }
.prose .cv-empty-note { font-size: 15px; color: var(--text-3); border: 1px dashed var(--line); border-radius: var(--r); padding: 14px 18px; }

.cv-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 0; }
.cv-stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; background: var(--bg); border-radius: var(--r-sm); padding: 12px 14px; }
.cv-stat dd { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cv-stat dt { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.cv-stat dt code { font-size: 0.92em; }
.cv-stat.is-good dd { color: var(--keep); }
.cv-stat.is-warn dd { color: var(--warn); }
.cv-size { margin: 0 0 0 auto; }
.tool textarea.cv-out { min-height: 340px; height: 440px; }

.cv-report-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.cv-filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.cv-filters button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 6px 5px 14px;
  font: 400 14px/1.2 var(--font); letter-spacing: -0.01em;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer;
}
.cv-filters button:hover { border-color: var(--text-3); }
.cv-filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cv-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--bg-alt); color: var(--text-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cv-filters button[aria-pressed="true"] .cv-count { background: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
.cv-search { flex: 0 1 240px; min-width: 160px; }
.tool .cv-report-wrap { max-height: 520px; overflow: auto; margin: 16px 0 0; }
.cv-report-wrap thead th { position: sticky; top: 0; z-index: 1; }
.cv-table { font-size: 14px; }
.cv-table th, .cv-table td { padding: 10px 14px; }
.prose .cv-table td code { font-size: 12.5px; white-space: normal; color: var(--text); font-weight: 400; overflow-wrap: anywhere; }
.cv-table td.cv-line { white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.prose .cv-table code.cv-output { display: block; margin-top: 4px; color: var(--text-2); }
.cv-table td.cv-none { text-align: center; color: var(--text-2); padding: 24px 14px; }
.cv-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: 0; }
.cv-b-skipped, .cv-b-removed { background: var(--strike-wash); color: var(--strike); }
.cv-b-warning { background: var(--warn-wash); color: var(--warn); }
.cv-b-note { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--link); }
.cv-b-info, .cv-b-kept { background: var(--keep-wash); color: var(--keep); }
.cv-b-duplicate, .cv-b-excluded { background: var(--bg-alt); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.cv-test-wrap { margin: 16px 0 0; }
@media (max-width: 560px) {
  .tool { padding: 16px; }
  .tool .code-field textarea { font-size: 12.5px; padding: 12px 14px; }
  .cv-source { padding: 14px; }
  .cv-size { margin-left: 0; flex-basis: 100%; }
  .cv-search { flex-basis: 100%; }
}

/* ---------- 404 ---------- */

.notfound { padding: 140px 0 160px; text-align: center; }
.notfound h1 { font-size: clamp(44px, 8vw, 80px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; margin: 10px 0 18px; }
.notfound .lede { font-size: 21px; color: var(--text-2); max-width: 560px; margin: 0 auto; }
.notfound .actions { justify-content: center; margin-top: 36px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--bg-alt); color: var(--text-2); font-size: 12px; letter-spacing: -0.01em; padding: 40px 0 28px; }
.site-footer .container { max-width: var(--max-wide); }
.foot-grid { display: grid; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer .brand-name { font-size: 15px; }
.site-footer .brand img { width: 20px; height: 20px; }
.site-footer p { max-width: 40ch; margin: 10px 0 0; line-height: 1.5; }
.site-footer h3 { font-size: 12px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; }
.site-footer li a { display: inline-block; padding: 4px 0; min-height: 24px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 16px; }
.foot-base a { display: inline-block; padding: 4px 0; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; transform: translateY(20px); animation: rise .9s cubic-bezier(.16, 1, .3, 1) forwards; }
  .d1 { animation-delay: .05s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .2s; } .d4 { animation-delay: .28s; } .d5 { animation-delay: .4s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
  /* site.js adds .settled shortly after load, so content never depends on an animation finishing. */
  .js.settled .rise { opacity: 1; transform: none; animation: none; }
  .js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s ease, transform .9s cubic-bezier(.16, 1, .3, 1); }
  .js .reveal.in { opacity: 1; transform: none; }
  .btn, .icon-btn, .toc a, .samples button, .link-btn, .cv-filters button { transition: background-color .2s, border-color .2s, color .2s, opacity .2s; }
}
