/* Prudent Vigilance site styles.
   Warm paper background, serif display type, green accent, pill controls.
   Fonts are self-hosted (SIL OFL, licences beside the files). No external requests.
   Theme: follows the system until the visitor picks one; theme.js sets
   data-theme="light" or "dark" on <html>. */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-var.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-italic-var.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f3eee4;
  --bg-glow: #ece2cf;
  --card: #fffaf2;
  --card-2: #f8f1e4;
  --ink: #1c1915;
  --muted: #6a6458;
  --line: #ddd4c4;
  --accent: #3f8f4a;
  --accent-deep: #2b6834;
  --accent-soft: #e2efe2;
  --accent-ink: #ffffff;
  --warn-bg: #fbf0d9;
  --warn-line: #e3c27a;
  --ok: #1a7f4b; --info: #2563eb; --caution: #a86c12; --bad: #b8382a;
  --crit: #c0573e; --major: #d7a03a;
  --shadow: 0 1px 2px rgb(60 45 20 / .06), 0 8px 24px -12px rgb(60 45 20 / .18);
  --shadow-lg: 0 2px 4px rgb(60 45 20 / .05), 0 24px 48px -20px rgb(60 45 20 / .28);
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --radius: 1.1rem;
  --radius-sm: .6rem;
  --measure: 70ch;
  /* Older names used by the tool styles below. */
  --surface: var(--card);
  --fg: var(--ink);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f; --bg-glow: #231e15; --card: #1d1a14; --card-2: #24211a;
    --ink: #efe8db; --muted: #a8a091; --line: #36322b;
    --accent: #7cc488; --accent-deep: #9ad6a4; --accent-soft: #1f2e21; --accent-ink: #10200f;
    --warn-bg: #2b2516; --warn-line: #7d6526;
    --ok: #4ade80; --info: #7aa7ff; --caution: #f6c35b; --bad: #ff8a7a;
    --crit: #e07a62; --major: #e6b85a;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -14px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 48px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f; --bg-glow: #231e15; --card: #1d1a14; --card-2: #24211a;
  --ink: #efe8db; --muted: #a8a091; --line: #36322b;
  --accent: #7cc488; --accent-deep: #9ad6a4; --accent-soft: #1f2e21; --accent-ink: #10200f;
  --warn-bg: #2b2516; --warn-line: #7d6526;
  --ok: #4ade80; --info: #7aa7ff; --caution: #f6c35b; --bad: #ff8a7a;
  --crit: #e07a62; --major: #e6b85a;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -14px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 48px -20px rgb(0 0 0 / .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--ink);
  background: radial-gradient(1100px 520px at 8% -8%, var(--bg-glow) 0%, transparent 60%) no-repeat, var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent-soft); }
