/* ToolDrop shared styles — one source of truth for every tool.
   Hosted at https://tooldrop.dev/assets/tooldrop.css and loaded cross-origin by each subdomain. */
:root {
  --bg: #f6f7f9; --fg: #1a1a1a; --muted: #666; --border: #d5d8dd;
  --card: #fff; --accent: #2271b1; --accent-fg: #fff;
  --err: #b32d2e; --ok: #1a7f37; --code-bg: #f0f1f3; --ad: #fafbfc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d; --fg: #e6e7e9; --muted: #9aa0a8; --border: #333842;
    --card: #1e2128; --accent: #4f9fd6; --accent-fg: #08111a;
    --err: #f28b82; --ok: #7ee787; --code-bg: #14161b; --ad: #1a1d23;
  }
}
* { box-sizing: border-box; }
/* Root font-size drives the accessibility text-size control (rem-based UI scales). */
html { font-size: 100%; }
:root[data-font="large"] { font-size: 112.5%; }
:root[data-font="xl"] { font-size: 125%; }
body {
  margin: 0; padding: 1.5rem; background: var(--bg); color: var(--fg);
  font: 0.9375rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 820px; margin: 0 auto; }

/* Top nav (injected) */
#td-topnav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  margin-bottom: 1.4rem; font-size: .85rem; }
#td-topnav .brand { font-weight: 700; color: var(--fg); text-decoration: none; margin-right: .3rem; }
#td-topnav a { color: var(--muted); text-decoration: none; }
#td-topnav a:hover { color: var(--accent); }
#td-topnav a.active { color: var(--accent); font-weight: 600; }
.td-example { margin-top: .5rem; }
.td-inmeta { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .5rem; }
.td-count { font-size: .75rem; color: var(--muted); }
.td-clear { font-size: .75rem; padding: .25rem .6rem; }

/* Category dropdown menus — scales as tools are added. */
.td-menu { display: flex; flex-wrap: wrap; gap: .1rem .4rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.td-menu-item { position: relative; }
.td-menu-btn { background: none; border: 1px solid transparent; color: var(--muted); font: inherit; font-size: .85rem;
  cursor: pointer; padding: .3rem .55rem; border-radius: 6px; }
.td-menu-btn::after { content: " ▾"; opacity: .6; }
.td-menu-btn:hover, .td-menu-btn.active { color: var(--accent); }
.td-menu-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--border); background: var(--card); }
.td-menu-panel { display: none; position: absolute; top: 100%; left: 0; z-index: 1000; min-width: 210px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: .35rem; margin-top: .35rem; }
/* Invisible bridge over the visual gap so the hover path button→panel never breaks. */
.td-menu-panel::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: .45rem; }
.td-menu-item.open > .td-menu-panel { display: block; }
@media (hover: hover) { .td-menu-item:hover > .td-menu-panel { display: block; } }
.td-menu-panel a { display: block; padding: .45rem .6rem; border-radius: 6px; color: var(--fg);
  text-decoration: none; font-size: .85rem; white-space: nowrap; }
.td-menu-panel a:hover { background: var(--code-bg); color: var(--accent); }
.td-menu-panel a.active { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  #td-topnav { position: relative; }
  .td-menu-item { position: static; }
  .td-menu-panel { left: .5rem; right: .5rem; top: calc(100% + .35rem); min-width: 0; }
}

header h1 { font-size: 1.45rem; margin: 0 0 .3rem; line-height: 1.25; }
p.sub { margin: 0 0 1.25rem; color: var(--muted); font-size: .92rem; }

/* Trust chips (landing hero) — the value prop, stated up front. */
.td-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }
.td-chips li { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; line-height: 1.5; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .32rem .8rem; }
.td-chips .ic { font-size: .95em; line-height: 1; flex: 0 0 auto; }
.td-chips b { font-weight: 600; }
/* Per-tool trust line — reinforces "nothing uploaded" on the exact page people land on. */
.td-trust { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 1.1rem;
  font-size: .78rem; color: var(--muted); }
.td-trust::before { content: "🔒"; font-size: .85rem; }

/* Text field paired with a native color-picker swatch. */
.td-colorrow { display: flex; gap: .5rem; align-items: stretch; }
.td-colorrow input[type="text"] { flex: 1 1 auto; }
/* Match the text input's box height exactly: line-box (.82rem × 1.5) + padding (.7rem × 2)
   + border (2 × 1px). rem-based so it tracks the text-size accessibility control. */
.td-cpick { flex: 0 0 auto; height: calc(0.82rem * 1.5 + 1.4rem + 2px); aspect-ratio: 1 / 1; width: auto;
  padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg); cursor: pointer; }
