/* Open Cryptology — layout modelled on the Cryptology ePrint Archive (Bootstrap 5 look),
   with a yellow palette. Hand-written; no framework. Light only.

   Palette (WCAG AA on #FEFEFE unless noted):
     navbar        #FFC72C  (text #212529, 11:1)
     link          #8A4B00  (6.6:1)    hover #B5410B (5.6:1)    visited #6E5B14 (6.4:1)
     text          #212529             muted #696357 (5.9:1)
     neutrals are warm sand, never cool grey: --sand (#faf7ee) < --sand-2 < --sand-3, lines --line
*/
:root {
  --text: #212529;
  --muted: #696357;
  --paper: #fefefe;
  --nav: #ffc72c;
  --nav-text: #212529;
  --nav-hover: #6b3f00;
  --link: #8a4b00;
  --link-hover: #b5410b;
  --link-visited: #6e5b14;
  --border: #d6cfbf;
  --line: #ebe7dc;
  --sand: #faf7ee;
  --sand-2: #f3eee1;
  --sand-3: #e6dfcd;
  --focus: rgba(224, 160, 0, .35);
  --nav-h: 3.5rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: light;
}
@media (min-width: 576px) { :root { --nav-h: 4.5rem; } }
@media (min-width: 992px) { :root { --nav-h: 5.5rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-top: var(--nav-h);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--paper);
  /* Our own warm backdrop (diagonal bands), visible around the white content box. */
  background-image:
    linear-gradient(115deg, transparent 0 64%, rgba(232, 137, 26, .30) 64% 80%, transparent 80%),
    linear-gradient(28deg, rgba(245, 166, 35, .45) 0 18%, transparent 18%),
    linear-gradient(160deg, #fff6d6 0%, #ffe39a 45%, #ffcf5c 75%, #f5a623 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---------- typography (Bootstrap 5 scale) */
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 500; line-height: 1.2; }
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + .9vw); }
h3 { font-size: calc(1.3rem + .6vw); }
h4 { font-size: calc(1.275rem + .3vw); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
@media (min-width: 1200px) {
  h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } h3 { font-size: 1.75rem; } h4 { font-size: 1.5rem; }
}
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 2rem; }
dl { margin: 0 0 1rem; }
dt { font-weight: 700; }
dd { margin: 0 0 .5rem; }
strong, b { font-weight: bolder; }
small, .small { font-size: .875em; }
code, pre { font-family: var(--mono); font-size: .875em; }
code { color: #a33a00; word-wrap: break-word; }
pre { display: block; margin: 0 0 1rem; overflow: auto; }
pre code { color: inherit; font-size: inherit; }
mark { background: #ffe58a; color: inherit; padding: 0 .1em; }
.text-muted { color: var(--muted) !important; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- links */
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); }
a.btn:visited { color: var(--text); }
a.btn:hover, a.btn:visited:hover { color: #fefefe; }
:focus-visible { outline: 2px solid #b57a00; outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; z-index: 2000; background: #fff; padding: 8px; }
.skip:focus { left: 8px; }

/* ---------- spacing utilities used in markup */
.mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; } .mt-4 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.ms-2 { margin-left: .5rem !important; } .ms-auto { margin-left: auto !important; }

/* ---------- container */
.container { width: 100%; margin-right: auto; margin-left: auto; padding-right: .75rem; padding-left: .75rem; }
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

/* ---------- navbar (fixed top) */
#topNavbar { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; }
.navbar { background: var(--nav); color: var(--nav-text); box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.nav-inner {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; min-height: var(--nav-h); padding-left: 0; padding-right: 0;
}
.site-name { color: var(--nav-text); font-size: 1.6rem; line-height: 1.2; padding: .4rem 0; white-space: nowrap; }
.site-name { display: inline-flex; align-items: center; gap: .6rem; }
.site-logo { width: 2.5rem; height: 2.5rem; flex: none; }
.site-name:visited { color: var(--nav-text); }
.site-name:hover { color: var(--nav-hover); }
.nav-links { display: flex; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 1.1rem; }
.nav-links a { display: block; padding: .5rem 0 .5rem 1.5rem; color: var(--nav-text); }
.nav-links a:visited { color: var(--nav-text); }
.nav-links a:hover { color: var(--nav-hover); text-decoration: underline; text-underline-offset: 4px; }
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-burger { display: none; cursor: pointer; padding: .5rem .75rem; }
.nav-burger span { display: block; width: 28px; height: 2px; margin: 5px 0; background: var(--nav-text); }
.nav-toggle:focus-visible + .nav-burger { outline: 2px solid var(--nav-text); outline-offset: 2px; }

/* "Log in" sits in the top bar on wide screens and in the ☰ menu on phones (a signed-in avatar stays in the bar) */
.nav-links .nav-login { display: none; }
.nav-account { margin-left: 1.5rem; padding: .5rem 0; font-size: 1.1rem; color: var(--nav-text); white-space: nowrap; }
.nav-account:visited { color: var(--nav-text); }
.nav-account:hover { color: var(--nav-hover); text-decoration: underline; text-underline-offset: 4px; }
.nav-account.has-avatar { padding: .3rem 0; line-height: 0; }
.nav-account.has-avatar:hover { text-decoration: none; }
.nav-account.has-avatar:hover .avatar { box-shadow: 0 0 0 2px var(--nav-text); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.1rem; height: 2.1rem; border-radius: 50%; object-fit: cover;
  background: #fff4cc; color: var(--text); font-size: .8rem; font-weight: 600; line-height: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
}
.nav-search { margin-left: 1rem; }
.nav-search > summary { list-style: none; cursor: pointer; padding: .5rem .75rem; color: var(--nav-text); line-height: 0; }
.nav-search > summary::-webkit-details-marker { display: none; }
.nav-search > summary:hover { color: var(--nav-hover); }
.search-icon { width: 25px; height: 25px; }
.nav-search-dd {
  position: absolute; right: .75rem; top: 100%; z-index: 1040;
  width: min(30rem, calc(100vw - 1.5rem)); background: #fff;
  border: 1px solid rgba(0, 0, 0, .15); border-radius: .25rem;
  box-shadow: rgba(0, 0, 0, .24) 0 3px 8px;
}
.nav-search-dd .form-control { background-color: var(--sand-2); border: 0; }

@media (max-width: 991.98px) {
  .site-name { font-size: 1.5rem; }
  .nav-burger { display: block; order: 0; }
  .site-name { order: 1; flex: 1; text-align: center; justify-content: center; }
  .site-logo { width: 2.1rem; height: 2.1rem; }
  .nav-account { order: 2; margin-left: 0; padding: .5rem .25rem; font-size: 1rem; }
  .nav-account:not(.has-avatar) { display: none; }
  .nav-links .nav-login { display: block; }
  .nav-search { order: 3; margin-left: 0; }
  .nav-links {
    order: 4; display: none; flex-basis: 100%; flex-direction: column;
    margin: 0; padding: 0 .75rem .75rem;
  }
  .nav-links a { padding: .5rem .75rem; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  /* phones and tablets: search opens as a yellow panel under the bar, like the menu, with a full-size field */
  .nav-search-dd {
    right: 0; width: 100%; padding: .25rem .75rem .9rem; background: var(--nav);
    border: 0; border-radius: 0; box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
  }
  .nav-search-dd .form-control { background-color: #fff; font-size: 1.1rem; padding: .7rem .9rem; border-radius: .5rem 0 0 .5rem; }
  .nav-search-dd .btn { font-size: 1.05rem; padding: .7rem 1.1rem; border-radius: 0 .5rem .5rem 0; }
}
@media (max-width: 767.98px) { .site-name { font-size: 1.4rem; } }
@media (max-width: 359.98px) { .site-name { font-size: 1.15rem; gap: .4rem; } .site-logo { width: 1.6rem; height: 1.6rem; } }

/* thin "unofficial" note under the navbar */
.unofficial {
  padding-top: .3rem; padding-bottom: .3rem;
  font-size: .8rem; line-height: 1.35; text-align: center;
  background: #fff4cc; color: var(--text);
  border-bottom: 1px solid #f0d27a;
}
@media (min-width: 576px) { .unofficial { border-radius: 0 0 .3rem .3rem; } }

/* ---------- main content box */
.eprintContent {
  margin-top: 1rem;
  padding: 1.5rem 1rem;
  background-color: var(--paper);
  border-radius: .3rem;
}
@media (min-width: 768px) { .eprintContent { padding: 1.5rem; } }
@media (min-width: 576px) { .eprintContent { margin-top: 1.5rem; } }
@media (max-width: 575.98px) { .eprintContent { margin-top: 0; border-radius: 0; } }

.site-footer { margin-top: 1.5rem; margin-bottom: 2rem; padding-top: .75rem; padding-bottom: .75rem; font-size: .8rem; text-align: center; background: rgba(254, 254, 254, .9); border-radius: .3rem; }
@media (max-width: 575.98px) { .site-footer { margin: 0; border-radius: 0; border-top: 1px solid #eee; } }

/* ---------- buttons */
.btn {
  display: inline-block; font-family: inherit; font-weight: 400; line-height: 1.5; color: var(--text);
  text-align: center; vertical-align: middle; cursor: pointer; user-select: none;
  background-color: transparent; border: 1px solid transparent; padding: .375rem .75rem;
  font-size: 1rem; border-radius: .25rem;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
.btn-outline-dark { color: var(--text); border-color: var(--text); }
.btn-outline-dark:hover { color: #fefefe; background-color: var(--text); }
.btn-secondary { color: #fff; background-color: var(--text); border-color: var(--text); }
.btn-secondary:hover { color: #fff; background-color: #000; border-color: #000; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .2rem; }
.icon { width: 1.2em; height: 1.2em; vertical-align: -.25em; margin-right: .4rem; }

/* ---------- forms */
.form-label { display: inline-block; margin-bottom: .5rem; }
.form-control, .form-select {
  display: block; width: 100%; padding: .375rem .75rem; font-family: inherit; font-size: 1rem;
  font-weight: 400; line-height: 1.5; color: var(--text); background-color: #fff;
  border: 1px solid var(--border); border-radius: .25rem; appearance: none;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control:focus, .form-select:focus { border-color: #e0a800; outline: 0; box-shadow: 0 0 0 .25rem var(--focus); }
.form-control::placeholder { color: var(--muted); opacity: 1; }
.form-control[type=file] { overflow: hidden; }
.form-control[type=file]::file-selector-button { margin: -.375rem .75rem -.375rem -.75rem; padding: .375rem .75rem; border: 0; border-right: 1px solid var(--border); background: var(--sand-2); color: var(--text); font: inherit; }
.form-control-sm[type=file]::file-selector-button { margin: -.25rem .5rem -.25rem -.5rem; padding: .25rem .5rem; }
.form-select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px 12px;
}
.form-control-sm, .form-select-sm { padding-top: .25rem; padding-bottom: .25rem; padding-left: .5rem; font-size: .875rem; border-radius: .2rem; }
textarea.form-control { min-height: calc(1.5em + .75rem + 2px); resize: vertical; }
.input-group { position: relative; display: flex; flex-wrap: nowrap; align-items: stretch; width: 100%; }
.input-group > .form-control { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .btn { position: relative; z-index: 2; }

/* ---------- badges, alerts */
.badge {
  display: inline-block; padding: .35em .65em; font-size: .75em; font-weight: 700; line-height: 1;
  color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25rem;
}
.bg-secondary { background-color: #776e60; color: #fff; }
.category { font-weight: 400; line-height: normal; color: var(--text); }
.category-applications   { background-color: rgba(214, 222, 60, .55); }
.category-protocols      { background-color: rgba(255, 170, 60, .50); }
.category-foundations    { background-color: rgba(255, 205, 40, .55); }
.category-implementation { background-color: rgba(205, 133, 63, .40); }
.category-secretkey      { background-color: rgba(235, 110, 70, .35); }
.category-publickey      { background-color: rgba(255, 232, 130, .90); }
.category-attacks        { background-color: rgba(181, 65, 11, .25); }
.category-uncategorized  { background-color: rgba(200, 186, 155, .45); }
.cc {
  display: inline-block; padding: .05rem .4rem; border: 2px solid var(--text); border-radius: .3rem;
  font-weight: 700; font-size: .85rem; letter-spacing: .02em; white-space: nowrap;
}
.alert { position: relative; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .25rem; }
.alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }

/* ---------- ePrint cards */
.eprintCard { min-width: 0; }
div.eprintCardHeader {
  padding: 1rem;
  text-align: center;
  margin-left: 1rem;
  margin-right: 1rem;
  background:
    linear-gradient(#fefefe, #fefefe),
    linear-gradient(to right, #fefefe 5%, #9a4a00 5%, #c8560f 15%, #e8891a 28%, #f5a623 45%,
      #ffc72c 60%, #ffd84d 75%, #fefefe 95%);
  border-bottom: 3px solid transparent;
  border-radius: 14%;
  background-repeat: no-repeat;
  background-origin: padding-box, border-box;
}
div.eprintCardHeader h3 { margin: 0; }
div.eprintCardContent { padding: 20px; }
div.eprintCard p { margin-top: .5rem; margin-bottom: .5rem; }

/* ---------- home */

/* ---------- search */
.search-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .search-layout { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.search-form { padding: .5rem; }
@media (min-width: 768px) { .search-form { padding-top: 1.5rem; } }
.search-form .form-label:first-child { margin-top: .5rem; }
.search-help { padding: .5rem; margin-top: 1rem; color: #4f4a40; }
.search-help ul { padding-left: 1.2rem; margin: 0; }
.search-results-col { min-height: 60vh; }
.search-help > summary { list-style: none; cursor: default; margin-bottom: .25rem; }
.search-help > summary::-webkit-details-marker { display: none; }
/* phones and tablets: a compact form (query; sort + button on one row), 16px fields so iPhones
   don't zoom in, and the tips behind a tap */
@media (max-width: 991.98px) {
  .search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
  .search-form label[for="anything"], .search-form #anything { grid-column: 1 / -1; }
  .search-form label[for="anything"] { margin: 0; }
  .search-form label[for="sort"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .search-form > div { margin: 0 !important; }
  .search-form .form-control, .search-form .form-select { font-size: 1rem; padding-top: .45rem; padding-bottom: .45rem; }
  .search-form .btn { font-size: 1rem; padding: .45rem 1rem; }
  .search-help { margin-top: 0; }
  .search-help > summary { cursor: pointer; }
  .search-help > summary::after { content: " \25B8"; color: var(--muted); }
  .search-help[open] > summary::after { content: " \25BE"; }
}
/* phones: thousands of tiny squares can't be tapped; the year page lists every paper below anyway */
@media (max-width: 575.98px) {
  .year-page .paper-grid, .year-page .grid-legend, .year-page .grid-hint,
  .home-grid .paper-grid, .home-grid .grid-legend { display: none; }
}
.results-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin: 1rem 0 0 1.5rem; }
.results-bar .results-h { margin: 0; }
.search-results-col > .results-h { margin: 1rem 0 0 1.5rem; }
.results { margin-top: 1rem; }
@media (min-width: 992px) { .results { margin-left: 1.5rem; } }
.result { margin-bottom: 1.5rem; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
.result-body { margin-top: .1rem; }
@media (min-width: 768px) { .result-body { margin-left: 1.5rem; } }
.result-row { display: flex; flex-direction: column; justify-content: space-between; }
@media (min-width: 768px) { .result-row { flex-direction: row; } .result-cat { margin-left: 1rem; } }
.result-cat { margin-top: .25rem; flex: none; }
a.result-title, a.result-title:visited { color: var(--text); }
a.result-title:hover { color: var(--link-hover); }
.result-authors { margin-top: .25rem; font-style: italic; }
.search-abstract { margin: .25rem 0 0; overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; margin: 1rem 0 0; }
@media (min-width: 992px) { .pager { margin-left: 1.5rem; } }
@media (max-width: 991.98px) { .results-bar, .search-results-col > .results-h { margin-left: 0; } }

/* ---------- paper page */
.paper-row { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 1.5rem; }
@media (min-width: 768px) {
  .paper-row { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .paper-main { padding-right: 3rem; }
  .paper-meta { padding-left: 3rem; }
}
@media (min-width: 992px) { .paper-row { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.paper-title { margin-bottom: 1rem; overflow-wrap: anywhere; }
span.authorName { font-style: italic; }
.paper-abstract { white-space: pre-wrap; overflow-wrap: break-word; }
.paper-abstract .katex-display { margin: .4em 0; overflow-x: auto; overflow-y: hidden; white-space: normal; }
.paper-meta { margin-top: 1.5rem; overflow-wrap: anywhere; }
/* Phones: one column. The PDF/BibTeX/ePrint row goes under the authors, the metadata rows under the abstract. */
@media (max-width: 767.98px) {
  .paper-main, .paper-meta { display: contents; }
  .paper-main > h5, .paper-abstract { order: 1; }
  .meta-note, .meta-rows, .meta-report { order: 2; }
  .meta-top { margin-top: 1rem; }
}
@media (min-width: 768px) { .paper-meta { margin-top: 0; } }
/* Metadata column: PDF + BibTeX + ePrint in one row, then short label/value rows. */
.paper-meta { position: relative; }
.meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.btn-pdf { background: var(--nav); border-color: var(--text); font-weight: 500; padding-left: 1rem; padding-right: 1rem; }
.btn-pdf:hover { color: #fefefe; background: var(--text); }
.meta-note { margin: .5rem 0 0; font-size: .875rem; }
.meta-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; align-items: baseline; margin: 1.25rem 0 0; font-size: .925rem; }
@media (max-width: 767.98px) { .meta-rows { margin-top: 1.5rem; } }
.meta-rows dt { font-weight: 600; }
.meta-rows dd { margin: 0; }
.meta-report { margin: 1.25rem 0 0; font-size: .875rem; }
.meta-list { list-style: none; margin: 0; padding: 0; }
.meta-list li + li { margin-top: .2rem; }
.meta-list small { white-space: nowrap; }
.meta-more { margin-top: .2rem; }
.meta-more > summary { cursor: pointer; color: var(--link); font-size: .875rem; width: max-content; }
.meta-more > summary:hover { color: var(--link-hover); }
.meta-more[open] > summary { margin-bottom: .2rem; }
/* BibTeX: a link-style toggle in the first row; the entry opens in a quiet panel on the row below. */
.cite > summary { list-style: none; display: inline-flex; align-items: center; gap: .15rem; cursor: pointer; color: var(--link); }
.cite > summary::-webkit-details-marker { display: none; }
.cite > summary:hover { color: var(--link-hover); }
.cite-chev { width: 1em; height: 1em; color: var(--muted); transition: transform .15s ease; }
.cite[open] .cite-chev { transform: rotate(180deg); }
.cite-panel { display: none; flex-basis: 100%; position: relative; padding: .55rem .75rem; background: #fbf8ef; border-radius: .25rem; }
.cite[open] ~ .cite-panel { display: block; }
.cite-panel pre { margin: 0; font-size: .75rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.cite-panel pre > span { display: block; padding-left: 8ch; text-indent: -8ch; }
.cite-copy { float: right; display: inline-flex; align-items: center; margin: 0 0 .25rem .5rem; padding: 0; border: 0; background: none; font: inherit; font-size: .8rem; color: var(--link); cursor: pointer; }
.cite-copy:hover { color: var(--link-hover); }
.cite-copy .icon { width: 1em; height: 1em; margin-right: .25rem; vertical-align: 0; }
@media (prefers-reduced-motion: reduce) { .cite-chev { transition: none; } }
.upload-form { margin-top: .75rem; padding: .75rem; background: #fff8e1; border: 1px dashed #e0b84a; border-radius: .25rem; }
/* No PDF yet: the upload box sits under the authors; /YYYY/NNNN#upload lands on it below the fixed navbar. */
.upload-cta {
  margin: 1.25rem 0 .5rem; padding: 1rem 1.25rem; max-width: 40rem; background: #fff3cd;
  border: 2px solid var(--nav); border-left-width: 6px; border-radius: .3rem;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
.upload-cta:target { box-shadow: 0 0 0 .25rem var(--focus); }
.upload-cta p { margin: 0 0 .5rem; }
.upload-cta-head { font-size: 1.15rem; }
.upload-cta .form-control { max-width: 28rem; }
/* Keep room for the 300px Turnstile widget on narrow phones. */
@media (max-width: 575.98px) { .upload-cta { margin-left: -.5rem; margin-right: -.5rem; padding: .75rem; border-left-width: 4px; } }
.attribution { overflow-wrap: anywhere; margin-bottom: .5rem; }

/* ---------- message pages */
.message { max-width: 48rem; padding: .5rem 0; }
.message h3 { overflow-wrap: anywhere; }
.contact-form { display: grid; gap: 1rem; max-width: 36rem; margin-top: 1.5rem; }
.contact-form .form-label { font-weight: 500; }

/* Home: the letter is the main column; search + papers missing a PDF sit on the right. */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding: .5rem 1rem; }
/* Search comes first in the markup so it sits above the letter on narrow screens. */
@media (min-width: 992px) {
  .home-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 1rem 3rem; }
  .home-letter { grid-column: 1; grid-row: 1 / span 2; }
  .home-search, .home-side { grid-column: 2; }
}
.home-letter { max-width: 42rem; font-size: 1.05rem; line-height: 1.65; }
.home-letter p { margin: 0 0 1rem; }
.home-letter strong { font-weight: 600; }
.contact-page { max-width: 36rem; }
.contact-page .contact-form { margin-top: 1rem; }
.home-side .eprintCardHeader { margin: 0; padding: .5rem; }
.home-side .eprintCardHeader h3 { font-size: 1.25rem; }
.home-side .eprintCardContent { padding: .5rem 0 0; }

/* Papers missing a PDF (/missing and the homepage card): one tile per year, filled from the bottom in
   green up to the share of papers with an up-to-date PDF here (--cur), then yellow up to the share
   with any PDF (--fill: the rest may be outdated), and one square per paper of a year. */
.year-page { max-width: 62rem; padding: .5rem 1rem; }
.year-page .results-bar { margin: 0 0 1rem; }
.year-page h5 { font-size: 1.1rem; margin-bottom: .5rem; }
.year-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr)); gap: 4px; }
.year-page .year-tiles { grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr)); }
a.year-tile, a.year-tile:visited {
  display: flex; flex-direction: column; justify-content: center; align-items: center; aspect-ratio: 1;
  border-radius: 4px; color: #102a17; line-height: 1.1; border: 1px solid rgba(27, 31, 35, .06);
  background: linear-gradient(to top, #40c463 var(--cur), #ffc72c var(--cur) var(--fill), var(--sand-3) var(--fill));
}
a.year-tile.full { background: #30a14e; color: #fff; }
a.year-tile:hover { outline: 2px solid var(--text); outline-offset: 1px; color: #102a17; }
a.year-tile.full:hover { color: #fff; }
a.year-tile.sel { outline: 3px solid var(--link); outline-offset: 1px; }
.home-missing a.year-tile.sel { outline-width: 2px; }
.yt-year { font-size: .8rem; font-weight: 600; }
.yt-pct { font-size: .7rem; }
.paper-grid { --cell: 11px; display: grid; grid-template-columns: repeat(auto-fill, var(--cell)); gap: 2px; }
.paper-grid.small { --cell: 6px; gap: 1px; }
.paper-grid > * { display: block; width: var(--cell); height: var(--cell); border-radius: 2px; background: #40c463; }
.paper-grid.small > * { border-radius: 1px; }
.paper-grid .m { background: #ddd4bf; }
.paper-grid .o { background: #ffc72c; }
.paper-grid .p { background: #79b8ff; }
.paper-grid a:hover, .paper-grid a:focus-visible { background: var(--link-hover); outline: none; }
.grid-head { display: flex; align-items: center; justify-content: center; gap: .25rem; }
.grid-nav { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; color: var(--muted); transition: background-color .15s, color .15s; }
a.grid-nav:hover, a.grid-nav:focus-visible { color: var(--text); background: rgba(138, 75, 0, .08); outline: none; }
.grid-nav.off { visibility: hidden; }
.grid-counts { text-align: center; color: var(--muted); }
.home-grid.from-prev { animation: grid-in-prev .2s ease-out; }
.home-grid.from-next { animation: grid-in-next .2s ease-out; }
@keyframes grid-in-prev { from { opacity: 0; transform: translateX(-10px); } }
@keyframes grid-in-next { from { opacity: 0; transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { .home-grid.from-prev, .home-grid.from-next { animation: none; } }
.home-grid.loading { opacity: .5; }
.grid-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: .5rem 0 0; padding: 0; color: var(--muted); }
.grid-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; background: #40c463; }
.grid-legend i.m { background: #ddd4bf; }
.grid-legend i.o { background: #ffc72c; }
.grid-legend i.p { background: #79b8ff; }

/* ---------- withdrawn papers, version history */
.withdrawn-notice { margin: .25rem 0 1rem; }
span.affiliation { color: #555; }
ul.versions { list-style: none; margin: 0; padding: 0; }
ul.versions li { margin: 0 0 .35rem; line-height: 1.3; }
ul.versions small { display: block; }
.result-head .badge { margin-left: .35rem; }

/* upload result notice (shown after the redirect back to the paper page) */
.upload-notice { border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: .95rem; }
.upload-notice-ok { background: #e7f6e9; border: 1px solid #9fd3a6; color: #1d4d24; }
.upload-notice-err { background: #fdecea; border: 1px solid #f1aea6; color: #6b1d14; }

/* ---------- accounts: /account settings, log in, /connect (on the same paper as every page) */
.settings { max-width: 42rem; margin: 0 auto; }
.settings-card {
  background: #fff; border: 1px solid var(--line); border-radius: .75rem;
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.settings-title { font-size: 1.35rem; font-weight: 600; margin: 0 0 .5rem; }
.settings-kicker { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.settings-hint { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }
.settings-fine { color: var(--muted); font-size: .8rem; margin: 1rem 0 0; }
.settings-notice { background: #fff4cc; border: 1px solid #f0d27a; border-radius: .5rem; padding: .55rem .9rem; margin: 0 0 1rem; font-size: .95rem; }
.settings-notice-err { background: #fdecec; border-color: #f1b5b5; }

/* header: photo, name, edit */
.settings-head { display: flex; gap: 1.1rem; align-items: flex-start; padding: .5rem .25rem 1.25rem; }
.avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; box-shadow: none; border: 1px solid var(--line); }
.settings-who { min-width: 0; flex: 1; }
.settings-logout { margin: .35rem 0 0; flex: none; }
.settings-name-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.settings-name { font-size: 1.6rem; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.settings-badge { font-size: .75rem; padding: .1rem .5rem; border-radius: 1rem; background: #fff4cc; border: 1px solid #f0d27a; }
.settings-link {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0; border: 0; background: none;
  color: var(--link); font: inherit; font-size: .85rem; cursor: pointer;
}
.settings-link:hover { color: var(--link-hover); text-decoration: underline; }
.name-edit { margin-top: .2rem; }
.name-edit > summary { list-style: none; }
.name-edit > summary::-webkit-details-marker { display: none; }
.name-edit[open] > summary { color: var(--muted); }
.name-form { display: flex; gap: .5rem; margin: .5rem 0 .25rem; max-width: 26rem; }
.name-reset { margin: .25rem 0 .5rem; }

/* rows: label · value · state or button */
.settings-rows { list-style: none; margin: 0; padding: 0; }
.settings-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.settings-rows > .settings-row:first-child { border-top: 0; }
.settings-row-label { flex: 0 0 6.25rem; font-weight: 600; font-size: .9rem; }
.settings-row-value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.settings-row form { margin: 0; }
.settings-actions { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }
.settings-actions form { margin: 0; }

.btn-danger-outline { color: #b42318; border-color: #d9534f; background: #fff; }
.btn-danger-outline:hover { color: #fff; background: #b42318; border-color: #b42318; }
/* /account: profile header, then titled sections of rows on the site's own paper */
.acct-head { align-items: center; padding: .25rem 0 1.5rem; margin-bottom: .5rem; border-bottom: 1px solid #efece4; }
.acct-head .avatar-lg { width: 4.75rem; height: 4.75rem; font-size: 1.6rem; border: 0; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--nav); }
.acct-head .settings-name { font-size: 1.75rem; letter-spacing: -.01em; }
.acct-head .settings-logout { margin: 0; }
.acct-section { margin: 1.5rem 0 0; }
.acct-h { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
.acct-card { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: .75rem; background: #fff; overflow: hidden; }
.acct-row { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; border-top: 1px solid #f1eee6; }
.acct-card > :first-child, .acct-card > :first-child > .acct-row { border-top: 0; }
.acct-row-top { align-items: flex-start; }
.acct-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: .6rem; background: var(--sand); border: 1px solid #f0ebdd; }
.acct-tile .provider-icon { width: 1.15rem; height: 1.15rem; }
.acct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; overflow-wrap: anywhere; }
.acct-label { font-weight: 600; }
.acct-sub { color: var(--muted); font-size: .875rem; }
.acct-sub a { color: var(--muted); }
.acct-sub a:hover { color: var(--link-hover); }
.acct-state { display: inline-flex; align-items: center; gap: .3rem; color: #2f7a3e; font-size: .85rem; white-space: nowrap; }
.acct-link { color: var(--text); text-decoration: none; }
.acct-link:visited { color: var(--text); }
.acct-link:hover { background: #fbf9f3; color: var(--text); text-decoration: none; }
.acct-chevron { width: 1rem; height: 1rem; color: var(--muted); flex: none; }
.acct-link:hover .acct-chevron { color: var(--text); }
.acct-row .btn-sm { border-radius: .4rem; }
.acct-head .btn-sm { border-radius: .4rem; }
.danger-confirm > summary { list-style: none; white-space: nowrap; }
.danger-confirm > summary::-webkit-details-marker { display: none; }
.danger-confirm[open] > summary { display: none; }
.danger-form { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.acct-check { white-space: nowrap; font-size: .9rem; }

/* log in */
.settings-login { max-width: 26rem; margin: 1rem auto; padding: 1.5rem; }
.login-buttons { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.login-buttons .btn {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  padding: .6rem 1rem; background: #fff; border-color: var(--border); border-radius: .45rem;
}
.login-buttons .btn:hover { background: var(--sand); color: var(--text); border-color: #b3a98f; }
.login-buttons .provider-icon { width: 1.25rem; height: 1.25rem; }
.provider-icon { width: 1.05rem; height: 1.05rem; flex: none; }
/* the log-in pop-up (app.js): the log-in card, centred over a dimmed page */
.login-dialog { padding: 0; border: 0; background: none; width: min(26rem, calc(100vw - 2rem)); max-width: none; overflow: visible; }
.login-dialog::backdrop { background: rgba(33, 37, 41, .45); }
.login-dialog .settings-login { position: relative; margin: 0; box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .18); }
.login-dialog .settings-title { padding-right: 1.75rem; }
.login-dialog-close {
  position: absolute; top: .55rem; right: .6rem; width: 2rem; height: 2rem; padding: 0;
  border: 0; border-radius: .4rem; background: none; color: var(--muted);
  font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.login-dialog-close:hover { color: var(--text); background: var(--sand); }
.provider-tag { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }

/* merge */
.merge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.merge-side { border: 1px solid var(--line); border-radius: .5rem; padding: .9rem 1rem; }
.merge-who { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; overflow-wrap: anywhere; }
.btn-link { border: 0; background: none; color: var(--link); }
.btn-link:hover { color: var(--link-hover); text-decoration: underline; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 575.98px) {
  .settings-head { gap: .8rem; }
  .avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.15rem; }
  .acct-head .avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.15rem; }
  .acct-head .settings-name { font-size: 1.35rem; }
  .settings-name { font-size: 1.3rem; }
  .settings-card { padding: 1rem; }
  .danger-form { align-items: flex-start; }
  .merge-grid { grid-template-columns: 1fr; }
}

/* ---------- year page: list of every paper */
ol.year-list { list-style: none; margin: 0; padding: 0; }
ol.year-list li { margin: 0 0 .85rem; line-height: 1.4; }
ol.year-list .badge { margin-left: .35rem; }
.year-authors { font-style: italic; color: #555; }

/* ---------- original manuscripts (manuscripts.ts) */
.ms-title { font-size: 1.8rem; font-weight: 650; line-height: 1.25; margin: .25rem 0 .5rem; }
.ms-authors { font-size: 1.1rem; margin: .25rem 0; }
.ms-uploader { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ms-person, .ms-row-person { display: inline-flex; align-items: center; }
.ms-person { color: var(--text); font-weight: 600; }
.ms-person:hover { color: var(--link-hover); }
.avatar-xs { width: 1.25rem; height: 1.25rem; font-size: .55rem; box-shadow: none; margin-right: .35rem; }
.ms-list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ms-day { margin: 1.5rem 0 .4rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.ms-list { list-style: none; padding: 0; margin: 0; }
.ms-row { padding: .65rem 0; border-top: 1px solid #f0eee8; }
.ms-row-title { font-weight: 600; font-size: 1.05rem; }
.ms-row-authors { color: #444; font-size: .92rem; margin-top: .1rem; }
.ms-row-person { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.ms-flag { font-size: .75rem; border: 1px solid #e0b4b4; color: #a33; border-radius: 1rem; padding: 0 .45rem; }
.ms-profile { max-width: 46rem; margin: 0 auto; }
.ms-profile-head { display: flex; gap: 1.1rem; align-items: center; margin-bottom: .5rem; }
.ms-idents { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.ms-idents .provider-tag { font-weight: 600; font-size: .9rem; }
.hm-primary { background: var(--text); color: #fff; padding: .55rem 1.1rem; }
.hm-primary:hover { background: #000; color: #fff; }
/* as a link: a.btn:visited would otherwise turn the label the same dark as the background */
a.hm-primary:visited, a.hm-primary:visited:hover { color: #fff; }


/* homepage: the letter, with a short list of where to go beside it (phones: below it) */
.hm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: .5rem 1rem; }
/* wide screens: letter and list stay side by side, centred, instead of drifting apart */
@media (min-width: 992px) { .hm { grid-template-columns: minmax(0, 42rem) 18rem; justify-content: center; gap: 4rem; } }
.hm-nav { align-self: start; border-top: 1px solid #eee7d6; }
.hm-item { display: block; padding: .85rem 0; border-bottom: 1px solid #eee7d6; color: var(--text); text-decoration: none; }
.hm-item:hover, .hm-item:visited { color: var(--text); }
.hm-item-title { display: block; font-weight: 600; }
.hm-item-title::after { content: " \2192"; color: var(--muted); }
.hm-item:hover .hm-item-title { text-decoration: underline; text-underline-offset: 3px; }
.hm-item-sub { display: block; color: var(--muted); font-size: .9rem; margin-top: .1rem; }
.hm-bars { margin: .6rem 0 0; }
.hm-bars svg { display: block; width: 100%; height: 40px; fill: #e0b94a; }
.hm-bars figcaption { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .2rem; }


.hm-latest-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.hm-latest-head .ms-day { margin-top: .25rem; }
.ms-more { font-size: .9rem; white-space: nowrap; }

/* /eprint: the papers-by-year grid in the middle, what the mirror is in a sidebar (phones: below) */
.ep-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 992px) {
  .ep-layout { grid-template-columns: minmax(0, 1fr) 19rem; gap: 3rem; }
  .ep-layout .ep-main { grid-column: 1; grid-row: 1; } .ep-layout .ep-text { grid-column: 2; grid-row: 1; align-self: start; }
}
.ep-main .eprintCardHeader { margin-top: .75rem; }
.ep-text { font-size: .95rem; line-height: 1.6; }
@media (min-width: 992px) { .ep-text { border-left: 1px solid #eee; padding-left: 1.5rem; margin-top: .75rem; } }
.ep-text p { margin: 0 0 .5rem; }
.ep-points { padding-left: 1.1rem; margin: 0; }
.ep-points li { margin: .4rem 0; }

/* search: matching manuscripts above the ePrint results */
.search-ms { margin: 0 0 1.5rem; }
@media (min-width: 992px) { .search-ms { margin-left: 1.5rem; } }

/* submit */
.sb { max-width: 40rem; margin: 0 auto; }
.ms-form { display: flex; flex-direction: column; gap: .35rem; }
.ms-form .form-label { margin-top: .6rem; font-weight: 600; }
.sb-drop { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.6rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed #d8cfb8; border-radius: .6rem; background: #fffdf6; }
.sb-drop:hover, .sb-drop.is-over { border-color: #c9a64a; }
.sb-drop { position: relative; }
.sb-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sb-drop:focus-within { border-color: #c9a64a; outline: 2px solid rgba(201,166,74,.35); }
.sb-drop span, .sb-sub { color: var(--muted); font-size: .85rem; font-weight: 400; }
.sb textarea[hidden] { display: none; }
.sb-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.sb-tabs { display: inline-flex; gap: .9rem; font-size: .85rem; }
.sb-tab { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.sb-tab:hover { color: var(--text); }
.sb-tab[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.sb-preview { padding: .375rem .75rem; border: 1px solid var(--border); border-radius: .25rem; background: #fff; line-height: 1.5; overflow-y: auto; }
.sb-preview.is-empty { color: var(--muted); }
.sb-authors { display: flex; flex-direction: column; gap: .4rem; }
.sb-author { display: flex; gap: .4rem; align-items: center; }
.sb-remove { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 0 .3rem; cursor: pointer; }
.sb-remove:hover { color: #b42318; }
.sb-add { padding-left: 0; }
.ms-license { white-space: normal; margin: .75rem 0; }

/* terms */
.tou { max-width: 44rem; margin: 0 auto; line-height: 1.6; }
.tou h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.tou li { margin: .4rem 0; }

@media (max-width: 575.98px) { .ms-title { font-size: 1.45rem; } }
}

/* /connect: approving an agent, a log-in style card */
.connect-who { display: flex; align-items: center; font-weight: 600; margin: .75rem 0 0; }
.connect-who .avatar-xs { width: 1.6rem; height: 1.6rem; font-size: .65rem; margin-right: .5rem; }
.connect-code, .connect-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; }
.connect-code { margin: 1.1rem 0 .3rem; padding: .55rem; font-size: 1.5rem; font-weight: 600; background: var(--sand); border: 1px solid var(--line); border-radius: .45rem; }
.connect-from { text-align: center; color: var(--muted); font-size: .85rem; margin: 0; }
.connect-buttons { display: flex; flex-direction: column; gap: .6rem; margin: 1.1rem 0 0; }
.connect-buttons .btn { padding: .6rem 1rem; border-radius: .45rem; }
.connect-input { text-transform: uppercase; font-size: 1.2rem; }
.connect-input.is-invalid { border-color: #d9534f; }

/* ---------- comments on paper and manuscript pages (comments.ts): a Reddit-like thread */
.cm-section { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid #f0eee8; }
.cm-section [hidden] { display: none !important; }
.cm-title { font-size: 1.15rem; font-weight: 650; margin: 0 0 .75rem; }
.cm-count { color: var(--muted); font-weight: 400; }
.cm-error { color: #a12a1c; font-size: .88rem; margin: 0 0 .5rem; }

/* the comment box */
.cm-composer { border: 1px solid var(--border); border-radius: 1.1rem; background: #fff; margin: 0 0 1.25rem; transition: border-color .15s; }
.cm-composer:focus-within { border-color: #8f8a7e; }
.cm-composer textarea, .cm-preview {
  display: block; width: 100%; padding: .6rem 1rem; border: 0; background: transparent; border-radius: 1.1rem;
  font: inherit; font-size: .95rem; line-height: 1.5; color: var(--text); resize: none; outline: none; overflow: hidden;
}
.cm-preview { white-space: pre-wrap; overflow-wrap: break-word; }
.cm-composer textarea::placeholder { color: #8a8f94; }
.cm-composer textarea[readonly] { cursor: text; }
.cm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: 0 .5rem .5rem; }
.cm-spacer { flex: 1; }
.cm-tool, .cm-cancel, .cm-submit {
  display: inline-flex; align-items: center; gap: .3rem; border: 0; border-radius: 999px; font: inherit;
  font-size: .82rem; font-weight: 600; line-height: 1; padding: .5rem .8rem; cursor: pointer;
}
.cm-tool { background: transparent; color: var(--muted); }
.cm-tool:hover, .cm-tool[aria-pressed="true"] { background: #f2f1ec; color: var(--text); }
.cm-cancel { background: #f2f1ec; color: var(--text); }
.cm-cancel:hover { background: #e6e4dd; }
.cm-submit { background: var(--text); color: #fff; }
.cm-submit:hover { background: #000; }
.cm-submit:disabled { background: #e6e4dd; color: #9a9890; cursor: default; }
.cm-composer.is-collapsed { border-radius: 999px; }
.cm-composer.is-collapsed .cm-bar { display: none; }
.cm-composer.is-collapsed textarea { height: 2.6rem !important; white-space: nowrap; }
.cm-composer.is-collapsed:hover { border-color: #8f8a7e; }
.cm .cm-composer { margin: .4rem 0 .6rem; }

/* the thread: avatar column with a line down to the replies; click the line to collapse */
.cm { display: grid; grid-template-columns: 2rem 1fr; column-gap: .5rem; padding-top: .7rem; }
.cm-gutter { display: flex; flex-direction: column; align-items: center; }
.cm-gutter .avatar-xs { width: 1.75rem; height: 1.75rem; font-size: .62rem; margin: 0; }
.cm-avatar { line-height: 0; }
.cm-avatar-gone { background: #e6e4dd; }
.cm-line { flex: 1; width: 1rem; margin-top: .3rem; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.cm-line::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: #e2e0d9; transform: translateX(-50%); }
.cm-line:hover::before { width: 2px; background: var(--text); }
.cm-expand { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--muted); cursor: pointer; }
.cm-expand:hover { color: var(--text); border-color: var(--text); }
.cm-content { min-width: 0; }
.cm-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-height: 1.75rem; font-size: .84rem; color: var(--muted); }
.cm-name { font-weight: 650; color: var(--text); }
.cm-name:visited { color: var(--text); }
.cm-name:hover { color: var(--text); text-decoration: underline; }
.cm-name-gone { color: var(--muted); font-weight: 600; }
.cm-dot { color: #b0aea6; }
.cm-time, .cm-time:visited { color: var(--muted); }
.cm-time:hover { color: var(--text); text-decoration: underline; }
.cm-flair { font-size: .68rem; font-weight: 700; letter-spacing: .02em; padding: .12rem .45rem; border-radius: 999px; line-height: 1.2; }
.cm-flair-op { color: #8a4b00; background: #fff1d0; }
.cm-body { font-size: .95rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; margin: .1rem 0 .15rem; }
.cm-body .katex-display { margin: .4em 0; overflow-x: auto; overflow-y: hidden; white-space: normal; }
.cm-body-gone { color: var(--muted); font-style: italic; }
.cm-actions { display: flex; align-items: center; gap: .15rem; margin-left: -.55rem; }
.cm-act {
  display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .55rem; border: 0; border-radius: 999px;
  background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; list-style: none;
}
.cm-act:visited { color: var(--muted); }
.cm-act:hover { background: #f2f1ec; color: var(--text); }
.cm-icon { width: 1rem; height: 1rem; flex: none; }
.cm-menu { position: relative; }
.cm-menu > summary::-webkit-details-marker { display: none; }
.cm-menu-list {
  position: absolute; z-index: 5; top: 100%; left: 0; min-width: 10rem; padding: .3rem 0; background: #fff;
  border: 1px solid #e6e4df; border-radius: .6rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
}
.cm-menu-list form { margin: 0; }
.cm-menu-item { display: block; width: 100%; padding: .5rem .9rem; border: 0; background: none; font: inherit; font-size: .88rem; text-align: left; color: var(--text); cursor: pointer; }
.cm-menu-item:hover { background: #f6f5f1; }
.cm-children { margin-top: .1rem; }
.cm.is-collapsed > .cm-content > :not(.cm-head) { display: none; }
.cm.is-collapsed > .cm-gutter > :not(.cm-expand) { display: none; }
.cm:target > .cm-content > .cm-body { animation: cm-flash 2.5s ease-out; border-radius: .3rem; }
@keyframes cm-flash { from { background: #fff4cc; } to { background: transparent; } }
@media (max-width: 575.98px) {
  .cm { grid-template-columns: 1.5rem 1fr; column-gap: .4rem; }
  .cm-gutter .avatar-xs, .cm-expand { width: 1.5rem; height: 1.5rem; }
  .cm-act[data-share] span { display: none; }
  .cm-act { padding: .4rem .5rem; }
}
.cm-content:has(> .cm-composer[data-kind="edit"]) > .cm-actions { display: none; }
.cm-content:has(> .cm-composer[data-kind="edit"]) > .cm-post-title { display: none; }

/* a post's title and label (comment, issue, question or extension): the title above the text and
   the labels under it, drawn like the chip; the chip and title on a post; the filter row */
.cm-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: 0 1rem .75rem; }
/* the chips belong to the post being written; a line sets the box's buttons apart from them */
.cm-kinds + .cm-bar { border-top: 1px solid var(--line); margin: 0 1rem; padding: .5rem 0; }
.cm-kinds + .cm-bar .cm-tool { margin-left: -.6rem; }
.cm-kind input { position: absolute; opacity: 0; width: 0; height: 0; }
.cm-kind span, .cm-filter {
  display: inline-block; padding: .32rem .7rem; border: 0; border-radius: 999px; background: none;
  font: inherit; font-size: .82rem; font-weight: 600; line-height: 1.2; color: var(--muted); cursor: pointer;
}
.cm-kind span:hover, .cm-filter:hover { background: #f2f1ec; color: var(--text); }
.cm-kind input:checked + span, .cm-filter[aria-pressed="true"] { background: var(--sand-2); color: var(--text); }
.cm-kind span { padding: .2rem .55rem; font-size: .72rem; font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 0 0 1px var(--line); }
.cm-kind input:checked + span { box-shadow: none; }
.cm-kind-issue input:checked + span { color: #8f2a1c; background: #fbe9e4; }
.cm-kind-extension input:checked + span { color: #2f5d3a; background: #e6f1e6; }
.cm-kind input:focus-visible + span { box-shadow: 0 0 0 .2rem var(--focus); }
.cm-title-input {
  display: block; width: calc(100% - 2rem); margin: .55rem 1rem 0; padding: 0 0 .45rem; border: 0;
  border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: 1rem; font-weight: 650;
  color: var(--text); outline: none;
}
.cm-title-input::placeholder { color: #8a8f94; font-weight: 600; }
.cm-composer.is-collapsed .cm-kinds, .cm-composer.is-collapsed .cm-title-input { display: none; }
.cm-flair-issue { color: #8f2a1c; background: #fbe9e4; }
.cm-flair-question { color: #5a5345; background: var(--sand-2); }
.cm-flair-extension { color: #2f5d3a; background: #e6f1e6; }
.cm-post-title { font-size: 1.02rem; font-weight: 650; line-height: 1.35; margin: .15rem 0 .2rem; overflow-wrap: break-word; }
.cm-filters { display: flex; flex-wrap: wrap; gap: .2rem; margin: -.5rem 0 .2rem -.3rem; }
.cm-filter .cm-count { margin-left: .15rem; }
.cm-thread[data-show="issue"] > .cm:not([data-kind="issue"]),
.cm-thread[data-show="question"] > .cm:not([data-kind="question"]),
.cm-thread[data-show="extension"] > .cm:not([data-kind="extension"]) { display: none; }

/* votes: up arrow, score, down arrow; the person's own vote is lit (app.js) */
.cm-vote { display: inline-flex; align-items: center; margin: 0 .3rem 0 .2rem; }
.cm-vote .cm-act { padding: .35rem; }
.cm-score { min-width: 1.2rem; text-align: center; font-size: .8rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-vote.is-up .cm-up, .cm-vote.is-up .cm-score { color: #b5410b; }
.cm-vote.is-down .cm-down, .cm-vote.is-down .cm-score { color: #55606e; }

.bot-profile-name { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.bot-profile-name .ms-title { margin: 0; }
.bot-badge { display: inline-flex; align-items: center; color: #684400; background: #fff1c3; border: 1px solid #dfc572; padding: .2em .65em; }
.bot-bio, .bot-feed-item { overflow-wrap: anywhere; }
.bot-activity { margin: 2rem 0 1rem; }
.bot-activity > header, .bot-feed-pages { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bot-activity > header { border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.bot-activity h2 { font-size: 1.15rem; margin: 0; }
.bot-activity header nav { display: flex; padding: .15rem; border: 1px solid var(--line); border-radius: 2rem; }
.bot-activity header nav a { padding: .22rem .75rem; border-radius: 2rem; color: var(--muted); font-size: .85rem; text-decoration: none; }
.bot-activity header nav [aria-current="page"] { background: var(--sand-2); color: var(--text); font-weight: 650; }
.bot-feed-item { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.bot-feed-meta, .bot-feed-stats { color: var(--muted); font-size: .82rem; }
.bot-feed-meta { display: flex; align-items: baseline; gap: .5rem; }
.bot-feed-meta .cm-flair { flex: none; background-color: var(--sand-2); }
.bot-feed-meta .cm-flair-issue { background-color: #fbe9e4; }
.bot-feed-item h3 { font-size: 1.05rem; margin: .4rem 0 .25rem; }
.bot-feed-item h3 a { color: var(--text); }
.bot-feed-item p { margin: 0 0 .4rem; }
.bot-feed-pages { margin: .7rem 0; }