h1, h2, h3, h4 { font-family: var(--serif); letter-spacing: -.02em; line-height: 1.15; margin: 1.6em 0 .5em; font-weight: 650; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin-top: .4em; letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
h4 { font-size: 1.05rem; }
p, ul, ol { max-width: var(--measure); }
li { margin: .2em 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--card-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3em; }
pre.code { max-width: 100%; overflow-x: auto; padding: 14px 16px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font: .88rem/1.6 var(--mono); }
pre.code code { background: none; border: 0; padding: 0; font-size: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
abbr[title] { text-decoration: underline dotted; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 24px; padding-bottom: 80px; min-height: 60vh; }
main.wide { max-width: 1320px; }
@media (max-width: 760px) { .wrap { padding: 0 18px; } body { font-size: 16px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 30; border-radius: 8px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand .word { font: 650 1.2rem/1 var(--serif); letter-spacing: -.02em; }
.brand .word b { font-weight: 650; color: var(--accent-deep); }
.site-header nav { margin-left: auto; }
.site-header ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; max-width: none; }
.site-header li { margin: 0; }
.site-header nav a { display: block; padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 15.5px; font-weight: 600; }
.site-header nav a:hover { color: var(--ink); background: var(--card-2); }
.site-header nav a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.theme-btn { width: 38px; height: 38px; flex: none; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.theme-btn[hidden] { display: none; }
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
@media (max-width: 900px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; gap: 8px 12px; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; }
  .theme-btn { margin-left: auto; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; padding: 48px 0 40px; margin-top: 24px; background: color-mix(in srgb, var(--card-2) 50%, transparent); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
.site-footer p { margin: .5em 0; max-width: 36rem; }
.site-footer h2 { font: 700 12.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 4px 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-deep); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; font-size: .9rem; }
.foot-base p { margin: 0; }

/* ---------- Type helpers ---------- */
.eyebrow { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-deep); }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 44rem; margin: 14px 0 0; }
@media (max-width: 760px) { .lede { font-size: 1.08rem; } }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.8em; }

/* Page header used on inner pages */
.page-head { padding: 28px 0 8px; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.page-head .lede { margin-top: 14px; }
.page-head .crumbs { margin: 0 0 12px; }
.page-head.with-icon { display: flex; gap: 20px; align-items: center; }
.page-head.with-icon img { width: 72px; height: 72px; border-radius: 18px; flex: none; box-shadow: var(--shadow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; font-size: .98rem; line-height: 1.3;
}
.btn:hover { background: var(--accent-deep); text-decoration: none; }
.btn.lg { padding: 12px 24px; font-size: 1.02rem; }
.btn.secondary, .btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.secondary:hover, .btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); background: var(--card); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.btn:disabled, .btn-plain:disabled { opacity: .45; cursor: not-allowed; }
.btn-plain {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; border-radius: 999px; font-weight: 600; font-size: .95rem; line-height: 1.3;
  background: var(--card); color: var(--accent-deep); border: 1px solid var(--line); text-decoration: none;
}
.btn-plain:hover:not(:disabled) { border-color: var(--accent); }
button { font: inherit; cursor: pointer; }

/* ---------- Cards, tags, notes ---------- */
.note {
  display: block; background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: var(--radius); padding: 14px 18px; max-width: var(--measure); margin: 20px 0;
}
.note p { margin: .25em 0; }
.note.quiet { background: var(--card-2); border: 1px dashed var(--line); color: var(--muted); max-width: none; }
.note.quiet strong, .note.quiet b { color: var(--ink); }

.tag { display: inline-block; font-size: 12.5px; font-weight: 700; line-height: 1.5; padding: 2px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.tag.local { color: var(--accent-deep); background: var(--accent-soft); box-shadow: none; }
.tag.net { color: var(--caution); background: color-mix(in srgb, var(--caution) 12%, transparent); box-shadow: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 0; margin: 20px 0; list-style: none; max-width: none; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; margin: 0;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card h3 { margin: 0; font-size: 1.2rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:hover h3 a { color: var(--accent-deep); }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.card .meta { margin-top: auto; padding-top: 6px; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.card .meta a { position: relative; z-index: 1; }
.card-head { display: flex; gap: 14px; align-items: center; }
.card-head img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); flex: none; }
.card .ico svg { width: 22px; height: 22px; }
.card .go { position: absolute; top: 22px; right: 22px; color: var(--muted); transition: transform .15s ease, color .15s; }
.card:hover .go { color: var(--accent-deep); transform: translateX(3px); }
.card.shot { padding: 0; overflow: hidden; }
.card.shot .thumb { aspect-ratio: 16 / 10; background: var(--card-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.card.shot .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: transform .4s ease; }
.card.shot .thumb img.dk, .feature .pic img.dk { display: none; }
:root[data-theme="dark"] .card.shot .thumb img.lt:has(+ img.dk), :root[data-theme="dark"] .feature .pic img.lt { display: none; }
:root[data-theme="dark"] .card.shot .thumb img.dk, :root[data-theme="dark"] .feature .pic img.dk { display: block; }
:root[data-theme="dark"] .card.shot .thumb img:only-child { filter: brightness(.82); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card.shot .thumb img.lt:has(+ img.dk), :root:not([data-theme="light"]) .feature .pic img.lt { display: none; }
  :root:not([data-theme="light"]) .card.shot .thumb img.dk, :root:not([data-theme="light"]) .feature .pic img.dk { display: block; }
  :root:not([data-theme="light"]) .card.shot .thumb img:only-child { filter: brightness(.82); }
}
.card.shot:hover .thumb img { transform: scale(1.03); }
.card.shot .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card.shot .go { top: auto; bottom: 20px; }
.card.muted-card { opacity: .8; }
@media (prefers-reduced-motion: reduce) { .card, .card .go, .card.shot .thumb img { transition: none; } .card:hover { transform: none; } }

.linklist { list-style: none; padding: 0; max-width: none; margin: 0; }
.linklist li { padding: 14px 0; border-top: 1px solid var(--line); margin: 0; }
.linklist li:first-child { border-top: 0; }
.linklist a { font-weight: 600; }
.linklist .meta { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 18px 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.two > .panel { margin: 0; }
.two.spaced { margin-top: 24px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.shots figure { margin: 0; }
.shots img { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); background: var(--card); }
.shots figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 26px; margin: 8px 0; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; }
thead th { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

input[type="search"], input[type="text"], input[type="number"], input[type="email"], input[type="date"], select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type="search"] { border-radius: 999px; padding-left: 16px; }

/* ---------- Home ---------- */
.hero { padding: 56px 0 36px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 920px) { .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 28px; } }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 3.9rem); margin: 0; line-height: 1.04; }
.hero h1 em { font-style: normal; color: var(--accent-deep); }
.hero .lede { margin-top: 20px; }
.hero .btn-row { margin-top: 28px; }
.hero-art { width: 100%; max-width: 520px; justify-self: end; }
.hero-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 40px rgb(60 45 20 / .14)); }
@media (max-width: 920px) { .hero-art { justify-self: center; max-width: 440px; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 12px 0 72px; padding: 0; list-style: none; max-width: none; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } }
.stats li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0; }
.stats b { display: block; font: 650 2.2rem/1 var(--serif); letter-spacing: -.03em; color: var(--ink); }
.stats span { color: var(--muted); font-size: .93rem; }

