/* =========================================================================
   PubArx — design system
   Self-hosted fonts, no inline styles (strict CSP), light + dark themes.
   ========================================================================= */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Source Serif 4", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eaecf0;
  --border: #dde1e6;
  --border-strong: #c3c9d1;
  --text: #15181e;
  --text-2: #424955;
  --text-3: #6a717d;

  --brand: #17365f;
  --brand-hover: #10294a;
  --brand-soft: #edf1f7;
  --brand-ink: #ffffff;
  --link: #1a4f96;
  --accent: #9b1c31;
  --accent-soft: #f7ebed;

  --success: #1b7347;
  --success-soft: #e5f3ea;
  --warning: #8f5d00;
  --warning-soft: #fcf2da;
  --danger: #b42318;
  --danger-soft: #fdebe9;
  --info: #1d5aa3;
  --info-soft: #e7f0fb;
  --neutral: #4f5664;
  --neutral-soft: #eef0f3;
  --on-accent: #ffffff;
  --medal-gold: #f6d77a; --medal-gold-ink: #5c4300;
  --medal-silver: #dfe3ea; --medal-silver-ink: #3b4555;
  --medal-bronze: #ecc3a0; --medal-bronze-ink: #5e3415;
  --on-success: #ffffff;
  --on-danger: #ffffff;

  --focus: #2f6fdc;
  --radius-sm: 3px;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(16, 22, 32, 0.06);
  --shadow-lg: 0 6px 20px rgba(16, 22, 32, 0.12);

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111418;
    --surface: #111418;
    --surface-2: #181c22;
    --surface-3: #20252d;
    --border: #2b313a;
    --border-strong: #3b434e;
    --text: #e6e8ec;
    --text-2: #b4bac4;
    --text-3: #8a919c;
    --brand: #8fb0e3;
    --brand-hover: #a9c3ec;
    --brand-soft: #1a2536;
    --brand-ink: #0c1420;
    --link: #93b6ea;
    --accent: #e0808f;
    --accent-soft: #35191e;
    --success: #5cc48c;
    --success-soft: #16301f;
    --warning: #e2b14d;
    --warning-soft: #33280f;
    --danger: #f08a80;
    --danger-soft: #3a1a17;
    --info: #79aaf0;
    --info-soft: #172741;
    --neutral: #aab2bf;
    --neutral-soft: #242b36;
    --on-accent: #23110a;
    --medal-gold: #5a4a12; --medal-gold-ink: #f8e4a0;
    --medal-silver: #3a414d; --medal-silver-ink: #e3e7ee;
    --medal-bronze: #5a3a22; --medal-bronze-ink: #f1d2b8;
    --on-success: #08200f;
    --on-danger: #2a0b08;
    --focus: #8fb4f2;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
a { color: var(--link); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }
pre { white-space: pre-wrap; word-break: break-word; }
::selection { background: var(--brand-soft); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--text);
}
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.65rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------------ layout */

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 820px; }
.container-tight { max-width: 560px; }
.page { padding-top: clamp(24px, 4vw, 48px); padding-bottom: 64px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { margin-bottom: 6px; }
.page-header .lede { color: var(--text-2); font-size: 1.05rem; max-width: 70ch; margin: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 8px;
}
.stack > * + * { margin-top: var(--stack, 16px); }
.stack-sm { --stack: 8px; }
.stack-lg { --stack: 28px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-center { justify-content: center; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.with-sidebar-left { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 980px) {
  .with-sidebar, .with-sidebar-left { grid-template-columns: 1fr; gap: 28px; }
}
.sticky { position: sticky; top: 88px; }
@media (max-width: 980px) { .sticky { position: static; } }

.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 0.875rem; }
.xsmall { font-size: 0.8rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.serif { font-family: var(--font-serif); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.pre-line { white-space: pre-line; }
.break { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark .mark-bg { fill: var(--brand); }
.brand-mark .mark-p { stroke: var(--brand-ink); }
.brand-mark .mark-dot { fill: var(--accent); }
.brand-name { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; }
.brand-name span { color: var(--accent); }

.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav a {
  color: var(--text-2); font-weight: 500; font-size: 0.95rem; padding: 8px 12px; border-radius: var(--radius-sm);
}
.primary-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.primary-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.header-search { flex: 1; max-width: 380px; margin-left: auto; position: relative; }
.header-search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.92rem;
}
.header-search input:focus { outline: none; border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.header-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
@media (min-width: 761px) { .header-search + .header-actions { margin-left: 0; } }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px;
}
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 0.93rem; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel svg { width: 16px; height: 16px; color: var(--text-3); }
.menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 0.95rem; }
.menu-head span { font-size: 0.82rem; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.account-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 4px; border-radius: 999px; }
.account-trigger:hover { background: var(--surface-2); }

.nav-toggle { display: none; }
@media (max-width: 1140px) {
  .primary-nav { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 760px) {
  .header-search { display: none; }
  .header-inner { gap: 12px; }
  .header-actions .btn-label { display: none; }
}
.mobile-nav .menu-panel { left: 0; right: auto; }
.mobile-only { display: none; }
@media (max-width: 980px) { .mobile-only { display: flex; } }
@media (max-width: 480px) { .hide-sm { display: none; } .brand-name { font-size: 1.25rem; } }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: 0.93rem; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { filter: brightness(0.95); }
.btn-success { background: var(--success); color: var(--on-success); }
.btn-success:hover { filter: brightness(0.95); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); color: var(--on-danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 0.85rem; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.link-button:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ cards, panels */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 22px; }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.05rem; font-family: var(--font-sans); font-weight: 650; letter-spacing: 0; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.panel-title { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; }
.side-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.side-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ------------------------------------------------------------------ alerts */

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid; font-size: 0.95rem; margin-bottom: 20px;
}
.alert svg { width: 18px; height: 18px; margin-top: 2px; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--text); }
.alert-success svg { color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); }
.alert-error svg { color: var(--danger); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); }
.alert-warning svg { color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text); }
.alert-info svg { color: var(--info); }

