:root {
  color-scheme: light dark;
  --page: #fff;
  --chrome: #f6f5f3;
  --text: #292a2d;
  --text-muted: #666866;
  --border: #e7e6e2;
  --control-border: #858780;
  --hover: #efeeeb;
  --accent: #3b5879;
  --accent-soft: #edf2f7;
  --anchor: #faedc3;
  --success: #396548;
  --warning: #815f25;
  --danger: #a03e3e;
  --shell-top: 0px;
  --shadow: 0 4px 16px rgb(0 0 0 / 10%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #191a1c;
    --chrome: #202124;
    --text: #e7e7e5;
    --text-muted: #a4a6a3;
    --border: #36383b;
    --control-border: #777b80;
    --hover: #2b2d30;
    --accent: #9abbe1;
    --accent-soft: #263547;
    --anchor: #4b4022;
    --success: #94c7a0;
    --warning: #e2bf7b;
    --danger: #f0a0a0;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--shell-top) + 76px); }
body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
button, a.button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--text); border-radius: 6px; background: var(--text); color: var(--page); padding: 7px 12px; text-decoration: none; font-weight: 500; line-height: 1.5; }
button:hover, a.button:hover { opacity: .88; }
button.secondary, a.secondary { background: var(--page); color: var(--text); border-color: var(--control-border); }
button.quiet { background: transparent; color: var(--accent); border-color: transparent; padding: 6px 8px; }
button.quiet:hover { background: var(--hover); opacity: 1; }
button:disabled { cursor: default; opacity: .55; }
:where(button, a, input, textarea, select, pre, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* A single navigation DOM changes placement, preserving page and form state. */
.app-header { position: fixed; inset: 0 auto 0 0; width: 224px; z-index: 30; padding: 24px 12px; background: var(--chrome); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: stretch; gap: 24px; overflow-y: auto; }
.brand { color: var(--text); font-size: 17px; font-weight: 600; text-decoration: none; letter-spacing: -.025em; padding: 0 12px; }
.brand { display: flex; align-items: center; gap: 6px; }
.brand-logo { flex: 0 0 32px; }
@media (prefers-color-scheme: dark) { .brand-logo { filter: invert(1); } }
nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav a { text-decoration: none; }
#workspace-navigation { flex-direction: column; gap: 3px; }
#workspace-navigation a { display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 8px 12px; border-radius: 6px; font-size: 14px; min-height: 36px; }
#workspace-navigation a:hover { background: var(--hover); color: var(--text); }
#workspace-navigation a[aria-current] { background: var(--hover); color: var(--text); font-weight: 500; }
.nav-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#workspace-navigation .guide-link { margin-top: 16px; }
.workspace-menu { margin: 0; border: 0; padding: 0; position: relative; min-width: 0; }
.workspace-menu > summary { padding: 8px 12px; border-radius: 6px; overflow-wrap: anywhere; color: var(--text-muted); }
.workspace-menu > summary:hover { background: var(--hover); }
.workspace-options { display: grid; gap: 12px; padding: 12px; background: var(--chrome); }
.workspace-options form { margin: 0; }
.workspace-options .quiet { padding-left: 0; }
.navigation-setting { display: grid; gap: 8px; font-size: 13px; }
.navigation-toggle { display: none; }
.app-content { margin-left: 224px; min-width: 0; }
main { container-type: inline-size; max-width: 1216px; width: 100%; margin-inline: auto; padding: 48px 48px 64px; }
html[data-navigation=top] .app-header { position: sticky; inset: 0 0 auto; width: 100%; height: 56px; padding: 0 24px; flex-direction: row; align-items: center; gap: 24px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
html[data-navigation=top] .app-content { margin-left: 0; }
html[data-navigation=top] #workspace-navigation { flex-direction: row; align-items: center; flex-wrap: nowrap; }
html[data-navigation=top] #workspace-navigation .nav-icon { display: none; }
html[data-navigation=top] #workspace-navigation .guide-link { margin-top: 0; }
html[data-navigation=top] .workspace-menu { margin-left: auto; }
html[data-navigation=top] .workspace-menu > summary { max-width: 180px; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-navigation=top] .workspace-options { position: absolute; right: 0; top: 100%; width: 220px; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 16px; font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.4; margin: 32px 0 12px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { overflow-wrap: anywhere; }
.muted, small, .page-properties { color: var(--text-muted); }
small, .page-properties { font-size: 13px; }
.page-properties { margin: 8px 0; line-height: 1.6; }
.page-heading { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; }
.page-heading > div { min-width: 0; }
.page-heading p { margin: 8px 0 0; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions a:not(.button) { font-size: 13px; }
.filters { display: flex; gap: 12px; align-items: end; margin-bottom: 24px; flex-wrap: wrap; }
.filters label:first-child { flex: 2; min-width: min(180px, 100%); }
.filters label { flex: 1; min-width: min(130px, 100%); font-size: 13px; }
label { display: block; font-weight: 500; margin-bottom: 6px; overflow-wrap: anywhere; }
input:not([type=hidden]):not([type=checkbox]), textarea, select { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--control-border); border-radius: 6px; background: var(--page); color: var(--text); }
input[type=checkbox] { accent-color: var(--accent); }
textarea { resize: vertical; font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
select[multiple] { min-height: 140px; }
form:not(.filters):not([data-logout]):not(.resolve-form) > p { margin: 20px 0; }
.note-list, .collection-grid { display: grid; }
.note-card { border-top: 1px solid var(--border); padding: 20px 0; min-width: 0; }
.note-card h2 { font-size: 16px; max-width: 900px; white-space: pre-line; margin: 0 0 8px; }
.note-card h2 a { color: var(--text); text-decoration: none; }
.note-card h2 a:hover { text-decoration: underline; }
.note-card p { margin: 6px 0; font-size: 13px; }
.card { padding: 0; margin: 32px 0; }
.badge { display: inline-block; border-radius: 4px; background: var(--hover); color: var(--text-muted); font-size: 13px; padding: 1px 6px; margin-right: 6px; }
.badge.resolved { color: var(--success); }
.badge.open { color: var(--warning); }
.empty { text-align: left; padding: 32px 0; }
.empty h2 { margin-top: 0; }
.empty.small { padding: 16px 0; }
.context-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin: -24px 0 40px; min-height: 40px; }
.breadcrumbs { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-muted); margin: 0; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { text-decoration: underline; }
.context-link { font-size: 13px; }
.citation-context { margin-block: 16px; }
.cited-passage { background: var(--accent-soft); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
#cited-passage { scroll-margin-top: calc(var(--shell-top) + 80px); }
.document { font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; background: var(--chrome); border: 0; border-radius: 6px; margin: 0; padding: 16px; tab-size: 4; }
.document::selection, .document *::selection, .document::highlight(draft-anchor) { background: var(--accent-soft); color: var(--text); }
.document-page { max-width: 1296px; }
.document-topbar { margin-bottom: 24px; }
.document-identity h1 { max-width: 760px; }
.document-byline { display: flex; align-items: center; gap: 8px 12px; color: var(--text-muted); font-size: 13px; margin: 0; flex-wrap: wrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.document-actions { font-size: 13px; }
.reader-toolbar { position: sticky; top: var(--shell-top); z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 16px; min-height: 52px; margin-bottom: 28px; padding: 8px 0; background: var(--page); border-bottom: 1px solid var(--border); }
.reader-modes { display: inline-flex; gap: 4px; }
.reader-mode { font-size: 13px; padding: 6px 12px; border: 0; background: transparent; color: var(--text-muted); }
.reader-mode[aria-pressed=true] { background: var(--hover); color: var(--text); }
.reader-hint { font-size: 13px; color: var(--text-muted); }
kbd { font: 12px system-ui, sans-serif; padding: 2px 5px; border: 1px solid var(--border); border-radius: 4px; margin-left: 8px; }
.discussion-jump { margin-left: auto; font-size: 13px; text-decoration: none; white-space: nowrap; }
.count { color: var(--text-muted); font-size: 13px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.document-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.document-column { min-width: 0; }
.document-reading { max-width: 760px; }
.document-reading .document { background: var(--page); border-radius: 0; padding: 0; font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); }
.markdown-prefix { display: none; }
.source-mode .markdown-prefix, mark .markdown-prefix, .cited-passage .markdown-prefix { display: inline; }
.document-title { font-size: 26px; line-height: 1.5; font-weight: 600; }
.document-heading { font-size: 20px; line-height: 1.6; font-weight: 600; }
.source-code { font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--chrome); }
.document-reading .source-mode, .source-mode .document-title, .source-mode .document-heading, .source-mode .source-code { font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: normal; background: var(--page); }
.document mark { background: var(--anchor); color: inherit; border-bottom: 1px solid var(--warning); border-radius: 2px; padding: 0; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.document mark:hover, .document mark.active { background: var(--accent-soft); border-bottom-color: var(--accent); }
.document mark.quiet-mark { background: var(--chrome); border-bottom-color: var(--control-border); }
.metadata { margin-top: 32px; }
details { margin: 24px 0; min-width: 0; }
summary { cursor: pointer; font-weight: 500; font-size: 14px; }
details pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.digest { font-size: 13px; overflow-wrap: anywhere; }
.thread-state { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.thread-state form { margin: 0; }
.discussion-rail { min-width: 0; border-top: 1px solid var(--border); padding-top: 24px; }
.discussion-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.discussion-heading h2 { font-size: 14px; margin: 0; }
.discussion-heading p { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.icon-button { min-width: 36px; min-height: 36px; padding: 4px; border: 1px solid transparent; background: transparent; color: var(--text-muted); font-size: 18px; font-weight: 400; }
.icon-button:hover { background: var(--hover); color: var(--text); opacity: 1; }
.discussion-filters { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.discussion-filters button { background: transparent; border: 0; color: var(--text-muted); font-weight: 500; font-size: 13px; padding: 6px 8px; }
.discussion-filters button[aria-pressed=true] { background: var(--hover); color: var(--text); }
.discussion-filters span { margin-left: 4px; }
.discussion-list { display: flex; flex-direction: column; gap: 16px; }
.comment-card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; font-size: 14px; background: var(--page); overflow-wrap: anywhere; }
.comment-card.active { border-color: var(--accent); background: var(--accent-soft); }
.comment-heading { display: flex; align-items: center; gap: 8px; }
.comment-author { min-width: 0; flex: 1; line-height: 1.5; }
.comment-author strong { font-size: 13px; font-weight: 600; }
.comment-author .badge { margin-left: 4px; }
.comment-time { display: block; color: var(--text-muted); font-size: 13px; text-decoration: none; margin-top: 2px; }
.comment-time:hover { text-decoration: underline; }
.resolve-form { margin: 0; }
.thread-label { display: flex; gap: 8px; align-items: center; color: var(--success); font-size: 13px; margin: 12px 0 0; }
.anchor-context { font-size: 13px; color: var(--text-muted); padding: 0 0 0 12px; border-left: 2px solid var(--accent); margin: 16px 0 12px; }
.anchor-context a { color: inherit; text-decoration: none; display: block; line-height: 1.6; }
.anchor-context a:hover { text-decoration: underline; }
.anchor-context small { display: block; margin-top: 8px; color: var(--warning); }
.earlier-label { display: block; font-weight: 500; margin-bottom: 6px; }
.whole-note-label { color: var(--text-muted); }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 16px; line-height: 1.65; }
.thread-reply { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.reply-context { font-size: 13px; color: var(--text-muted); }
.comment-actions { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.inline-reply { padding: 0; margin: 0; flex: 1 0 100%; }
.inline-reply summary { color: var(--accent); font-size: 13px; width: max-content; }
.inline-reply[open] summary { margin-bottom: 12px; }
.reply-form textarea, .comment-composer textarea { font: 14px/1.6 system-ui, sans-serif; min-height: 96px; }
.comment-more { font-size: 13px; }
.comment-composer { border: 1px solid var(--control-border); margin: 0 0 16px; padding: 16px; border-radius: 8px; }
.comment-composer[open] { border-color: var(--accent); }
.comment-composer > summary { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.compose-caret { color: var(--text-muted); margin-left: auto; }
.comment-composer[open] .compose-caret { display: none; }
.selection-context { margin: 16px 0; padding: 10px 12px; background: var(--accent-soft); border-radius: 4px; }
.selection-context p { font-size: 13px; margin: 0; }
.selection-context button { padding-left: 0; font-size: 13px; }
.keyboard-anchor { border-top: 1px solid var(--border); padding: 12px 0 0; margin: 16px 0 0; }
.keyboard-anchor summary { font-size: 13px; color: var(--text-muted); }
.range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.range-inputs label { font-size: 13px; }
.keyboard-anchor button { margin-top: 8px; font-size: 13px; }
button.small-button { font-size: 13px; }
.composer-actions { gap: 8px; }
.draft-status { font-size: 13px; }
.draft-status.recovered { color: var(--warning); }
.discussion-empty { padding: 24px 0; color: var(--text-muted); }
.discussion-empty h3 { font-size: 14px; color: var(--text); margin: 0 0 8px; }
.discussion-empty p { font-size: 13px; }
.filter-empty { font-size: 13px; padding: 16px 0; }
.selection-popover { position: fixed; z-index: 50; box-shadow: var(--shadow); padding: 8px 12px; font-size: 13px; }
.notice { padding: 12px 16px; border-left: 2px solid var(--warning); background: var(--chrome); font-size: 14px; }
.notice.success { border-color: var(--success); }
.notice.error { border-color: var(--danger); }
.notice.warning { border-color: var(--warning); }
.revision-notice { margin: 0 0 24px; }
.errorlist { color: var(--danger); padding-left: 20px; font-size: 14px; }
.editor-page { max-width: 760px; margin-inline: auto; }
.editor-page > form { max-width: 640px; margin-top: 32px; }
.helptext { display: block; font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.login-page { max-width: 400px; margin: 48px auto; }
.login-page form { margin: 24px 0; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.comparison > section { min-width: 0; }
.walkthrough { padding-left: 20px; }
.walkthrough li { padding: 0 0 16px 4px; }
.pagination { margin-top: 24px; align-items: center; }
.view-tabs { gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 20px; padding-bottom: 4px; }
.view-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--text-muted); border-radius: 6px; white-space: nowrap; }
.view-tabs a:hover, .view-tabs a[aria-current] { background: var(--hover); color: var(--text); }
.view-tabs a[aria-current] { font-weight: 600; }
.browse-filters { gap: 10px; margin-bottom: 10px; }
.browse-filters label { min-width: min(120px, 100%); }
.browse-filters label:first-child { flex: 2 1 240px; }
.list-summary { display: flex; gap: 16px; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.list-summary p { margin: 8px 0; }
.compact-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 13px 0; }
.compact-note h2 { font-size: 15px; margin: 0 0 4px; line-height: 1.5; }
.note-row-main { min-width: 0; }
.note-card .note-preview { margin: 2px 0 6px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-properties { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--text-muted); font-size: 12px; }
.row-properties .badge { font-size: 12px; margin: 0; }
.row-properties a { color: var(--text-muted); }
.row-properties .newer-revision { color: var(--accent); }
.note-row-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; color: var(--text-muted); font-size: 12px; padding-top: 3px; }
.inline-menu, .row-menu { margin: 0; position: relative; }
.inline-menu > summary, .row-menu > summary { min-height: 36px; padding: 7px 10px; font-size: 13px; color: var(--text-muted); }
.menu-items, .row-menu form { z-index: 25; position: absolute; right: 0; top: 100%; min-width: 190px; background: var(--page); padding: 12px; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.menu-items { display: grid; gap: 8px; }
.scope-context { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.project-overview { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
.project-overview > section { min-width: 0; }
.project-overview h2:first-child { margin-top: 12px; }
.project-overview h3 { margin: 12px 0; }
.overview-row { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--border); padding: 12px 0; }
.overview-row span { font-size: 13px; }
.project-management { border-top: 1px solid var(--border); padding-top: 20px; }
.project-management .actions { margin-top: 20px; }
.add-selection { margin: 12px 0; }
.add-selection form { max-width: 640px; }
.note-management { margin: -12px 0 20px; }
.note-management > summary { color: var(--text-muted); font-size: 13px; }
.note-management form { margin-top: 12px; }
.reader-outline { position: relative; margin: 0; }
.reader-outline > summary, .reader-top { font-size: 13px; }
.reader-outline nav { position: absolute; top: 100%; left: 0; width: min(340px, 65vw); max-height: 50vh; overflow-y: auto; padding: 16px; background: var(--page); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 6px; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 10px; }
.reader-outline nav a { font-size: 13px; }
.document span[id^=document-line-] { scroll-margin-top: calc(var(--shell-top) + 80px); }
@container (max-width: 760px) { .project-overview { grid-template-columns: 1fr; gap: 16px; } .note-row-meta { max-width: 110px; } .compact-note { gap: 12px; } }
@container (max-width: 440px) { .compact-note { grid-template-columns: 1fr; gap: 6px; } .note-row-meta { max-width: none; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; } .view-tabs a { padding-inline: 8px; } .list-summary { align-items: start; } }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; left: 12px; top: 8px; z-index: 60; background: var(--page); padding: 8px; }
.history { font-size: 13px; padding-left: 20px; }
.proposal, .review-workspace { margin: 32px 0; }
.proposal .button { margin-top: 16px; }
#labeling-frame { color-scheme: light; width: 100%; height: 850px; border: 1px solid var(--control-border); border-radius: 6px; background: #fafbf7; }
.break { overflow-wrap: anywhere; }
/* Share the rail breakpoint with discussion.js through the actual grid geometry. */
@container (min-width: 840px) {
  .document-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); }
  .discussion-rail { border-top: 0; padding-top: 0; }
}
@container (max-width: 760px) {
  .page-heading { flex-direction: column; gap: 16px; }
  .reader-hint { display: none; }
  .comparison { grid-template-columns: 1fr; }
  .context-bar { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (max-width: 1199px) { main { padding-inline: 32px; } }
@media (max-width: 959px) {
  .app-header, html[data-navigation=top] .app-header { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 10px 20px; border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; overflow: visible; }
  .brand { padding: 0; }
  .navigation-toggle { display: inline-flex; min-height: 36px; }
  #workspace-navigation, html[data-navigation=top] #workspace-navigation { grid-column: 1 / -1; flex-direction: column; align-items: stretch; }
  .workspace-menu, html[data-navigation=top] .workspace-menu { grid-column: 1 / -1; margin: 0; }
  html[data-navigation=top] .workspace-menu > summary { max-width: none; }
  html[data-navigation=top] .workspace-options { position: static; width: 100%; box-shadow: none; border: 0; }
  html.navigation-ready:not([data-navigation-open=true]) #workspace-navigation,
  html.navigation-ready:not([data-navigation-open=true]) #workspace-menu { display: none; }
  .app-content { margin-left: 0; }
}
@media (max-width: 599px) {
  main { padding: 32px 20px 48px; }
  h1 { font-size: 28px; line-height: 1.25; }
  .context-bar { margin-top: -16px; margin-bottom: 32px; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filters label { min-width: 0; }
  .login-page { margin: 24px auto; }
  #labeling-frame { height: 950px; }
}
@media (pointer: coarse) {
  button, a.button, select, summary, #workspace-navigation a { min-height: 44px; }
  .icon-button { min-width: 44px; min-height: 44px; }
  input:not([type=hidden]), textarea, select, .reply-form textarea, .comment-composer textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color 120ms, color 120ms; } }
@media print {
  .app-header, .reader-toolbar, .metadata, .document-actions, .comment-composer, .discussion-filters, .resolve-form, .comment-actions, .selection-popover { display: none !important; }
  .app-content { margin: 0; }
  main { max-width: none; padding: 0; }
  .document-layout { display: block; }
  .comment-card { break-inside: avoid; margin-top: 12px !important; }
  .discussion-rail { margin-top: 32px; }
}
/* Retained execution remains a readable part of the Work page. */
.run-trace .page-heading { margin-bottom: 12px; }
.trace-badge { color: var(--text-muted); font-size: 13px; }
.trace-steps { list-style: none; padding: 0; margin: 24px 0; }
.trace-step { border-left: 1px solid var(--border); padding: 0 0 20px 16px; }
.trace-step:last-child { padding-bottom: 0; }
.trace-number { display: inline-block; min-width: 24px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.trace-step details { margin: 0; }
.trace-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.65; padding: 12px 0; }
.trace-tool, .trace-observation { padding: 8px 0 8px 16px; font-size: 13px; }
.trace-tool code { overflow-wrap: anywhere; }

.browse-filters { display: block; }
.filter-primary, .filter-secondary { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.filter-primary label:first-child { flex: 2 1 260px; }
.filter-primary label { flex: 1 1 200px; }
.extra-filters { margin: 12px 0 8px; }
.extra-filters > summary { font-size: 13px; color: var(--text-muted); }
.filter-secondary { margin-top: 12px; max-width: 720px; }
.filter-secondary label { flex: 1 1 180px; }
.revision-search { margin-bottom: 8px; }
.candidate-selection-preview { margin-top: 16px; }
.candidate-selection-preview li { margin: 12px 0; }
.selection-snippet { white-space: normal; overflow-wrap: anywhere; }
.candidate-selection-preview .selection-snippet { margin: 6px 0; }
.shared-document { margin: 24px 0; }
.shared-document h4 { font-size: 16px; margin-bottom: 8px; }

.collection-context { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.collection-context .breadcrumbs { margin: 0; }
.collection-switch { font-size: 13px; color: var(--text-muted); width: min(280px, 100%); }
.collection-switch select { margin-top: 4px; }
/* Authoring keeps the everyday path short and its advanced values inspectable. */
.editor-page > .breadcrumbs { margin-bottom: 24px; }
.form-section { margin: 24px 0; }
.form-section h2 { margin-top: 0; }
.form-field { margin: 20px 0; }
.error-summary:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.error-summary ul { margin-bottom: 0; }
.option-count { font-size: 13px; }
.document-outline { margin: 0 0 24px; }
.document-outline nav { display: grid; gap: 8px; padding: 16px 0; }
.revision-diff { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.7 ui-monospace, monospace; }
.revision-diff > span { display: block; }
.diff-added { color: var(--success); background: var(--chrome); }
.diff-removed { color: var(--danger); background: var(--chrome); }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.review-source, .review-panel { min-width: 0; }
.review-source { container-type: inline-size; }
.review-source .document-topbar { margin-top: 24px; }
.review-source .document-identity h2 { margin: 0 0 12px; }
.review-source .reader-hint { display: none; }
.review-source .reader-toolbar { position: static; }
.source-choice { margin-top: 0; }
.source-choice nav { display: grid; padding: 16px 0; }
.review-navigation { position: sticky; top: var(--shell-top); z-index: 21; padding: 12px 0; border-bottom: 1px solid var(--border); background: var(--page); font-size: 13px; }
#review-progress { color: var(--text-muted); }
#labeling-frame { color-scheme: light dark; height: 1000px; background: var(--page); border: 1px solid var(--border); }
.review-actions { position: sticky; bottom: 0; z-index: 10; background: var(--page); padding: 12px 0; border-top: 1px solid var(--border); }
.review-actions .draft-status { margin: 0 0 8px; }
@container (min-width: 900px) { .review-layout { grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); } }

/* Reading styles retain every source character for exact passage selections. */
.markdown-strong { font-weight: 650; }
.markdown-emphasis { font-style: italic; }
.markdown-code { font-family: ui-monospace, monospace; background: var(--chrome); }
.document-list-item { display: block; padding-left: 1.3em; text-indent: -1.3em; }
.source-mode .markdown-strong { font-weight: inherit; }
.source-mode .markdown-emphasis { font-style: inherit; }
.source-mode .markdown-code { background: none; }
.source-mode .document-list-item { display: inline; padding-left: 0; text-indent: 0; }
.next-action { margin: 24px 0; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
