/* DAWN Peer Review — Apple-style design system */
/* v3.7.112 (user) one font family for every text: buttons, boxes, dropdowns and code take the font around them (the app font,
   Cormorant Garamond) instead of the browser's own. :where() keeps this the weakest rule, so a chosen font still wins. */
:where(button, input, select, textarea, code, kbd, pre, samp) { font-family: inherit; }
:root {
  --font: "Cormorant Garamond", Georgia, "Times New Roman", serif; /* v3.7.112 app font */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --accent: #0071e3;
  --accent-text: #ffffff;
  --bg: #f5f5f7;
  --bg-image: none;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: #f5f5f7;
  --separator: rgba(0, 0, 0, 0.1);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --green: #34c759; --orange: #ff9500; --red: #ff3b30; --blue: #007aff; --gray: #8e8e93; --purple: #af52de;
  --radius: 18px;
  --radius-sm: 12px;
  --btn-radius: 980px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.16), 0 0 1px rgba(0, 0, 0, 0.12);
  --blur: saturate(180%) blur(20px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
  --surface: rgba(28, 28, 30, 0.72); --surface-solid: #1c1c1e; --surface-2: #2c2c2e;
  --separator: rgba(255, 255, 255, 0.12); --fill: rgba(120, 120, 128, 0.24); --fill-2: rgba(120, 120, 128, 0.36);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.12);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.16);
  --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --blue: #0a84ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.47; letter-spacing: -0.01em;
  color: var(--text); background: var(--bg) var(--bg-image) center / cover fixed no-repeat;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.022em; margin: 0; }
h1 { font-size: 34px; font-weight: 700; line-height: 1.12; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--text-3); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 16px; }
.mono { font-family: var(--font); letter-spacing: 0.02em; }

