/* FoldScout — light-first scientific SaaS directory */
:root {
  --bg: #f7f8fa; --bg-2: #eef0f4; --card: #ffffff; --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --line: #e2e8f0; --line-2: #cbd5e1; --brand: #1d4ed8; --brand-2: #0f766e; --brand-soft: #eff6ff;
  --accent: #0f766e; --focus: #2563eb;
  --yes: #15803d; --yes-bg: #ecfdf3; --yes-line: #bbf7d0;
  --res: #b45309; --res-bg: #fffbeb; --res-line: #fde68a;
  --no: #b91c1c; --no-bg: #fef2f2; --no-line: #fecaca;
  --unv: #475569; --unv-bg: #f1f5f9; --unv-line: #cbd5e1;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px -8px rgb(15 23 42 / .08);
  --radius: 12px; --radius-sm: 8px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --bg-2: #111827; --card: #131a26; --ink: #e8edf5; --ink-2: #b6c0d1; --muted: #8490a4;
  --line: #1f2a3c; --line-2: #2c3a52; --brand: #60a5fa; --brand-2: #2dd4bf; --brand-soft: #0f1c33;
  --accent: #2dd4bf; --focus: #818cf8;
  --yes: #4ade80; --yes-bg: rgb(74 222 128 / .1); --yes-line: rgb(74 222 128 / .28);
  --res: #fbbf24; --res-bg: rgb(251 191 36 / .1); --res-line: rgb(251 191 36 / .28);
  --no: #f87171; --no-bg: rgb(248 113 113 / .1); --no-line: rgb(248 113 113 / .28);
  --unv: #94a3b8; --unv-bg: rgb(148 163 184 / .1); --unv-line: rgb(148 163 184 / .28);
  --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 8px 24px -12px rgb(0 0 0 / .55);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body { margin: 0; font: 15.5px/1.55 var(--sans); color: var(--ink); background: var(--bg); }
body:has(.cmp-bar:not([hidden])) { padding-bottom: 72px; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.wrap { width: min(100% - 40px, var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .92em; }
.nd { color: var(--muted); font-style: italic; }
.i { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }
.flabel { display: block; font: 500 11.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.linkish { background: none; border: 0; color: var(--brand); cursor: pointer; text-decoration: underline; padding: 0; font: inherit; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.btn:focus-visible, .chip input:focus-visible + span, .theme-toggle:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--ink); background: var(--bg-2); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.cmp-on { display: none; }
.btn[aria-pressed="true"] .cmp-add { display: none; }
.btn[aria-pressed="true"] .cmp-on { display: inline; }

/* header */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); text-decoration: none; font-size: 16px; }
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0 0 1px rgb(255 255 255 / .2) inset; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.byline { font: 500 12px var(--mono); color: var(--muted); text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.byline:hover { color: var(--brand); border-color: var(--brand); }
.theme-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.theme-toggle .i:last-child { display: none; }
:root[data-theme="dark"] .theme-toggle .i:first-child { display: none; }
:root[data-theme="dark"] .theme-toggle .i:last-child { display: inline; }

/* hero */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--brand-soft), transparent 70%); }
.eyebrow { display: inline-block; font: 500 12px var(--mono); color: var(--brand-2); background: var(--card); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; margin: 0 0 18px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4.6vw, 44px); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; max-width: 18ch; }
.lede { margin: 14px 0 0; font-size: 17.5px; color: var(--ink-2); max-width: 58ch; line-height: 1.55; }
.highlights { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.highlights li { font-size: 13px; font-weight: 550; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.stats { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stats li, .stats a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow); min-height: 72px; }
.stats a:hover { border-color: var(--brand); }
.stat-n { font: 700 22px/1 var(--sans); letter-spacing: -.03em; }
.stat-l { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.verified-line { margin: 16px 0 0; font-size: 13.5px; color: var(--muted); }
.cdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--unv); }
.c-yes { background: var(--yes); } .c-restricted { background: var(--res); } .c-no { background: var(--no); } .c-unverified { background: var(--unv); border: 1px dashed var(--muted); }

