/* The OpenSheaf Manager, in the design of opensheaf.org: the block of --os-*
   variables is that of the site's resources/opensheaf.css, copied whole. */
:root {
    color-scheme: light;
    --os-paper: #f9f8f5;
    --os-surface: #f1efea;
    --os-rule: #dedbd3;
    --os-ink: #171716;
    --os-muted: #6a6861;
    --os-faint: #a09d95;
    --os-ok: #2c6a3e;
    --os-ok-bg: #e6efe4;
    --os-bad: #9d2b22;
    --os-bad-bg: #f6e4e0;
    --os-warn: #7d5200;
    --os-warn-bg: #f5ecd6;
    --os-serif: "CMU Serif", "Latin Modern Roman", "Computer Modern", "Times New Roman", serif;
    --os-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --os-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --os-paper: #12141a;
        --os-surface: #1b1e25;
        --os-rule: #31353e;
        --os-ink: #e6e7ea;
        --os-muted: #9a9ea8;
        --os-faint: #646975;
        --os-ok: #93cfa1;
        --os-ok-bg: #182a23;
        --os-bad: #eda59c;
        --os-bad-bg: #342025;
        --os-warn: #e7c277;
        --os-warn-bg: #2d281c;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --os-paper: #12141a;
    --os-surface: #1b1e25;
    --os-rule: #31353e;
    --os-ink: #e6e7ea;
    --os-muted: #9a9ea8;
    --os-faint: #646975;
    --os-ok: #93cfa1;
    --os-ok-bg: #182a23;
    --os-bad: #eda59c;
    --os-bad-bg: #342025;
    --os-warn: #e7c277;
    --os-warn-bg: #2d281c;
}
@media print {
    :root, :root[data-theme] {
        color-scheme: light !important;
        --os-paper: #fff !important;
        --os-surface: #fff !important;
        --os-rule: #999 !important;
        --os-ink: #000 !important;
        --os-muted: #333 !important;
        --os-faint: #666 !important;
        --os-ok: #000 !important;
        --os-ok-bg: #fff !important;
        --os-bad: #000 !important;
        --os-bad-bg: #fff !important;
        --os-warn: #000 !important;
        --os-warn-bg: #fff !important;
    }
}
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
             src: url("https://opensheaf.org/resources/fonts/plex/IBMPlexSans-Roman.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 100 700; font-display: swap;
             src: url("https://opensheaf.org/resources/fonts/plex/IBMPlexSans-Italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
             src: url("https://opensheaf.org/resources/fonts/jetbrains/JetBrainsMono-Roman.woff2") format("woff2"); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--os-paper); color: var(--os-ink); font: 16px/1.6 var(--os-sans);
       -webkit-font-smoothing: antialiased; }
