:root {
  --canvas: #f4f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --text: #141b2d; --muted: #5a6478; --faint: #8a93a6;
  --border: #e3e7ef; --border-strong: #cfd5e1;
  --brand: #16254a; --brand-2: #23386e; --accent: #0f766e; --accent-strong: #0b5e58; --accent-bg: #e3f4f1; --accent-text: #0b5048;
  --info: #2952c4; --info-bg: #e9efff; --info-text: #1f3f99;
  --ok: #1d7a3a; --ok-bg: #e5f5ea; --warn: #8a5300; --warn-bg: #fdf1dc; --bad: #b42828; --bad-bg: #fdeaea;
  --focus: #2952c4; --radius: 10px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 27, 45, .06), 0 1px 1px rgba(20, 27, 45, .04);
  --shadow: 0 4px 16px rgba(20, 27, 45, .07), 0 1px 3px rgba(20, 27, 45, .05);
  --shadow-paper: 0 10px 30px rgba(20, 27, 45, .10), 0 2px 6px rgba(20, 27, 45, .06);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --doc-font: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1420; --surface: #171e2e; --surface-2: #1c2436; --text: #e8ecf4; --muted: #a3adc2; --faint: #7b859b;
    --border: #283146; --border-strong: #36415a;
    --brand: #c9d6f5; --brand-2: #9fb3e6; --accent: #3cc2b3; --accent-strong: #5fd3c6; --accent-bg: #0f3a36; --accent-text: #9de8de;
    --info: #8fb0ff; --info-bg: #1b2a52; --info-text: #c3d3ff;
    --ok: #7fd497; --ok-bg: #173523; --warn: #f2c27a; --warn-bg: #3d2c0f; --bad: #f4a3a3; --bad-bg: #431c1c;
    --focus: #8fb0ff;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03); --shadow-paper: 0 10px 30px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 650; margin: 0.2rem 0 0.5rem; line-height: 1.25; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.35rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); z-index: 10; }
.skip:focus { left: 8px; }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.error { color: var(--bad); }
.notice { background: var(--info-bg); color: var(--info-text); padding: 10px 14px; border-radius: var(--radius); }
svg.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 64px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; font: 700 1.12rem/1 var(--font-display); letter-spacing: -0.02em; }
.brand .logo { width: 30px; height: 30px; }
.top nav { display: flex; gap: 4px; height: 100%; }
.top nav a { display: flex; align-items: center; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.top nav a:hover { color: var(--text); }
.top nav a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
.who { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 0.9rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--surface); font-weight: 600; font-size: 0.8rem; }
.who form { margin: 0; }
main { max-width: 1320px; margin: 0 auto; padding: 32px 28px 64px; outline: none; }
@media (max-width: 760px) {
  .top { gap: 10px; padding: 0 16px; }
  .top nav a { padding: 0 8px; }
  .brand span, .who > span:not(.avatar) { display: none; } /* logo and initials stay; the name is on every page anyway */
  main { padding: 20px 16px 48px; }
  table.list th:nth-child(2), table.list td:nth-child(2) { display: none; }
}