/* ------------------------------------------------------------------ badges & chips */

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge svg { width: 13px; height: 13px; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 0.84rem;
}
a.chip:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }

/* ------------------------------------------------------------------ forms */

.form { max-width: 760px; }
.form-section { padding: 24px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > h2 { font-size: 1.15rem; margin-bottom: 4px; }
.form-section > .muted { margin-bottom: 18px; }
.field { margin-bottom: 18px; }
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field > legend { padding: 0; }
.field > label, .field-label {
  display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; color: var(--text);
}
.field .req { color: var(--danger); margin-left: 2px; }
.field .optional { color: var(--text-3); font-weight: 400; font-size: 0.85rem; margin-left: 4px; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="url"],
.field input[type="search"], .field input[type="number"], .field input[type="date"], .field input[type="datetime-local"],
.field select, .field textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem; line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field select, .select { padding-right: 34px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select[multiple] { background-image: none; padding-right: 12px; min-height: 140px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field .help { font-size: 0.84rem; color: var(--text-3); margin-top: 6px; }
.field .error { font-size: 0.86rem; color: var(--danger); margin-top: 6px; font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.counter { font-size: 0.8rem; color: var(--text-3); text-align: right; margin-top: 4px; }
.counter.is-over { color: var(--danger); font-weight: 600; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.93rem; line-height: 1.5; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.check + .check { margin-top: 12px; }
.declaration { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.declaration + .declaration { margin-top: 10px; }

.choices { display: grid; gap: 10px; }
.choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .choices-2 { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: block; height: 100%; padding: 14px 16px 14px 44px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); transition: border-color .15s, box-shadow .15s, background-color .15s; position: relative;
}
.choice-body::before {
  content: ""; position: absolute; left: 16px; top: 17px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--surface);
}
.choice input:checked + .choice-body { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.choice input:checked + .choice-body::before { border: 5px solid var(--brand); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-title { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.choice-desc { display: block; font-size: 0.87rem; color: var(--text-2); margin-top: 4px; }

.file-drop {
  display: block; padding: 28px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); text-align: center;
  background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.file-drop { position: relative; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--brand); background: var(--brand-soft); }
.file-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-drop svg { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--brand); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop strong { display: block; font-size: 1rem; }
.file-name { display: block; margin-top: 10px; font-weight: 600; color: var(--text); }
.file-name.is-error { color: var(--danger); }

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 20px; margin-top: 8px; border-top: 1px solid var(--border); }
.form-actions .spacer { flex: 1; }

/* Authors editor */
.author-list { display: grid; gap: 12px; }
.author-row { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.author-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.author-row-head strong { font-size: 0.9rem; }
.author-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.author-grid .field { margin-bottom: 12px; }
@media (max-width: 640px) { .author-grid { grid-template-columns: 1fr; } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ hero & home */

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    radial-gradient(800px 300px at -10% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; padding: clamp(40px, 7vw, 88px) 0; align-items: center; }
@media (max-width: 980px) { .hero-inner { grid-template-columns: 1fr; gap: 36px; } }
.hero h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.3rem); line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .lede { font-size: 1.15rem; color: var(--text-2); max-width: 56ch; margin-bottom: 28px; }
.hero-search { display: flex; gap: 8px; max-width: 620px; padding: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.02rem; padding: 0 12px; color: var(--text); }
.hero-search input:focus { outline: none; }
.hero-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px var(--brand-soft); }
.hero-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-size: 0.92rem; color: var(--text-3); }

.process-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 26px; }
.process-card h2 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 650; margin-bottom: 18px; }
.process { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process li { position: relative; padding: 0 0 18px 48px; }
.process li:last-child { padding-bottom: 0; }
.process li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.88rem;
  background: var(--brand-soft); color: var(--brand);
}
.process li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--border); }
.process strong { display: block; font-size: 0.97rem; }
.process span { font-size: 0.88rem; color: var(--text-2); }