.section { margin: 0 0 80px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin: 0; }
.section-head p { color: var(--muted); margin: 10px 0 0; max-width: 38rem; }
.section-head .more { font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (max-width: 620px) { .section-head { flex-direction: column; align-items: start; } }

.feature { display: grid; grid-template-columns: 1fr 1.1fr; background: var(--card); border: 1px solid var(--line); border-radius: 1.5rem; overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }
.feature .txt { padding: 40px; }
.feature .txt h2 { margin: 0 0 12px; }
.feature .txt p { color: var(--muted); }
.feature .pic { background: var(--card-2); border-left: 1px solid var(--line); padding: 28px 0 0 28px; display: flex; align-items: end; overflow: hidden; }
.feature .pic img { display: block; border-radius: 12px 0 0 0; border: 1px solid var(--line); border-right: 0; border-bottom: 0; box-shadow: var(--shadow-lg); }
@media (max-width: 860px) { .feature .pic { border-left: 0; border-top: 1px solid var(--line); } .feature .txt { padding: 28px; } }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; padding: 0; max-width: none; margin: 0; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }
.principles li { margin: 0; padding: 4px 0 0 18px; border-left: 3px solid var(--accent); }
.principles h3 { margin: 0 0 6px; }
.principles p { margin: 0; color: var(--muted); }

/* ---------- About ---------- */
.about-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px 0 8px; }
@media (max-width: 640px) { .about-hero { grid-template-columns: 1fr; } }
.monogram { width: 112px; height: 112px; border-radius: 30px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); font: 650 40px/1 var(--serif); letter-spacing: -.03em; box-shadow: var(--shadow-lg); }
.about-hero h1 { margin: 0; }
.about-hero .role { margin: 8px 0 0; color: var(--muted); font-size: 1.1rem; }
.timeline { list-style: none; padding: 0; margin: 0; max-width: none; }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.timeline li:first-child { border-top: 0; }
.timeline .yrs { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .95rem; }
.timeline .what { font-weight: 600; }
.timeline .what small { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; max-width: none; }
.pills li { margin: 0; padding: 5px 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: .95rem; }

/* ---------- Tools: shared ---------- */
.crumbs { margin: .4em 0 0; color: var(--muted); font-size: .95rem; }
.crumbs a { color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 32px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.copy-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 3px 12px; font-size: .85rem;
}
.copy-btn:hover { border-color: var(--accent); }
.copy-btn.copied { border-color: var(--ok); color: var(--ok); }

