:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #f0ece2;
  --ink: #1c1a15;
  --ink-2: #4a463d;
  --muted: #6b6457;
  --line: #e2dbcc;
  --line-strong: #cfc6b3;
  --accent: #23345c;
  --accent-ink: #f6f3ec;
  --accent-soft: #e3e8f3;
  --focus: #3b62c4;

  --sev-blocker: #a8231b;
  --sev-blocker-bg: #f8e3e0;
  --sev-bad: #a94d1a;
  --sev-bad-bg: #f8e8dc;
  --sev-neutral: #56616f;
  --sev-neutral-bg: #e8ebef;
  --sev-good: #2b7348;
  --sev-good-bg: #e0efe5;

  --grade-a: #2b7348;
  --grade-b: #5f7f22;
  --grade-c: #94700a;
  --grade-d: #b9561f;
  --grade-f: #a8231b;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(40, 32, 16, 0.06), 0 6px 24px rgba(40, 32, 16, 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --surface: #1c1b16;
    --surface-2: #26241d;
    --ink: #ece6d9;
    --ink-2: #c9c2b3;
    --muted: #a39b8a;
    --line: #333027;
    --line-strong: #4a463a;
    --accent: #aebfe6;
    --accent-ink: #14130f;
    --accent-soft: #252c3d;
    --focus: #8fb0ff;

    --sev-blocker: #ff8a80;
    --sev-blocker-bg: #3a1c19;
    --sev-bad: #f0a06b;
    --sev-bad-bg: #36251a;
    --sev-neutral: #a9b4c2;
    --sev-neutral-bg: #252a31;
    --sev-good: #7fd19e;
    --sev-good-bg: #1a2e22;

    --grade-a: #7fd19e;
    --grade-b: #b7d66e;
    --grade-c: #e6c35a;
    --grade-d: #f0a06b;
    --grade-f: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; border-radius: 8px; }