.stats-band { background: var(--surface); border-bottom: 1px solid var(--border); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 22px 24px; border-right: 1px solid var(--border); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--text-3); font-size: 0.86rem; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

.section { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.subject-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.subject-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.subject-tile strong { font-weight: 650; }
.subject-tile span { font-size: 0.85rem; color: var(--text-3); }

/* ------------------------------------------------------------------ paper list items */

.paper-list { list-style: none; margin: 0; padding: 0; }
.paper-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.paper-item:first-child { padding-top: 4px; }
.paper-item:last-child { border-bottom: 0; }
.paper-meta-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 0.82rem; color: var(--text-3); margin-bottom: 6px; }
.paper-meta-top .id { font-family: var(--font-mono); color: var(--text-2); }
.paper-title { font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.01em; }
.paper-title a { color: var(--text); }
.paper-title a:hover { color: var(--link); text-decoration: none; }
.paper-authors { font-size: 0.93rem; color: var(--text-2); margin-bottom: 6px; }
.paper-abstract { font-size: 0.93rem; color: var(--text-2); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.paper-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.84rem; color: var(--text-3); }
.paper-foot a { color: var(--text-2); font-weight: 500; }
.paper-foot .sep::before { content: "·"; margin-right: 14px; color: var(--border-strong); }
.metric { display: inline-flex; align-items: center; gap: 5px; }
.metric svg { width: 14px; height: 14px; }
.compact .paper-item { padding: 14px 0; }
.compact .paper-title { font-size: 1.02rem; }

/* ------------------------------------------------------------------ paper page */

.paper-head { padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.86rem; color: var(--text-3); margin-bottom: 14px; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs svg { width: 14px; height: 14px; }
.paper-head h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.35rem); line-height: 1.2; margin-bottom: 16px; }
.author-line { font-size: 1.02rem; line-height: 1.7; margin-bottom: 6px; }
.author-line a { color: var(--text); font-weight: 500; }
.author-line .author { white-space: nowrap; }
.author-line sup { color: var(--text-3); font-size: 0.72em; margin-left: 1px; }
.orcid-link { display: inline-flex; vertical-align: -2px; margin-left: 3px; }
.orcid-link svg { width: 15px; height: 15px; }
.affiliations { list-style: none; padding: 0; margin: 0 0 14px; font-size: 0.88rem; color: var(--text-2); }
.affiliations sup { color: var(--text-3); margin-right: 4px; }
.paper-dates { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; color: var(--text-3); }
.paper-dates strong { color: var(--text-2); font-weight: 600; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.abstract h2, .content-section h2 { font-size: 1.25rem; }
.abstract-text { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.75; color: var(--text); max-width: 75ch; }
.abstract-text p { margin-bottom: 0.9em; }
.content-section { margin-top: 36px; }
.content-section > h2 { display: flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 0.92rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.side-section .kv, .card .kv.small { grid-template-columns: 84px minmax(0, 1fr); gap: 8px 12px; }
.kv .mono { white-space: nowrap; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }

.version-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.version-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.version-list li:last-child { border-bottom: 0; }
.version-list .is-current { font-weight: 650; }
.version-list .v { font-family: var(--font-mono); }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); font-size: 0.93rem; margin-bottom: 20px;
}
.notice svg { width: 18px; height: 18px; color: var(--warning); margin-top: 2px; }

/* ------------------------------------------------------------------ community review */

.community { margin-top: 44px; padding-top: 32px; border-top: 2px solid var(--text); }
.community-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.community-head h2 { margin-bottom: 4px; }
.community-counts { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.9rem; color: var(--text-2); }
.community-counts strong { color: var(--text); font-size: 1.05rem; margin-right: 4px; }
.cta-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  margin-bottom: 26px;
}
.cta-panel p { margin: 0; font-size: 0.93rem; color: var(--text); max-width: 60ch; }
.cta-panel.is-muted { background: var(--surface-2); border-color: var(--border); }