/* Safety Navigator */
.sn-tools { margin: 24px 0 8px; display: grid; gap: 6px; max-width: 560px; }
.sn-tools label { font-weight: 700; }
.sn-tools input { width: 100%; }
.sn-tools p { margin: 2px 0; }
.sn-table { font-size: .94rem; margin-top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.sn-table tbody tr:last-child > * { border-bottom: 0; }
.sn-table tbody tr:hover > * { background: var(--card-2); }
.sn-table tbody th { font-weight: 700; min-width: 120px; max-width: 220px; }
.sn-table td:nth-child(3), .sn-table td:nth-child(4) { min-width: 140px; }
.sn-table tr[hidden] { display: none; }
@media (max-width: 760px) {
  .sn-table thead { display: none; }
  .sn-table tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .sn-table th, .sn-table td { display: block; border: 0; padding: 2px 0; }
  .sn-table td:nth-child(3)::before { content: "Serious ICSR: "; color: var(--muted); }
  .sn-table td:nth-child(4)::before { content: "Non-serious ICSR: "; color: var(--muted); }
  .sn-table td:nth-child(5)::before { content: "Sections: "; color: var(--muted); }
}
.sn-regulator { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; position: sticky; top: 66px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 0; z-index: 5; }
@media (max-width: 900px) { .chips { position: static; } }
.chips a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; text-decoration: none; background: var(--card); font-weight: 600; font-size: .93rem; }
.chips a:hover { border-color: var(--accent); }
.chips a.empty { opacity: .45; }
.sn-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 16px; margin: 16px 0; scroll-margin-top: 130px; }
.sn-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sn-section h2 { margin: .8em 0 .4em; font-size: 1.3rem; }
.req h3 { font: 700 .82rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; margin: 1.2em 0 .3em; color: var(--muted); }
.req-text { white-space: pre-wrap; margin: .2em 0 .6em; }
.sn-links { padding-left: 1.2em; }

/* Causality */
.ca-app { margin-top: 24px; max-width: 780px; }
.ca-toolbar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 10px; }
.ca-patient { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 16px; }
.ca-patient summary { cursor: pointer; font-weight: 700; }
.ca-patient-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0 4px; }
.ca-patient-fields label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.ca-patient-fields .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .ca-patient-fields { grid-template-columns: 1fr; } }
.ca-progress p { margin: 0 0 6px; }
.ca-track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.ca-fill { height: 100%; width: 0; background: var(--accent); transition: width .25s; border-radius: 99px; }
.ca-q { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 18px 22px 20px; margin: 0 0 16px; min-width: 0; box-shadow: var(--shadow); }
.ca-js .ca-q { display: none; }
.ca-js .ca-q.active { display: block; }
.ca-q legend { font: 650 1.25rem/1.3 var(--serif); letter-spacing: -.01em; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.ca-q legend + * { clear: both; }
.ca-num { display: block; font: 700 .78rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-deep); margin-bottom: 6px; }
.ca-q abbr[title] { text-decoration: underline dotted; cursor: help; }
.ca-tip { color: var(--muted); margin: .3em 0; }
.ca-scales { margin: .2em 0 .6em; color: var(--muted); }
.ca-guide { margin: 6px 0 12px; }
.ca-guide summary { cursor: pointer; color: var(--accent-deep); font-weight: 700; font-size: .95rem; }
.ca-guide p { font-size: .95rem; margin: .4em 0; }
.ca-options { display: grid; gap: 8px; }
.ca-option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; cursor: pointer; background: var(--card); }
.ca-option:hover { border-color: var(--accent); }
.ca-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ca-option input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.ca-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ca-hint { flex: 1; text-align: center; }
.ca-error { color: var(--bad); font-weight: 600; margin: 0 0 8px; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } .ca-fill { transition: none; } }
.ca-results:focus { outline: none; }
.ca-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ca-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.ca-card h3 { margin: 0; }
.ca-card p { margin: .2em 0; }
.ca-cat { font: 650 1.4rem/1.2 var(--serif); }
.ca-card.c-high { border-left-color: var(--ok); } .ca-card.c-high .ca-cat { color: var(--ok); }
.ca-card.c-mod { border-left-color: var(--info); } .ca-card.c-mod .ca-cat { color: var(--info); }
.ca-card.c-low { border-left-color: var(--caution); } .ca-card.c-low .ca-cat { color: var(--caution); }
.ca-card.c-none { border-left-color: var(--bad); } .ca-card.c-none .ca-cat { color: var(--bad); }
.ca-status { min-height: 1.4em; color: var(--muted); font-size: .9rem; }
.ca-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 20px 24px; max-width: min(560px, 92vw); width: 100%; box-shadow: var(--shadow-lg); }
.ca-dialog::backdrop { background: rgb(0 0 0 / .45); }
.ca-dialog h2 { margin-top: 0; font-size: 1.3rem; }
.ca-history-list { list-style: none; padding: 0; max-height: 50vh; overflow: auto; }
.ca-history-item { display: grid; gap: 2px; width: 100%; text-align: left; background: none; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; }
.ca-history-item:hover { background: var(--accent-soft); }
.print-only { display: none; }