main, header.site, footer.site { max-width: 50rem; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
main { padding-bottom: 4rem; }
a, a:visited { color: inherit; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 0.2em; text-decoration-color: var(--os-faint); }
a:hover, a:focus { text-decoration-color: currentColor; }
:focus-visible { outline: 1.5px solid var(--os-ink); outline-offset: 3px; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2rem; letter-spacing: -0.02em; margin: 0.5em 0 0.4em; }
h2 { font-size: 1.4rem; margin: 2rem 0 0.4rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
h4 { font-size: 1rem; margin: 0 0 0.2rem; }
code, pre { font-family: var(--os-mono); font-size: 0.85em; font-variant-ligatures: none; }
pre { white-space: pre-wrap; background: var(--os-surface); padding: 0.6em 0.8em; border-radius: 4px; }
.lead { color: var(--os-muted); }
.muted, .help { color: var(--os-muted); }
.small, .help { font-size: 0.85rem; }
.loading { color: var(--os-muted); }

header.site { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3em 1.2em; padding-top: 1.4rem; }
header.site .brand { display: inline-flex; align-items: center; gap: 0.45em; font-size: 1.05rem;
  text-decoration: none; align-self: center; }
header.site .nav { display: flex; gap: 1.5em; margin-left: auto; font-size: 0.82rem; }
header.site .nav a { color: var(--os-muted); text-decoration: none; }
header.site .nav a:hover { color: var(--os-ink); }
img.symbol { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { img.symbol { filter: invert(1); } }
footer.site { color: var(--os-muted); font-size: 0.78rem; line-height: 1.5; padding-bottom: 2.5rem; }
footer.site a { color: inherit; }

.controls { display: flex; flex-wrap: wrap; gap: 0.5em; align-items: center; margin: 0.8em 0; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type="file"]), select, textarea { padding: 0.4em 0.6em; border: 1px solid var(--os-rule);
  border-radius: 4px; background: var(--os-paper); }
textarea { width: 100%; }
.controls input:not([type="file"]) { flex: 1 1 14rem; min-width: 0; }
button { padding: 0.4em 0.9em; border: 1px solid var(--os-rule); border-radius: 4px; background: var(--os-paper);
  cursor: pointer; }
button:hover { border-color: var(--os-muted); }
button.small { padding: 0.1em 0.6em; font-size: 0.82rem; }
button.primary { background: var(--os-ink); border-color: var(--os-ink); color: var(--os-paper); font-weight: 600; }

.notice { margin: 1em 0; padding: 0.8em 1.1em; border-radius: 4px; background: var(--os-surface); }
.notice.ok { background: var(--os-ok-bg); }
.notice.bad { background: var(--os-bad-bg); }
.notice.warn { background: var(--os-warn-bg); }
.notice p { margin: 0.3em 0; }
.chip { display: inline-block; padding: 0.05em 0.6em; border-radius: 999px; font-size: 0.72rem; line-height: 1.6;
  background: var(--os-surface); white-space: nowrap; margin-left: 0.3em; vertical-align: 0.1em; }
.chip.ok { background: var(--os-ok-bg); color: var(--os-ok); }
.chip.bad { background: var(--os-bad-bg); color: var(--os-bad); }
.chip.warn { background: var(--os-warn-bg); color: var(--os-warn); }
a.chip.arxiv { text-decoration: none; }
a.chip.arxiv:hover { text-decoration: underline; }

table { border-collapse: collapse; width: 100%; font-size: 0.9rem; border-bottom: 1px solid var(--os-ink); }
th, td { text-align: left; padding: 0.45em 0.8em 0.45em 0; border-bottom: 1px solid var(--os-rule); vertical-align: top; }
th { color: var(--os-muted); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  border-top: 1px solid var(--os-ink); border-bottom-color: var(--os-ink); }
td.actions { white-space: nowrap; }
td.actions button { margin: 0 0.2em 0.2em 0; }
details.collection { padding: 0.6em 0; border-bottom: 1px solid var(--os-rule); }
ol.members { margin: 0.3em 0; padding-left: 1.4em; font-size: 0.92rem; }
li::marker { color: var(--os-faint); }

form.op { margin: 2rem 0; padding: 1.2em 1.4em; background: var(--os-surface); border-radius: 4px; }
form.op h3 { margin-top: 0; }
.field { margin: 0.8em 0; display: grid; gap: 0.2em; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field .required { font-weight: 400; color: var(--os-muted); }
.field .help { margin: 0; }
.result { margin: 0.4em 0; padding: 0.5em 0; border-bottom: 1px solid var(--os-rule); }
.result summary { cursor: pointer; }
.signed-in { margin: 0.5em 0; }
@media (max-width: 40rem) { h1 { font-size: 1.6rem; } td.actions { white-space: normal; } }
ol.steps { padding-left: 1.4em; }
ol.steps > li { margin: 0.9em 0; }
ol.steps pre { margin: 0.4em 0; }
ol.progress { padding-left: 1.4em; color: var(--os-faint); }
ol.progress > li { margin: 0.3em 0; }
ol.progress > li.done { color: var(--os-muted); }
ol.progress > li.done::after { content: " \2713"; color: var(--os-ok); }
ol.progress > li.now { color: var(--os-ink); font-weight: 600; }

/* how the changes are written: directly, or to the workflow */
.notice.signing .controls { margin: 0.4em 0; }
.notice.signing input#wallet { min-width: 18em; }
/* the two ways of writing, as a segmented choice */
.modes { display: inline-flex; border: 1px solid var(--os-rule); border-radius: 6px; overflow: hidden; margin-bottom: 0.5em;
  font-size: 0.88rem; }
.modes label { padding: 0.3em 0.9em; cursor: pointer; color: var(--os-muted); }
.modes label + label { border-left: 1px solid var(--os-rule); }
.modes label.on { background: var(--os-ink); color: var(--os-paper); font-weight: 600; }
.modes input { position: absolute; opacity: 0; pointer-events: none; }
.modes label:focus-within { outline: 2px solid var(--os-muted); outline-offset: -2px; }
.notice.signing p { margin: 0.4em 0; }
details.how { margin-top: 0.3em; }
details.how summary { cursor: pointer; }
details.setup { margin-top: 0.6em; }
details.setup > summary { font-weight: 600; }
details.setup h4 { margin: 0.9em 0 0.2em; font-size: 1rem; }
details.setup textarea { font-family: var(--os-mono); font-size: 0.85em; }
details.setup input#setup-wallet { min-width: 18em; }
details.setup p.bad { color: var(--os-bad); }
details.setup ul.rotation-files { padding-left: 1.2em; }
details.setup ul.rotation-files li { margin: 0.25em 0; font-family: var(--os-mono); font-size: 0.85em; }
details.setup input.check { width: 5em; margin-left: 0.6em; font-family: var(--os-mono); text-transform: uppercase; }
.print-sheets { display: none; }
@media print {
  body.printing-sheets > *:not(.print-sheets) { display: none !important; }
  body.printing-sheets > .print-sheets { display: block; }
  .print-sheets pre { font-size: 11pt; white-space: pre-wrap; break-after: page; }
}
input#unlock-code { width: 8em; font-size: 1.2em; letter-spacing: 0.1em; }

/* the parts of the archive's page that fold (collections, papers), and the
   compact lists */
.list-tools { display: flex; justify-content: flex-end; margin: 1.2em 0 -0.6em; }
details.block > summary, details.collection > summary { cursor: pointer; list-style: none; }
details.block > summary::-webkit-details-marker, details.collection > summary::-webkit-details-marker { display: none; }
details.block > summary h3, details.collection > summary h4 { display: inline; }
details.block > summary::before, details.collection > summary::before {
  content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin: 0 0.6em 0.15em 0.1em;
  border-right: 1.5px solid var(--os-muted); border-bottom: 1.5px solid var(--os-muted); transform: rotate(-45deg);
  transition: transform 0.15s; }
details[open].block > summary::before, details[open].collection > summary::before { transform: rotate(45deg); }
details.block > summary { margin: 1.6em 0 0.6em; }
details.block > summary h3 { margin: 0; }
.count { font-weight: 400; }
.compact details.collection { padding: 0.3em 0; }
.compact details.collection > summary h4 { font-size: 0.95rem; }
.compact table.papers td { padding-top: 0.25em; padding-bottom: 0.25em; }
.compact table.papers td:first-child { white-space: nowrap; }
.compact table.papers td[data-title] { max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact table.papers th:last-child, .compact table.papers td.actions { width: 1%; }
@media (hover: hover) and (pointer: fine) {
  .compact table.papers td.actions button { visibility: hidden; }
  .compact table.papers tr:hover td.actions button,
  .compact table.papers tr:focus-within td.actions button { visibility: visible; }
}

/* messages: a pane floating at the top right */
.toast { position: fixed; top: 3.2rem; right: 1rem; z-index: 30; width: min(26rem, calc(100vw - 2rem));
  max-height: 60vh; overflow: auto; }
.toast .notice { margin: 0; padding-right: 2.4em; position: relative; border: 1px solid var(--os-rule);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); animation: toast-in 0.18s ease-out; }
.toast .close, .toast .notice > .close { position: absolute; top: 0.35em; right: 0.45em; border: none; background: none;
  font-size: 1.2rem; line-height: 1; padding: 0.1em 0.3em; color: var(--os-muted); }
.toast .close:hover { color: var(--os-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* Activity: a bar fixed at the bottom of the page, opening on a panel */
body.with-dock main { padding-bottom: 5rem; }
body.with-dock footer.site { padding-bottom: 4rem; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--os-surface);
  border-top: 1px solid var(--os-rule); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08); }
.dock-bar { display: flex; align-items: center; gap: 0.8em; width: 100%; max-width: 50rem; margin: 0 auto;
  padding: 0.5em 16px; border: none; border-radius: 0; background: none; text-align: left; font-size: 0.82rem;
  color: var(--os-muted); }
.dock-title { font-weight: 600; color: var(--os-ink); }
.dock-status { display: flex; align-items: center; gap: 0.6em; flex: 0 1 auto; white-space: nowrap; }
.dock-status .chip { margin: 0; }
.dock-last { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-last .bad { color: var(--os-bad); }
.site.published { color: var(--os-ok); }
.site.late { color: var(--os-warn); }
.caret { width: 0.45em; height: 0.45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-135deg); margin-top: 0.3em; transition: transform 0.15s; flex: none; }
.dock.open .caret { transform: rotate(45deg); margin-top: -0.2em; }
.dock-panel { max-width: 50rem; margin: 0 auto; padding: 0 16px 0.8em; max-height: 55vh; overflow: auto; }
.dock-panel h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--os-muted);
  margin: 0.8em 0 0.2em; }
.history { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.history li { border-bottom: 1px solid var(--os-rule); }
.history button.again { display: block; width: 100%; text-align: left; border: none; border-radius: 0;
  background: none; padding: 0.35em 0; color: var(--os-ink); }
.history button.again:hover { background: var(--os-paper); }
.history button.bad { color: var(--os-bad); }
.history button.warn { color: var(--os-warn); }
.spinner { display: inline-block; width: 0.8em; height: 0.8em; vertical-align: -0.05em;
  border: 2px solid var(--os-rule); border-top-color: var(--os-muted); border-radius: 50%;
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .toast .notice { animation: none; } }
@media (max-width: 40rem) {
  .dock-last { display: none; }
  .toast { top: auto; bottom: 3.2rem; right: 0.5rem; left: 0.5rem; width: auto; }
}
.dock-panel .result { margin: 0; padding: 0.3em 0; font-size: 0.85rem; }
.dock-panel .result p { margin: 0.2em 0; }
@media print { .toast, .dock { display: none; } }

/* The theme button of the OpenSheaf site (theme.js): a half-lit circle at
   the top right of the window, switching between light and dark. */
.theme-control { position: fixed; top: 0.7rem; right: 0.8rem; z-index: 40; margin: 0; }
.theme-control .theme-toggle { display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
    border: 0; border-radius: 50%; background: var(--os-paper); color: var(--os-faint); cursor: pointer; }
.theme-control .theme-toggle::before { content: ""; width: 13px; height: 13px;
    border: 1.5px solid currentColor; border-radius: 50%;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.theme-control .theme-toggle:hover { color: var(--os-ink); }
.theme-control .theme-toggle:focus-visible { outline: 1.5px solid var(--os-ink); outline-offset: 2px; }
@media screen and (max-width: 60rem) { header.site { padding-right: 3rem; } }
@media print { .theme-control { display: none !important; } }
.result.change p { margin: 0.2em 0; }
.result.change summary { cursor: pointer; }
.chip.how-page { background: var(--os-ok-bg); color: var(--os-ok); }
.chip.how-workflow, .chip.how-request { background: var(--os-surface); color: var(--os-muted); }

/* a new archive: the owner made in the page */
.create .op.setup { margin: 1.2rem 0; padding: 1.2em 1.4em; background: var(--os-surface); border-radius: 4px; }
.create .op h3 { margin-top: 0; }
.create h4 { margin: 1.2em 0 0.2em; font-size: 1rem; }
.create ul.rotation-files { padding-left: 1.2em; }
.create ul.rotation-files li { margin: 0.25em 0; font-family: var(--os-mono); font-size: 0.85em; }
.create input.check { width: 5em; margin-left: 0.6em; font-family: var(--os-mono); text-transform: uppercase; }
.create input.secret { min-width: 24em; font-family: var(--os-mono); font-size: 0.85em; }
.create input#create-wallet { min-width: 18em; }
.create .field input[type="checkbox"] { margin-right: 0.4em; }
details.ceremony { margin-top: 1.5em; }
details.ceremony > summary { font-weight: 600; }

/* key wallets and owners: the wallets (step 1), the owners in one (step 2) */
.notice.signing ul.wallets, .notice.signing ul.owners { list-style: none; padding: 0; margin: 0.3em 0; }
.notice.signing ul.wallets li, .notice.signing ul.owners li { margin: 0.2em 0; }
.notice.signing h4 { margin: 0.8em 0 0.2em; font-size: 0.95rem; }
button.small.link { background: none; border: none; padding: 0 0.2em; color: var(--os-muted); text-decoration: underline; cursor: pointer; }
.small.warn { color: var(--os-warn); }
/* a branch listed under its line */
table.papers tr.branch td:first-child code { font-weight: normal; }
.acting { margin: 0.4em 0 0.8em; }
.acting .notice p { margin: 0.3em 0; }