/* Endorse and review: one card per action, with its button or the reason it is not available. */
.contribute { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.contribute-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.contribute-title { font-weight: 650; font-size: 0.95rem; color: var(--text); }
.contribute-item p { margin: 0; font-size: 0.88rem; color: var(--text-2); }
.contribute-item > .btn, .contribute-item > .contribute-done, .contribute-item > .contribute-note { margin-top: auto; }
.contribute-item p.contribute-note { color: var(--text-3); }
.contribute-done { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--success); }
.contribute-done:hover { color: var(--success); }
.contribute-orcid {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.contribute-orcid p { margin: 0; font-size: 0.88rem; max-width: 52ch; }
.contribute-orcid form { margin: 0; }
.contribute-foot { grid-column: 1 / -1; margin: 0; font-size: 0.8rem; color: var(--text-3); }
.side-community .btn + .btn { margin-top: 6px; }
.side-community .contribute-done { margin-bottom: 6px; }
@media (max-width: 640px) {
  .contribute { grid-template-columns: 1fr; }
}

.sub-section { margin-top: 30px; }
.sub-section > h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sub-section > h3 .count { color: var(--text-3); font-weight: 500; }

.endorsers { display: grid; gap: 10px; }
.endorser { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.endorser .name { font-weight: 600; font-size: 0.93rem; }
.endorser .who { font-size: 0.83rem; color: var(--text-3); }
.endorser blockquote { margin: 6px 0 0; font-size: 0.92rem; color: var(--text-2); font-style: italic; font-family: var(--font-serif); }

.review { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.review + .review { margin-top: 16px; }
.review-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.review-body { padding: 16px 18px; }
.review-body h4 { font-family: var(--font-sans); font-size: 0.82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 16px 0 6px; }
.review-body h4:first-child { margin-top: 0; }
.review-body .text { white-space: pre-line; font-size: 0.95rem; }
.review-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); font-size: 0.85rem; }
.person { display: flex; gap: 10px; align-items: center; }
.person .name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.person .who { font-size: 0.82rem; color: var(--text-3); }

.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 0.82rem; letter-spacing: .02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.8rem; }

.thread { list-style: none; margin: 0; padding: 0; }
.comment { padding: 14px 0; border-top: 1px solid var(--border); }
.thread > .comment:first-child { border-top: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 0.86rem; color: var(--text-3); }
.comment-head .name { color: var(--text); font-weight: 600; font-size: 0.92rem; }
.comment-body { white-space: pre-line; font-size: 0.95rem; overflow-wrap: anywhere; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 6px; font-size: 0.84rem; }
.comment-actions > .reply-box[open], .review-foot > .reply-box[open] { flex: 1 0 100%; order: 99; }
.comment-actions a, .comment-actions summary { color: var(--text-3); cursor: pointer; }
.comment-actions a:hover, .comment-actions summary:hover { color: var(--text); }
.replies { list-style: none; margin: 10px 0 0 22px; padding: 0 0 0 16px; border-left: 2px solid var(--border); }
.replies .comment { padding: 10px 0; }
.review .replies { margin: 0; padding: 4px 18px 8px; border-left: 0; }
.author-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; }
.hidden-note { font-size: 0.88rem; color: var(--text-3); font-style: italic; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.reply-box > summary { list-style: none; }
.reply-box > summary::-webkit-details-marker { display: none; }
.reply-form { margin-top: 10px; }
.reply-form textarea { width: 100%; min-height: 90px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.93rem; resize: vertical; }
.reply-form textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--brand-soft); }
.reply-form .row { margin-top: 8px; }

.empty {
  text-align: center; padding: 28px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-3); font-size: 0.93rem; background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.empty svg { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--text-3); }
.empty strong { display: block; color: var(--text-2); margin-bottom: 4px; }

/* ------------------------------------------------------------------ diff */

.diff { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.75; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.diff ins { background: var(--success-soft); color: var(--success); text-decoration: none; border-radius: 3px; padding: 0 1px; }
.diff del { background: var(--danger-soft); color: var(--danger); border-radius: 3px; padding: 0 1px; }
.changelog { white-space: pre-line; padding: 16px 18px; background: var(--brand-soft); border-radius: var(--radius); border-left: 4px solid var(--brand); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-weight: 600; font-size: 0.78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.table .title-cell { font-weight: 600; max-width: 460px; }

/* ------------------------------------------------------------------ tabs, steps, timeline */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text-2); font-weight: 500; font-size: 0.93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.tabs .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-size: 0.75rem; font-weight: 700; color: var(--text-2); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 0.93rem; }
.side-nav a svg { width: 16px; height: 16px; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }

