/* Readable, device-independent workspace. rem follows browser text preferences. */
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3VF-Upright.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
:root {
  font-size: 112.5%;
  --font-ui: "Source Sans 3", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --sidebar-width: 14rem;
  --ink: #203d37;
  --muted: #52665e;
  --faint: #5b6c64;
  --surface: #ffffff;
  --rail: #edf2ef;
  --active: #dde8e2;
  --control: #84958d;
  --positive-ink: #245f45;
  --positive-bg: #eaf4ee;
  --warning-ink: #80570f;
  --warning-bg: #fff5de;
  --negative-ink: #963f36;
  --negative-bg: #fceeea;
  --neutral-ink: #52615b;
  --neutral-bg: #edf1ee;
  --info-ink: #275b75;
  --info-bg: #edf4f7;
  --radius-panel: 12px;
  --radius-control: 8px;
  --text-meta: max(12px, .8125rem);
  --text-caption: max(12px, .75rem);
  --line: #dde6e0;
  --bg: #f5f7f6;
  --shadow: none;
}
html[data-text-size="standard"] { font-size: 100%; }
html[data-text-size="small"] { font-size: 87.5%; }
body { font-family: var(--font-ui); font-size: 1rem; line-height: 1.65; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .6rem 1rem; background: #fff; border: 2px solid var(--primary); border-radius: .5rem; }
.skip-link:focus { top: .6rem; }
button, input, select, textarea { font-family: inherit; }
button, a, summary, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid #348b7c; outline-offset: 4px; }
input, select, textarea { font-size: 1rem; border-radius: .5rem; }
input, select { min-height: 2.75rem; }
input[type="checkbox"] { width: 1.125rem; height: 1.125rem; min-height: 1.125rem; flex-shrink: 0; }
input[type="file"] { min-height: 2.75rem; font-size: .875rem; }
h1 { font-weight: 650; line-height: 1.45; text-wrap: balance; }
h2 { line-height: 1.55; }
.button, .button.small { min-height: 2.75rem; border-radius: .5rem; font-size: .9375rem; padding: .6rem 1rem; }
.button.small { padding: .45rem .8rem; }
.button.danger-subtle { font-size: .875rem; }
.button:hover { transform: none; }
.icon-button { min-width: 2.5rem; min-height: 2.5rem; }
.text-link, .back-link { font-size: .875rem; white-space: normal; }
.sidebar { width: var(--sidebar-width); height: 100vh; height: 100dvh; padding: 1.5rem 1rem 0; overflow: hidden; box-shadow: none; border-right: 1px solid var(--line); }
.brand { font-size: 1.1rem; padding-left: .4rem; gap: .6rem; color: var(--ink); letter-spacing: 0; line-height: 1.45; }
.brand small { font-size: var(--text-caption); letter-spacing: .04em; color: var(--muted); }
.workspace-name { font-size:max(12px,.8125rem); margin: .9rem 0 1.1rem; padding: .7rem .6rem; }
.workspace-name small { font-size:max(12px,.75rem); color:var(--muted); }
.workspace-icon { width: 2rem; height: 2rem; }
.nav-caption { font-size:max(12px,.75rem); color:var(--muted); margin-bottom: .5rem; }
.sidebar nav { min-height: 0; overflow-y: auto; flex: 1 1 auto; scrollbar-width: thin; scrollbar-color: #648f80 transparent; }
.nav-item { font-size: .9375rem; padding: .65rem .75rem; min-height: 2.75rem; gap: .7rem; margin-bottom: .3rem; }
.nav-item .icon { width: 1.15rem; height: 1.15rem; }
.nav-item.active { background: var(--active); color: var(--ink); box-shadow: none; font-weight: 600; }
.nav-caption.secondary { margin-top: .85rem; }
.sidebar-bottom { padding-top: .35rem; flex-shrink: 0; }
.local-status { font-size:max(12px,.75rem); color:var(--muted); padding: .7rem .4rem; white-space: normal; }
.sidebar-user { padding: .85rem .2rem 1rem; }
.sidebar-user .user-meta strong { font-size: .875rem; }
.sidebar-user .user-meta small { font-size:max(12px,.75rem); color:var(--muted); }
.shell { margin-left: var(--sidebar-width); min-width: 0; }
/* The section navigation reserves this header's height on every screen width. */
.topbar { position: sticky; top: 0; z-index: 20; min-height: 3.5rem; height: auto; padding: .65rem clamp(1rem, 2.2vw, 2.5rem); gap: 1rem; }
.breadcrumb { font-size: .875rem; gap: .6rem; min-width: 0; }
.breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { gap: .5rem; flex-shrink: 0; }
.today { font-size:max(12px,.8125rem); color: var(--muted); }
.topbar-divider { margin: 0 .5rem; }
.main { width: 100%; max-width: 90rem; padding: 1.3rem clamp(1rem, 2.2vw, 2.5rem) 0; }
.page-heading { align-items: flex-start; margin-bottom: 1.2rem; }
.page-heading h1, .page-heading.compact h1 { font-size: 1.625rem; line-height: 1.5; }
.page-heading p { font-size: .9375rem; line-height: 1.8; color: var(--muted); }
.page-heading > .button { font-size: .9375rem; min-height: 2.75rem; flex-shrink: 0; }

.panel { border-radius: var(--radius-panel); margin-bottom: 1.35rem; box-shadow: var(--shadow); }
.panel-heading { padding: 1.1rem 1.25rem; flex-wrap: wrap; }
.panel-heading h2 { font-size: 1.0625rem; }
.panel-heading p, .panel-heading > .muted { font-size:max(12px,.8125rem); color: var(--muted); }
.search-field { min-height: 3.6rem; padding: .5rem; border-radius: .75rem; gap: .65rem; }
.search-field > .icon { margin-left: .5rem; }
.search-field input { font-size: 1rem; min-height: 2.75rem; }
.search-field kbd { font-family: inherit; font-size:max(12px,.75rem); color: var(--muted); }
.search-field .button { font-size: .9375rem; min-height: 2.75rem; padding: .55rem 1rem; }
.search-hints { flex-wrap: wrap; gap: .55rem 1.25rem; font-size:max(12px,.8125rem); }
.search-hints > span { color: var(--muted); }
.metrics { gap: 1rem; }
.metric { padding: 1.15rem 1.2rem; border-radius: var(--radius-panel); transition: box-shadow .2s, border-color .2s; }
.metric:hover { box-shadow: none; }
.metric-top { font-size: .9375rem; gap: .5rem; }
.metric-value { font-size: 1.7rem; font-weight: 600; }
.metric-value small, .metric p { font-size:max(12px,.8125rem); white-space: normal; }
.kind-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.kind-card { padding: 1rem; gap: .7rem; border-radius: .7rem; }
.kind-card strong { font-size: .9375rem; white-space: normal; }
.kind-card small { font-size:max(12px,.8125rem); color: var(--muted); white-space: normal; }
.kind-card .type-icon { width: 2.35rem; height: 2.5rem; }
.dashboard-middle { grid-template-columns: minmax(0, 1.6fr) minmax(17rem, 1fr); gap: 1.1rem; }
.chart-layout { align-items: stretch; padding: .5rem 1.2rem 1rem; flex-direction: column; }
.chart-summary { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; padding: 0; }
.chart-summary > span, .chart-summary small, .legend { font-size:max(12px,.8125rem); color: var(--muted); }
.chart-summary strong { font-size: 1.9rem; margin: 0; }
.chart-summary .legend { margin: 0; }
.trend-chart { width: 100%; height: auto; max-height: none; aspect-ratio: 520/195; }
.chart-label, .chart-number { font-size: 20px; fill: #526d60; }
.task-item { margin: 0 1.15rem; padding: .8rem 0; gap: .65rem; }
.task-item strong { font-size: .9375rem; }
.task-item small { font-size:max(12px,.8125rem); color: var(--muted); }
.task-item > b { font-size: 1.2rem; }
.local-note { font-size:max(12px,.75rem); color: #61796a; white-space: normal; margin: .8rem 1.15rem; }
.table-wrap { max-width: 100%; overscroll-behavior-inline: contain; }
table { font-size: .9375rem; }
th { font-size:max(12px,.8125rem); color: #5f7569; padding: .8rem .9rem; }
td, .records-table td { font-size: .9375rem; color: #3f5c4c; padding: 1rem .9rem; }
.records-table { min-width: 48rem; }
.records-table th:first-child { width: 36%; }
.record-title { min-width: 16rem; align-items: flex-start; }
.title-link { font-size: 1rem; max-width: none; -webkit-line-clamp: unset; overflow: visible; overflow-wrap: anywhere; }
.record-title small { font-size:max(12px,.8125rem); color: var(--muted); max-width: none; overflow-wrap: anywhere; }
.authors-short, .type-label { font-size: .875rem; }
.badge, .tag, .material-status, .plain-pill { font-size: var(--text-caption); line-height: 1.6; white-space: nowrap; flex: none; }
.table-scroll-note { color: var(--muted); font-size:max(12px,.75rem); padding: .2rem 1.2rem .65rem; }
.filters, .people-filter { padding: 1.15rem 1.25rem; }
.filter-first { flex-wrap: wrap; }
.filter-first input, .filter-first select, .filter-more select, .filter-more input { font-size: .9375rem; min-width: 0; }
.search-scope { font-size: .875rem; gap: .7rem 1.1rem; }
.search-scope select { width: auto; max-width: 100%; font-size: .875rem; min-height: 2.5rem; }
.search-scope small { font-size:max(12px,.75rem); color: var(--muted); }
.info-panel, .form-panel { padding: 1.25rem 1.4rem; }
.form-grid { gap: 1.2rem 1.5rem; }
.account-form h2 { margin-bottom: .65rem; }
.profile-form-section { margin-top: 1.75rem; }
.profile-form-section .panel-heading { padding: 0 0 1rem; flex-wrap: wrap; gap: .75rem; }
.profile-form-section [data-field="english_name"], .profile-form-section [data-field="aliases"], .profile-form-section [data-field="bio"] { grid-column: 1 / -1; }
.profile-form-section > .help { margin-top: .65rem; }
.account-form > h2:not(:first-of-type), .account-form > [data-new-member] { margin-top: 1.75rem; }
.account-form .help + .form-grid, .account-form > p + .form-grid { margin-top: 1rem; }
.field > label, .form-row .field > label { font-size: .9375rem !important; color: #3a574a; }
.field .help, .help, .field > small, .inline-note, .section-title small { font-size:max(12px,.8125rem); line-height: 1.85; color: var(--muted); }
.field input, .field select, .field textarea, .form-row input, .form-row select { font-size: 1rem; }
.section-title { gap: .65rem; flex-wrap: wrap; }
.section-title h2 { font-size: 1.1rem; }
.form-row { padding: 1rem; border-radius: .6rem; }
.credit-form-row { grid-template-columns: minmax(0, 1.4fr) minmax(4.5rem, .5fr) minmax(0, 1fr) 2.75rem; gap: .85rem; }
.credit-form-row > .field { grid-column: auto; grid-row: auto; }
.credit-form-row > .field:first-of-type { grid-column: 1; }
.credit-form-row > .credit-checks { grid-column: 1 / 3; grid-row: auto; flex-direction: row; flex-wrap: wrap; gap: .5rem 1rem; }
.credit-form-row > .field:has([name$="-affiliation"]) { grid-column: 3; }
.credit-form-row > .remove-form-row { grid-column: 4; grid-row: 1; }
.credit-checks label { font-size: .875rem; }
.link-form-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 2.75rem; gap: .85rem; }
.remove-form-row { min-width: 2.5rem; min-height: 2.75rem; }
.sticky-actions { padding: .8rem 1.2rem; bottom: 1rem; box-shadow: 0 4px 14px rgb(23 61 47 / 8%); }
.sticky-actions .button { min-height: 2.75rem; font-size: .9375rem; }
.info-grid dt, .side-info > span, .detail-meta, .workflow small { font-size:max(12px,.8125rem); color: var(--muted); }
.info-grid dd, .summary-block p, .credit-name > a, .attachment-name > strong { font-size: 1rem; }
.detail-heading h1 { font-size: 1.5rem; overflow-wrap: anywhere; }
.detail-layout { grid-template-columns: minmax(0, 1fr) minmax(17rem, .4fr); }
.detail-meta { flex-wrap: wrap; }
.attachment-name > div, .attachment-name > small, .hash-details { font-size:max(12px,.75rem); color: var(--muted); }
.attachment-name { min-width: 0; }
.file-actions { flex-wrap: wrap; }
.people-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.person-card { padding: 1.2rem; }
.person-card h2 { font-size: 1.25rem; }
.person-card h2 small, .person-card > p, .person-card-foot { font-size:max(12px,.8125rem); }
.person-card .tag { font-size:max(12px,.75rem); }
.report-summary { gap: 1rem; }
.report-summary p, .table-footnote, .role-grid p, .principles li, .restore-steps { font-size: .875rem; line-height: 1.85; }
.footer { font-size:max(12px,.75rem); color: var(--muted); padding: 1.25rem 0; gap: .5rem; flex-wrap: wrap; }
.demo-strip, .archive-note { font-size:max(12px,.8125rem); line-height: 1.8; }
.doi-query { gap: .7rem; padding: 0 1.25rem 1rem; }
.doi-query input { font-size: 1rem; }
.doi-message, .doi-authors { font-size: .875rem; line-height: 1.9; }
.doi-field-options { gap: .7rem; }
.doi-field-options > label { padding: .85rem; min-width: 0; align-items: flex-start; }
.doi-field-options > label > span { min-width: 0; }
.doi-field-options strong { font-size: .9375rem; }
.doi-proposed-value { font-size: .9375rem; max-height: 16rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.doi-field-options small { font-size:max(12px,.75rem); line-height: 1.8; color: var(--muted); }
.doi-field-options label:has([data-doi-field="summary"]) { grid-column: 1/-1; }
.doi-missing { grid-column: 1/-1; padding: .85rem 1rem; border: 1px dashed #ccdcd1; border-radius: .55rem; font-size: .875rem; color: var(--muted); background: #fafcf9; }
.doi-source-label { display: block; margin: .25rem 0; color: #396c58 !important; }
.doi-warning { margin-top: .5rem; color: #8b672c; }
.doi-result-footer { flex-wrap: wrap; gap: .8rem; }
.doi-result-footer small { font-size:max(12px,.8125rem); }
.doi-authors p, .doi-proposed-value, .doi-message { overflow-wrap: anywhere; }
.document-name { font-size: 1.6rem !important; }
.document-layout { grid-template-columns: minmax(0, 1.3fr) minmax(20rem, 1fr); gap: 1.25rem; }
.recognized-text, .text-preview { font: 1rem/1.95 var(--font-ui); max-height: 75vh; }
.document-state p, .preview-toolbar > strong, .text-correction, .processing-actions > p { font-size: .9375rem; }
.page-selector, .preview-pagination, .recognition-note, .reviewed-text, .text-correction form > p { font-size:max(12px,.8125rem); }
.page-selector input { font-size: .9375rem; width: 4rem; min-height: 2.5rem; height: auto; }
.page-selector .button { min-height: 2.5rem; font-size: .875rem; }
.text-correction textarea { font-size: 1rem; }
.preview-toolbar { flex-wrap: wrap; }
.preview-canvas { min-height: 20rem; padding: 1rem; }
.profile-document { font-family: var(--font-ui); }
.reading-preferences { position: relative; z-index: 60; }
.reading-preferences > summary { list-style: none; display: flex; align-items: center; gap: .35rem; cursor: pointer; min-height: 2.5rem; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: .5rem; font-size:max(12px,.8125rem); background: #fff; color: #466656; }
.reading-preferences > summary::-webkit-details-marker { display: none; }
.reading-symbol { font-size: 1.1rem; font-weight: 650; }
.reading-popover { position: absolute; right: 0; top: calc(100% + .55rem); width: min(18rem, calc(100vw - 2rem)); padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: .7rem; box-shadow: 0 12px 35px rgb(20 54 41 / 15%); }
.reading-popover > strong { font-size: .9375rem; }
.reading-choices { display: flex; gap: .4rem; margin: .8rem 0; }
.reading-choices button { flex: 1; min-width: 0; min-height: 2.75rem; font-size: .875rem; border: 1px solid var(--line); border-radius: .4rem; background: #f7faf7; color: var(--ink); }
.reading-choices button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: #eaf5ee; box-shadow: inset 0 0 0 1px var(--primary); }
.reading-popover p { font-size:max(12px,.75rem); line-height: 1.8; color: var(--muted); }
.sidebar-close, .nav-scrim { display: none; }
.login-form-side { position: relative; padding: 5rem 2.5rem 2rem; }
.login-preferences { position: absolute; top: 1.5rem; right: 1.5rem; }
.login-form-wrap { width: 100%; max-width: 26rem; }
.login-form-wrap h2 { font-size: 1.65rem; }
.login-form-wrap > p, .login-mini-label, .login-help, .login-offline, .demo-login, .demo-login span { font-size: .875rem; line-height: 1.85; }
.login-form-wrap .field > label { font-size: 1rem; }
.login-story h1 { font-size: 2rem; }
.login-story p, .login-story-foot { font-size: .9375rem; }
@media (min-width: 112em) { .kind-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 100em) { .today, .topbar-divider { display: none; } .document-layout, .detail-layout { grid-template-columns: minmax(0, 1fr); } .detail-aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; } }
@media (max-width: 74.99em) {
  .shell { margin-left: 0; }
  .sidebar { width: min(18rem, calc(100vw - 3rem)); transform: translateX(-105%); transition: transform .2s; z-index: 80; }
  .nav-open .sidebar { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .sidebar-close { display: inline-flex; position: absolute; top: 1rem; right: .5rem; color: var(--ink); }
  .sidebar .brand { padding-right: 2rem; }
  .nav-open { overflow: hidden; }
  .nav-scrim:not([hidden]) { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; border: 0; background: rgb(9 31 24 / 30%); }
  .breadcrumb > span:first-of-type, .breadcrumb > .icon { display: none; }
  .dashboard-middle { grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr); }
}
@media (max-width: 59.99em) {
  .metrics, .report-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-middle, .report-bottom, .document-layout, .detail-layout, .import-layout, .backup-guide { grid-template-columns: minmax(0,1fr); }
  .kind-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .form-grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-first { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-first > * { width: 100%; min-width: 0; }
  .filter-first > .filter-search { grid-column: 1/-1; }
  .form-panel { padding: 1.15rem; }
  .login-layout { grid-template-columns: 1fr; }
  .login-story { min-height: auto; padding: 1.5rem 2rem; }
  .login-story-main { margin: 1rem 0; padding: 0; }
  .login-story h1 { font-size: 1.75rem; }
  .login-story p, .archive-illustration, .login-story-foot { display: none; }
  .login-form-side { min-height: auto; padding: 5rem 1.5rem 1.5rem; }
}
@media (max-width: 43.74em) {
  .reading-preferences:not(.login-preferences) .reading-popover { position: fixed; top: 4.25rem; right: 1rem; width: calc(100vw - 2rem); }
  .login-preferences .reading-popover { right: -.5rem; }
  .topbar { padding: .55rem .8rem; gap: .3rem; }
  .topbar-right { gap: .1rem; }
  .breadcrumb { gap: .2rem; font-size:max(12px,.8125rem); }
  .reading-label { display: none; }
  .reading-preferences > summary { padding: .25rem .5rem; }
  .topbar-right > .icon-button { display: none; }
  .main { padding: 1.2rem .85rem 0; }
  .page-heading { gap: .8rem; flex-wrap: wrap; }
  .page-heading h1, .page-heading.compact h1 { font-size: 1.5rem; }
  .page-heading p { font-size: .875rem; }
  .page-heading > .button { margin-left: 0; }
  .metrics { gap: .65rem; }
  .metric { padding: .85rem .8rem; }
  .metric-top { font-size:max(12px,.8125rem); }
  .metric-icon { width: 1.7rem; height: 1.7rem; }
  .metric-value { font-size: 2rem; }
  .metric p { font-size:max(12px,.75rem); }
  .kind-grid, .report-kinds { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .kind-card { padding: .8rem .65rem; gap: .45rem; }
  .kind-card > .icon { display: none; }
  .kind-card strong { font-size: .875rem; }
  .kind-card small { font-size:max(12px,.75rem); }
  .kind-card .type-icon { width: 1.8rem; height: 2.1rem; }
  .panel-heading { padding: 1rem; gap: .6rem; }
  .panel-heading h2 { font-size: 1.0625rem; }
  .search-field { gap: .3rem; padding: .35rem; }
  .search-field kbd { display: none; }
  .search-field input { font-size: 1rem; padding: .3rem; }
  .search-field .button { padding: .5rem .65rem; }
  .search-field .button .icon { display: none; }
  .search-hints { font-size:max(12px,.75rem); gap: .4rem .85rem; }
  .chart-summary { gap: .3rem .7rem; }
  .chart-summary small { width: 100%; }
  .chart-label, .chart-number { font-size: 25px; }
  .records-table th, .records-table td { display: table-cell !important; }
  .form-grid, .form-grid.three, .info-grid, .detail-aside, .role-grid, .settings-shortcuts, .profile-filter, .doi-field-options { grid-template-columns: minmax(0,1fr); }
  .form-grid { gap: 1rem; }
  .form-panel, .info-panel { padding: 1rem; }
  .credit-form-row { grid-template-columns: minmax(0,1fr) minmax(4rem,.45fr) 2.5rem; }
  .credit-form-row > .field:first-of-type { grid-column: 1; }
  .credit-form-row > .credit-checks { grid-column: 1/3; }
  .credit-form-row > .field:has([name$="-affiliation"]) { grid-column: 1/3; }
  .credit-form-row > .remove-form-row { grid-column: 3; }
  .link-form-row { grid-template-columns: minmax(0,1fr) 2.5rem; }
  .link-form-row > .field { grid-column: 1; }
  .link-form-row > .remove-form-row { grid-column: 2; grid-row: 1; }
  .sticky-actions { bottom: .5rem; padding: .7rem .8rem; }
  .doi-query { flex-wrap: wrap; padding: 0 1rem 1rem; }
  .doi-query input { flex-basis: 100%; }
  .doi-message, .doi-result { padding-left: 1rem; padding-right: 1rem; }
  .doi-result-footer > .button { width: 100%; }
  .people-grid { grid-template-columns: minmax(0,1fr); }
  .person-profile { padding: 1rem; }
  .person-profile > div { min-width: 0; }
  .person-profile > .button { margin-left: 0; }
  .attachment-row { flex-wrap: wrap; }
  .attachment-name { flex-basis: calc(100% - 3rem); }
  .file-actions { flex-basis: 100%; flex-direction: row; justify-content: flex-end; }
  .preview-toolbar, .preview-pagination { padding: .85rem; }
  .preview-canvas { padding: .5rem; min-height: 12rem; }
  .page-selector { flex-wrap: wrap; }
  .footer > span { max-width: 100%; }
  .login-story { padding: 1.3rem; }
  .login-form-wrap h2 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .button { transition: none; } .button:hover { transform: none; } }

.annual-trend { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .5rem; margin: .7rem 0 .1rem; }
.annual-column { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: .2rem; }
.annual-total { font-size: 1.1rem; color: #41624f; font-variant-numeric: tabular-nums; }
.annual-bar { width: 100%; max-width: 4.5rem; height: 8rem; fill: #aacbb8; }
.annual-bar.latest { fill: #38745a; }
.annual-baseline { fill: none; stroke: #d8e7dc; stroke-width: 1; }
.annual-year { font-size:max(12px,.8125rem); color: #5b7264; font-variant-numeric: tabular-nums; }
@media (max-width:43.74em) { .credit-form-row > .field:has([name$="-role"]) { grid-column: 1/3; } }

/* Shared task surfaces: readable states, quiet navigation and one set of controls. */
::selection { color: var(--ink); background: #d9eee4; }
input, textarea { caret-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input, select, textarea { border-color: var(--control); }
button:disabled, .button:disabled { opacity: 1; color: var(--muted); background: var(--neutral-bg); border-color: var(--line); cursor: not-allowed; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: var(--neutral-bg); opacity: 1; }
button, a { text-underline-offset: .2em; }
.button, .button.small, .page-heading > .button, .filter-first .button { min-height: 44px; border-radius: var(--radius-control); }
.button:active { background: var(--active); }
.button.primary:active { background: var(--primary-dark); }
.button.subtle { color: var(--ink); background: var(--neutral-bg); border-color: var(--line); }
.button.danger-subtle { color: var(--negative-ink); background: transparent; }
.icon-button { min-width: 44px; min-height: 44px; color: var(--muted); }
.text-link { font-size: max(14px, .875rem); }
.sidebar { color: var(--ink); }
.nav-item, .nav-item .icon, .sidebar-user .logout { color: var(--muted); }
.nav-item.active .icon { color: var(--primary); }
.sidebar-user .user-meta strong { color: var(--ink); }
.sidebar-user .user-meta small, .workspace-name small { color: var(--muted); }
.sidebar .nav-caption { letter-spacing: 0; }
.brand-mark .icon { width: 27px; height: 27px; }
.brand > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.brand small { margin-top: .2rem; }
.topbar { background: var(--bg); }
.page-heading p { max-width: none; }
.page-heading .button-group { justify-content: flex-end; }
.panel, .metric { box-shadow: none; }
.panel { border-radius: var(--radius-panel); }
.panel-heading h2, .section-title h2 { color: var(--ink); font-weight: 600; }
.info-panel > .panel-heading { padding: 0 0 1rem; }
.green, .blue, .purple, .amber, .type-icon, .type-pill, .tag, .purple-tag { color: var(--muted); background: var(--neutral-bg); }
.type-icon.paper, .type-icon.patent, .type-icon.software, .type-icon.thesis, .type-icon.vertical, .type-icon.horizontal, .type-icon.award { color: var(--muted); background: transparent; }
.type-pill.paper, .type-pill.patent, .type-pill.software, .type-pill.thesis, .type-pill.vertical, .type-pill.horizontal, .type-pill.award { color: var(--ink); background: var(--neutral-bg); }
.record-title .type-icon { width: 20px; height: 26px; }
.badge.ready, .badge.success { color: var(--positive-ink); background: var(--positive-bg); }
.badge.processing, .badge.running, .badge.queued { color: var(--info-ink); background: var(--info-bg); }
.badge.failed, .badge.needs_ocr { color: var(--negative-ink); background: var(--negative-bg); }
.badge.partial, .badge.unsupported, .badge.superseded, .badge.withdrawn { color: var(--neutral-ink); background: var(--neutral-bg); }
.message.error, .field-error, .error-text, .required { color: var(--negative-ink); }
.message.error { background: var(--negative-bg); border-color: #e9c6c0; }
.message.warning, .missing-note, .doi-warning { color: var(--warning-ink); background: var(--warning-bg); }
.message.info { color: var(--info-ink); background: var(--info-bg); }
.tag, .plain-pill { color: var(--muted); background: var(--neutral-bg); }
.material-status, .badge { font-variant-numeric: tabular-nums; }
.positive { color: var(--positive-ink); }
.search-field { box-shadow: none; min-height: 3rem; border-color: var(--control); }
.hero-search { margin-bottom: 1.1rem; }
.overview-metrics { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; margin-bottom: 1.2rem; }
.overview-metrics .metric { border: 0; border-right: 1px solid var(--line); border-radius: 0; margin: 0; padding: .85rem 1.1rem; }
.overview-metrics .metric:last-child { border-right: 0; }
.overview-metrics .metric:hover { background: var(--bg); }
.overview-metrics .metric-value { margin-top: .1rem; color: var(--ink); }
.overview-metrics .metric p { color: var(--muted); margin-top: .2rem; }
.overview-kind-links { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.overview-kind-links a { display: inline-flex; gap: .5rem; align-items: center; min-height: 44px; font-size: .9375rem; }
.overview-kind-links a:hover { color: var(--primary); text-decoration: underline; }
.overview-kind-links span { color: var(--muted); font-variant-numeric: tabular-nums; }
.overview-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .42fr); gap: 1.2rem; align-items: start; }
.recent-list { padding: 0 1.25rem; }
.recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.recent-row > a { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.recent-row > a:hover { color: var(--primary); text-decoration: underline; }
.recent-row .badge { align-self: start; }
.recent-meta { grid-column: 1/-1; color: var(--muted); font-size: var(--text-meta); display: flex; gap: .35rem 1rem; flex-wrap: wrap; }
.recent-meta span { overflow-wrap: anywhere; }
.recent-empty { padding: 1rem 0 1.5rem; }
.task-item { padding: .8rem 0; gap: .8rem; }
.task-item > .icon:first-child { color: var(--muted); width: 18px; height: 18px; }
.task-item > b { font-variant-numeric: tabular-nums; color: var(--ink); }
.task-item small { max-width: none; overflow-wrap: anywhere; }
.overview-trend .chart-layout { display: grid; grid-template-columns: minmax(12rem, .7fr) minmax(0, 2fr); align-items: center; gap: 1.5rem; }
.overview-trend .chart-summary { display: block; }
.overview-trend .chart-summary small { white-space: normal; }
.overview-trend .annual-bar { height: 6rem; }
.overview-trend .annual-trend { margin: 0; }
th { background: var(--surface); border-top: 0; letter-spacing: 0; }
td.numeric, th.numeric { text-align: right; }
th, td { overflow-wrap: anywhere; }
.table-wrap:has(> .responsive-records) { max-height: 72vh; overflow: auto; scrollbar-color: #8d9f95 var(--bg); }
.responsive-records th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.responsive-records td { padding-top: .8rem; padding-bottom: .8rem; }
.library-table { min-width: 42rem; }
.mobile-row-action { display: none; }
.title-link { color: var(--ink); }
.filter-form { padding: 1.1rem 1.25rem 0; }
.filter-first { gap: .6rem; }
.filter-first input, .filter-first select { height: auto; min-height: 44px; }
.filter-first > .filter-search { flex: 2 1 17rem; }
.filter-first > select { flex: 1 1 7rem; width: auto; }
.advanced-filters { color: var(--muted); margin-top: .7rem; }
.advanced-filters summary { min-height: 44px; }
.advanced-filters summary > span { font-size: var(--text-meta); }
.advanced-filters .search-scope { margin: .7rem 0 1rem; }
.search-scope select { min-height: 44px; }
.filter-more label { min-width: 0; }
.library-tabs { border-bottom: 1px solid var(--line); gap: 1.3rem; }
.library-tabs .button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .6rem 0; box-shadow: none; background: transparent; color: var(--muted); }
.library-tabs .button.primary { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.library-tabs .button:hover { color: var(--ink); background: transparent; }
.library-title { color: var(--ink); font-size: 1rem; }
.library-meta { font-size: var(--text-meta); }
.directory-card-foot { font-size: var(--text-meta); }
.directory-section-links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); background: transparent; border-color: var(--line); }
.directory-section-links a:hover { color: var(--primary); border-color: var(--control); }
.directory-cohort-title { font-size: .9375rem; color: var(--ink); }
.directory-cohort-title small { color: var(--muted); }
.detail-heading { gap: 1.2rem; }
.detail-heading > div:first-child { min-width: 0; }
.detail-heading .title-en { max-width: none; font-size: 1rem; color: var(--muted); overflow-wrap: anywhere; }
.detail-layout, .detail-main, .detail-aside { min-width: 0; }
.record-actions { padding: 1.1rem 1.3rem; overflow: visible; }
.archive-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1.2rem; }
.archive-progress h2 { grid-column: 1; font-size: 1.0625rem; }
.archive-progress > form { grid-column: 2; grid-row: 1/3; align-self: center; }
.archive-progress > details, .archive-progress > p { grid-column: 1/-1; }
.record-actions .workflow { grid-column: 1; display: flex; gap: .65rem 1.2rem; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.record-actions .workflow li { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: .5rem; font-size: var(--text-meta); color: var(--muted); }
.record-actions .workflow li::before { content: ''; position: static; display: block; width: 7px; height: 7px; flex: none; border: 0; border-radius: 50%; background: var(--control); }
.record-actions .workflow li.done { color: var(--positive-ink); }
.record-actions .workflow li.done::before { background: var(--positive-ink); }
.record-actions .workflow small { display: none; }
.record-actions .review-panel { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.record-actions .review-panel h2 { margin: 0 0 .8rem; }
.record-actions .review-panel form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.review-field { min-width: 0; }
.review-field label { display: block; font-size: .9375rem; margin-bottom: .5rem; }
.review-field textarea { margin: 0; width: 100%; }
.review-buttons { grid-column: 1/-1; display: flex; gap: .7rem; flex-wrap: wrap; }
.review-buttons .button { width: auto; margin: 0; }
.record-section-nav { position: sticky; top: 0; z-index: 10; display: flex; gap: .3rem 1rem; align-items: center; overflow-x: auto; padding: .45rem 0; margin: 0 0 1.2rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.record-section-nav a { display: inline-flex; align-items: center; white-space: nowrap; min-height: 44px; color: var(--muted); font-size: .875rem; }
.record-section-nav a:first-child { color: var(--primary); font-weight: 600; }
.record-section-nav a:hover { color: var(--primary); text-decoration: underline; }
#record-actions, #record-info, #record-people, #checklist, #materials, #record-history, .material-check-item { scroll-margin-top: 6rem; }
/* Narrative fields use the full content column; short labels and raw OCR keep their own layout. */
.summary-block p, .prose-text {
  max-width: none;
  text-align: justify;
  text-align-last: start;
  text-justify: auto;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: normal;
}
.summary-block p, .profile-bio.prose-text, .library-summary.prose-text { width: 100%; }
.file-history { margin: 1rem 0; border-top: 1px solid var(--line); }
.file-history > summary { padding: .75rem 0; min-height: 44px; color: var(--muted); cursor: pointer; }
.file-history .attachment-row { background: var(--bg); padding: 1rem; }
.attachment-name > strong { color: var(--ink); overflow-wrap: anywhere; }
.file-actions { align-items: center; gap: .4rem; }
.file-actions .text-link { min-height: 44px; }
.material-check-item > p { margin: .7rem 0; }
.material-check-item > details > summary { min-height: 44px; cursor: pointer; }
.requirement-upload-note, .replacement-note { border: 1px solid var(--line); padding: .8rem; border-radius: var(--radius-control); background: var(--neutral-bg); display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.requirement-upload-note span, .replacement-note span { flex: 1; min-width: 12rem; }
.info-grid dd { overflow-wrap: anywhere; }
.form-panel { border-radius: var(--radius-panel); }
.section-title { border-bottom: 1px solid var(--line); padding-bottom: .9rem; margin-bottom: 1.1rem; }
.sticky-actions { z-index: 15; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-panel); flex-wrap: wrap; gap: .7rem; bottom: max(.6rem, env(safe-area-inset-bottom)); }
.bundle-summary, .profile-document-title { color: var(--ink); background: var(--neutral-bg); }
.bundle-summary strong, .bundle-summary span, .bundle-download small { color: var(--ink); }
.login-story { background: var(--rail); color: var(--ink); }
.login-story .brand, .login-story h1 { color: var(--ink); }
.login-story p, .login-story-foot { color: var(--muted); }
.login-story-main { margin: auto 0; }
.login-form-wrap h2 { font-size: 1.5rem; }
.login-form-wrap .field { margin-bottom: 1rem; }
.login-form-wrap .button { min-height: 48px; }
.footer { margin-top: 1.5rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
@media (max-width: 59.99em) {
  .overview-metrics .metric:nth-child(2) { border-right: 0; }
  .overview-metrics .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .overview-work { grid-template-columns: minmax(0, 1fr); }
  .overview-work .task-panel { order: -1; }
  .overview-work .task-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-first > .filter-search { grid-column: 1/-1; }
  .page-heading .button-group { justify-content: flex-start; }
  .page-heading { flex-wrap: wrap; }
}
@media (max-width: 47.99em) {
  .overview-trend .chart-layout { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .overview-trend .chart-summary { display: flex; }
  .overview-work .task-rows { grid-template-columns: minmax(0, 1fr); }
  .table-wrap:has(> .responsive-records) { max-height: none; overflow: visible; }
  .responsive-records { display: block; min-width: 0; width: 100%; }
  .responsive-records thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .responsive-records tbody { display: block; }
  .responsive-records tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1rem; padding: 1rem; border-bottom: 1px solid var(--line); }
  .responsive-records tbody > tr:last-child { border-bottom: 0; }
  .responsive-records td { display: block !important; min-width: 0; padding: 0 !important; border: 0; white-space: normal; }
  .responsive-records td::before { content: attr(data-label); display: block; color: var(--muted); font-size: var(--text-caption); margin-bottom: .2rem; }
  .responsive-records td:first-child, .responsive-records td:last-child, .responsive-records td[colspan] { grid-column: 1/-1; }
  .responsive-records td:first-child::before, .responsive-records td:last-child::before, .responsive-records td[colspan]::before { content: none; }
  .responsive-records td.numeric { text-align: left; }
  .responsive-records td:last-child { display: flex !important; justify-content: flex-end; }
  .responsive-records td[colspan] { display: block !important; }
  .responsive-records .record-title { min-width: 0; }
  .responsive-records .title-link { max-width: none; -webkit-line-clamp: unset; overflow: visible; overflow-wrap: anywhere; }
  .responsive-records .record-title small { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .mobile-row-action { display: inline; font-size: .875rem; color: var(--primary); margin-left: .25rem; }
  .archive-progress { grid-template-columns: minmax(0, 1fr); }
  .archive-progress > form { grid-column: 1; grid-row: auto; }
  .record-actions .review-panel form { grid-template-columns: minmax(0, 1fr); }
  .record-actions { padding: 1rem; }
  .record-section-nav { gap: 1rem; }
  .record-section-nav a { font-size: max(14px, .875rem); }
  .file-actions { justify-content: flex-start; }
  .library-table td:last-child .text-link { min-height: 44px; }
  .library-tabs { gap: .6rem 1rem; }
  .page-heading .button-group { width: 100%; }
  .page-heading .button-group .button { white-space: normal; }
}
@media (max-width: 32em) {
  .recent-row { grid-template-columns: minmax(0, 1fr); }
  .recent-row .badge { justify-self: start; }
  .advanced-filters summary > span { display: none; }
  .search-scope { align-items: stretch; }
  .search-scope label, .search-scope select { width: 100%; }
}
@media (pointer: coarse) {
  .text-link, .directory-section-links a { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* 2.11.1: verified on the live site at desktop, tablet and phone widths. */
.record-section-nav { top: var(--topbar-height, 4rem); }
#record-actions, #record-info, #record-people, #checklist, #materials, #record-history, .material-check-item {
  scroll-margin-top: calc(var(--topbar-height, 4rem) + 5.5rem);
}
.filter-actions { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
.filter-actions .button { white-space: nowrap; }
.search-scope, .filter-more label, .list-toolbar > span,
.report-summary > div > span, .report-summary p, .report-summary small,
.kind-count > span:not(.type-icon), .table-footnote, .member-stat small,
.principles li, .shortcut p, .role-grid p, .document-metrics span,
.document-record-title, .document-note, .empty-state p,
.title-type, .credit-checks label { color: var(--muted); }
.report-summary strong, .kind-count > strong, .member-stat > span:not(.avatar),
.member-stat > strong, .shortcut h2, .empty-state h3 { color: var(--ink); }
.avatar.pale { color: var(--ink); }
.main .back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
  min-height: 44px;
  padding: .6rem 1rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius-control);
  background: var(--positive-bg);
  color: var(--primary-dark);
  font-size: max(14px, 1rem);
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.main .back-link .icon { width: 1.125rem; height: 1.125rem; min-width: 20px; }
.main .back-link:hover { background: var(--active); border-color: var(--primary-dark); color: var(--primary-dark); }
.main .back-link:active { background: #d1e1d7; }
.main .back-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.page-heading .back-link { margin-bottom: 0; flex-shrink: 0; }
.type-picker a { color: var(--muted); }
.type-picker a.selected { color: var(--primary); }
.summary-block h3, .timeline-item strong, .upload-box > summary,
.upload-dropzone > strong { color: var(--ink); }
.summary-block p, .credit-order, .credit-name small, .tag.neutral,
.attachment-name .version, .attachment-name .current-version, .hash-details code,
.timeline-item p, .timeline-item p > span, .timeline-item small,
.upload-dropzone .upload-feedback, .document-state p, .page-selector,
.preview-pagination, .recognition-note, .text-correction,
.text-correction form > p, .processing-actions > p { color: var(--muted); }
.report-summary strong small { color: var(--muted); }
.side-info strong { color: var(--ink); }
.search-hints a, .advanced-filters summary > span, .list-toolbar small { color: var(--muted); }
@media (max-height: 53.125em) {
  .sidebar { padding-top: .75rem; }
  .sidebar .brand { margin-bottom: .75rem; }
  .sidebar .workspace-name, .sidebar .local-status, .sidebar .nav-caption { display: none; }
  .sidebar .nav-item { min-height: 44px; padding: .4rem .75rem; margin-bottom: .1rem; }
  .sidebar-user { padding: .5rem .2rem; }
}
@media (max-width: 59.99em) {
  .filter-first > .filter-actions { grid-column: 1/-1; justify-content: flex-end; }
}
@media (max-width: 32em) {
  .search-scope > label:first-child { flex-direction: column; align-items: stretch; gap: .35rem; }
  .filter-first > .filter-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