@media print {
  body > *:not(main), main > *:not(#ca-report), .site-footer, .site-header { display: none !important; }
  #ca-report { display: block !important; color: #000; }
  #ca-report h1 { font-size: 20pt; }
  #ca-report li { margin: 4px 0; }
}

/* Disproportionality analyzer */
.pva-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px 18px; margin: 18px 0; }
.pva-h { font-size: 1.25rem; margin: .8em 0 .6em; }
.pva-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px 18px; align-items: start; }
@media (max-width: 900px) { .pva-grid { grid-template-columns: 1fr 1fr; } .pva-grid .pva-field:first-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .pva-grid { grid-template-columns: 1fr; } }
.pva-field { display: grid; gap: 5px; }
.pva-field label { font-weight: 700; }
.pva-runbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
#status { font-weight: 600; font-size: .92rem; }
#status[style*="red"] { color: var(--bad) !important; }
#status[style*="green"] { color: var(--ok) !important; }
#status[style*="blue"], #status[style*="black"] { color: var(--ink) !important; }
.loader { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.loader[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.pva-saved { margin-top: 10px; }
.pva-saved summary { cursor: pointer; font-weight: 700; }
.pva-saved-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pva-saved-row select { min-width: 260px; max-width: 100%; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
@media (max-width: 700px) { .stat-strip { grid-template-columns: 1fr 1fr; } }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; background: var(--card); }
.stat.accent { background: var(--accent-soft); }
.stat-n { font: 650 1.6rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stat-l { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 860px) { .charts-row { grid-template-columns: 1fr; } }
.chart-panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); }
.chart-title { font-weight: 700; font-size: .9rem; margin: 0 0 8px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; height: 100%; background: none; border: 0; padding: 0; color: inherit; }
.chart-col .bar { width: 100%; max-width: 28px; background: var(--accent); border-radius: 5px 5px 2px 2px; min-height: 4px; }
.chart-col:hover .bar { opacity: .8; }
.chart-col .lbl { font-size: .65rem; color: var(--muted); margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reason-row { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; align-items: center; font-size: .88rem; margin: 6px 0; }
.reason-track { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.reason-fill { height: 100%; background: var(--accent); }
.reason-fill.dme { background: var(--muted); }
.reason-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.results-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.results-actions [hidden] { display: none; }
.inline-filter { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--muted); }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.results { font-size: .88rem; }
table.results th, table.results td { white-space: nowrap; padding: 6px 10px; }
table.results thead th { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink); }
table.results td:nth-child(n+3):nth-child(-n+7) { text-align: right; font-variant-numeric: tabular-nums; }
table.results thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
table.results thead tr.filter-header th { top: 34px; }
table.results thead th.sortable { cursor: pointer; user-select: none; }
table.results thead th.sortable[aria-sort="ascending"]::after { content: " ▲"; }
table.results thead th.sortable[aria-sort="descending"]::after { content: " ▼"; }
table.results .filter-header input { width: 100%; min-width: 120px; padding: 4px 8px; font-size: .85rem; border-radius: 8px; }
table.results tbody tr { cursor: pointer; }
table.results tbody tr:hover td, table.results tbody tr.selected td { background: var(--accent-soft); }
table.results .signal-yes { font-weight: 700; color: var(--ok); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; }
.pair-detail { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; background: var(--card); }
.pair-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
table.twobytwo { width: auto; margin: 6px 0; }
table.twobytwo th, table.twobytwo td { border: 1px solid var(--line); padding: 6px 14px; text-align: center; }
table.twobytwo td { font-weight: 700; font-variant-numeric: tabular-nums; }

/* EURD filter */
.eu-load { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
@media (max-width: 760px) { .eu-load { grid-template-columns: 1fr; } }
.eu-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 18px; margin-bottom: 16px; }
.eu-card h2 { font-size: 1.25rem; margin: .8em 0 .6em; }
.eu-drop { display: grid; gap: 8px; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; cursor: pointer; background: var(--card-2); }
.eu-drop:hover, .eu-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.eu-drop input { font-size: .9rem; }
.eu-info { margin: 8px 0; }
.eu-preview { overflow: auto; margin: 6px 0; }
.eu-preview table { font-size: .78rem; }
.eu-preview th, .eu-preview td { padding: 3px 6px; white-space: nowrap; }
.eu-or { display: block; margin: 14px 0 4px; font-weight: 700; }
.eu-card textarea { width: 100%; margin-bottom: 8px; font: inherit; }
.eu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.eu-grid label { display: grid; gap: 4px; font-weight: 700; }
.eu-grid select { width: 100%; }
.eu-quick label { display: inline-flex; gap: 4px; margin-left: 8px; font-weight: 400; }
.eu-check { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; }
.eu-fuzzy { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.eu-progress { max-width: 520px; }
.eu-note { min-height: 1.4em; font-size: .92rem; color: var(--muted); }
.eu-note.success { color: var(--ok); } .eu-note.error { color: var(--bad); }
.eu-results-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.eu-results-bar input { flex: 1; min-width: 200px; }
.eu-table table { font-size: .88rem; }
.eu-table thead th { position: sticky; top: 0; background: var(--card); }

/* PV news */
.pn-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; margin: 20px 0; }
.pn-tools label { display: grid; gap: 4px; font-weight: 700; }
.pn-tools input { min-width: 280px; }
.pn-tools p { flex-basis: 100%; margin: 0; }
.pn-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px 8px; margin: 16px 0; }
.pn-day h2 { font: 700 .82rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em; margin: 1.2em 0 .2em; color: var(--accent-deep); }
.pn-day[hidden], .pn-list li[hidden] { display: none; }
.pn-list .meta .tag { margin-right: 6px; }
.pn-sources { font-size: .92rem; }