.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 32px; counter-reset: s; }
.steps li { flex: 1; position: relative; padding-top: 40px; font-size: 0.88rem; color: var(--text-3); text-align: center; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-3); z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); }
.steps li:first-child::after { display: none; }
.steps li.is-done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps li.is-done::after, .steps li.is-current::after { background: var(--brand); }
.steps li.is-current { color: var(--text); font-weight: 600; }
.steps li.is-current::before { border-color: var(--brand); color: var(--brand); }
.steps a { color: inherit; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 28px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.timeline li::after { content: ""; position: absolute; left: 9.5px; top: 20px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.tone-success::before { background: var(--success); }
.timeline li.tone-warning::before { background: var(--warning); }
.timeline li.tone-danger::before { background: var(--danger); }
.timeline li.tone-info::before { background: var(--info); }
.timeline .when { font-size: 0.82rem; color: var(--text-3); }
.timeline .what { font-weight: 600; }
.timeline .message { margin-top: 6px; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); white-space: pre-line; font-size: 0.93rem; }
.timeline .internal { background: var(--warning-soft); }

/* ------------------------------------------------------------------ researcher profile */

.profile-head { display: flex; gap: 24px; align-items: flex-start; padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.profile-head h1 { margin-bottom: 4px; }
.profile-head .role { color: var(--text-2); font-size: 1.02rem; }
.profile-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 0.92rem; }
.profile-links a { display: inline-flex; align-items: center; gap: 6px; }
.profile-links svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .profile-head { flex-direction: column; gap: 14px; } }
.researcher-card { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.researcher-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.researcher-card .name { font-weight: 650; }
.researcher-card .meta { font-size: 0.85rem; color: var(--text-3); }
.researcher-card .aff { font-size: 0.88rem; color: var(--text-2); }

/* ------------------------------------------------------------------ search */

.search-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.search-bar input { flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 1.02rem; }
.search-bar input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--brand-soft); }
.filters { display: grid; gap: 14px; }
.filters .field { margin: 0; }
.result-count { font-size: 0.92rem; color: var(--text-2); margin-bottom: 8px; }

/* ------------------------------------------------------------------ pagination */

.pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 28px; list-style: none; padding: 0; }
.pagination a, .pagination span {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 0.9rem; font-weight: 500;
}
.pagination a:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.pagination .is-current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pagination .is-disabled { opacity: .45; }

/* ------------------------------------------------------------------ auth */

.auth-wrap { display: grid; place-items: center; padding: clamp(32px, 6vw, 72px) var(--gutter); }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(24px, 5vw, 40px); }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .lede { color: var(--text-2); margin-bottom: 26px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 0.93rem; color: var(--text-2); }
.btn-orcid { gap: 10px; }
.btn-orcid svg { width: 20px; height: 20px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 0.82rem; color: var(--text-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 18px; }
.auth-icon svg { width: 26px; height: 26px; }
.auth-icon.success { background: var(--success-soft); color: var(--success); }
.auth-icon.danger { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ prose (static pages) */

.prose { max-width: 72ch; font-size: 1.02rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; font-family: var(--font-sans); font-weight: 650; font-size: 1.08rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li + li { margin-top: 6px; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.toc { position: sticky; top: 88px; font-size: 0.9rem; }
.toc a { display: block; padding: 5px 0; color: var(--text-2); }

/* ------------------------------------------------------------------ footer */

.site-footer { margin-top: auto; background: var(--surface); border-top: 1px solid var(--border); font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding: 48px 0 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h2 { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li + li { margin-top: 8px; }
.footer-grid a { color: var(--text-2); }
.footer-about p { color: var(--text-2); max-width: 40ch; margin-top: 12px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 0 28px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 0.85rem; }

/* ------------------------------------------------------------------ misc */

.icon { width: 18px; height: 18px; }
.icon-sm { width: 14px; height: 14px; }
.inline-icon { display: inline-flex; align-items: center; gap: 6px; }
details.disclosure > summary { cursor: pointer; font-weight: 600; color: var(--link); list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .15s; color: var(--text-3); }
details.disclosure[open] > summary::before { transform: rotate(90deg); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 0.93rem; }
.check-list svg { width: 18px; height: 18px; margin-top: 2px; }
.check-list .ok svg { color: var(--success); }
.check-list .warn svg { color: var(--warning); }
.check-list .bad svg { color: var(--danger); }
.callout { padding: 18px 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; }
.math-block { overflow-x: auto; }
.katex { font-size: 1.05em; }

@media print {
  .site-header, .site-footer, .no-print, .community form, .cta-panel, .contribute, .side-community { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