.td-cpick::-webkit-color-swatch-wrapper { padding: 3px; }
.td-cpick::-webkit-color-swatch { border: none; border-radius: 5px; }
.td-cpick::-moz-color-swatch { border: none; border-radius: 5px; }
/* Pass/fail badges (contrast checker). */
.td-pass { color: var(--ok); font-weight: 700; }
.td-fail { color: var(--err); font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: .82rem; text-transform: none;
  letter-spacing: 0; color: var(--muted); margin-bottom: .5rem; }

.modes { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.modes button { flex: 0 0 auto; padding: .4rem .8rem; border: 1px solid var(--border);
  background: transparent; color: var(--fg); border-radius: 6px; cursor: pointer; font-size: .85rem; }
.modes button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.modes .sep { flex: 0 0 1px; align-self: stretch; background: var(--border); margin: .1rem .3rem; }
.modes .td-check { display: flex; align-items: center; gap: .4rem; margin: 0; text-transform: none;
  letter-spacing: 0; font-size: .82rem; color: var(--fg); cursor: pointer; }

textarea, input[type=text] { width: 100%; padding: .7rem .8rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--code-bg); color: var(--fg);
  font: 0.82rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
textarea { min-height: 140px; resize: vertical; }
.field { margin-bottom: .8rem; }
/* A field directly before a hint drops its bottom margin so the hint sits the same
   distance below as on single-input tools (avoids a double gap). */
.field:has(+ .hint) { margin-bottom: 0; }
/* .field label now inherits the unified label style (normal case, .82rem). */
.hint { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }

.btn { padding: .5rem 1rem; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-fg); border-radius: 8px; cursor: pointer; font-size: .9rem; font-weight: 600; text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--accent); filter: none; }

pre { margin: 0; padding: .8rem; background: var(--code-bg); border-radius: 8px;
  border: 1px solid var(--border); overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  font: 0.82rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; min-height: 2.5rem; }
pre.error { color: var(--err); }
pre.ok-note { color: var(--ok); border-color: var(--ok); }
.row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.copy { padding: .35rem .7rem; border: 1px solid var(--border); background: transparent;
  color: var(--fg); border-radius: 6px; cursor: pointer; font-size: .8rem; text-decoration: none; }
.copy:hover { border-color: var(--accent); }
.meta { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }

/* SEO content */
.content { margin-top: 2rem; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.content h2 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; }
.content h3 { font-size: .98rem; margin: 1.1rem 0 .3rem; }
.content p { margin: .4rem 0; }
.content code { background: var(--code-bg); padding: .1rem .35rem; border-radius: 4px;
  font: 12.5px ui-monospace, Menlo, monospace; }
.content a, .content a:visited { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.td-related { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.td-related a { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--border);
  border-radius: 999px; font-size: .85rem; color: var(--accent) !important; text-decoration: none !important; }
.td-related a:hover { border-color: var(--accent); }

/* Footer (injected) */
#td-footer { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--muted); }
#td-footer a { color: var(--accent); text-decoration: none; }
#td-footer a:hover { text-decoration: underline; }
#td-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1.5rem; }
#td-footer .cols strong { display: block; color: var(--fg); margin-bottom: .3rem; font-size: .8rem; }
#td-footer ul { list-style: none; margin: 0; padding: 0; }
#td-footer li { margin: .15rem 0; }
#td-footer .fine { margin-top: 1rem; }

/* Ad slot — hidden until an ad unit is configured; the .td-ad class (added by JS when
   ads are live) reserves the box so the live ad doesn't shift content. */
.td-ad { margin: 2rem 0 0; padding: .5rem; background: var(--ad);
  border: 1px dashed var(--border); border-radius: 8px; text-align: center;
  min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
.td-ad .ad-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: .35rem; }
.td-ad .ph { font-size: .78rem; color: var(--muted); }

/* Diff */
.td-diff span { display: block; }
.td-diff-add { color: var(--ok); }
.td-diff-del { color: var(--err); }
.td-diff-ctx { color: var(--muted); }

/* Regex tester */
.td-regex-hl { border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg);
  padding: .7rem .8rem; white-space: pre-wrap; word-break: break-word; min-height: 2.5rem; margin-bottom: .6rem;
  font: 0.82rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.td-regex-hl mark { background: var(--accent); color: var(--accent-fg); border-radius: 3px; padding: 0 1px; }
.td-regex-empty { color: var(--muted); }

/* Color swatch */
.td-swatch { height: 54px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .6rem; }

/* Contrast preview */
.td-contrast-prev { padding: 1.1rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .7rem;
  font-size: 1.15rem; font-weight: 600; text-align: center; }

/* chmod grid */
.td-chmod { border-collapse: collapse; font-size: .9rem; }
.td-chmod th, .td-chmod td { padding: .35rem .8rem; text-align: center; }
.td-chmod thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.td-chmod tbody th { text-align: left; color: var(--fg); font-weight: 600; }

/* QR code */
.td-qr { display: flex; justify-content: center; padding: .6rem; }
.td-qr svg { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }

/* Command palette (⌘K / Ctrl+K) */
.td-cmd { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem; }
.td-cmd-box { width: min(520px, 100%); background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: .5rem; }
.td-cmd-input { width: 100%; border: 1px solid var(--border); border-radius: 8px;
  background: var(--code-bg); color: var(--fg); font-size: 1rem; padding: .75rem .85rem; outline: none; }
.td-cmd-input:focus, .td-cmd-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px;
  border-color: var(--accent); box-shadow: none; }
