:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-alt: #f7f9fa;
  --surface-tint: #eef8f6;
  --border: #dce4e8;
  --border-strong: #c7d2d9;
  --text: #13242c;
  --muted: #60717b;
  --faint: #8a99a2;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff3ef;
  --navy: #102a36;
  --ok: #137a52;
  --ok-soft: #e4f5ed;
  --warn: #9a5c00;
  --warn-soft: #fff4dc;
  --danger: #b42336;
  --danger-soft: #fff0f1;
  --shadow-sm: 0 1px 2px rgb(15 35 45 / 5%), 0 4px 14px rgb(15 35 45 / 4%);
  --shadow-md: 0 2px 4px rgb(15 35 45 / 4%), 0 16px 40px rgb(15 35 45 / 8%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e171c;
    --surface: #152229;
    --surface-alt: #1c2c34;
    --surface-tint: #13312f;
    --border: #2b3d46;
    --border-strong: #41545d;
    --text: #edf4f5;
    --muted: #a5b4ba;
    --faint: #7f929a;
    --accent: #5dd0c4;
    --accent-strong: #77ded3;
    --accent-soft: #173c3a;
    --navy: #091318;
    --ok: #61d39e;
    --ok-soft: #17372a;
    --warn: #f2bb65;
    --warn-soft: #392b16;
    --danger: #ff8996;
    --danger-soft: #402126;
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 20%);
    --shadow-md: 0 18px 46px rgb(0 0 0 / 28%);
  }
}

html { scroll-behavior: smooth; }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
::selection { background: var(--accent-soft); color: var(--text); }

.wrap { max-width: 1240px; padding: 38px 36px 72px; }
.narrow { max-width: 780px; }
.stack { margin-top: 20px; }
.stack-sm { margin-top: 12px; }
.stack-lg { margin-top: 32px; }
h1 { font-size: clamp(27px, 3vw, 34px); line-height: 1.18; letter-spacing: -.035em; }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.018em; }
h3 { margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .09em; }
p.lead { max-width: 72ch; margin-bottom: 28px; }

.card {
  padding: 22px 24px;
  border-color: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.grid { gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  position: relative;
  min-height: 112px;
  padding: 20px 21px;
  overflow: hidden;
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat::after {
  position: absolute;
  right: -18px;
  bottom: -34px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: var(--accent-soft);
  content: "";
  opacity: .65;
}
.stat .label { position: relative; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.stat .value { position: relative; z-index: 1; margin-top: 5px; font-size: 31px; font-weight: 720; letter-spacing: -.04em; line-height: 1.15; }
.stat .note { position: relative; z-index: 1; font-size: 11.5px; }

.table-scroll { margin: 0 -4px; }
table { font-size: 13.5px; }
th, td { padding: 12px 13px; }
th { color: var(--faint); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-alt); }
td a { font-weight: 600; text-decoration: none; }
.kv th, .kv td { padding: 9px 12px 9px 0; }
.kv th { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.badge.active { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); }
.badge.disabled { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); }
.badge.archived { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-soft); }
.badge.lock { border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }

label { margin: 15px 0 6px; font-size: 12.5px; font-weight: 620; }
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=date], select, textarea {
  min-height: 42px;
  padding: 9px 12px;
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 110px; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
input[readonly] { background: var(--surface-alt); color: var(--muted); }
input[type=checkbox] { width: 16px; height: 16px; margin-right: 7px; accent-color: var(--accent); vertical-align: -3px; }

button, .btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 35 45 / 5%);
  font-size: 13.5px;
  font-weight: 650;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