/* Navigation bar */
.navbar {
  position: sticky; top: 0; z-index: 50; height: 52px; display: flex; align-items: center; gap: 14px;
  padding: 0 20px; background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 0.5px solid var(--separator);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.brand img { height: 26px; width: auto; border-radius: 6px; }
.brand .dot { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #ff9f0a, #ff375f 55%, #bf5af2); }

/* Cards */
.card {
  background: var(--surface-solid); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.glass .card, .card.glass { background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; min-height: 36px; border-radius: var(--btn-radius);
  background: var(--accent); color: var(--accent-text); transition: filter .15s, transform .1s, background .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.secondary { background: var(--fill); color: var(--accent); }
.btn.plain { background: transparent; color: var(--accent); padding: 6px 10px; }
.btn.danger { background: var(--fill); color: var(--red); }
.btn.danger.filled { background: var(--red); color: #fff; }
.btn.small { font-size: 13px; padding: 4px 12px; min-height: 28px; }
.btn.large { font-size: 17px; padding: 12px 26px; min-height: 48px; }
.btn.block { width: 100%; }
[data-btn="tinted"] .btn:not(.secondary):not(.plain):not(.danger) { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
[data-btn="outline"] .btn:not(.secondary):not(.plain):not(.danger) { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--text-2); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 17px; }
.icon-btn:hover { background: var(--fill); color: var(--text); }

/* Forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: var(--fill); border: 0; border-radius: 10px;
  padding: 9px 12px; outline: none; width: 100%; transition: box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 35%, transparent); background: var(--surface-solid); }
input[type=color] { width: 44px; height: 32px; border: 0; padding: 0; background: none; border-radius: 8px; cursor: pointer; }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--fill-2); border-radius: 31px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* Segmented control */
.segmented { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.segmented button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--text); padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.segmented button.on { background: var(--surface-solid); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }

/* Grouped list (Settings style) */
.group { background: var(--surface-solid); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.group > .item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px; position: relative; }
.group > .item + .item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.group > .item .label { flex: 1; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2); margin: 22px 16px 7px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.badge.orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.badge.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.badge.red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.badge.purple { color: var(--purple); background: color-mix(in srgb, var(--purple) 14%, transparent); }
.badge.plain::before { display: none; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 0.5px solid var(--separator); white-space: nowrap; }
table.list td { padding: 11px 12px; border-bottom: 0.5px solid var(--separator); vertical-align: middle; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--fill); }
table.list tr:last-child td { border-bottom: 0; }

/* Dialog / sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.sheet { background: var(--surface-solid); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
.sheet.wide { width: min(1000px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 8px; position: sticky; top: 0; background: var(--surface-solid); z-index: 2; }
.sheet-body { padding: 10px 22px 22px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }

/* Toast */
.toast-wrap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(30,30,32,.92); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadow-lg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: pop .25s; max-width: 90vw; }
.toast.error { background: rgba(255,59,48,.95); }

.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .big { font-size: 44px; margin-bottom: 8px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid var(--fill-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }

@media (max-width: 720px) {
  html:not(.dq-zw) h1 { font-size: 28px; }
  html:not(.dq-zw) .navbar { padding: 0 14px; }
  html:not(.dq-zw) .card { padding: 18px; }
}

/* Paper collection cards (admin Papers page and reviewer home) */
.pcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; margin-top: 22px; }
.pcard { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 18px 20px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pcard-top { display: flex; align-items: center; width: 100%; min-height: 24px; }
.pcard-tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: var(--accent); color: #fff; }
.pcard-tag.done { background: var(--secondary, #8e90b2); }
.pcard-tag.muted { background: #b9b9c8; }
.pcard-tag.warn { background: var(--red); }
.pcard-corner { font-size: 12px; color: var(--text-2); }
.pcard-seal { position: relative; width: 150px; height: 150px; margin: 14px 0 12px; }
.pcard-seal img { width: 100%; height: 100%; border-radius: 50%; }
.pcard-num { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(255,255,255,.92); border-radius: 10px; padding: 0 8px; font-family: var(--font-display, inherit); font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.2; }
.pcard-title { font-family: var(--font-display, inherit); font-size: 22px; font-weight: 500; margin: 0 0 6px; color: var(--text); }
.pcard-desc { font-size: 14px; color: var(--text-2); margin: 0 0 14px; min-height: 3.9em; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-actions { display: flex; gap: 14px; margin-top: auto; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--text); background: transparent; color: var(--text); font-size: 15px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.round-btn.alt { border-color: var(--accent); color: var(--accent); font-size: 13px; letter-spacing: 1px; }
.round-btn:hover:not(:disabled) { background: var(--fill); }
.round-btn:disabled { cursor: not-allowed; opacity: .6; }
.pcard.locked { cursor: default; filter: grayscale(1); opacity: .55; }
.pcard.locked:hover { transform: none; box-shadow: none; }
.pcard-seal { height: auto; display: flex; flex-direction: column; align-items: center; margin-bottom: 6px; }
.pcard-seal img { height: 150px; }
.pcard-num { position: static; transform: none; background: none; padding: 0; margin-top: 6px; font-size: 20px; color: var(--text-2); letter-spacing: .08em; }
.sb-version { margin: 18px 14px 8px; font-size: 11px; color: var(--text-2); opacity: .7; }
.segmented .seg-add { min-width: 34px; font-size: 18px; line-height: 1; color: var(--accent); }
button.pcard-tag { border: 0; cursor: pointer; font-family: inherit; }
button.pcard-tag:hover { filter: brightness(0.95); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.pcard.suspended { background: #eef0f3; }
.pcard.suspended .pcard-seal, .pcard.suspended .pcard-title, .pcard.suspended .pcard-desc, .pcard.suspended .pcard-actions { filter: grayscale(1); opacity: .55; }

/* Paper block covers (seal or uploaded image), all blocks the same height */
.pcard { overflow: hidden; }
.pcard-cover { position: relative; flex: none; margin: 14px auto 8px; overflow: hidden; }
.pcard-cover.circle { border-radius: 50%; }
.pcard-cover.rect { width: calc(100% + 36px); margin: 12px -18px 10px; }
.pcard-cover img { width: 100%; height: 100%; display: block; }
.pcard-cover.circle img { object-fit: contain; }
.pcard-shade { position: absolute; inset: 0; }
.pcard-over { position: absolute; left: 0; right: 0; padding: 12px 18px; display: flex; flex-direction: column; gap: 2px; }
.pcard-cover.pos-top .pcard-over { top: 0; }
.pcard-cover.pos-center .pcard-over { top: 50%; transform: translateY(-50%); }
.pcard-cover.pos-bottom .pcard-over { bottom: 0; }
.pcard-over .pcard-title { margin: 0; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.pcard-over .pcard-num { margin: 0; font-size: 15px; opacity: .9; }
.pcard > .pcard-num { position: static; transform: none; background: none; padding: 0; margin: 2px 0 4px; font-family: var(--font-display, inherit); font-size: 20px; color: var(--text-2); letter-spacing: .08em; }
.pcard-title { overflow-wrap: anywhere; }
.pcard-desc { min-height: 0; }
.pcard.suspended .pcard-cover { filter: grayscale(1); opacity: .55; }
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.design-grid .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.design-grid .controls .full { grid-column: 1 / -1; }
.design-preview { position: sticky; top: 0; }
.design-preview .pcard { cursor: default; }
@media (max-width: 860px) { html:not(.dq-zw) .design-grid { grid-template-columns: 1fr; } }
.pcard > .pcard-title, .pcard-over .pcard-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; flex: none; }
/* Several papers in one table cell: a thin line between each. */
.cell-item { padding: 6px 0; min-width: 150px; }
.cell-item + .cell-item { border-top: 1px solid var(--line, rgba(91, 91, 140, .18)); }
.cell-item:first-child { padding-top: 0; } .cell-item:last-child { padding-bottom: 0; }
/* Button size settings (Appearance), Apple style. The DAWN style has its own rules in dawn.css. */
.btn { font-size: calc(15px * var(--bt, 1)); letter-spacing: var(--btn-ls, normal); padding: calc(8px * var(--bs, 1)) calc(18px * var(--bs, 1)); min-height: calc(36px * var(--bs, 1)); }
.btn.small { font-size: calc(13px * var(--bt, 1)); padding: calc(4px * var(--bs, 1)) calc(12px * var(--bs, 1)); min-height: calc(28px * var(--bs, 1)); }
.btn.large { font-size: calc(17px * var(--bt, 1)); padding: calc(12px * var(--bs, 1)) calc(26px * var(--bs, 1)); min-height: calc(48px * var(--bs, 1)); }
.btn.plain { padding: calc(6px * var(--bs, 1)) calc(10px * var(--bs, 1)); }
.round-btn { flex: none; width: var(--round-btn, 44px); height: var(--round-btn, 44px); font-size: calc(var(--round-btn, 44px) * .34); }
.btn.neutral { background: var(--fill); color: var(--text-2); }
/* v3.7.117 (user: "check the entire app to make sure things don't shift on selection") the page always keeps room for its scroll bar, so
   a list that gets shorter or longer (Members › Guests, filters) never moves the buttons and titles sideways */
html { scrollbar-gutter: stable; }

/* v3.7.191 every app page is one picture of the 16-inch window, scaled to the window width (common.js dqAppFit); the quiz player fits itself */
@media (min-width: 721px) { html.dq-fit body.dq > .dq-top, html.dq-fit body.dq > .dq-main:not(:has(> .q-player)) { zoom: var(--app-k, 1); } }
/* v3.7.207 the same on a desktop window zoomed in past the phone width (dq-zw) */
html.dq-fit.dq-zw body.dq > .dq-top, html.dq-fit.dq-zw body.dq > .dq-main:not(:has(> .q-player)) { zoom: var(--app-k, 1); }

/* inside the picture a window-width unit (5vw) would be counted twice: the 16-inch values instead (5vw of 1728 = 86.4px) */
@media (min-width: 721px) { html.dq-fit body.dq > .dq-top { padding-left: 86.4px; padding-right: 86.4px; } html.dq-fit body.dq > .dq-top .dq-menu { left: 82.4px; } html.dq-fit body.dq > .dq-main:not(:has(> .q-player)) { padding-left: 86.4px; padding-right: 86.4px; } }
/* v3.7.207 the same on a desktop window zoomed in past the phone width (dq-zw) */
html.dq-fit.dq-zw body.dq > .dq-top { padding-left: 86.4px; padding-right: 86.4px; } html.dq-fit.dq-zw body.dq > .dq-top .dq-menu { left: 82.4px; } html.dq-fit.dq-zw body.dq > .dq-main:not(:has(> .q-player)) { padding-left: 86.4px; padding-right: 86.4px; }


/* v3.7.196 copy / screenshot guard for quiz takers (js/guard.js). The cover sits outside <body>: only a small lock in the centre, message below. */
html.dq-guard-on body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.dq-guard-on input, html.dq-guard-on textarea, html.dq-guard-on [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
html.dq-guard-on img, html.dq-guard-on video, html.dq-guard-on svg { -webkit-user-drag: none; }
#dq-guard { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2147483647; background: #1d1b2e; color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; -webkit-user-select: none; user-select: none; }
#dq-guard[hidden] { display: none; }
#dq-guard .dq-guard-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
#dq-guard svg { display: block; }
#dq-guard p { margin: 0; font: 600 16px/1.35 system-ui, -apple-system, sans-serif; max-width: 90vw; }
html.dq-guard-cover, html.dq-guard-cover body { overflow: hidden !important; }
html.dq-guard-cover { scrollbar-gutter: auto !important; background: #1d1b2e !important; }
html.dq-guard-cover body { visibility: hidden; }
@media print {
  html.dq-guard-on body { display: none !important; }
  html.dq-guard-on #dq-guard, html.dq-guard-on #dq-guard[hidden] { display: flex !important; position: static; width: auto; height: 90vh; background: #fff; color: #000; }
}

/* v3.7.201 (user: "msg appears too tiny - unreadable. check all notifications are readable size like the page beneath") the page is one
   picture zoomed by window width / 1728 (v3.7.191), but the confirm boxes, sheets and toasts are added straight to <body>, outside the zoomed
   page, so on a big window they stayed at the 16-inch size while the page grew around them. They now take the same zoom as the page. */
@media (min-width: 721px) {
  html.dq-fit body.dq > .dq-modal-bd > .dq-modal, html.dq-fit body.dq > .backdrop > .sheet, html.dq-fit body.dq > .toast-wrap > .toast { zoom: var(--app-k, 1); }
  html.dq-fit body.dq > .backdrop > .sheet { max-height: calc((100vh - 40px) / var(--app-k, 1)); max-width: calc((100vw - 40px) / var(--app-k, 1)); }
}
/* v3.7.207 the same on a desktop window zoomed in past the phone width (dq-zw) */
html.dq-fit.dq-zw body.dq > .dq-modal-bd > .dq-modal, html.dq-fit.dq-zw body.dq > .backdrop > .sheet, html.dq-fit.dq-zw body.dq > .toast-wrap > .toast { zoom: var(--app-k, 1); }
  html.dq-fit.dq-zw body.dq > .backdrop > .sheet { max-height: calc((100vh - 40px) / var(--app-k, 1)); max-width: calc((100vw - 40px) / var(--app-k, 1)); }