.td-cmd-list { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.td-cmd-list li { padding: .5rem .7rem; border-radius: 8px; cursor: pointer; }
.td-cmd-name { display: block; font-size: .9rem; }
.td-cmd-desc { display: block; font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.td-cmd-list li.on { background: var(--accent); color: var(--accent-fg); }
.td-cmd-list li.on .td-cmd-desc { color: var(--accent-fg); opacity: .85; }
.td-cmd-empty { color: var(--muted); cursor: default; padding: .5rem .7rem; font-size: .9rem; }
.td-cmd-group { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); padding: .7rem .7rem .25rem; margin-top: .3rem; border-top: 1px solid var(--border); cursor: default; }
.td-cmd-group:first-child { border-top: none; margin-top: 0; padding-top: .25rem; }

/* Email viewer (eml / msg) */
.drop { border: 2px dashed var(--border); border-radius: 10px; padding: 1.4rem; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s; }
.drop.over { border-color: var(--accent); color: var(--fg); }
.hdr-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.hdr-table th { text-align: left; vertical-align: top; color: var(--muted); font-weight: 600;
  width: 6.5rem; padding: .2rem .6rem .2rem 0; white-space: nowrap; }
.hdr-table td { padding: .2rem 0; word-break: break-word; }
.bodyframe { width: 100%; height: 60vh; min-height: 340px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; }
/* Resizable wrapper (resize works on the div, not the replaced iframe). */
.td-frame { width: 100%; height: 60vh; min-height: 200px; resize: vertical; overflow: hidden;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.td-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.att { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--border); font-size: .88rem; }
.att:first-child { border-top: none; }
.att .name { font-weight: 600; }
.att .size { color: var(--muted); font-size: .8rem; }
.att a { margin-left: auto; }
.viewtabs button { font-size: .8rem; }

/* Landing hub */
[hidden] { display: none !important; }
.tools-search { margin: 2.2rem 0 1.8rem; position: relative; }
.tools-search input { width: 100%; padding: .7rem 3.6rem .7rem .9rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card); color: var(--fg); font-size: .95rem; }
.td-kbd { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); pointer-events: none;
  font: 500 .78rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: .03em;
  color: var(--muted); background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: .2rem .45rem; }
.tool-group { margin: 0; }
.group-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 1.6rem 0 .2rem; }
.group-heading:first-child { margin-top: .5rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .9rem; margin: .6rem 0 1.2rem; }
.tool-card { display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; }
.tool-card:hover { border-color: var(--accent); }
.tool-card h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--accent); }
.tool-card p { margin: 0; font-size: .85rem; color: var(--muted); }

/* ===================== Accessibility ===================== */

/* Manual theme override (wins over the prefers-color-scheme media query above). */
:root[data-theme="light"] {
  --bg: #f6f7f9; --fg: #1a1a1a; --muted: #666; --border: #d5d8dd;
  --card: #fff; --accent: #2271b1; --accent-fg: #fff;
  --err: #b32d2e; --ok: #1a7f37; --code-bg: #f0f1f3; --ad: #fafbfc;
}
:root[data-theme="dark"] {
  --bg: #16181d; --fg: #e6e7e9; --muted: #9aa0a8; --border: #333842;
  --card: #1e2128; --accent: #4f9fd6; --accent-fg: #08111a;
  --err: #f28b82; --ok: #7ee787; --code-bg: #14161b; --ad: #1a1d23;
}

/* High-contrast mode (WCAG AAA-leaning). Light variant by default; dark variant when dark. */
:root[data-contrast="high"] {
  --bg: #ffffff; --fg: #000000; --muted: #1a1a1a; --border: #000000;
  --card: #ffffff; --accent: #0b4a86; --accent-fg: #ffffff;
  --err: #8a0000; --ok: #0a5a24; --code-bg: #eeeeee; --ad: #ffffff;
}
:root[data-theme="dark"][data-contrast="high"] {
  --bg: #000000; --fg: #ffffff; --muted: #f2f2f2; --border: #ffffff;
  --card: #000000; --accent: #7ec3ff; --accent-fg: #000000;
  --err: #ff9b9b; --ok: #8bf3a0; --code-bg: #111111; --ad: #000000;
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="high"]:not([data-theme="light"]) {
    --bg: #000000; --fg: #ffffff; --muted: #f2f2f2; --border: #ffffff;
    --card: #000000; --accent: #7ec3ff; --accent-fg: #000000;
    --err: #ff9b9b; --ok: #8bf3a0; --code-bg: #111111; --ad: #000000;
  }
}

