/* GUIDE — site styles. Tokens first: change the look here, not in templates. */
:root {
  --ink: #0E1B2B; --ink-2: #26323F; --text-2: #3A4A5C; --muted: #5B6878; --faint: #A3AEBA;
  --line: #E3E7EC; --line-2: #EEF1F4; --surface: #FFFFFF; --mist: #F6F8FA; --mist-2: #F1F4F7;
  --accent: #E8590C; --accent-text: #C2410C; --accent-soft: #FFF1E8; --accent-line: #F6D9C6;
  --on-ink: #FFFFFF; --ink-panel: #0E1B2B; --ink-panel-2: #1C2C3F; --ink-panel-line: #33465B; --ink-panel-text: #C6D0DB;
  --ok: #15803D; --ok-soft: #ECFDF3; --bad: #B91C1C; --bad-soft: #FEF2F2; --warn: #B45309; --warn-soft: #FFF7E6;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 18px 40px rgba(14, 27, 43, .12);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E8EDF3; --ink-2: #D4DCE5; --text-2: #B7C2CE; --muted: #93A1B0; --faint: #5E6C7B;
    --line: #253244; --line-2: #1D2938; --surface: #0D1622; --mist: #111C2A; --mist-2: #172334;
    --accent: #FF8A4C; --accent-text: #FF9F6B; --accent-soft: #2A1A10; --accent-line: #5A3520;
    --on-ink: #0D1622; --ink-panel: #172334; --ink-panel-2: #1F2E42; --ink-panel-line: #33465B; --ink-panel-text: #B7C2CE;
    --ok: #4ADE80; --ok-soft: #0F2A1B; --bad: #F87171; --bad-soft: #2B1212; --warn: #FBBF24; --warn-soft: #2B2110;
    --shadow: 0 18px 40px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E8EDF3; --ink-2: #D4DCE5; --text-2: #B7C2CE; --muted: #93A1B0; --faint: #5E6C7B;
  --line: #253244; --line-2: #1D2938; --surface: #0D1622; --mist: #111C2A; --mist-2: #172334;
  --accent: #FF8A4C; --accent-text: #FF9F6B; --accent-soft: #2A1A10; --accent-line: #5A3520;
  --on-ink: #0D1622; --ink-panel: #172334; --ink-panel-2: #1F2E42; --ink-panel-line: #33465B; --ink-panel-text: #B7C2CE;
  --ok: #4ADE80; --ok-soft: #0F2A1B; --bad: #F87171; --bad-soft: #2B1212; --warn: #FBBF24; --warn-soft: #2B2110;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.6 var(--sans); }
img { max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -.005em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1340px; margin: 0 auto; padding: 0 24px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .mono { font-family: var(--mono); } .serif { font-family: var(--serif); }
.small { font-size: 14px; } .xs { font-size: 12.5px; }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stack { display: flex; flex-direction: column; } .row { display: flex; align-items: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.wrap-row { display: flex; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; } .grow { flex: 1 1 auto; min-width: 0; }

/* header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px 22px; padding-top: 12px; padding-bottom: 12px; min-height: 66px; }
.site-header .brand { flex: none; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: .06em; }
.brand-long { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.qs { position: relative; flex: 1 1 220px; min-width: 200px; max-width: 380px; }
.qs input[type=search] { width: 100%; font: inherit; font-size: 14.5px; padding: 9px 12px 9px 36px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--mist); color: var(--ink); }
.qs input[type=search]:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.qs .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.qs kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 12px var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: var(--surface); }
.site-nav { display: flex; flex-wrap: nowrap; align-items: center; gap: 20px; font-size: 15px; margin-left: auto; flex: none; white-space: nowrap; }
.site-nav a { text-decoration: none; color: var(--text-2); font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { font-weight: 600; }
.lab-logo { display: flex; align-items: center; padding-left: 18px; border-left: 1px solid var(--line); }
.lab-logo img { width: 104px; height: auto; display: block; }
:root[data-theme="dark"] .lab-logo img, :root[data-theme="dark"] .lab-img { filter: invert(1) brightness(1.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lab-logo img, :root:not([data-theme="light"]) .lab-img { filter: invert(1) brightness(1.6); } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }
.tt-sun { display: none; }
:root[data-theme="dark"] .tt-sun { display: block; } :root[data-theme="dark"] .tt-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt-sun { display: block; } :root:not([data-theme="light"]) .tt-moon { display: none; } }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--mist-2); color: var(--ink); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.banner { background: var(--ink-panel); color: var(--on-ink); font-size: 14px; text-align: center; padding: 8px 16px; }
:root[data-theme="dark"] .banner { color: var(--ink); }
.banner a { color: inherit; font-weight: 600; }

/* search dropdown */
.qs-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50; min-width: min(560px, 92vw); }
.qs-results.open { display: block; }
.qs-item { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.qs-item:hover, .qs-item.active { background: var(--mist-2); color: var(--ink); }
.qs-kind { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); width: 58px; flex: none; }
.qs-title { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-sub { font-size: 12.5px; color: var(--muted); }
.qs-foot { display: flex; justify-content: space-between; padding: 8px 12px 4px; border-top: 1px solid var(--line-2); margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.qs-empty { padding: 12px; color: var(--muted); font-size: 14px; }

/* buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600;
  text-decoration: none; color: var(--on-ink); background: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius-sm);
  padding: 10px 16px; cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--on-ink); opacity: .92; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: #C9D1DA; }
:root[data-theme="dark"] .btn.secondary { border-color: var(--line); }
.btn.secondary:hover { border-color: var(--ink); color: var(--ink); opacity: 1; }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { background: var(--mist-2); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1A0D05; }
.btn.sm { font-size: 13px; padding: 6px 11px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid #D5DCE3; border-radius: 999px; padding: 5px 12px; text-decoration: none; cursor: pointer; }
:root[data-theme="dark"] .chip { border-color: var(--line); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--mist-2); color: var(--text-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.accent { background: var(--accent-soft); color: var(--accent-text); }

/* cards & panels */
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s ease; }
a.card:hover { border-color: var(--ink); color: var(--ink); }
.card img.fig { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); background: var(--mist); }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card .title { font-family: var(--serif); font-size: 19px; line-height: 1.28; font-weight: 500; }
.card .meta { margin-top: auto; padding-top: 4px; font: 12.5px var(--mono); color: var(--muted); }
.card .blurb { font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid.cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.grid.cards-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.grid.cards-4 .title { font-size: 19px !important; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tiles { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tiles > * { background: var(--surface); }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.stat b { font-family: var(--serif); font-size: 40px; font-weight: 500; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list > a, .list > div { padding: 13px 18px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.list > :last-child { border-bottom: 0; }
.list > a:hover { background: var(--mist); color: var(--ink); }
.dark-panel { background: var(--ink-panel); color: #FFFFFF; border-radius: 20px; }
:root[data-theme="dark"] .dark-panel { border: 1px solid var(--line); }
.dark-panel p { color: var(--ink-panel-text); }
.dark-panel .eyebrow { color: #FFB38A; }
.dark-panel a.q { display: block; text-decoration: none; background: #FFFFFF; color: #3A4A5C; border-radius: 14px; padding: 18px 20px; font-size: 17px; }
.dark-panel a.qs2 { color: #FFFFFF; text-decoration: none; border: 1px solid var(--ink-panel-line); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.dark-panel a.qs2:hover { border-color: #FFFFFF; }

/* hero / search */
.hero { background: var(--mist); border-bottom: 1px solid var(--line); }
.hero .inner { padding-block: 72px 60px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 44px; align-items: end; }
.hero h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.04; letter-spacing: -.015em; }
.hero .lede { font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 620px; }
.bigsearch { grid-column: 1 / -1; position: relative; }
.bigsearch input[type=search], .bigsearch input[type=text] { width: 100%; font: inherit; font-size: 19px; padding: 20px 20px 20px 56px; border: 1.5px solid #C9D1DA; border-radius: 14px;
  background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .bigsearch input[type=search] { border-color: var(--line); }
.bigsearch input[type=search]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.bigsearch .ico { position: absolute; left: 20px; top: 22px; color: var(--muted); }
.bigsearch .qs-results { min-width: 0; }
.section { padding-block: 64px 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: 36px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.arrow { font-weight: 600; text-decoration: none; font-size: 15px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--mist-2); padding: 4px; border-radius: 12px; }
.tabs button, .tabs a { font: inherit; font-size: 14px; font-weight: 600; border: 0; border-radius: 9px; padding: 8px 15px; cursor: pointer;
  background: transparent; color: var(--muted); text-decoration: none; }
.tabs [aria-selected="true"], .tabs .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 27, 43, .14); }
.area-tile { padding: 24px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.area-tile:hover { background: var(--mist); color: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: 4px; }
.bars span { flex: 1; border-radius: 2px; }

/* explore */
.layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.side { flex: 1 1 250px; max-width: 290px; display: flex; flex-direction: column; gap: 26px; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.facet { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-size: 15px; }
.facet:hover { background: var(--mist-2); color: var(--ink); }
.facet.on { background: var(--mist-2); }
.box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--faint); background: var(--surface); flex: none; display: grid; place-items: center; }
.facet.on .box { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.facet .n { margin-left: auto; font: 13px var(--mono); color: var(--muted); }
.hist { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.hist a { flex: 1; border-radius: 2px; background: #D5DCE3; display: block; }
:root[data-theme="dark"] .hist a { background: var(--line); }
.hist a.on { background: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
select, input[type=text], input[type=search], input[type=number], input[type=url], input[type=password], textarea {
  font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid #D5DCE3; border-radius: 9px; background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] select, :root[data-theme="dark"] input, :root[data-theme="dark"] textarea { border-color: var(--line); }
textarea { width: 100%; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.seg { display: inline-flex; border: 1px solid #D5DCE3; border-radius: 9px; overflow: hidden; }
.seg a { padding: 8px 13px; font-size: 14px; text-decoration: none; color: var(--ink); }
.seg a.on { background: var(--ink); color: var(--on-ink); }
.rowlist a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
.pager { display: flex; gap: 6px; justify-content: center; padding-top: 12px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; text-align: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 14px; }
.pager .on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed #D5DCE3; border-radius: 14px; }

/* paper */
.paper-head { background: var(--mist); border-bottom: 1px solid var(--line); }
.paper-head .wrap { padding-top: 28px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
.paper-head h1 { font-size: clamp(32px, 4vw, 50px); line-height: 1.1; max-width: 980px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { color: var(--muted); }
.authors-line { font-size: 17px; color: var(--text-2); line-height: 1.6; }
.paper-body { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-top: 40px; padding-bottom: 80px; }
.article { flex: 999 1 560px; min-width: 0; max-width: 770px; display: flex; flex-direction: column; gap: 36px; }
.aside { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.brief p.big { font-family: var(--serif); font-size: 21px; line-height: 1.55; }
.prose { font-size: 17px; line-height: 1.72; color: var(--ink-2); overflow-wrap: break-word; }  /* long bare URLs must wrap on phones */
.prose h2 { font-size: 30px; color: var(--ink); margin: 38px 0 14px; }
.prose h3 { font-size: 22px; color: var(--ink); margin: 26px 0 10px; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote, .prose pre { margin: 0 0 16px; }
.prose li { margin-bottom: 8px; } .prose ul, .prose ol { padding-left: 22px; }
.prose strong { color: var(--ink); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { font-size: 13px; color: var(--muted); font-weight: 600; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; color: var(--text-2); }
.prose code { font: 0.9em var(--mono); background: var(--mist-2); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--mist); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose .admonition { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--mist); }
.prose .admonition-title { font-weight: 600; margin-bottom: 6px; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }
.missing-link { border-bottom: 1px dotted var(--faint); }
dl.details { margin: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 12px; font-size: 14px; }
dl.details dt { color: var(--muted); } dl.details dd { margin: 0; overflow-wrap: anywhere; }
pre.bib { margin: 0; padding: 14px 16px; background: var(--mist); font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.limits { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 14px; padding: 20px 22px; font-size: 16px; line-height: 1.65; }
.rel { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.rel .k { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }

.video-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; display: block; background: #000; }

.video-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
@media (max-width: 760px) {
  .video-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 24px; gap: 14px; margin: 0 -24px; padding: 0 24px 8px; scrollbar-width: none; }
  .video-row > .video-card { flex: 0 0 78%; scroll-snap-align: start; }
}
.video-card .thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #0E1B2B; border-bottom: 1px solid var(--line); }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.video-card:hover .thumb img { transform: scale(1.04); }
.video-card .play { position: absolute; left: 14px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(14, 27, 43, .82); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: background .2s ease; }
.video-card .play svg { margin-left: 3px; }
.video-card:hover .play { background: var(--accent); color: #1A0D05; }
@media (prefers-reduced-motion: reduce) { .video-card .thumb img { transition: none; } .video-card:hover .thumb img { transform: none; } }

/* forms & auth */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lbl { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.flash { border-radius: 12px; padding: 12px 16px; font-size: 15px; border: 1px solid var(--line); background: var(--mist); }
.flash.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.login-wrap { min-height: calc(100vh - 70px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.login-art { background: var(--ink-panel); color: #FFFFFF; padding: clamp(32px, 6vw, 80px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-art h1 { font-size: clamp(34px, 4vw, 52px); color: #FFFFFF; }
.login-art p { color: var(--ink-panel-text); font-size: 17px; line-height: 1.6; max-width: 460px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-card input { width: 100%; font-size: 16px; padding: 13px 14px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--mist); margin-top: 72px; }
.site-footer .wrap { padding-top: 44px; padding-bottom: 44px; display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(120px, auto)); gap: 10px 44px; font-size: 14px; }
.footer-links a { text-decoration: none; color: var(--text-2); }
.footer-links a:hover { color: var(--ink); }

table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tr:hover td { background: var(--mist); }
.scroll-x { overflow-x: auto; }
.bar-track { width: 90px; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar-track span { display: block; height: 100%; background: var(--ink); }

/* One logo on every page: the subtitle does not fit beside the search box, and showing it only
   where there is no search (the home page) made the logo change and the page jump between pages. */
.site-header .brand-long { display: none; }
@media (max-width: 1320px) { .qs ~ .site-nav { gap: 16px; } }
@media (max-width: 1100px) {
  .site-header .wrap { flex-wrap: wrap; }
  .qs { order: 3; flex: 1 1 100%; max-width: none; }
  .site-nav { gap: 13px; font-size: 14.5px; }
  .lab-logo { padding-left: 12px; }
  .lab-logo img { width: 92px; }
}
@media (max-width: 760px) {
  .brand-long { display: none; }
  .site-nav { margin-left: 0; gap: 6px 16px; }
  .lab-logo { padding-left: 12px; }
  .hero .inner { padding-block: 44px 40px; }
  .site-nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 18px; padding-bottom: 2px; scrollbar-width: none; }
  .site-nav > * { flex: none; }
  .qs { max-width: none; order: 3; flex-basis: 100%; }
  .rel { grid-template-columns: 1fr; gap: 2px; }
  .footer-links { grid-template-columns: repeat(2, minmax(120px, auto)); }
}
/* ── phones: compact header, folded filters, card tables ───────────── */
.m-actions, .m-only { display: none; }
@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 10px; min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .m-actions { display: flex; gap: 8px; margin-left: auto; }
  .site-header .qs { display: none; }
  .site-header.search-open .qs { display: block; order: 3; flex-basis: 100%; }
  .site-header.search-open .m-search, .site-header.nav-open .m-menu { border-color: var(--ink); }
  .site-header .site-nav { display: none; }
  .site-header.nav-open .site-nav { display: flex; order: 4; flex-wrap: wrap; align-items: center; width: 100%; overflow: visible;
    gap: 10px 14px; padding: 4px 0 6px; border-top: 1px solid var(--line); }
  .site-header.nav-open .site-nav > a:not(.lab-logo):not(.btn) { flex-basis: 100%; padding: 11px 2px; font-size: 16px; border-bottom: 1px solid var(--line-2); }
  .site-header.nav-open .site-nav .lab-logo { padding-left: 2px; border: 0; margin-right: auto; }
  .site-header .user-menu .menu { right: 0; left: auto; }
  .m-only { display: inline-flex; }
  .m-filters { margin-bottom: 18px; }
  .layout > .side { display: none; }
  .layout.filters-open > .side { display: flex; max-width: none; flex-basis: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: none; white-space: nowrap; }
  .tabs button, .tabs a { padding: 8px 12px; }
  .panel-head { flex-wrap: wrap; gap: 10px; }
  .panel-head > .label { flex-basis: 100%; }
  .clip-sm > :nth-child(n+41) { display: none; }
  table.cards-sm thead { display: none; }
  table.cards-sm, table.cards-sm tbody { display: block; }
  table.cards-sm tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; position: relative; padding: 14px 12px 14px 48px; border-bottom: 1px solid var(--line-2); }
  table.cards-sm td { display: block; padding: 0 !important; border: 0 !important; min-width: 0 !important; text-align: left !important; white-space: normal !important; }
  table.cards-sm td:nth-child(2), table.cards-sm td:nth-child(3) { flex-basis: 100%; }
  table.cards-sm td:first-child { position: absolute; left: 14px; top: 16px; }
  table.cards-sm td.empty { display: none; }
  table.cards-sm td[data-label] { font-size: 13px; }
  table.cards-sm td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--sans, inherit); }
  table.cards-sm td[data-label] > div { display: inline-block; margin-left: 8px; }
  table.cards-sm tr:hover td { background: none; }
}
@media print { .site-header, .site-footer, .aside { display: none; } }