/* goals */
.goals { padding: 48px 0 8px; }
.sec-head { margin-bottom: 16px; }
.sec-head h2, .directory h2, .legend h2, .tp-sec h2, .signup-h, .compare-page h1 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; }
.sec-head.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.goal-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.goal { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; min-height: 96px; display: flex; flex-direction: column; gap: 4px; }
.goal:hover, .goal[aria-pressed="true"] { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 1px var(--brand); }
.goal-l { font-weight: 650; font-size: 15px; }
.goal-n { font: 500 12px var(--mono); color: var(--muted); }
.goal-how { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.goal-note { background: var(--brand-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 0 0 14px; color: var(--ink-2); }

/* filters */
.directory { padding: 40px 0 24px; }
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 52px; padding: 0 48px 0 44px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 16px; }
.search kbd { position: absolute; right: 14px; font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; border: 0; margin: 0; scrollbar-width: thin; }
.chips::-webkit-scrollbar { height: 4px; }
.chip { cursor: pointer; flex: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip > span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font: 500 11.5px var(--mono); opacity: .7; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.toolbar #result-count { margin: 0; flex: 1; font-size: 13.5px; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 8px; }
.sort select, .fsel select { min-height: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); }
.adv { display: none; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.adv.open { display: grid; }
.adv-head { display: none; }
.fsel { display: flex; flex-direction: column; min-width: 0; }
.fcount { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font: 600 11px var(--mono); }

/* cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tool-name { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.tool-name a { color: var(--ink); text-decoration: none; }
.tool-name a:hover { color: var(--brand); }
.dev { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.tool-line { margin: 10px 0 0; color: var(--ink-2); font-size: 14.5px; }
.meta { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.meta .mk { color: var(--muted); margin-right: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.tag { font: 500 12px var(--mono); background: var(--bg-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; color: var(--ink-2); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.more { flex: 1; min-width: 0; }
.more > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); background: var(--bg); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { border-color: var(--line-2); color: var(--ink); }
.more[open] > summary { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.sum-close { display: none; }
.more[open] .sum-open { display: none; }
.more[open] .sum-close { display: inline; }
.more[open] .chev { transform: rotate(180deg); }
.more-body { margin-top: 14px; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.kv { margin: 0; display: grid; gap: 12px; }
.kv > div { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.full-link { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 14px; }
.srclist { margin: 0; padding-left: 18px; }
.srclist a { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font: 600 12px/1.2 var(--sans); padding: 5px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; cursor: help; position: relative; }
.badge-ico { font-size: 11px; }
.badge-yes { color: var(--yes); background: var(--yes-bg); border-color: var(--yes-line); }
.badge-restricted { color: var(--res); background: var(--res-bg); border-color: var(--res-line); }
.badge-no { color: var(--no); background: var(--no-bg); border-color: var(--no-line); }
.badge-unverified { color: var(--unv); background: var(--unv-bg); border-color: var(--unv-line); }
.badge.lg { font-size: 13px; padding: 7px 12px; }
.w-yes { color: var(--yes); font-weight: 600; } .w-no { color: var(--no); font-weight: 600; } .w-unverified { color: var(--muted); }

/* legend / truths / evidence */
.legend { padding: 40px 0; }
.legend-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 20px; }
.legend-grid div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.legend-grid dd { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.legend-sub { margin: 28px 0 8px; font-size: 16px; }
.truths { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.truths li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.evidence { margin: 24px 0; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--brand-soft); }
.evidence h3 { margin: 0 0 6px; font-size: 16px; }
.evidence p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.disclaimer { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.disclaimer.compact { font-size: 13px; margin-top: 18px; }

/* sponsor */
.sp-slot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--card); }
.sp-k { flex: none; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); padding: 3px 7px; border-radius: 5px; }
.sp-t { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sp-who { font-size: 13.5px; font-weight: 550; }
.sp-who em { font-style: italic; color: var(--muted); font-weight: 400; }
.sp-sub { font-size: 12px; color: var(--muted); }
.sp-btn { flex: none; font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
.sp-tool { margin: 28px 0; }
.sp-home { max-width: 420px; }

/* signup */
.signup { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; margin: 40px 0 56px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.signup p { margin: 6px 0 0; font-size: 14px; }
.signup-form { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-form input[type="email"] { flex: 1 1 200px; min-height: 44px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; }
.signup-msg { flex-basis: 100%; min-height: 1.2em; font-size: 13px; color: var(--muted); margin: 0 !important; }
.signup-form.is-off .signup-msg { color: var(--res); }

/* tool page */
.tool-page { padding-top: 28px; padding-bottom: 48px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.tp-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 18px 0 28px; }
.tp-head h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; }
.tp-dev { margin: 8px 0 0; color: var(--ink-2); }
.tp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tp-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tp-layout { display: grid; grid-template-columns: 180px 1fr; gap: 36px; align-items: start; }
.toc { position: sticky; top: 80px; font-size: 13.5px; }
.toc ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.toc a { color: var(--ink-2); text-decoration: none; display: block; padding: 6px 8px; border-radius: 6px; }
.toc a:hover { background: var(--bg-2); color: var(--ink); }
.tp-sec { margin-bottom: 36px; scroll-margin-top: 80px; }
.tp-sec h2 { margin: 0 0 12px; font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tp-sec h3 { margin: 18px 0 6px; font-size: 15px; }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rights-panel { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--card); padding: 20px 22px; box-shadow: var(--shadow); margin: 0 0 16px; }
.rights-yes { border-left-color: var(--yes); }
.rights-restricted { border-left-color: var(--res); }
.rights-no { border-left-color: var(--no); }
.rights-unverified { border-left-color: var(--unv); border-left-style: dashed; }
.rp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-h { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }
.rp-lic { margin: 16px 0 0; font: 500 14.5px/1.5 var(--mono); }
.rp-note { margin: 12px 0 0; font-size: 15px; line-height: 1.6; }
.rp-sources { margin-top: 16px; }
.rp-sources ol { margin: 6px 0 0; padding-left: 18px; }
.rp-sources a { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.rp-meaning { font-size: 13px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.related { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.related a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 550; font-size: 14px; min-height: 48px; }
.related a:hover { border-color: var(--brand); }

/* Seq2Study module */
.s2s-mod { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin: 36px 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.s2s-k { margin: 0; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.s2s-mod h2 { margin: 6px 0 6px; font-size: 20px; letter-spacing: -.02em; }
.s2s-p { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 54ch; }
.s2s-svc { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.s2s-svc li { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2); }

/* compare */
.compare-page { padding: 40px 0 64px; }
.cmp-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 20px 0 24px; }
.cmp-pick select { min-width: 260px; min-height: 44px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); }
.cmp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.cmp-table th, .cmp-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table th { background: var(--bg-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table .row-label { width: 140px; font-weight: 600; color: var(--ink-2); background: var(--bg); white-space: nowrap; }
.empty-cmp { padding: 32px; margin: 0; color: var(--muted); text-align: center; }
.cmp-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(15 23 42 / .08); padding: 10px 0; }
.cmp-bar-in { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.cmp-items { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-items li { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 550; }
.cmp-items button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; min-width: 28px; min-height: 28px; }
.cmp-actions { display: flex; gap: 8px; }

/* prose / updates */
.prose-page { padding-top: 48px; max-width: 780px; padding-bottom: 48px; }
.prose-page h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; }
.prose h2 { margin: 32px 0 8px; font-size: 19px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.prose ul { padding-left: 20px; }
.changelog { list-style: none; padding: 0; margin: 32px 0 0; border-left: 1px solid var(--line-2); }
.cl-entry { position: relative; padding: 0 0 28px 24px; }
.cl-entry::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.cl-date { font: 500 12.5px var(--mono); color: var(--muted); }
.cl-body h2 { font-size: 18px; margin: 4px 0 10px; }
.cl-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cl-tools { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 16px; }
.cl-tools li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13.5px; color: var(--ink-2); background: var(--bg-2); }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer p { margin: 0 0 4px; }
.footer .s2s { color: var(--muted); }
.footer .s2s a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer .s2s a:hover { color: var(--brand); }

/* responsive */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .goal-grid { grid-template-columns: 1fr 1fr; }
  .adv.open { grid-template-columns: 1fr 1fr; }
  .tp-layout { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
  .toc .flabel { display: none; }
  .toc ol { display: flex; gap: 4px; }
  .toc a { white-space: nowrap; background: var(--bg-2); }
  .legend-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 28px, var(--max)); }
  .nav a { padding: 8px 8px; font-size: 13px; }
  .byline { display: none; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { max-width: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .goal-grid { grid-template-columns: 1fr; }
  .signup, .s2s-mod { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
  .kv > div, .facts div { grid-template-columns: 1fr; gap: 4px; }
  .search kbd { display: none; }
  .sec-head.row { flex-direction: column; align-items: stretch; }
  .sp-home { max-width: none; }
  .adv { position: fixed; inset: auto 0 0; z-index: 60; display: none; grid-template-columns: 1fr; max-height: 80vh; overflow: auto; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgb(15 23 42 / .2); margin: 0; }
  .adv.open { display: grid; }
  .adv-head { display: flex; justify-content: space-between; align-items: center; grid-column: 1 / -1; }
  .adv-head h3 { margin: 0; font-size: 16px; }
  body.drawer-open::before { content: ""; position: fixed; inset: 0; background: rgb(15 23 42 / .4); z-index: 55; }
  .cmp-bar-in { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:first-child { grid-column: 1 / -1; }
  .nav { gap: 0; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print {
  .topbar, .filters, .signup, .theme-toggle, .cmp-bar, .sp-slot, .s2s-mod, .hero-cta, .card-actions .cmp-toggle { display: none !important; }
  .more { display: block !important; }
  .more-body { display: block !important; }
}
/* fieldsets default to min-width:min-content — keep the chip row scrollable instead of widening the page */
.chips { min-width: 0; max-width: 100%; }
.filters, .directory, .cards, .card { min-width: 0; }
@media (max-width: 760px) {
  .topbar-in { gap: 8px; }
  .nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .logo { font-size: 15px; }
}
@media (max-width: 420px) { .logo { font-size: 0; gap: 0; } .logo-mark { width: 26px; height: 26px; } }
.chips { position: relative; } .chip { position: relative; } .chip input { inset: 0; width: 100%; height: 100%; margin: 0; }
@media (max-width: 760px) { .legend-grid { grid-template-columns: 1fr; } .badge.lg { white-space: normal; } .legend-grid > div, .kv dd, .facts dd { min-width: 0; } }
.stats li:has(> a) { padding: 0; border: 0; background: none; box-shadow: none; }
.stats li > a { height: 100%; }
.cmp-table thead th a { font-size: 15px; text-transform: none; letter-spacing: -.01em; color: var(--ink); font-weight: 700; text-decoration: none; }
.cmp-table thead th a:hover { color: var(--brand); }
.cmp-table thead th .linkish { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
@media (max-width: 420px) {
  .nav a { padding: 8px 6px; font-size: 12.5px; }
  .theme-toggle { width: 40px; flex: none; }
  .topbar-in { gap: 4px; }
}

[hidden] { display: none !important; }
@media (max-width: 760px) {
  .sp-slot { flex-wrap: wrap; gap: 6px 10px; }
  .sp-t { flex-basis: 100%; order: 3; }
  .sp-btn { margin-left: auto; min-height: 44px; }
}
.chip > span { min-height: 44px; } .theme-toggle { width: 44px !important; height: 44px; } .sort select, .fsel select { min-height: 44px; }