/* Focus: solid ring for regular (mouse/programmatic) focus; dashed while tabbing
   with the keyboard (the root gets .td-kbd-nav on Tab, removed on pointer input). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root.td-kbd-nav :focus-visible { outline-style: dashed; }

/* Reduced motion — by OS preference or the in-page toggle. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; scroll-behavior: auto !important;
}

/* Skip-to-content link — visible only when focused. */
.td-skip { position: absolute; left: -9999px; top: 0; z-index: 1001;
  background: var(--accent); color: var(--accent-fg); padding: .5rem .85rem;
  border-radius: 0 0 6px 0; font-size: .9rem; font-weight: 600; text-decoration: none; }
.td-skip:focus { left: 0; }
#td-main:focus { outline: none; }

/* Accessibility controls — floating widget, bottom-right (baked <details>). */
.td-a11y { position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; }
.td-a11y > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: var(--accent-fg); border: 1px solid var(--accent);
  padding: .5rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.22); }
.td-a11y > summary::-webkit-details-marker { display: none; }
.td-a11y-body { position: absolute; right: 0; bottom: calc(100% + .5rem);
  width: 260px; max-width: calc(100vw - 2rem);
  display: flex; flex-direction: column; gap: .75rem; padding: .9rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28); }
.td-a11y-body .grp { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.td-a11y-body .grp > span { font-size: .78rem; color: var(--muted); width: 100%; margin-bottom: .15rem; }
/* Segmented groups (theme, text size). */
.td-a11y-body .grp button { padding: .32rem .6rem; border: 1px solid var(--border); background: transparent;
  color: var(--fg); border-radius: 6px; cursor: pointer; font-size: .8rem; }
.td-a11y-body .grp button:hover { border-color: var(--accent); }
.td-a11y-body .grp button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Toggle rows + iOS-style switches. */
.td-a11y-body .td-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.td-a11y-body .td-row .lbl { font-size: .85rem; }
.td-a11y-body .td-row .lbl small { display: block; color: var(--muted); font-size: .72rem; }
.td-switch { flex: 0 0 auto; width: 40px; height: 22px; padding: 0; border-radius: 999px;
  border: 1px solid var(--border); background: var(--border); position: relative; cursor: pointer;
  transition: background .15s; }
.td-switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .15s; }
.td-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.td-switch[aria-checked="true"]::after { transform: translateX(18px); }
/* High-contrast: token-based so the switch is visible in dark high-contrast too. */
:root[data-contrast="high"] .td-switch { border-color: var(--fg); background: transparent; }
:root[data-contrast="high"] .td-switch::after { background: var(--fg); }
:root[data-contrast="high"] .td-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
:root[data-contrast="high"] .td-switch[aria-checked="true"]::after { background: var(--accent-fg); }
.td-a11y-reset { align-self: flex-start; margin-top: .1rem; background: none; border: none; padding: .2rem 0;
  color: var(--accent); font-size: .8rem; cursor: pointer; text-decoration: underline; }

/* Readable font — self-hosted Atkinson Hyperlegible. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-700.woff2") format("woff2"); }
:root[data-face="atkinson"] body { font-family: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Increased text spacing (WCAG 1.4.12). */
:root[data-spacing="loose"] body { line-height: 1.9; letter-spacing: .02em; word-spacing: .05em; }
:root[data-spacing="loose"] p, :root[data-spacing="loose"] li { margin-top: .7em; }

/* Underline all links (override id-scoped nav/footer rules) — but not button-styled links. */
:root[data-underline="on"] a:not(.copy):not(.btn) { text-decoration: underline !important; }

/* Always show focus (not only keyboard). */
:root[data-focus="always"] a:focus, :root[data-focus="always"] button:focus,
:root[data-focus="always"] input:focus, :root[data-focus="always"] textarea:focus,
:root[data-focus="always"] select:focus, :root[data-focus="always"] summary:focus,
:root[data-focus="always"] [tabindex]:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Print — drop the interactive chrome, print the content in black on white. */
@media print {
  #td-topnav, #td-footer, #td-ad, .td-a11y, .td-cmd, .td-skip, .tools-search,
  .copy, .btn, .td-example, .td-inmeta, .td-clear, .drop, .modes, .td-related { display: none !important; }
  body { color: #000; background: #fff; padding: 0; }
  .wrap { max-width: none; }
  .card { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  pre, .content, .content p, .content code, textarea, input { color: #000 !important; background: #fff !important; }
  a { color: #000 !important; text-decoration: underline; }
  .content { content-visibility: visible; }
}