button:hover, .btn:hover { border-color: var(--accent); background: var(--surface-tint); color: var(--accent-strong); transform: translateY(-1px); }
button.primary, .btn.primary { border-color: var(--accent); background: var(--accent); box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 20%, transparent); color: #fff; }
button.primary:hover, .btn.primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
button.danger, .btn.danger { background: var(--danger-soft); }
button.small, .btn.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.actions { gap: 9px; margin-top: 18px; }
.hint { font-size: 11.5px; line-height: 1.55; }
.flash { margin-bottom: 20px; padding: 13px 15px; border-radius: var(--radius-sm); font-size: 13.5px; }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); }
.flash.error { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-soft); }
.filters { gap: 11px 15px; }
.filter-actions { gap: 9px; margin-top: 20px; padding-top: 18px; }
.bar-track { height: 8px; border-radius: 999px; }
.version-row.current { background: var(--accent-soft); }

/* Administration */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: 252px;
  height: 100vh;
  flex: 0 0 252px;
  flex-direction: column;
  padding: 26px 18px 20px;
  overflow-y: auto;
  background: linear-gradient(155deg, var(--navy) 0%, #0a2029 100%);
  color: #d9e6e8;
}
.admin-brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 32px; color: #fff; text-decoration: none; }
.admin-brand .brand-mark { border-radius: 9px; box-shadow: 0 6px 16px rgb(0 0 0 / 18%); }
.admin-brand span { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.admin-brand strong { overflow: hidden; font-size: 13px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.admin-brand small { margin-top: 3px; color: #87a3ad; font-size: 10px; letter-spacing: .055em; text-transform: uppercase; }
.admin-sidebar nav.main { display: flex; flex-direction: column; gap: 3px; }
.admin-sidebar nav.main a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  color: #a9bec5;
  font-size: 13px;
  font-weight: 570;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.admin-sidebar nav.main a:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.admin-sidebar nav.main a.active { background: rgb(72 205 191 / 14%); color: #79ded4; }
.nav-dot { width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; opacity: .72; }
.admin-sidebar nav.main a.active .nav-dot { border-color: #62d1c5; background: #62d1c5; box-shadow: 0 0 0 4px rgb(98 209 197 / 11%); opacity: 1; }
.admin-sidebar-footer { display: grid; gap: 12px; margin-top: auto; padding: 24px 8px 0; border-top: 1px solid rgb(255 255 255 / 8%); }
.system-status { display: flex; align-items: center; gap: 7px; color: #8fa9b1; font-size: 10.5px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.system-status span { width: 6px; height: 6px; border-radius: 50%; background: #65d29d; box-shadow: 0 0 0 4px rgb(101 210 157 / 10%); }
.sidebar-signout { width: 100%; min-height: 34px; border-color: rgb(255 255 255 / 12%); background: rgb(255 255 255 / 5%); box-shadow: none; color: #b8cbd0; font-size: 12px; }
.sidebar-signout:hover { border-color: rgb(255 255 255 / 22%); background: rgb(255 255 255 / 9%); color: #fff; }
.admin-main { min-width: 0; flex: 1; }
.admin-main > .wrap > h1:first-of-type { margin-bottom: 7px; }

/* Public archive */
body.public { min-height: 100vh; background: var(--surface); }
body.public header.topbar { border-bottom-color: var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); }
body.public .topbar-inner { display: flex; max-width: 960px; align-items: center; gap: 16px; padding: 15px 28px; }
body.public .brand { gap: 10px; color: var(--text); }
body.public .brand-mark { border-radius: 8px; box-shadow: 0 4px 12px rgb(15 118 110 / 16%); }
body.public .brand .brand-copy { display: flex; flex-direction: column; color: var(--text); font-family: inherit; line-height: 1.16; }
body.public .brand .brand-copy strong { font-size: 12.5px; font-weight: 720; letter-spacing: -.01em; }
body.public .brand .brand-copy small { margin-top: 3px; color: var(--muted); font: 10px/1.2 var(--mono); }
.public-status { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.public-status > span { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
body.public > main.wrap, body.public footer .wrap { max-width: 960px; padding-right: 28px; padding-left: 28px; }
body.public > main.wrap { min-height: calc(100vh - 149px); padding-top: 0; padding-bottom: 78px; }
body.public > main.wrap > .card { margin-top: 64px; }

.index-page { padding-top: 66px; }
.index-hero {
  position: relative;
  margin-bottom: 58px;
  padding: 46px 48px 40px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 16%, transparent) 0, transparent 31%), linear-gradient(140deg, var(--surface-tint), var(--surface) 58%);
  box-shadow: var(--shadow-md);
}
.index-hero::after {
  position: absolute;
  top: -58px;
  right: -52px;
  width: 206px;
  height: 206px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 30px color-mix(in srgb, var(--accent) 4%, transparent), 0 0 0 62px color-mix(in srgb, var(--accent) 3%, transparent);
  content: "";
}
.eyebrow { margin: 0 0 15px; color: var(--accent); font-size: 10.5px; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.index-hero h1 { position: relative; z-index: 1; max-width: 640px; margin: 0 0 16px; font-size: clamp(25px, 2.9vw, 34px); line-height: 1.2; letter-spacing: -.022em; }
.index-hero .lead { position: relative; z-index: 1; max-width: 630px; margin-bottom: 26px; font-size: 16px; line-height: 1.7; }
.hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px 24px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta span::before { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); content: ""; }
.hero-meta strong { color: var(--text); font-weight: 730; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading > span { color: var(--faint); font-size: 11px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.index-list { gap: 11px; }
.index-item {
  align-items: center;
  padding: 19px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.index-item:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow-md); color: var(--text); transform: translateY(-2px); }
.index-main { min-width: 0; }
.index-title { margin-bottom: 3px; font-size: 15px; font-weight: 700; letter-spacing: -.012em; }
.index-venue { font-size: 12.5px; }
.index-side { display: flex; flex: none; align-items: center; gap: 14px; }
.index-slug { font-size: 11.5px; }
.index-arrow { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--surface-tint); color: var(--accent); font-size: 16px; transition: transform .18s ease, background .18s ease; }
.index-item:hover .index-arrow { background: var(--accent); color: #fff; transform: translateX(2px); }

.paper-page { padding-top: 68px; }
.paper-head { position: relative; margin-bottom: 38px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.paper-head::after { position: absolute; bottom: -1px; left: 0; width: 74px; height: 2px; background: var(--accent); content: ""; }
/* A research record, not a landing page: the title carries the page without
   shouting, and lighter tracking keeps a long one readable at this size. */
.paper-title { margin-bottom: 20px; font-size: clamp(26px, 3.1vw, 37px); font-weight: 710; line-height: 1.2; letter-spacing: -.024em; }
.byline { font-size: 16px; }
.author-name { font-weight: 620; }
.affiliations { display: grid; gap: 2px; font-size: 12.5px; }
.actions-row { margin-bottom: 50px; }
.action { min-height: 44px; padding: 9px 16px; border-color: var(--border-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 680; }
.action:hover { border-color: var(--accent); background: var(--surface-tint); color: var(--accent-strong); transform: translateY(-1px); }
.paper-section { margin-bottom: 45px; }
.paper-section h2, .doc-page h2 { margin-bottom: 17px; padding-bottom: 10px; color: var(--muted); font-size: 10.5px; font-weight: 780; letter-spacing: .12em; }
.abstract { font-size: 16px; line-height: 1.82; }
.record { gap: 11px 28px; font-size: 13.5px; }
.record a { font-weight: 600; }
.note { font-size: 12.5px; }
.code-block pre { padding: 18px 92px 18px 18px; font-size: 12px; line-height: 1.7; }
.copy-btn { min-height: 30px; font-size: 11px; }
.doc-page { padding-top: 64px; }
.doc-page h1 { font-size: 27px; letter-spacing: -.02em; }
.doc-page .lead { margin-bottom: 34px; font-size: 15.5px; }
.doc-page h2 { margin-top: 34px; }
.doc-page .note { margin-top: 30px; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--surface-tint); }
footer.site { background: var(--surface-alt); }
footer.site .wrap { align-items: center; padding-top: 21px; padding-bottom: 23px; }
footer.site nav { display: flex; gap: 18px; }
footer.site a { color: var(--muted); text-decoration: none; }

/* Sign in */
.login-page { min-height: 100vh; background: var(--surface); }
.signin { display: grid; max-width: none; min-height: 100vh; grid-template-columns: minmax(360px, .88fr) minmax(460px, 1.12fr); margin: 0; padding: 0; }
.signin-intro { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: 48px clamp(38px, 5vw, 76px); overflow: hidden; background: radial-gradient(circle at 85% 10%, #1c5963 0, transparent 34%), linear-gradient(145deg, #123541, #091f28 72%); color: #c3d5d9; }
.signin-brand { display: flex; align-items: center; gap: 12px; }
.signin-brand .signin-mark { margin: 0; border-radius: 11px; box-shadow: 0 8px 22px rgb(0 0 0 / 22%); }
.signin-brand span { display: flex; flex-direction: column; line-height: 1.25; }
.signin-brand strong { color: #fff; font-size: 14px; }
.signin-brand small { margin-top: 3px; color: #8fa9b1; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.signin-intro > div:nth-child(2) { max-width: 510px; }
.signin-intro .eyebrow { color: #71d9ce; }
.signin-intro h1 { max-width: 12ch; margin-bottom: 22px; color: #fff; font-size: clamp(38px, 5vw, 64px); line-height: 1.01; }
.signin-intro > div:nth-child(2) > p:last-child { max-width: 48ch; margin: 0; color: #a9c0c6; font-size: 15px; line-height: 1.75; }
.signin-footnote { display: flex; align-items: center; gap: 9px; margin: 0; color: #77949c; font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.signin-footnote span { width: 7px; height: 7px; border-radius: 50%; background: #68d5ca; box-shadow: 0 0 0 5px rgb(104 213 202 / 11%); }
.signin-panel { display: grid; min-height: 100vh; place-items: center; padding: 48px; background: var(--surface); }
.signin-form { width: min(100%, 400px); }
.signin-form h2 { margin: 0 0 7px; font-size: 31px; letter-spacing: -.035em; }
.signin-form .lead { margin-bottom: 28px; }
.signin-form button[type=submit] { width: 100%; margin-top: 3px; }
.signin-note { margin-top: 19px; text-align: center; }

.skip-link { position: fixed; z-index: 100; top: 10px; left: -9999px; }
.skip-link:focus { left: 10px; }
button:focus-visible, .btn:focus-visible, .action:focus-visible, .copy-btn:focus-visible, .index-item:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .admin-shell { display: block; }
  .admin-sidebar { position: relative; width: 100%; height: auto; padding: 16px 20px; }
  .admin-brand { margin: 0 0 15px; }
  .admin-brand small { display: none; }
  .admin-sidebar nav.main { flex-direction: row; gap: 4px; padding-bottom: 6px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .admin-sidebar nav.main::-webkit-scrollbar { display: none; }
  .admin-sidebar nav.main a { flex: none; padding: 8px 10px; }
  .nav-dot { display: none; }
  .admin-sidebar-footer { position: absolute; top: 16px; right: 20px; margin: 0; padding: 0; border: 0; }
  .system-status { display: none; }
  .sidebar-signout { width: auto; }
  .admin-main .wrap { padding-top: 30px; }
  .signin { grid-template-columns: 1fr; }
  .signin-intro { min-height: 300px; padding: 32px; }
  .signin-intro > div:nth-child(2) { margin-top: 54px; }
  .signin-intro h1 { font-size: 40px; }
  .signin-intro > div:nth-child(2) > p:last-child, .signin-footnote { display: none; }
  .signin-panel { min-height: auto; padding: 52px 30px 70px; }
}

@media (max-width: 680px) {
  .wrap { padding: 28px 18px 56px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .grid { gap: 14px; }
  .card { padding: 19px 18px; }
  .admin-sidebar { padding-right: 14px; padding-left: 14px; }
  .admin-sidebar-footer { right: 14px; }
  .admin-brand { margin-right: 86px; }
  .admin-brand strong { max-width: 180px; }
  body.public .topbar-inner, body.public > main.wrap, body.public footer .wrap { padding-right: 18px; padding-left: 18px; }
  .public-status { display: none; }
  .index-page { padding-top: 36px; }
  .index-hero { margin-bottom: 42px; padding: 32px 25px 29px; border-radius: 17px; }
  .index-hero h1 { font-size: 25px; }
  .index-hero .lead { font-size: 14px; }
  .hero-meta { display: grid; gap: 7px; }
  .section-heading > span { display: none; }
  .index-item { flex-direction: row; align-items: center; padding: 17px; }
  .index-side { align-self: center; }
  .index-slug { display: none; }
  .paper-page { padding-top: 45px; }
  .paper-title { font-size: 26px; }
  .record { grid-template-columns: 1fr; gap: 2px; }
  .record dd { margin-bottom: 12px; }
  .actions-row { display: grid; grid-template-columns: 1fr; margin-bottom: 40px; }
  .action { width: 100%; }
  .action-out { margin-left: auto; }
  .bar-row { grid-template-columns: 100px 1fr 42px; }
  footer.site .wrap { align-items: flex-start; }
  footer.site nav { gap: 12px; }
  .signin-intro { min-height: 265px; padding: 26px 22px; }
  .signin-intro > div:nth-child(2) { margin-top: 42px; }
  .signin-intro h1 { margin-bottom: 0; font-size: 35px; }
  .signin-panel { padding: 42px 22px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  body.public .topbar, footer.site, .copy-btn, .action-out { display: none; }
  body.public > main.wrap { max-width: none; min-height: 0; padding: 0; }
  .paper-page { padding-top: 0; }
}


/* ------------------------------------------------------------------ *
 * Research page: two columns on wide screens.
 *
 * A single 900px ribbon left the whole right side of the window empty
 * while the abstract stopped short of the rule above it, so every block
 * ended on a different line. The metadata now occupies that space and
 * the reading column keeps one measure.
 * ------------------------------------------------------------------ */
/* Masthead, content and footer must share one column, or the site name never
   lines up with the text under it. */
body.public > main.wrap,
body.public footer .wrap,
body.public .topbar-inner { max-width: 1180px; }

.paper-head { padding-bottom: 30px; }
/* A 74px tick on a 900px rule read as a broken line. */
.paper-head::after { display: none; }
/* Wide enough to keep a long paper title to three lines rather than five. */
.paper-title { max-width: 32ch; }

.paper-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 56px;
  align-items: start;
}
.paper-main { min-width: 0; }
.paper-main .paper-section:last-child { margin-bottom: 0; }
.abstract { max-width: none; }

.paper-rail { position: sticky; top: 28px; display: grid; gap: 20px; }
.paper-rail .actions-row { flex-direction: column; gap: 8px; margin: 0; }
.paper-rail .action { justify-content: flex-start; width: 100%; }
.paper-rail .action-out { margin-left: auto; }

/* One primary action, so the eye is told where to go first. */
.action-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.action-primary .action-icon, .action-primary .action-out { color: #fff; }
.action-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.rail-card {
  padding: 20px 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.rail-card h2 {
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 780;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rail-card .record {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  font-size: 13px;
}
.rail-card .record dt {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.rail-card .record dd { margin: 3px 0 0; overflow-wrap: break-word; }
.rail-card .note { margin-top: 16px; font-size: 12px; line-height: 1.6; }

/* Code blocks were heavy grey slabs; a lighter box keeps the page calm. */
.code-block pre { border-color: var(--border); background: var(--surface-alt); }

@media (max-width: 1040px) {
  .paper-body { grid-template-columns: 1fr; gap: 34px; }
  .paper-rail { position: static; order: -1; }
  .paper-rail .actions-row { flex-direction: row; flex-wrap: wrap; }
  .paper-rail .action { width: auto; }
  .paper-rail .action-out { margin-left: 0; }
  .paper-title { max-width: 26ch; }
}

/* A structured abstract keeps its paragraphs. */
.abstract p { margin: 0 0 15px; }
.abstract p:last-child { margin-bottom: 0; }