.skip:focus { left: 16px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn-quiet {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.link-btn {
  border: 0; background: none; padding: 2px 0; color: var(--accent); cursor: pointer;
  font-size: 13px; text-decoration: underline; text-underline-offset: 2px;
}

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead-inner {
  max-width: 1320px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--accent); }
.brand-name { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.tagline { margin: 0; color: var(--ink-2); font-family: var(--serif); font-size: 17px; font-style: italic; }
.masthead-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.status { margin: 0; color: var(--muted); font-size: 13px; }

.banner {
  max-width: 1272px; margin: 16px auto 0; padding: 12px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
}

/* ---------- layout ---------- */
.layout {
  max-width: 1320px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 28px; align-items: start;
}

/* ---------- picker ---------- */
.picker {
  position: sticky; top: 16px;
  height: calc(100vh - 32px); max-height: 900px; min-height: 420px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.picker-head { padding: 14px 14px 8px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.picker-title-row, .digest-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 0; letter-spacing: -0.01em; }
.pick-count { color: var(--muted); font-size: 13px; }

.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search { position: relative; display: block; }
.search input {
  width: 100%; height: 38px; padding: 0 34px 0 34px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.search-icon { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font: 600 11px/1 var(--sans); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 6px;
  pointer-events: none;
}
.search input:focus ~ .search-kbd, .search input:not(:placeholder-shown) ~ .search-kbd { display: none; }
@media (pointer: coarse) { .search-kbd { display: none; } }

.select select {
  height: 38px; padding: 0 28px 0 10px; max-width: 100%;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer;
}
.select-cat select { width: 150px; }
.select select:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: 10px; }
.tabs button {
  border: 0; background: transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.tab-badge {
  min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; line-height: 20px;
  background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums;
}
.hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); min-height: 22px; }

.svc-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; scroll-padding: 8px; }
.svc {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px 8px 11px; border-left: 3px solid transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.svc + .svc { border-top: 1px solid var(--line); }
.svc:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.svc.is-visitor { border-left-color: var(--muted); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.svc.is-account { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.svc.skeleton { height: 54px; border-left-color: transparent; }
.svc.skeleton::before, .svc.skeleton::after { content: ""; border-radius: 6px; background: var(--surface-2); }
.svc.skeleton::before { width: 28px; height: 28px; }
.svc.skeleton::after { width: 60%; height: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .svc.skeleton::before, .svc.skeleton::after { animation: pulse 1.2s ease-in-out infinite alternate; }
}
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

.logo {
  width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); flex: none;
}
.logo-fallback { display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; border: 0; }
.svc-main { min-width: 0; }
.svc-name {
  display: block; border: 0; background: none; padding: 0; text-align: left; cursor: pointer;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.svc-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.svc-meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.svc-domain { overflow: hidden; text-overflow: ellipsis; }
.svc.is-visitor .svc-meta, .svc.is-account .svc-meta { color: var(--ink-2); }
.grade {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; flex: none;
  border-radius: 4px; font-size: 11px; font-weight: 700; color: #fff; background: var(--muted);
}
@media (prefers-color-scheme: dark) { .grade { color: #14130f; } }
.grade-A { background: var(--grade-a); } .grade-B { background: var(--grade-b); }
.grade-C { background: var(--grade-c); } .grade-D { background: var(--grade-d); } .grade-F { background: var(--grade-f); }

/* Visitor / Account toggles */
.toggles { display: inline-flex; gap: 4px; }
.toggles button {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 7px;
  padding: 4px 10px; min-height: 30px; font-size: 13px; cursor: pointer; color: var(--ink-2);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
}
.toggles button:hover { border-color: var(--muted); }
.toggles button:active { transform: scale(0.96); }
.toggles button[aria-pressed="true"] { font-weight: 600; }
.toggles button[data-mode="visitor"][aria-pressed="true"] { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }
.toggles button[data-mode="account"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toggles button[aria-pressed="true"]::before { content: "✓ "; }
.toggles-lg button { min-height: 38px; padding: 6px 16px; font-size: 14px; }

.svc-empty { padding: 28px 18px; color: var(--muted); text-align: center; display: grid; gap: 8px; justify-items: center; }
.svc-empty b { color: var(--ink-2); }

/* ---------- digest ---------- */
.digest { min-width: 0; outline: none; position: relative; }
.sticky-sentinel { position: absolute; top: 0; height: 1px; width: 1px; }
.digest-head {
  position: sticky; top: 0; z-index: 4;
  background: var(--bg); padding: 4px 0 10px; margin-bottom: 4px;
  transition: box-shadow 0.2s;
}
.digest-head.is-stuck { box-shadow: 0 8px 12px -10px rgba(0, 0, 0, 0.25); }
.summary { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 10px; }
.filters-end { display: flex; gap: 8px; align-items: center; }
.sev-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.sev-toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; min-height: 32px;
  border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid currentColor; transition: background-color 0.15s, opacity 0.15s;
}
.sev-toggle[aria-pressed="false"] { background: transparent; opacity: 0.72; font-weight: 500; }
.sev-toggle[aria-pressed="false"] .sev-dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.sev-toggle:hover { opacity: 1; }
.sev-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.sev-n { font-variant-numeric: tabular-nums; opacity: 0.85; }
.sev-blocker-c { color: var(--sev-blocker); background: var(--sev-blocker-bg); }
.sev-bad-c { color: var(--sev-bad); background: var(--sev-bad-bg); }
.sev-neutral-c { color: var(--sev-neutral); background: var(--sev-neutral-bg); }
.sev-good-c { color: var(--sev-good); background: var(--sev-good-bg); }
.sev-blocker-t { color: var(--sev-blocker); }
.sev-bad-t { color: var(--sev-bad); }
.sev-neutral-t { color: var(--sev-neutral); }
.sev-good-t { color: var(--sev-good); }

.section {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.section-muted { box-shadow: none; background: transparent; border-style: dashed; }
.section-muted .section-head { border-bottom: 0; }
.section-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.section-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.section-head h3 { font-family: var(--serif); font-size: 20px; margin: 2px 0 2px; font-weight: 600; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.section-empty { padding: 16px 18px; color: var(--muted); margin: 0; }

.group-title {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 18px 4px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.group-title .n { color: var(--muted); font-weight: 600; }
.items { list-style: none; margin: 0; padding: 0 0 6px; }
.item { border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-head {
  width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  border: 0; background: none; text-align: left; padding: 11px 18px; cursor: pointer;
  transition: background-color 0.12s;
}
.item-head:hover { background: var(--surface-2); }
.item-head:focus-visible { outline-offset: -2px; }
.item-static { cursor: default; padding: 8px 0; grid-template-columns: 10px minmax(0, 1fr); }
.item-static:hover { background: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.sev-blocker .dot { background: var(--sev-blocker); box-shadow: 0 0 0 3px var(--sev-blocker-bg); }
.sev-bad .dot { background: var(--sev-bad); }
.sev-neutral .dot { background: var(--sev-neutral); }
.sev-good .dot { background: var(--sev-good); }
.item-text { min-width: 0; }
.item-title { font-weight: 600; }
.item-svcs { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.item-svcs b { color: var(--ink-2); font-weight: 600; }
.item-count { font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 2px; display: flex; align-items: center; gap: 8px; }
.chev { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.18s var(--ease); }
.item-head[aria-expanded="true"] .chev { transform: translateY(1px) rotate(225deg); }
.item-body { padding: 0 18px 14px 40px; }
@media (prefers-reduced-motion: no-preference) {
  .item-body:not([hidden]) { animation: reveal 0.18s var(--ease); }
}
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.item-desc { margin: 0 0 10px; color: var(--ink-2); }
.theme-tag { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; margin-bottom: 8px; }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sources li { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 14px; }
.src-name { border: 0; background: none; padding: 0; font-weight: 600; cursor: pointer; color: var(--ink); }
.src-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.mode-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.src-point { display: block; color: var(--ink-2); margin-top: 2px; }
.src-analysis { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.src-link { font-size: 13px; display: inline-block; margin-top: 4px; }

.more { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.signup-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 14px; }

.docs { border-top: 1px solid var(--line); }
.docs summary { padding: 12px 18px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.docs summary:hover { color: var(--ink); }
.docs-list { list-style: none; margin: 0; padding: 0 18px 14px; display: grid; gap: 8px; }
.docs-list li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; font-size: 14px; }
.doc-svc { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-svc:hover { color: var(--accent); text-decoration: underline; }
.doc-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.doc-link { white-space: nowrap; display: inline-flex; gap: 6px; align-items: baseline; }
.doc-cached { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.doc-cached:hover { color: var(--accent); }

.empty {
  margin-top: 14px; padding: 32px 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 16px; text-align: center; }
.steps { list-style: none; counter-reset: step; margin: 0 auto 22px; padding: 0; display: grid; gap: 12px; max-width: 520px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 2px 12px; align-items: baseline; }
.steps li::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px;
}
.steps span { color: var(--ink-2); font-size: 14px; }
.empty-sub { margin: 0 0 10px; text-align: center; color: var(--ink-2); font-size: 14px; }
.empty-note { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.try-btn { padding: 5px 12px 5px 6px; }
.try-btn .logo { width: 18px; height: 18px; border-radius: 4px; font-size: 10px; }

/* ---------- footer ---------- */
.footer { max-width: 1320px; margin: 0 auto; padding: 8px 24px 48px; color: var(--muted); font-size: 13px; }
.footer p { max-width: 90ch; }
.footer .privacy { color: var(--ink-2); }
.footer-title { font-family: var(--sans); font-size: 13px; font-weight: 700; margin: 18px 0 6px; color: var(--ink-2); }
.credits { margin: 0; padding-left: 18px; max-width: 90ch; display: grid; gap: 4px; }
.footer code { font-size: 12px; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }

/* ---------- static pages: per-site summaries and the A-Z directory ---------- */
a.btn-quiet { color: var(--ink); text-decoration: none; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 6px 0 2px; }
.crumbs a { color: var(--muted); }
.sp { max-width: 860px; margin: 0 auto; padding: 24px 24px 8px; }
.sp h1 { font-family: var(--serif); font-size: 30px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.sp-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.sp-logo { width: 56px; height: 56px; border-radius: 12px; }
.sp-meta { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-intro { color: var(--ink-2); font-size: 16px; max-width: 70ch; }
.sp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 6px; }
.sp-cta .muted { font-size: 13px; flex-basis: 100%; }
.sp-section h2 { font-family: var(--serif); font-size: 20px; margin: 2px 0; font-weight: 600; }
.sp-body { padding-bottom: 10px; }
.sp-points { list-style: none; margin: 0; padding: 0 18px 8px; }
.sp-points li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.sp-points li:first-child { border-top: 0; }
.sp-points p { margin: 0; }
.sp-title { font-weight: 600; }
.sp-point { color: var(--ink-2); font-size: 14px; margin-top: 2px !important; }
.sp-analysis { color: var(--muted); font-size: 13px; margin-top: 2px !important; }
.sp-src { font-size: 13px; }
.sp-docs, .sp-related { margin-top: 22px; }
.sp-docs h2, .sp-related h2, .dir-cat h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 8px; }
.sp-docs ul { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.sp-related ul, .dir-cat ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.sp-related li, .dir-cat li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sp-related a, .dir-cat a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.dir-cats a { border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; font-size: 13px; text-decoration: none; color: var(--ink-2); }
.dir-cats a:hover { background: var(--surface-2); }
.dir-cat { margin-bottom: 22px; scroll-margin-top: 12px; }
.footer .popular { color: var(--ink-2); line-height: 1.8; max-width: 100ch; margin: 0 0 14px; }
@media (max-width: 480px) {
  .sp { padding: 16px 14px 8px; }
  .sp h1 { font-size: 24px; }
  .sp-points { padding: 0 12px 8px; }
}

/* ---------- 404 page ---------- */
.brand-link { color: inherit; text-decoration: none; }
.not-found { max-width: 560px; margin: 0 auto; padding: 72px 24px; text-align: center; }
.not-found h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 10px; }
.not-found p { color: var(--ink-2); margin: 0 0 18px; }
.not-found .not-found-code { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--accent); margin: 0 0 8px; }
.not-found code { font-size: 13px; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.btn-primary {
  display: inline-block; padding: 10px 18px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.1); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 30;
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 24px));
  padding: 10px 12px 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-size: 14px;
  transform: translate(-50%, 16px); opacity: 0; transition: transform 0.2s var(--ease), opacity 0.2s;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }
.toast-action {
  border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg);
  border-radius: 7px; padding: 5px 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.toast-action:hover { background: color-mix(in srgb, var(--bg) 28%, transparent); }

/* ---------- sheet (dialog) ---------- */
.sheet {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.sheet-wide { width: min(900px, calc(100vw - 32px)); }
.sheet::backdrop { background: rgba(20, 18, 12, 0.45); }
.sheet[open] { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in 0.2s var(--ease); }
  .sheet[open]::backdrop { animation: fade-in 0.2s; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.sheet-head h2 { flex: 1; font-size: 19px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-close {
  border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted);
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
}
.sheet-close:hover { background: var(--surface-2); color: var(--ink); }
.sheet-body { padding: 16px 18px 24px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-body h3 { font-family: var(--serif); font-size: 17px; margin: 20px 0 4px; }
.sheet-body h3:first-child { margin-top: 0; }
.sheet-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.sheet-hero .logo { width: 44px; height: 44px; border-radius: 10px; font-size: 18px; }
.sheet-mode {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--surface-2); font-weight: 600;
}
.kv { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.items-compact .item-head { padding: 6px 0; }
.good-details { margin-top: 16px; }
.good-details summary { cursor: pointer; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.doc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc-rows li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.doc-rows .doc-name { min-width: 200px; font-weight: 600; }
.doc-rows .doc-cached { font-size: 13px; color: var(--accent); }
.legend { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.legend li { display: flex; gap: 10px; align-items: center; }
.legend .sev-dot { background: currentColor; padding: 0; }
.how .steps { margin: 0 0 8px; max-width: none; }
.how p { margin: 0 0 10px; color: var(--ink-2); }
.prose { font-family: var(--serif); font-size: 16px; line-height: 1.65; max-width: 72ch; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--serif); line-height: 1.3; margin: 1.3em 0 0.4em; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 19px; } .prose h3 { font-size: 17px; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; }
.prose p, .prose ul, .prose ol { margin: 0 0 0.8em; }
.prose-source { font-size: 13px; color: var(--muted); margin: 0 0 12px; font-family: var(--sans); }

.mobile-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5;
  padding: 13px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  text-decoration: none; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ---------- touch screens: bigger targets ---------- */
@media (pointer: coarse) {
  .toggles button { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  .tabs button { min-height: 40px; }
  .search input, .select select { height: 44px; font-size: 16px; } /* 16px stops iOS zooming on focus */
  .sev-toggle { min-height: 40px; }
  .btn-quiet { min-height: 38px; }
  .item-head { padding-top: 13px; padding-bottom: 13px; }
  .link-btn { padding: 8px 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .masthead-inner { padding: 12px 16px; }
  .tagline { display: none; }
  .masthead-end { gap: 10px; }
  .status { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 16px; }
  .picker { position: static; height: auto; max-height: none; min-height: 0; }
  .svc-list { height: 58vh; flex: none; }
  .digest-head { padding-top: 8px; }
  .footer { padding: 8px 16px 96px; }
  .banner { margin: 12px 12px 0; }
  .toast { bottom: 80px; }
}
@media (max-width: 480px) {
  .search-row { grid-template-columns: 1fr; }
  .select-cat select { width: 100%; }
  .svc { grid-template-columns: 28px minmax(0, 1fr); row-gap: 8px; }
  .svc .toggles { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .item-head { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .item-body { padding: 0 14px 14px 14px; }
  .item-count > span:first-child { display: none; }
  .docs-list li { grid-template-columns: 1fr; }
  .filters-end { width: 100%; }
  .filters-end .select { flex: 1; }
  .filters-end select { width: 100%; }
  .sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
}
@media (min-width: 901px) { .mobile-bar { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