/* ---------- Dashboard: EMA PV inspections ---------- */
/* Chart colours are variables so the charts follow the theme (see _data/dashboard.js). */
.dash {
  --d-crit: #c0573e; --d-major: #d39a2c; --d-minor: #4f86b0; --d-a: #2f6e38; --d-b: #9cc89f;
  --d-grid: #e6dccb; --d-mark: #946400; --d-on-a: #ffffff;
  font-size: .95rem;
}
:root[data-theme="dark"] .dash {
  --d-crit: #e07a62; --d-major: #e6b85a; --d-minor: #7fb0d8; --d-a: #7cc488; --d-b: #3f6e46;
  --d-grid: #34302a; --d-mark: #e6b85a; --d-on-a: #10200f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dash {
    --d-crit: #e07a62; --d-major: #e6b85a; --d-minor: #7fb0d8; --d-a: #7cc488; --d-b: #3f6e46;
    --d-grid: #34302a; --d-mark: #e6b85a; --d-on-a: #10200f;
  }
}
.dash p, .dash ul { max-width: none; }
.dash-bar {
  position: sticky; top: 66px; z-index: 6; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  margin: 8px 0 0; padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
@media (max-width: 900px) { .dash-bar { position: static; } }
.dash-bar label { font-size: .85rem; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.dash-bar input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.dash select { padding: 5px 10px; font-size: .88rem; border-radius: 999px; }
.dash .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.dash .seg button { border: 0; background: transparent; padding: 5px 12px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.dash .seg button:hover { color: var(--ink); background: var(--card-2); }
.dash .seg button.on { background: var(--accent); color: var(--accent-ink); }
.dash-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 4px; }
.dash-nav a { padding: 4px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; font-weight: 600; font-size: .88rem; }
.dash-nav a:hover { border-color: var(--accent); }
.dash-main section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; scroll-margin-top: 150px; }
.dash-main h2 { margin: 0 0 6px; font-size: 1.45rem; }
.dash-main h3 { font-size: 1.1rem; margin: 18px 0 6px; }
.dash .cap { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.dash .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.dash .kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card-2); }
.dash .kpi b { display: block; font: 650 1.8rem/1.15 var(--serif); letter-spacing: -.02em; }
.dash .kpi span { font-size: .82rem; color: var(--muted); }
.dash .callout { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 10px; margin-top: 14px; }
.dash table { font-size: .86rem; }
.dash th, .dash td { padding: 6px 9px; }
.dash th { background: var(--card-2); font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .84rem; }
.dash td.n, .dash th.n { text-align: right; font-variant-numeric: tabular-nums; }
.dash .tw { overflow-x: auto; margin: 10px 0; }
.dash blockquote { margin: 10px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--card-2); border-radius: 8px; }
.dash blockquote cite { display: block; font-size: .82rem; color: var(--muted); margin-top: 4px; }
.dash .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 4px 0; }
.dash .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dash svg { max-width: 100%; height: auto; }
.dash svg text { font-family: var(--sans); }
.dash .ctl { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.dash .ctl label { font-size: .88rem; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.dash ul { padding-left: 20px; }
.dash li { margin: 4px 0; }
.dash-foot { color: var(--muted); font-size: .85rem; text-align: center; padding: 16px 0 0; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 9px; border-radius: 8px; font-size: .8rem; display: none; z-index: 30; white-space: pre; box-shadow: var(--shadow); }
