:root {
  color-scheme: light;
  --canvas: #edf1eb;
  --sheet: #fff;
  --raised: #f5f7f3;
  --paper: #fdfcf8;
  --ink: #1f2b24;
  --muted: #536259;
  --line: #e0e7df;
  --control: #cbd5cc;
  --accent: #315b43;
  --accent-bg: #e8f1e8;
  --warning: #77511a;
  --warning-bg: #f7efdb;
  --error: #8f312b;
  --error-bg: #faeeeb;
  --radius: 8px;
  --gutter: 18px;
  --serif: "Songti SC", "SimSun", "Noto Serif CJK SC", serif;
  font: 14px/1.55 "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-variant-numeric: tabular-nums;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 23px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
h2 { font-size: 16px; line-height: 1.4; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
img { max-width: 100%; }
textarea { resize: vertical; }
input, textarea, select {
  min-width: 0;
  border: 1px solid var(--control);
  border-radius: 6px;
  background: var(--sheet);
}
input, select { min-height: 36px; padding: 6px 9px; }
textarea { padding: 8px 9px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
input[type="checkbox"] { accent-color: var(--accent); min-height: auto; }
hr { border: 0; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hint, .meta { font-size: 12px; color: var(--muted); }
.meta { margin-top: 5px; overflow-wrap: anywhere; }
.boot { padding: 30px; color: var(--muted); }
.button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--control);
  border-radius: 6px;
  font-weight: 560;
  color: var(--ink);
  background: var(--sheet);
  text-decoration: none;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--raised); }
.primary, .primary.button { background: #254634; border-color: #254634; color: #fff; }
.primary:hover:not(:disabled) { background: #345a44; }
.text-button {
  border: 0;
  border-radius: 6px;
  min-height: 32px;
  padding: 3px 7px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  font-size: 12px;
}
.text-button:hover:not(:disabled) { background: var(--raised); color: var(--ink); }
.icon-label > span { font-size: 16px; line-height: 1; }
.row-actions, .pane-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 5px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 560;
  color: #435248;
  background: var(--canvas);
}
.stage.submitted { color: var(--warning); background: var(--warning-bg); }
.stage.returned { color: var(--error); background: var(--error-bg); }
.stage.approved { color: var(--accent); background: var(--accent-bg); }

.topbar {
  height: 56px;
  padding: 0 clamp(14px, 1.8vw, 28px);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 27px);
  color: var(--ink);
}
.brand { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.brand strong { font: 700 25px/1.2 var(--serif); white-space: nowrap; }
.brand-mark { display: inline-flex; gap: 2px; align-items: center; flex: none; width: 26px; height: 24px; }
.brand-mark i { width: 11px; height: 18px; background: var(--accent); }
.brand-mark i:first-child { border-radius: 2px 4px 0 2px; transform: skewY(10deg); }
.brand-mark i:last-child { border-radius: 4px 2px 2px 0; transform: skewY(-10deg); opacity: .84; }
.top-scope { padding-left: 22px; border-left: 1px solid var(--control); color: var(--ink); font-size: 19px; }
.account { margin-left: auto; display: flex; align-items: center; gap: 7px; min-width: 0; }
.account-name { font-weight: 600; font-size: 15px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.account-role { color: var(--muted); font-size: 12px; white-space: nowrap; }
.account-role::before { content: "·"; margin-right: 6px; }
.sheet { border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); min-width: 0; }

#app:is([data-role="interviewer"], [data-role="admin"]), .reference-dialog {
  --accent: #195232;
  --accent-bg: #eaf3e5;
  --canvas: #e9efe9;
  --ink: #19231d;
  --paper: #fdfcfb;
}
#app:is([data-role="interviewer"], [data-role="admin"]) { background: var(--canvas); }
.topbar .brand-mark { gap: 0; width: 38px; height: 32px; }
.topbar .brand-mark i {
  width: 19px;
  height: 25px;
  background: transparent;
  border: 2px solid var(--accent);
  opacity: 1;
}
.topbar .brand-mark i:first-child { border-right: 0; transform: skewY(8deg); }
.topbar .brand-mark i:last-child { transform: skewY(-8deg); }
.work-sheet {
  height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
}
.task-bar {
  display: flex;
  flex: none;
  gap: 10px;
  align-items: center;
  padding: 0 clamp(12px, 1.4vw, 24px);
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
}
.task-tabs { display: flex; gap: 8px; align-items: stretch; flex: 1; min-width: 0; overflow-x: auto; }
.task-tab {
  border: 0;
  border-bottom: 4px solid transparent;
  height: 57px;
  min-width: 113px;
  max-width: 193px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 550;
  white-space: nowrap;
}
.task-tab:focus-visible { outline-offset: -4px; }
.task-tab span:last-child { overflow: hidden; text-overflow: ellipsis; }
.task-tab:hover { background: var(--raised); }
.task-tab.is-active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.interview-heading {
  flex: none;
  min-height: 88px;
  padding: 8px clamp(18px, 1.9vw, 30px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--sheet);
}
.interview-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.interview-title h1 { font: 700 clamp(25px, 2.2vw, 36px)/1.25 var(--serif); }
.interview-heading .meta { font-size: 14px; color: var(--ink); }
.work-sheet .primary, .reference-dialog .primary { background: var(--accent); border-color: var(--accent); }
.work-sheet .primary:hover:not(:disabled), .reference-dialog .primary:hover:not(:disabled) { background: #236640; }
.outline-accent { border-color: #88a393; color: var(--accent); font-weight: 650; }
.task-bar > .button { min-height: 39px; padding-inline: 18px; }
.submit-review { min-height: 47px; min-width: 144px; font-size: 17px; }
.interview-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(270px, 34fr) minmax(310px, 37fr) minmax(236px, 27fr);
  gap: 9px;
  padding: 11px 12px 12px;
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  overflow: hidden;
}
.pane-head {
  min-height: 51px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pane-head h2 { white-space: nowrap; }
.pane-scroll { padding: 14px; min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; }
.interview-grid .pane { border: 0; border-radius: 12px; }
.interview-grid .pane-head { margin: 0 14px; min-height: 53px; padding: 7px 3px; flex: none; }
.interview-grid .pane-head h2 { font-size: clamp(19px, 1.55vw, 24px); font-weight: 700; }
.chat-scroll { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px; }
.chat-message {
  width: 90%;
  max-width: 540px;
  flex: none;
  padding: 8px 13px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8f6;
}
.chat-own { align-self: flex-end; width: 79%; border-color: transparent; background: var(--accent-bg); }
.chat-message header { display: flex; align-items: baseline; gap: 7px; color: var(--accent); font-size: 14px; }
.chat-message header span { font-size: 12px; font-weight: 550; }
.chat-message header span::before { content: "·"; margin-right: 6px; }
.chat-text { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.chat-message .asset-list { grid-template-columns: minmax(0, 1fr); margin-top: 4px; }
.chat-message .asset-tile { min-height: 31px; padding-inline: 8px; font-size: 13px; }
.chat-message .inline-error { margin-top: 7px; }
.chat-retry { color: var(--accent); }
.composer.chat-composer { margin-inline: 12px; padding: 10px 3px; }
.chat-composer textarea { resize: vertical; min-height: 45px; max-height: 160px; }
.chat-composer .composer-actions .primary { min-width: 79px; }
.chat-composer .composer-actions > * { min-height: 37px; }
.chat-composer .composer-actions select { font-size: 13px; }
.review-thread { max-height: 44dvh; overflow: auto; margin-bottom: 14px; }
.inner-tabs, .book-tabs { display: flex; flex: none; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.inner-tabs { padding: 0 13px; }
.inner-tab {
  padding: 0 1px;
  min-height: 37px;
  border: 0;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}
.inner-tab:hover { color: var(--ink); }
.inner-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.notes { display: grid; gap: 10px; }
.note { min-width: 0; padding: 10px 11px; border-radius: 6px; background: var(--raised); }
.note header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.note header strong { font-weight: 650; color: var(--accent); }
.note time { margin-left: auto; white-space: nowrap; }
.note p { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.note.feedback-return { background: var(--error-bg); }
.note.feedback-photo { background: var(--warning-bg); }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; background: var(--sheet); }
.composer textarea { display: block; width: 100%; }
.composer-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.composer-actions select { font-size: 12px; min-height: 34px; padding-inline: 4px; }
.composer-actions button[type="submit"] { margin-left: auto; }
.subsection { margin: 16px 0 8px; }
.asset-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.asset-tile {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
}
.asset-tile:hover { background: var(--raised); }
.asset-tile > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-tile img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex: none; }
.file-kind { color: var(--accent); font-weight: 650; font-size: 11px; }
.survey { margin-top: 7px; border: 1px solid #d1dfcd; border-radius: 8px; overflow: hidden; background: var(--sheet); }
.survey-head { display: flex; justify-content: space-between; gap: 7px; padding: 4px 10px; background: var(--accent-bg); }
.survey-head strong { color: var(--ink); }
.survey-count { white-space: nowrap; font-size: 13px; }
.survey-past .survey-head { cursor: pointer; }
.survey-past .survey-head::after { content: "＋"; color: var(--muted); }
.survey-past[open] .survey-head::after { content: "−"; }
.survey-past .survey-count { margin-left: auto; }
.survey-body { padding: 5px 9px 4px; }
.survey ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.survey li::marker { font-weight: 700; }
.question { display: grid; gap: 2px; overflow-wrap: anywhere; }
.question > span { font-size: 13px; font-weight: 650; }
.question textarea { width: 100%; min-height: 28px; padding: 3px 6px; font-size: 13px; line-height: 1.45; }
.survey-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; justify-content: space-between; }
.survey-foot .text-button { min-height: 28px; padding-inline: 3px; color: var(--accent); }
.past-round { border-top: 1px solid var(--line); padding: 8px 0; }
.past-round summary { cursor: pointer; color: var(--accent); overflow-wrap: anywhere; }
.past-round p { margin-top: 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-error, .form-error { color: var(--error); background: var(--error-bg); padding: 8px; border-radius: 6px; overflow-wrap: anywhere; }

.draft-sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 27px clamp(18px, 2.1vw, 35px) 14px;
  background: var(--paper);
}
.article-title, .article-body {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  resize: none;
}
.article-title {
  flex: none;
  field-sizing: content;
  min-height: 1.4em;
  max-height: 4.2em;
  font: 700 clamp(25px, 2.65vw, 42px)/1.4 var(--serif);
  text-align: center;
}
.article-body { flex: 1; min-height: 0; margin-top: 24px; font: clamp(16px, 1.45vw, 23px)/1.85 var(--serif); }
.version-menu { gap: 9px; }
.chevron { display: inline-block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.draft-foot {
  border-top: 1px solid var(--line);
  min-height: 58px;
  margin-inline: 14px;
  padding: 8px 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 11px;
  color: var(--muted);
  font-size: 12px;
}
.revision-note { flex: 1; color: var(--ink); font-size: 13px; }
.draft-count { white-space: nowrap; }
.draft-foot .primary { min-height: 37px; min-width: 99px; }
.ref-refresh { display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: 14px; }
.ref-refresh span { font-size: 21px; line-height: 1; }
.ref-form { padding: 11px 14px 0; }
.ref-field { position: relative; }
.ref-field > span {
  position: absolute;
  top: 11px;
  left: 13px;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}
.ref-field > span::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1px;
  right: -4px;
  bottom: -1px;
  background: var(--muted);
  transform: rotate(45deg);
}
.ref-form input { width: 100%; min-height: 38px; padding-left: 40px; }
.ref-scroll { padding-top: 9px; }
.ref-instruction { margin-bottom: 11px; color: var(--muted); font-size: 13px; }
.ref-list { margin: 0; padding: 0; min-inline-size: 0; border: 0; }
.ref-result {
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 59px;
  padding: 4px 7px 4px 11px;
  border-bottom: 1px solid var(--line);
}
.ref-result:hover { background: var(--raised); }
.ref-selected, .ref-selected:hover { border-color: transparent; border-radius: 10px; background: var(--accent-bg); }
.ref-choice { flex: 1; display: flex; align-items: center; min-width: 0; gap: 11px; min-height: 40px; cursor: pointer; }
.ref-choice:has(input:disabled) { cursor: default; }
.ref-choice > span { min-width: 0; }
.ref-choice input { flex: none; margin: 0; width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); }
.ref-result strong { display: block; font: 700 clamp(15px, 1.23vw, 19px)/1.35 var(--serif); overflow-wrap: anywhere; }
.ref-result small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.ref-result .ref-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ref-result button { flex: none; min-height: 36px; color: var(--accent); font-size: 13px; font-weight: 650; }
.ref-result button:hover { background: var(--sheet); }
.ref-scroll .inline-error { margin-bottom: 7px; }
.workspace-empty { padding: var(--gutter); }
.workspace-empty .empty { margin: 24px 0 0; border: 1px solid var(--line); border-radius: var(--radius); }
.empty { padding: 20px 12px; }
.empty h3 { font-size: 14px; color: var(--ink); }
.empty p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 52ch; }
.empty button { margin-top: 12px; }
.empty-panel { border: 1px solid var(--line); border-radius: var(--radius); padding-inline: 10px; }

.admin-shell { display: grid; grid-template-columns: clamp(170px, 12.5vw, 198px) minmax(0, 1fr); margin: 0 8px 8px; }
.sidebar { padding: 20px 10px 12px 3px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar button {
  position: relative;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--ink);
  min-height: 47px;
  display: flex;
  align-items: center;
  padding: 4px 16px;
  text-align: left;
  font-size: 16px;
  white-space: nowrap;
}
.sidebar button:hover { background: var(--raised); }
.sidebar button.is-active { background: #dcebd7; color: var(--accent); font-weight: 700; }
.sidebar button.is-active::before {
  content: "";
  position: absolute;
  inset: 6px auto 6px 0;
  width: 4px;
  border-radius: 3px;
  background: var(--accent);
}
.admin-sheet { min-height: calc(100dvh - 64px); padding: 18px 22px 22px; }
.admin-shell[data-view="task"] .sidebar {
  background: var(--sheet);
  border-right: 1px solid var(--line);
  border-radius: 16px 0 0 16px;
}
.admin-shell[data-view="task"] .admin-sheet { border-left: 0; border-radius: 0 16px 16px 0; }
.admin-sheet .primary { background: var(--accent); border-color: var(--accent); }
.admin-sheet .primary:hover:not(:disabled) { background: #236640; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head > div:first-child { min-width: 0; }
.admin-crumb { border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.admin-crumb ol { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 0; list-style: none; }
.admin-crumb li { display: inline-flex; min-width: 0; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.admin-crumb li + li::before { content: "/"; color: var(--muted); }
.admin-crumb button { border: 0; background: transparent; padding: 2px 0; color: var(--accent); text-align: left; overflow-wrap: anywhere; }
.admin-crumb button:hover { text-decoration: underline; text-underline-offset: 3px; }
.admin-crumb [aria-current="page"] { color: var(--muted); }
.book-head, .review-head { margin-top: 13px; min-height: 80px; }
.book-head h1, .review-head h1 { font: 700 clamp(24px, 2.2vw, 36px)/1.25 var(--serif); }
.book-head .meta { color: var(--ink); font: 600 16px/1.5 var(--serif); }
.review-head .meta { font-size: 13px; }
.book-head .row-actions > :is(.primary, .button), .review-head .row-actions > :is(.primary, .button) {
  min-height: 40px;
  padding-inline: 15px;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th { color: var(--muted); font-size: 12px; font-weight: 550; background: var(--sheet); white-space: nowrap; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; min-width: 120px; }
tbody th small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
td.number, th.number { text-align: right; white-space: nowrap; }
td.date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.table-actions { text-align: right; white-space: nowrap; }
.table-actions button { margin-left: 4px; }
.inline-meta { margin-left: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.row-link, .book-row { color: var(--ink); display: inline-flex; border: 0; background: transparent; text-align: left; padding: 0; max-width: 100%; overflow-wrap: anywhere; }
.row-link:hover, .book-row:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.book-row { align-items: center; gap: 10px; }
.book-spine {
  display: grid;
  place-items: center;
  width: 36px;
  height: 46px;
  border: 1px solid var(--line);
  border-left: 3px solid #a5b8a6;
  border-radius: 3px 5px 5px 3px;
  background: var(--canvas);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 17px;
  flex: none;
  overflow: hidden;
}
.book-spine img { width: 100%; height: 100%; object-fit: cover; }
.book-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--control); border-radius: 10px; }
.book-stats div { display: flex; align-items: center; justify-content: center; gap: 12px; margin-block: 12px; padding-inline: 8px; }
.book-stats div + div { border-left: 1px solid var(--line); }
.book-stats span { color: var(--ink); font-size: 14px; }
.book-stats strong { font-size: 23px; font-weight: 600; line-height: 1.25; }
.book-tabs { gap: 18px; margin-top: 9px; }
.book-tabs .inner-tab { min-height: 45px; padding-inline: 11px; font-size: 15px; border-bottom-width: 3px; }
.book-body { padding-top: 15px; }
.block-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.block-heading p { margin-top: 3px; }
.list-tools { display: flex; justify-content: space-between; column-gap: 10px; align-items: center; margin-bottom: 8px; }
.filter-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.filter-tabs button { border: 0; border-radius: 6px; min-height: 32px; padding: 4px 8px; background: none; color: var(--muted); white-space: nowrap; }
.filter-tabs button:hover, .filter-tabs button.is-active { background: var(--raised); color: var(--ink); }
.filter-tabs button.is-active { font-weight: 650; }
.chapter-layout { display: grid; grid-template-columns: minmax(0, 1.73fr) minmax(270px, 1fr); align-items: start; gap: 12px; }
.chapter-list { display: grid; gap: 12px; min-width: 0; }
.chapter-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.chapter-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chapter-card-head h2 { font-size: 20px; }
.chapter-card-head .hint { font-size: 13px; }
.chapter-card > .empty-panel { margin-top: 12px; }
.chapter-table { margin-top: 12px; border: 0; border-radius: 7px; }
.chapter-table table { min-width: 525px; }
.chapter-table thead th { background: var(--raised); color: var(--ink); font-size: 13px; }
.chapter-table :is(th, td) { padding: 11px 9px; }
.chapter-table th[scope="row"] { min-width: 115px; }
.chapter-table th[scope="row"] button { font: 700 16px/1.45 var(--serif); }
.chapter-table .chapter-tally { display: none; }
.chapter-table tbody tr:not(.selected-chapter):hover { background: var(--raised); }
.chapter-table tbody .selected-chapter { background: var(--accent-bg); }
.chapter-table tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
.chapter-index { color: var(--muted); text-align: center; }
.candidate-list > div { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--line); gap: 9px; }
.candidate-list .row-link { font: 700 16px/1.5 var(--serif); }
.selected-chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-block: 13px; }
.selected-chapter-head h3 { font: 700 clamp(17px, 1.45vw, 22px)/1.4 var(--serif); overflow-wrap: anywhere; }
.selected-chapter-head span { flex: none; font-variant-numeric: tabular-nums; }
.chapter-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.chapter-gallery figure { margin: 0; }
.chapter-gallery figcaption { font-size: 13px; text-align: center; padding: 5px 6px; overflow-wrap: anywhere; }
.chapter-missing {
  display: grid;
  place-items: center;
  min-height: 72px;
  margin-top: 12px;
  border: 1px dashed var(--control);
  border-radius: 8px;
  color: var(--muted);
}
.chapter-detail-actions, .chapter-order { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.chapter-detail-actions .button { flex: 1 1 auto; }
.chapter-order { gap: 5px; margin-top: 7px; }
.chapter-order button:last-child { margin-left: auto; }
.gallery { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.gallery-tile { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-image { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--raised); border: 0; padding: 0; }
.gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-info { display: grid; padding: 9px; gap: 3px; overflow-wrap: anywhere; }
.gallery-info small { color: var(--muted); font-size: 12px; }
.gallery-info .row-actions { margin-left: -5px; }
.layout-grid { display: grid; grid-template-columns: minmax(160px, 27%) minmax(0, 530px); gap: 32px; align-items: start; }
.cover-preview { display: grid; gap: 8px; text-align: center; }
.cover-paper {
  min-height: 253px;
  border: 1px solid var(--line);
  border-left: 4px solid #a5b8a6;
  border-radius: 3px 7px 7px 3px;
  padding: 23px 10px 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.cover-paper strong { font: 650 24px/1.4 var(--serif); }
.cover-paper img { width: 100%; max-height: 180px; object-fit: contain; }
.cover-paper p { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-weight: 560; }
.field input, .field select, .field textarea { width: 100%; }
.split-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.service-form { max-width: 1000px; }
.service-row { display: grid; grid-template-columns: minmax(190px, .68fr) minmax(0, 1.25fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.service-row h2 { display: flex; align-items: center; gap: 8px; }
.service-row p { margin-top: 6px; color: var(--muted); }
.service-fields { padding: 14px; background: var(--raised); border-radius: var(--radius); }
.service-actions { display: flex; justify-content: flex-end; padding-top: 16px; }
.review-head { padding-bottom: 12px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.review-head .stage.submitted { background: #e0edd7; color: var(--accent); }
.review-grid {
  height: max(425px, calc(100dvh - 223px));
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.34fr) minmax(0, .97fr);
}
.review-grid .pane { border-radius: 12px; }
.review-grid .pane-head { margin-inline: 12px; padding-inline: 2px; flex: none; }
.review-grid .pane-head h2 { font-size: 20px; }
.review-material-pane .note { background: #edf3ea; }
.review-material-pane .subsection { margin: 17px 0 8px; font-size: 16px; }
.review-material-pane .asset-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.review-material-pane .asset-tile { min-height: 37px; padding-inline: 7px; }
.review-photo { border: 0; padding: 0; display: block; width: 100%; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.review-photo img { display: block; width: 100%; aspect-ratio: 2.13; object-fit: cover; }
.review-answers { display: grid; gap: 5px; margin: 0; }
.review-answers > div { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.25fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.review-answers :is(dt, dd) { margin: 0; padding: 7px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-answers dt { font-weight: 650; background: #edf3ea; }
.review-material-pane .past-round .review-answers { margin-top: 6px; }
.read-sheet { background: var(--paper); padding: 24px clamp(14px, 2vw, 28px); font-family: var(--serif); }
.read-sheet h3 { font: 700 clamp(24px, 2.38vw, 36px)/1.35 var(--serif); text-align: center; margin: 6px 0 26px; overflow-wrap: anywhere; }
.review-copy { font-size: clamp(16px, 1.28vw, 20px); line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-copy p { text-indent: 2em; margin-bottom: .9em; }
.review-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  margin-inline: 12px;
  padding: 6px 4px;
  border-top: 1px solid var(--line);
  background: var(--sheet);
}
.review-feedback-pane .composer { margin-inline: 12px; padding: 10px 2px 12px; }
.review-feedback-pane .composer textarea { min-height: 101px; }
.review-feedback-pane .note { border: 1px solid var(--line); }

dialog {
  border: 1px solid var(--control);
  border-radius: 12px;
  margin: auto;
  padding: 0;
  width: min(510px, calc(100% - 30px));
  max-height: 88dvh;
  color: var(--ink);
  background: var(--sheet);
  box-shadow: 0 14px 52px #172b2126;
}
dialog::backdrop { background: #1a2a2355; }
dialog.dialog-wide { width: min(760px, calc(100% - 30px)); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { overflow-wrap: anywhere; }
.dialog-body { padding: 14px 15px; }
.dialog-error { margin-bottom: 10px; }
.close-button { display: grid; place-items: center; min-width: 32px; height: 32px; background: transparent; border: 0; border-radius: 6px; font-size: 24px; color: var(--muted); }
.close-button:hover { background: var(--raised); }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.full-image { display: block; width: 100%; max-height: 65dvh; object-fit: contain; background: var(--raised); }
.article-excerpt { font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 56dvh; overflow-y: auto; padding: 10px 2px; }
dialog.reference-dialog { width: min(730px, calc(100% - 30px)); padding: 0 21px; border-radius: 14px; }
.reference-dialog .dialog-head { padding: 11px 3px; min-height: 60px; }
.reference-dialog .dialog-head h2 { font-size: 23px; }
.reference-dialog .dialog-body { padding: 0; }
.reference-content { min-height: min(34dvh, 320px); max-height: 57dvh; overflow: auto; padding: 22px 16px 24px; }
.reference-content h3 { font: 700 clamp(24px, 2.7vw, 41px)/1.35 var(--serif); text-align: center; overflow-wrap: anywhere; }
.reference-source { margin: 8px 0 19px; text-align: center; font-size: 14px; color: var(--muted); }
.reference-content .article-excerpt { max-height: none; padding: 2px 0; font: clamp(17px, 1.55vw, 23px)/1.9 var(--serif); }
.reference-content .article-excerpt p { margin-bottom: 1.15em; text-indent: 2em; }
.reference-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 13px 3px 16px;
  border-top: 1px solid var(--line);
}
.reference-footer .dialog-actions { margin: 0 0 0 auto; gap: 10px; }
.reference-footer .button, .reference-footer .primary { min-height: 41px; min-width: 112px; }
.reference-content > .button { margin-top: 8px; }
.version-row { display: grid; grid-template-columns: 65px 1fr auto; align-items: center; text-align: left; width: 100%; gap: 8px; min-height: 40px; border: 0; border-bottom: 1px solid var(--line); background: var(--sheet); }
.version-row:hover { background: var(--raised); }
.version-row span { font-size: 12px; color: var(--muted); }
.image-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; max-height: 53dvh; overflow: auto; }
.image-choice { display: grid; align-content: start; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; }
.image-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.image-choice img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.image-choice span { padding: 6px; font-size: 12px; overflow-wrap: anywhere; }
#notice {
  position: fixed;
  inset: auto 18px 18px auto;
  z-index: 20;
  max-width: min(450px, calc(100% - 36px));
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: var(--sheet);
  padding: 10px 13px;
  box-shadow: 0 5px 20px #16281d18;
  display: none;
}
#notice.visible, #notice.error { display: block; }
#notice.error { color: var(--error); border-color: #d7a49c; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-wrap {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  background: var(--sheet);
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(215px, .85fr) 1fr;
  overflow: hidden;
}
.auth-brand { display: flex; gap: 11px; align-items: flex-start; padding: 30px 25px; background: #e3ebe1; }
.auth-brand strong { font: 700 28px/1.12 var(--serif); letter-spacing: .055em; }
.auth-brand p { color: var(--muted); margin-top: 6px; font-size: 13px; }
.auth-form { padding: 26px; }
.auth-form h1 { margin-bottom: 16px; }
.auth-form .primary { margin-top: 4px; }

@media (max-width: 1120px) {
  :root { --gutter: 12px; }
  .admin-shell { grid-template-columns: 165px minmax(0, 1fr); }
  .admin-sheet { padding: 17px; }
}
@media (max-width: 1100px) {
  .chapter-layout { grid-template-columns: minmax(0, 1fr); }
  .chapter-gallery { max-width: 570px; }
}
@media (max-width: 950px) {
  .work-sheet { height: auto; min-height: calc(100dvh - 56px); overflow: visible; }
  .interview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(410px, 65dvh); }
  .reference-pane { grid-column: 1 / -1; max-height: 470px; }
  .admin-shell { display: block; }
  .sidebar { padding: 0 10px 8px; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar button { min-height: 38px; padding-inline: 11px; font-size: 14px; }
  .admin-shell[data-view="task"] .sidebar { border: 0; border-radius: 12px 12px 0 0; }
  .admin-shell[data-view="task"] .admin-sheet { border-left: 1px solid var(--line); border-radius: 0 0 12px 12px; }
  .review-grid { height: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .review-grid > .pane { min-height: 340px; max-height: 545px; }
  .review-grid > .pane:last-child { grid-column: 1 / -1; }
}
@media (max-width: 610px) {
  .topbar { gap: 8px; padding-inline: 11px; }
  .top-scope, .account-role { display: none; }
  .topbar .brand strong { font-size: 21px; }
  .topbar .brand { gap: 7px; }
  .task-bar { padding-inline: 9px; gap: 6px; }
  .task-bar > .button { min-height: 38px; padding-inline: 11px; }
  .task-refresh { display: none; }
  .task-tab { min-width: 81px; height: 46px; padding-inline: 8px; font-size: 15px; }
  .interview-heading { gap: 7px; flex-wrap: wrap; }
  .interview-heading .row-actions { margin-left: auto; }
  .submit-review { min-height: 36px; min-width: 99px; font-size: 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .interview-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .interview-grid .pane { min-height: 440px; max-height: 620px; }
  .interview-grid .draft-pane { height: 540px; }
  .chat-own { width: 86%; }
  .chat-message:not(.chat-own) { width: 94%; }
  .composer.chat-composer .composer-actions { gap: 4px; }
  .chat-composer .composer-actions .primary { min-width: 60px; }
  .chat-composer .composer-actions .outline-accent { padding-inline: 7px; }
  .reference-content { padding-inline: 5px; }
  .layout-grid, .service-row, .review-grid, .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .cover-preview { max-width: 265px; }
  .admin-sheet { padding: 12px; }
  .book-tabs { gap: 3px; overflow-x: auto; }
  .book-tabs .inner-tab { padding-inline: 7px; font-size: 13px; }
  .book-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-stats div { margin: 0; padding: 9px 6px; gap: 6px; }
  .book-stats div:nth-child(odd) { border-left: 0; }
  .book-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .book-stats strong { font-size: 20px; }
  .admin-crumb { font-size: 13px; }
  .chapter-card { padding: 10px; }
  .chapter-table table { min-width: 0; }
  .chapter-table :is(th, td) { padding: 8px 5px; }
  .chapter-table :is(th, td):is(:nth-child(3), :nth-child(5)) { display: none; }
  .chapter-table th[scope="row"] { min-width: 0; }
  .chapter-table th[scope="row"] button { font-size: 14px; }
  .chapter-table .chapter-tally { display: block; font-size: 11px; }
  .chapter-table .button { padding-inline: 6px; font-size: 12px; }
  .auth-brand, .auth-form { padding: 19px; }
}