/* Building blocks */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 26px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 650; color: var(--accent); margin: 0 0 4px; }
label { display: block; font-weight: 550; margin: 14px 0 6px; }
input[type=email], textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input[type=email]:focus, textarea:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
button, .button { font: inherit; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
button:hover, .button:hover { background: var(--surface-2); border-color: var(--faint); }
button:active, .button:active { transform: translateY(1px); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .primary, .primary:hover { color: #062b27; } }
button:disabled { opacity: .7; cursor: progress; }
.link { border: 0; background: none; padding: 0; color: var(--info); text-decoration: underline; font-weight: 500; }
.link:hover { background: none; }
.wide { width: 100%; }
.buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-neutral { background: var(--info-bg); color: var(--info-text); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-ok { background: var(--accent-bg); color: var(--accent-text); }
.chip-done { background: var(--ok-bg); color: var(--ok); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }

/* Sign-in */
.auth { min-height: calc(100vh - 160px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; max-width: 980px; margin: 24px auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.auth-brand { background: linear-gradient(155deg, #16254a 0%, #1f3a6e 60%, #0f766e 140%); color: #f2f5fb; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand h1 { color: #fff; font-size: 2rem; }
.auth-brand p { color: #c9d4ee; }
.auth-brand ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; gap: 10px; align-items: flex-start; color: #e3e9f7; }
.auth-brand .brand { color: #fff; }
.auth-form { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-form button { margin-top: 18px; width: 100%; padding: 11px; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth-brand { padding: 32px; } .auth-form { padding: 32px; } }
.dev { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--warn); border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); }
.dev a { color: inherit; font-weight: 650; }

/* Inbox */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat .n { font: 650 1.9rem/1.1 var(--font-display); }
.stat .l { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.stat-warn .n { color: var(--warn); } .stat-ok .n { color: var(--accent); } .stat-done .n { color: var(--ok); }
.upload { display: flex; align-items: center; gap: 22px; border: 2px dashed var(--border-strong); background: var(--surface-2); box-shadow: none; transition: border-color .15s, background .15s; }
.upload .up-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); flex: none; }
.upload .up-icon svg { width: 26px; height: 26px; }
.upload .up-text { flex: 1; } .upload .up-text p { margin: 0; }
.upload.dragging { background: var(--accent-bg); border-color: var(--accent); }
@media (max-width: 640px) { .upload { flex-wrap: wrap; } }
.doclist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.doclist li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); position: relative; }
.doclist li:first-child { border-top: 0; }
.doclist li:hover { background: var(--surface-2); }
.doclist .ficon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.doclist .ficon svg { width: 20px; height: 20px; }
.doclist .ficon.word { background: #e7eefc; color: #2b579a; }
.doclist a.title { font-weight: 600; color: var(--text); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doclist a.title::after { content: ""; position: absolute; inset: 0; }
.doclist a.title:hover { color: var(--info); }
.doclist .meta { color: var(--muted); font-size: .84rem; }
.doclist .extra { color: var(--muted); font-size: .86rem; text-align: right; min-width: 90px; }
@media (max-width: 720px) { .doclist li { grid-template-columns: 40px minmax(0, 1fr); } .doclist .extra { text-align: left; } }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* Review */
.crumb { margin: 0 0 6px; font-size: .88rem; }
.crumb a { color: var(--muted); text-decoration: none; } .crumb a:hover { color: var(--info); }
.review { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } }
.pane { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.pane-tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tab { border: 0; padding: 7px 14px; font-size: .9rem; color: var(--muted); background: none; border-radius: 8px; }
.tab:hover { background: var(--surface-2); }
.tab[aria-pressed=true] { background: var(--brand); color: var(--surface); }
.paper-wrap { padding: 28px; max-height: calc(100vh - 230px); overflow: auto; background: repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--border) 35%, transparent) 23px 24px), var(--surface-2); }
.doc { max-width: 760px; margin: 0 auto; background: var(--surface); padding: 56px 64px; border-radius: 6px; box-shadow: var(--shadow-paper); font-family: var(--doc-font); font-size: 15.5px; line-height: 1.6; }
.doc h1 { font-family: var(--doc-font); font-size: 1.45rem; letter-spacing: 0; } .doc h2 { font-family: var(--doc-font); font-size: 1.15rem; margin-top: 1.4rem; } .doc h3 { font-family: var(--doc-font); font-size: 1rem; }
.doc table { border-collapse: collapse; margin: 10px 0; font-size: .92em; } .doc th, .doc td { border: 1px solid var(--border-strong); padding: 5px 9px; } .doc th { background: var(--surface-2); }
.doc .aside { margin-left: 50%; }
@media (max-width: 700px) { .doc { padding: 28px 22px; } .paper-wrap { padding: 12px; } }
.orig-wrap { max-height: calc(100vh - 230px); overflow: auto; padding: 16px; background: var(--surface-2); }
.orig-wrap canvas { display: block; width: 100% !important; height: auto; margin: 0 auto 14px; background: #fff; box-shadow: var(--shadow-paper); border-radius: 4px; }
.pane-body.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pane-body.split .orig-wrap { border-right: 1px solid var(--border); }
.pane-body.split .paper-wrap { padding: 16px; }
.pane-body.split .doc { padding: 28px 30px; font-size: 14.5px; }
.review.split { grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); }
@media (max-width: 1100px) { .pane-body.split { grid-template-columns: 1fr; } }
mark.rv { border-radius: 3px; padding: 1px 2px; cursor: pointer; color: inherit; transition: background .2s, box-shadow .2s; }
mark.rv-fix, mark.rv-repeat, mark.rv-typo { background: var(--info-bg); box-shadow: inset 0 -2px 0 var(--info); }
mark.rv-unsure, mark.rv-image-text, mark.rv-alt, mark.rv-title { background: var(--warn-bg); box-shadow: inset 0 -2px 0 var(--warn); }
mark.rv.done { background: var(--ok-bg); box-shadow: inset 0 -2px 0 var(--ok); }
mark.rv.selected, img.selected { outline: 3px solid var(--focus); outline-offset: 2px; }
img[data-alt-item] { cursor: pointer; box-shadow: 0 0 0 3px var(--warn-bg); }
img[data-alt-item].done { box-shadow: 0 0 0 3px var(--ok-bg); }

.side { position: sticky; top: 84px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.side-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.side-head h2 { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #22a094); border-radius: 999px; transition: width .35s ease; }
.progress-label { margin: 8px 0 0; font-size: .84rem; color: var(--muted); }
.side-body { padding: 14px; overflow: auto; flex: 1; }
.side-foot { padding: 14px 16px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.side-foot p { margin: 8px 0 0; }
.items { list-style: none; margin: 0; padding: 0; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.item:hover { border-color: var(--border-strong); }
.item[aria-current] { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.item.is-done { background: var(--surface-2); border-color: var(--border); }
.item.is-done .item-body { display: none; }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--info-bg); color: var(--info-text); }
.tag-unsure, .tag-image-text, .tag-alt, .tag-compare, .tag-check, .tag-title { background: var(--warn-bg); color: var(--warn); }
.tag-blocker { background: var(--bad-bg); color: var(--bad); }
.item p { margin: 4px 0; }
.note { font-size: .9rem; color: var(--muted); }
.diff { font-size: .95rem; } .diff del { color: var(--bad); text-decoration-thickness: 2px; } .diff ins { color: var(--ok); text-decoration: none; font-weight: 650; }
.proposed { font-family: var(--doc-font); background: var(--surface-2); border: 1px solid var(--border); padding: 7px 10px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.small-btn { padding: 5px 13px; font-size: .88rem; }
.decided { color: var(--ok); font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; }
.decided::before { content: "✓"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-bg); font-size: .7rem; }
.editor label { margin-top: 8px; }

/* Published */
.success { display: flex; gap: 18px; align-items: center; background: linear-gradient(120deg, var(--ok-bg), var(--accent-bg)); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); border-radius: var(--radius-lg); padding: 22px 26px; margin-bottom: 20px; }
.success .badge { width: 52px; height: 52px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }
.success .badge svg { width: 26px; height: 26px; }
.success h2 { margin: 0; } .success p { margin: 2px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 10px; }
.checks li::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: .75rem; font-weight: 700; }
.checks li.fail::before { content: "✗"; background: var(--bad-bg); color: var(--bad); }
.checks li.fail { color: var(--bad); }
.decisions { padding-left: 18px; margin: 6px 0; } .decisions li { margin: 4px 0; }

/* Tables (audit) */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
table.list th, table.list td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--surface-2); }
table.list td a { color: var(--text); font-weight: 550; }
.narrow { max-width: 520px; margin: 48px auto; }
/* Public front page */
.landing main { max-width: 1080px; }
.hero { padding: 40px 0 28px; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.15; margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 22px; }
.deadline { background: var(--warn-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: var(--radius-lg); padding: 16px 22px; margin: 0 0 36px; }
.deadline p { margin: 0; }
.steps { list-style: none; padding: 0; margin: 12px 0 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.steps li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.steps h3, .who-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.steps p, .who-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--surface); font-weight: 700; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.who-card .up-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); margin-bottom: 10px; }
.proof p { margin: 0; font-size: 1.05rem; }
.site-foot { text-align: center; color: var(--muted); padding: 24px 16px 40px; font-size: .9rem; }

/* Automatic fixes, record page */
.autofix { margin-top: 6px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; font-size: .9rem; }
.autofix summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.autofix ul { margin: 8px 0 4px; padding-left: 18px; } .autofix del { color: var(--bad); } .autofix ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.record-cta { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.record-cta p { margin: 4px 0 0; max-width: 640px; }
table.kv { border-collapse: collapse; width: 100%; } table.kv th, table.kv td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
table.kv th { width: 160px; color: var(--muted); font-weight: 600; }
@media print {
  .top, .no-print, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .card, table.list { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
