:root { --ink:#1d2330; --muted:#5d6675; --line:#d9dde4; --bg:#fafaf8; --accent:#1f4e8c; --warn:#9a5b00; --bad:#a12a2a; --ok:#246b3a; }
* { box-sizing: border-box; }
body { margin:0; font: 16px/1.55 Georgia, "Times New Roman", serif; color:var(--ink); background:var(--bg); }
header.top { border-bottom:1px solid var(--line); background:#fff; }
header.top .wrap { display:flex; align-items:center; gap:1.5rem; padding:.8rem 1.2rem; }
header.top .brand { font-weight:bold; font-size:1.25rem; color:var(--ink); text-decoration:none; letter-spacing:.04em; }
header.top nav { display:flex; gap:1rem; flex:1; font: 15px system-ui, sans-serif; }
header.top nav a { color:var(--accent); text-decoration:none; }
header.top .who { font: 14px system-ui, sans-serif; color:var(--muted); display:flex; gap:.6rem; align-items:center; }
.wrap { max-width: 920px; margin: 0 auto; }
main.wrap { padding: 1.5rem 1.2rem 4rem; }
h1 { font-size:1.7rem; margin:.2rem 0 1rem; } h2 { font-size:1.25rem; margin-top:2rem; }
a { color:var(--accent); }
.muted { color:var(--muted); } .small { font-size:.9rem; }
.msg { padding:.6rem .9rem; border-radius:4px; margin-bottom:1rem; font-family:system-ui, sans-serif; font-size:.95rem; background:#eef3fa; }
.msg.error { background:#fbecec; color:var(--bad); } .msg.warning { background:#fdf4e5; color:var(--warn); } .msg.success { background:#eaf5ee; color:var(--ok); }
table { width:100%; border-collapse:collapse; font-family:system-ui, sans-serif; font-size:.93rem; }
th, td { text-align:left; padding:.5rem .4rem; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:600; }
form p { margin: 0 0 1rem; }
label { display:block; font: 600 .92rem system-ui, sans-serif; margin-bottom:.25rem; }
input[type=text], input[type=email], textarea, select { width:100%; padding:.5rem; font: 15px/1.4 system-ui, sans-serif; border:1px solid #b9c0cc; border-radius:4px; background:#fff; }
input[type=checkbox] + label, label:has(input[type=checkbox]) { display:inline; }
.helptext { display:block; color:var(--muted); font: .85rem system-ui, sans-serif; }
.errorlist { color:var(--bad); font: .9rem system-ui, sans-serif; padding-left:1rem; }
button, .button { display:inline-block; padding:.55rem 1.1rem; font: 600 15px system-ui, sans-serif; border-radius:4px; border:1px solid var(--accent); background:var(--accent); color:#fff; cursor:pointer; text-decoration:none; }
button.secondary, .button.secondary { background:#fff; color:var(--accent); }
button.danger { background:#fff; color:var(--bad); border-color:var(--bad); }
button.link { background:none; border:none; color:var(--accent); padding:0; font-weight:normal; }
.card { background:#fff; border:1px solid var(--line); border-radius:6px; padding:1rem 1.2rem; margin-bottom:1.2rem; }
.status { display:inline-block; padding:.15rem .55rem; border-radius:999px; font: 600 .82rem system-ui, sans-serif; background:#eef1f5; }
.status.decided { background:#eaf5ee; color:var(--ok); } .status.draft { background:#fdf4e5; color:var(--warn); }
.token { font-family: ui-monospace, monospace; word-break: break-all; background:#f1f3f6; padding:.4rem .6rem; border-radius:4px; display:block; }
.providers { display:flex; gap:1rem; flex-wrap:wrap; margin:1rem 0; }
.letter { white-space: pre-wrap; background:#fff; border:1px solid var(--line); padding:1.2rem; border-radius:6px; }
.inline { display:inline; }

/* Submit page: everything 2px larger than the rest of the site */
body.page-upload main { font-size: 18px; }
body.page-upload main button { font-size: 17px; }
.dropzone { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.3rem;
  min-height: 190px; margin-bottom: 1rem; padding: 1.5rem; text-align:center; cursor:pointer;
  border: 2px dashed #9aa6b8; border-radius: 8px; background:#f7f9fc; font-weight:normal;
  font-family: system-ui, sans-serif; transition: background .15s, border-color .15s; position:relative; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background:#eaf1fb; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background:#eef7f1; }
.dropzone input[type=file] { position:absolute; width:1px; height:1px; opacity:0; }
.dropzone:focus-within { outline: 3px solid #9fc0ec; outline-offset: 2px; }
.dz-main { font-size: 1.15em; font-weight: 600; color: var(--ink); word-break: break-all; }
.dz-sub { font-size: .9em; color: var(--muted); }
.dz-error { color: var(--bad); font-family: system-ui, sans-serif; margin-top: -.4rem; }

.site-footer { padding: 1rem 1.2rem 2.5rem; border-top: 1px solid var(--line); font: 14px system-ui, sans-serif; color: var(--muted); }
.site-footer a { color: var(--muted); }
.legal h2 { font-size: 1.15rem; margin-top: 1.8rem; }
.legal li { margin-bottom: .35rem; }
.legal table.services { margin: .6rem 0 1rem; }
.legal table.services td { font-size: .9rem; }

/* Author rows on the review page */
.authors-block { margin-bottom: 1.2rem; }
table.authors { margin: .4rem 0 .6rem; }
table.authors th { font-size: .85rem; padding: .3rem .3rem; }
table.authors td { padding: .25rem .3rem; border-bottom: none; }
table.authors td:nth-child(1) { width: 28%; } table.authors td:nth-child(2) { width: 38%; }
table.authors .row-tools { white-space: nowrap; width: 1%; }
table.authors .row-tools button { padding: 0 .25rem; font-size: 1rem; }
.danger-link { color: var(--bad) !important; }
.small-button { padding: .3rem .8rem; font-size: 14px; }
@media (max-width: 640px) {
  table.authors thead { display: none; }
  table.authors tr.author-row { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.authors td { width: auto !important; }
}

/* Declarations on the review page */
h2.form-section { font-size: 1.1rem; margin: 1.8rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.tiny { display: block; font: .75rem/1.35 system-ui, sans-serif; color: var(--muted); margin-top: .15rem; }
fieldset.declaration { border: 0; padding: 0; margin: 0 0 1.1rem; }
fieldset.declaration legend { font: 600 .92rem system-ui, sans-serif; margin-bottom: .3rem; padding: 0; }
label.choice { display: flex; gap: .5rem; align-items: baseline; font-weight: normal; margin: .25rem 0; cursor: pointer; }
label.choice input { flex: none; }
.explain { margin: .5rem 0 0 1.6rem; }
.card.files p { margin: 0 0 .5rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .3rem 0; font: 15px system-ui, sans-serif; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline-form select { width: auto; max-width: 100%; }
.inline-form label { display: inline; margin: 0; }

/* Editor dashboard tabs */
nav.tabs { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem;
  font: 15px system-ui, sans-serif; align-items: flex-end; }
nav.tabs a { padding: .45rem .8rem; text-decoration: none; color: var(--muted); border: 1px solid transparent;
  border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
nav.tabs a.active { color: var(--ink); background: #fff; border-color: var(--line); font-weight: 600; }
nav.tabs a.side { margin-left: auto; font-size: 13px; }
nav.tabs .count { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 12px; text-align: center; }
form.send-back { margin-top: 1rem; }

/* Problems after a failed save or submit: impossible to miss */
/* The yellow edge is an inset shadow, not a border: a question's heading (a fieldset legend)
   would otherwise sit on the border line. */
.has-error { background: #fff3b0; box-shadow: inset 0 0 0 2px #e0b000; border-radius: 6px; padding: .6rem .8rem !important; }
.has-error input[type=text], .has-error input[type=email], .has-error textarea, .has-error select { background: #fff; }
.has-error .errorlist { color: #8a1c1c; font-weight: 600; list-style: none; padding-left: 0; margin: .4rem 0 0; }
.error-summary { background: #fff3b0; border: 2px solid #e0b000; border-left-width: 8px; border-radius: 6px;
  padding: .8rem 1rem; margin-bottom: 1.2rem; font-family: system-ui, sans-serif; }
.error-summary:focus { outline: 3px solid #9fc0ec; outline-offset: 2px; }
[id^="f-"] { scroll-margin-top: 1rem; }
/* Keep each question's heading inside its box: float it across the full width,
   and start every line after it below (answers are flex rows, which would otherwise sit beside it). */
fieldset.declaration > legend { float: left; width: 100%; }
fieldset.declaration > legend ~ * { clear: both; }

/* Live checking on the review page */
[id^="f-"] { transition: background-color .2s, box-shadow .2s; }
.live-msg { display: block; color: #8a1c1c; font: 600 .88rem system-ui, sans-serif; margin-top: .35rem; clear: both; }
.live-status { font: 600 .92rem system-ui, sans-serif; padding: .45rem .7rem; border-radius: 6px; margin: 1rem 0 .6rem; }
.live-status:empty { display: none; }
.live-status.todo { background: #fff3b0; color: #6b4a00; }
.live-status.done { background: #eaf5ee; color: var(--ok); }
.error-summary.resolved { background: #eaf5ee; border-color: #8cc6a0; }

/* Upload progress */
.progress { margin: .9rem 0 .3rem; }
.progress-label { display:flex; justify-content:space-between; font-size:.95em; margin-bottom:.3rem; }
.progress-track { height: 14px; border-radius: 7px; background: #e4e9f0; overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 7px; background: var(--accent); transition: width .2s linear; }
.progress-bar.reading { background-color: var(--ok);
  background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%,
    rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%, transparent);
  background-size: 28px 28px; animation: progress-stripes 1s linear infinite; }
@keyframes progress-stripes { from { background-position: 28px 0; } to { background-position: 0 0; } }
.dropzone.busy { pointer-events: none; opacity: .75; }

/* Editor: one paper */
.paper-state { color: var(--muted, #555); margin-top: -.4rem; }
.action-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.4rem; }
.action-bar .button, .action-bar button { margin: 0; }
.assign-panel h2 { margin-top: 0; }
.assign-panel[hidden] { display: none; }
.action-bar .button, .action-bar button { padding: .45rem .9rem; font-size: 14px; }
.action-bar .zip { margin-left: auto; }
form.card > h2:first-of-type, div.card > h2:first-child { margin-top: 0; }
.paper-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ref-sym { display: inline-block; min-width: 1.1em; text-align: center; font-size: 1.1em; }
.ed-status .refs { white-space: nowrap; }
.decided-link { margin-top: 2.5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.mail summary { cursor: pointer; } .mail .letter { margin-top: .6rem; }

/* Editor dashboard: compact lists */
.page-editor table th, .page-editor table td { padding: .28rem .45rem; }
.page-editor table td:nth-child(1), .page-editor table th:nth-child(1) { width: 1%; padding-left: .2rem; color: var(--muted); }
.page-editor table td:nth-child(2), .page-editor table th:nth-child(2) { width: 1%; white-space: nowrap; }
.page-editor table td { line-height: 1.35; }
.page-editor h2 { margin: 1.4rem 0 .4rem; }
/* Editor dashboard: use most of a wide window (header and footer line up with it). */
.page-editor .wrap { max-width: 90vw; }
.page-editor main.wrap > p.small:not(.decided-link), .page-editor .ref-legend { max-width: 920px; }

/* Person type-ahead (transplanted from peers.science) */
.ta-wrap { position: relative; }
.ta-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12);
  font: 15px system-ui, sans-serif; }
.ta-list li { padding: 6px 10px; cursor: pointer; }
.ta-list li.active, .ta-list li:hover { background: #eaf1fb; }
.ta-list li.invited { color: var(--muted); }
.ta-list .aff { color: var(--muted); font-size: 13px; margin-left: 6px; }
.ta-list .num { float: right; color: var(--muted); font-size: 13px; }
.ta-list li.more { color: var(--muted); font-size: 13px; cursor: default; background: none; }
.ta-note { margin: .3rem 0 0; }
@media (max-width: 640px) { .ta-list .num { display: none; } }
