/* content-reevaluator — plain, calm, readable. System fonts, no framework. */
:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1d2126;
  --muted: #5d636c;
  --faint: #8a9099;
  --line: #e2dfd7;
  --line-strong: #cfcbc0;
  --accent: #2c5a85;
  --accent-ink: #ffffff;
  --accent-soft: #e8eff6;
  --ok: #2b7149;
  --ok-soft: #e5f2ea;
  --warn: #8f5300;
  --warn-soft: #fbf0dc;
  --bad: #a82a22;
  --bad-soft: #fbe6e4;
  --ins: #dff0e4;
  --ins-ink: #164a2b;
  --del: #fbe2df;
  --del-ink: #7a1d17;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 30, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c; --card: #1d2126; --ink: #e8e6e1; --muted: #a9adb4; --faint: #7f858d;
    --line: #2e333a; --line-strong: #3b414a; --accent: #7fb0dc; --accent-ink: #0f1a24; --accent-soft: #1f2d3a;
    --ok: #79c497; --ok-soft: #1c2e23; --warn: #e2b062; --warn-soft: #33281a; --bad: #f08a80; --bad-soft: #3a1f1d;
    --ins: #1e3a28; --ins-ink: #b8e6c6; --del: #42211e; --del-ink: #f5c2bc; --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; }
.wrap--narrow { max-width: 820px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.875rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.hidden { display: none !important; }

/* buttons and inputs */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-ink); border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 38px;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn--small { padding: 4px 10px; font-size: 0.85rem; min-height: 30px; }
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="url"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; line-height: 1.6; }
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } }
.err { color: var(--bad); }
.okmsg { color: var(--ok); }

/* badges */
.badge {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 550;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap; text-decoration: none;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--plain { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
a.badge:hover { text-decoration: underline; }
.countlink { font-weight: 600; text-decoration: none; border-bottom: 1px dotted currentColor; }
.countlink:hover { border-bottom-style: solid; }
.stats { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 0.95rem; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.85rem; }

/* class header */
.classhead h1 { margin-bottom: 2px; }
.classhead .code { color: var(--muted); font-weight: 500; margin-right: 6px; }

/* author workspace */
.workspace { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 960px) { .workspace { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.slidepane { position: relative; }
@media (min-width: 960px) { .slidepane { position: sticky; top: 12px; } }
.slideframe {
  background: #e9e7e1; border: 1px solid var(--line); border-radius: 8px; aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.slideframe canvas { width: 100%; height: auto; display: block; }
.slideframe .ph { color: var(--muted); padding: 16px; text-align: center; font-size: 0.95rem; }
.slidenav { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.slidenav .where { flex: 1; text-align: center; font-weight: 600; }
.strip { display: flex; gap: 6px; flex-wrap: wrap; }
.strip a {
  position: relative; min-width: 36px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 0.85rem;
  background: var(--card);
}
.strip a.cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.strip a .dot {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--warn); color: #fff; font-size: 0.7rem; line-height: 18px; text-align: center;
}
.strip a.changed { border-bottom: 3px solid var(--ok); }
details.slidetext { margin-top: 10px; }
details.slidetext summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
details.slidetext pre { white-space: pre-wrap; background: var(--bg); padding: 10px; border-radius: 8px; margin: 8px 0 0; font-family: inherit; font-size: 0.9rem; }
.editor textarea { min-height: 260px; font-size: 1.02rem; }
.editor .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.readonly { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px; }

/* proposals */
.proposal { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 8px; padding: 12px 14px; background: var(--card); }
.proposal + .proposal { margin-top: 10px; }
.proposal.st-accepted, .proposal.st-edited { border-left-color: var(--ok); }
.proposal.st-dismissed { border-left-color: var(--line-strong); }
.proposal .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.proposal .claim { margin: 4px 0 6px; }
.proposal .sugg { background: var(--ins); color: var(--ins-ink); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; margin: 6px 0; }
.proposal .why { color: var(--muted); font-size: 0.92rem; }
.proposal .sources { margin: 6px 0 0; padding-left: 18px; font-size: 0.9rem; }
.proposal .decision { margin-top: 8px; font-size: 0.9rem; padding-top: 8px; border-top: 1px dashed var(--line); }
.proposal .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.proposal form { margin-top: 10px; }
.proposal form textarea { min-height: 90px; }

/* diffs */
.diff { white-space: pre-wrap; line-height: 1.7; }
.diff ins { background: var(--ins); color: var(--ins-ink); text-decoration: none; border-radius: 3px; padding: 0 1px; }
.diff del { background: var(--del); color: var(--del-ink); border-radius: 3px; padding: 0 1px; }
.diffslide { display: grid; gap: 12px; grid-template-columns: 1fr; padding: 14px 0; border-top: 1px solid var(--line); }
.diffslide:first-child { border-top: 0; }
@media (min-width: 760px) { .diffslide { grid-template-columns: 220px minmax(0, 1fr); } }
.thumb { background: #e9e7e1; border-radius: 6px; aspect-ratio: 16 / 9; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; }
.thumb canvas { width: 100%; height: auto; display: block; }

/* lists */
.plain { list-style: none; margin: 0; padding: 0; }
.plain > li { padding: 10px 0; border-top: 1px solid var(--line); }
.plain > li:first-child { border-top: 0; }
.classcard h2 { margin-bottom: 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--ink); font-size: 0.88rem; }
.tabs a.on { background: var(--ink); color: var(--card); border-color: var(--ink); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--card);
  padding: 10px 16px; border-radius: 8px; font-size: 0.95rem; max-width: calc(100vw - 32px); z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
#toast.bad { background: var(--bad); color: #fff; }

/* the change record prints */
.record h2 { margin-top: 26px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.record h3 { margin-top: 18px; }
.record .kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 0.95rem; }
.record .kv dt { color: var(--muted); }
.record .kv dd { margin: 0; }
@media print {
  :root { --bg: #fff; --card: #fff; --line: #ccc; }
  body { font-size: 11pt; }
  .noprint, .topbar { display: none !important; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .record a[href^="http"]::after { content: " <" attr(href) ">"; font-size: 0.8em; color: #555; word-break: break-all; }
  tr, .proposal { break-inside: avoid; }
}
