:root {
  color-scheme: light;
  --ink: #1d2c24;
  --muted: #586961;
  --line: #dce4df;
  --accent: #315c49;
  --accent-dark: #214334;
  --accent-soft: #ebf2ed;
  --surface: #fff;
  --paper: #f5f7f4;
  --content: 1100px;
  --font-body: 'Science Hub Rubik', 'Science Hub Songgu', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  --font-title: 'Science Hub Rubik Display', 'Science Hub Zhizao', var(--font-body);
  font: 15px/1.55 var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { display: flex; flex-direction: column; height: 100dvh; min-height: 0; margin: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #487965;
  outline-offset: 2px;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
h1, h2, h3, .brand {
  font-family: var(--font-title);
  font-weight: 400;
  font-synthesis: none;
}
h1 { margin: 0; line-height: 1.26; overflow-wrap: anywhere; }
h1[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.icon { display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 auto; }

.topbar {
  height: 68px; padding: 0 32px; display: flex; align-items: center; gap: 21px; background: white;
  border-bottom: 1px solid var(--line); flex: none;
}
body:has(.collection) .topbar { padding-inline: max(24px, calc((100% - var(--content)) / 2)); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 23px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-icon {
  width: 35px; height: 35px; border-radius: 8px; display: grid; place-items: center; color: white;
  background: var(--accent-dark);
}
.brand-icon .icon { font-size: 18px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; padding-left: 20px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: nowrap; }
.breadcrumbs:empty { display: none; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-dark); text-decoration: underline; }
.breadcrumbs .icon { font-size: 12px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.reviewer-name { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; white-space: nowrap; }
.avatar { display: grid; place-items: center; flex: none; border-radius: 50%; font-weight: 600; color: var(--accent-dark); background: #e5eee7; }
.top-avatar { width: 32px; height: 32px; font-size: 13px; }
.miniature { width: 28px; height: 28px; font-size: 12px; }

#app { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
#app:has(.desk) { overflow: hidden; }
.collection { width: min(var(--content), calc(100% - 48px)); margin-inline: auto; padding: 49px 0 52px; }
.collection-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.collection-heading > div { display: flex; align-items: center; gap: 14px; }
.collection h1 { font-size: clamp(29px, 3.9vw, 46px); }
.sample-label { color: var(--muted); font-size: 12px; border-left: 1px solid var(--line); padding-left: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.project-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: 15px; background: var(--surface); color: var(--ink); text-decoration: none;
}
.project-card:hover { border-color: #9fb6a9; }
.project-cover { position: relative; aspect-ratio: 2.16; background: #e5ebe5; }
.project-cover img, .project-overview-cover img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.project-cover img.project-figure, .project-overview-cover img.project-figure { object-fit: contain; background: #f1f4f0; padding: 8px; }
.stage-label {
  display: inline-flex; width: fit-content; align-items: center; gap: 7px; padding: 5px 9px;
  border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); font-size: 12px; white-space: nowrap;
}
.stage-label > span { width: 6px; height: 6px; border-radius: 50%; background: #568068; }
.project-cover .stage-label { position: absolute; top: 15px; left: 16px; background: var(--surface); }
.project-card-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 19px 23px 18px; }
.project-card h2 { margin: 0; font-size: clamp(21px, 2.3vw, 28px); line-height: 1.29; overflow-wrap: anywhere; }
.project-card p { margin: 0; color: var(--muted); line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-journal { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--accent-dark); font-size: 14px; }
.project-journal .icon { align-self: center; font-size: 14px; }
.project-journal span { overflow-wrap: anywhere; }
.project-card .project-journal { margin-top: auto; padding-top: 6px; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 53px; border-top: 1px solid var(--line); padding: 7px 19px 7px 23px; }
.card-version { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 12px; }
.card-version strong { color: var(--ink); font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-version > span { white-space: nowrap; }
.card-version .unread-count { color: var(--accent-dark); }
.open-card { display: grid; place-items: center; width: 30px; height: 30px; flex: none; color: var(--accent); }
.project-card:hover .open-card { background: var(--accent-soft); border-radius: 7px; }
.collection-empty { color: var(--muted); margin: 16px 0; }

.submission { --submission-inset: clamp(21px, 3.2vw, 36px); padding-top: 38px; }
.submission-form { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.submission-body { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); }
.submission-details { min-inline-size: 0; margin: 0; padding: 27px var(--submission-inset) 30px; border: 0; }
.submission h2 { margin: 0; font-size: 22px; line-height: 1.3; }
.submission-fields { display: grid; gap: 15px; }
.submission-fields h2 { margin-bottom: 2px; }
.submission-fields-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.submission-details label { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: 14px; font-weight: 550; }
.submission-details :is(input, select, textarea) { min-width: 0; min-height: 41px; padding: 8px 10px; border-color: #d6e1d9; font-size: 15px; font-weight: 400; }
.submission-details textarea { line-height: 1.55; resize: vertical; }
.submission-details textarea::placeholder { color: #66756d; }
.submission-details :is(input, select, textarea):disabled { opacity: 1; color: var(--muted); background: #f5f7f5; }
.submission-uploads {
  display: flex; flex-direction: column; gap: 25px; min-width: 0; padding: 27px var(--submission-inset) 30px;
  border-left: 1px solid var(--line); border-radius: 0 14px 0 0; background: #f8faf8;
}
.submission-cover-picker, .submission-drop { position: relative; display: grid; border: 1px dashed #a6beb0; border-radius: 9px; color: var(--accent-dark); }
.submission-cover-picker { place-items: center; aspect-ratio: 2.4; min-height: 140px; margin-top: 15px; background: #eaf2eb; }
.submission-cover-picker:hover, .submission-drop:hover, .submission-drop.dragging { border-color: #6d967f; background: #e5efe7; }
.submission-cover-picker:focus-within, .submission-drop:focus-within { outline: 2px solid #487965; outline-offset: 2px; }
.submission-cover-picker > input, .submission-drop > input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.submission-cover-picker > input:disabled, .submission-drop > input:disabled { cursor: default; }
.submission-cover-placeholder { display: grid; justify-items: center; gap: 3px; }
.submission-cover-icon, .submission-drop-icon { display: grid; place-items: center; flex: none; color: var(--accent); background: #dcebe1; }
.submission-cover-icon { width: 40px; height: 40px; margin-bottom: 3px; border-radius: 9px; }
.submission-cover-icon .icon { font-size: 20px; }
.submission-cover-placeholder strong, .submission-drop strong { font-size: 14px; font-weight: 630; }
.submission-cover-placeholder small, .submission-drop small { color: var(--muted); font-size: 12px; }
.submission-cover-picker:has(img:not([hidden])) { border-style: solid; }
#submission-cover-preview { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); object-fit: contain; }
.submission-cover-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.submission-cover-caption span, .submission-file-description strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.submission-files-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.submission-files-heading > span { color: var(--muted); font-size: 13px; }
.submission-drop { grid-template-columns: auto 1fr; align-items: center; gap: 11px; padding: 12px 13px; background: var(--surface); }
.submission-drop-icon { width: 35px; height: 35px; border-radius: 7px; }
.submission-drop :is(strong, small) { display: block; }
.submission-message { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.submission-message:empty { display: none; }
.submission .error { color: #8a4142; }
.submission-file-list { list-style: none; margin: 7px 0 0; padding: 0; }
.submission-file-list li { display: flex; align-items: center; gap: 9px; min-height: 49px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.submission-file-description { min-width: 0; flex: 1; }
.submission-file-description strong { display: block; font-size: 13px; font-weight: 550; }
.submission-file-description small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.submission-file-check { display: grid; place-items: center; width: 34px; color: var(--accent); }
.submission-footer {
  position: sticky; z-index: 2; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px var(--submission-inset); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; background: var(--surface);
}
.submission-footer p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.submission-footer p:empty { position: absolute; }
.submission-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.submission-actions .primary { min-width: 108px; }

.collection-detail { padding-top: 36px; }
.project-overview {
  display: grid; grid-template-columns: minmax(0, 1fr) 36%; border: 1px solid var(--line);
  border-radius: 15px; overflow: hidden; background: var(--surface);
}
.project-overview-info { display: grid; justify-items: start; align-content: center; gap: 11px; padding: 26px 30px; }
.project-overview h1 { font-size: clamp(25px, 3.3vw, 37px); }
.project-overview p { color: var(--muted); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.project-overview-cover { position: relative; min-height: 190px; background: #e5ebe5; }
#edit-project { margin: 0 0 -7px -8px; }
.versions-heading { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 13px; gap: 10px; }
.versions-heading h2 { margin: 0; font-size: 25px; }
.versions-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.version-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 84px 14px;
  align-items: center; gap: 16px; min-height: 82px; padding: 15px 21px; color: var(--ink); text-decoration: none;
}
.version-row + .version-row { border-top: 1px solid var(--line); }
.version-row:hover { background: #f8faf8; }
.version-row:focus-visible { outline-offset: -3px; }
.version-file-icon { width: 41px; height: 41px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.version-file-icon .icon { font-size: 19px; }
.version-title { display: flex; align-items: center; column-gap: 10px; row-gap: 4px; flex-wrap: wrap; }
.version-title h3 { flex: 0 1 auto; min-width: 0; margin: 0; font: 500 18px/1.3 var(--font-body); overflow-wrap: anywhere; }
.version-title time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.version-info p { margin: 4px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.latest-label { color: var(--accent-dark); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; line-height: 1.3; font-size: 11px; }
.version-counts { display: flex; align-items: center; gap: 14px; color: var(--muted); white-space: nowrap; }
.version-counts span { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.version-counts .icon { font-size: 13px; }
.version-status { justify-self: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.version-status.waiting { padding: 4px 7px; background: #edf3ec; color: var(--accent-dark); border-radius: 5px; }
.version-arrow { display: flex; color: var(--accent); }

.heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 32px;
  border-bottom: 1px solid var(--line); background: #f7f9f7; flex: none;
}
.heading-info { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 11px; min-width: 0; }
.title-line h1 { font-size: clamp(22px, 2.3vw, 32px); }
.version { border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; font-size: 12px; font-weight: 500; color: var(--accent-dark); background: white; white-space: nowrap; }
.heading-actions { display: flex; align-items: center; flex: none; }
.connection { color: #765b32; font-size: 12px; display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.connection .icon { font-size: 14px; }

.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.button { min-height: 39px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; background: transparent; font-weight: 655; }
.button.small { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.button.small .icon { font-size: 14px; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 1px 2px #203a2818; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border-color: #d7e2da; color: var(--accent-dark); background: #fff; }
.button.secondary:hover:not(:disabled), .button.quiet:hover:not(:disabled), .button[aria-pressed='true'] { background: var(--accent-soft); }
.button.quiet { color: #365747; }
.icon-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 7px; color: #466052; background: transparent; }
.icon-button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-dark); }

.desk { flex: 1; min-height: 0; display: grid; grid-template-columns: 254px minmax(0, 1fr) 342px; }
.mobile-tabs { display: none; }
.materials, .feedback { min-width: 0; min-height: 0; background: var(--surface); }
.materials { padding: 18px 13px 22px; overflow: auto; border-right: 1px solid var(--line); }
.panel-label { display: flex; justify-content: space-between; align-items: center; margin: 0 7px 9px; color: #3d5246; font-size: 13px; font-weight: 710; }
.panel-label > span:first-child { display: flex; gap: 7px; align-items: center; }
.counter { min-width: 21px; height: 21px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 5px; background: #eef3ef; color: #4e695b; font-weight: 720; font-size: 11px; font-variant-numeric: tabular-nums; }
.file-list { display: grid; gap: 2px; }
.file-row, .invite-row {
  width: 100%; display: flex; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 8px;
  min-width: 0; text-align: left; background: transparent;
}
.file-row { padding: 8px 7px; min-height: 53px; position: relative; }
.file-row:hover, .invite-row:hover { background: #f4f7f4; }
.file-row.current { border-color: #dce8df; background: var(--accent-soft); }
.file-row.current::before { content: ''; position: absolute; left: -1px; width: 3px; height: 23px; border-radius: 0 2px 2px 0; background: #5b856e; }
.file-icon { display: grid; place-items: center; width: 32px; height: 33px; border-radius: 7px; flex: none; color: #597064; background: #eaf1ec; }
.file-icon.pdf { color: #864a55; background: #f8eaed; }
.file-icon.docx { color: #3c619b; background: #e8f0fc; }
.file-icon.image { color: #3b7563; background: #e7f3ee; }
.file-icon.zip { color: #805922; background: #f8edda; }
.file-icon.text { color: #655396; background: #efebfa; }
.file-description, .reader-name > div { min-width: 0; flex: 1; }
.file-description strong, .file-description small, .reader-name strong, .reader-name small {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-description strong, .reader-name strong { font-size: 13px; font-weight: 680; }
.file-description small, .reader-name small { font-size: 11px; color: var(--muted); }
.file-meta { display: flex; flex: none; }
.file-count { background: #dce9df; color: #314f3e; min-width: 18px; padding: 0 4px; text-align: center; font-size: 11px; border-radius: 4px; }
.upload-button { border: 1px dashed #cedcd2; margin-top: 10px; width: 100%; color: var(--accent-dark); }
.upload-button:hover { background: #f0f5f1; }
.invite-label { margin-top: 21px; padding-top: 15px; border-top: 1px solid var(--line); }
.invite-row { min-height: 38px; padding: 5px 4px; gap: 6px; }
.invite-row > .icon { font-size: 13px; color: var(--muted); }
.invite-name { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 6px; border-radius: 5px; flex: none; white-space: nowrap; font-size: 11px; }
.pill.active { background: #e7f1e9; color: #355a45; }
.pill.complete { background: #e7f4ed; color: #226451; }
.pill.muted { background: #eff2ef; color: #54655c; }
.side-empty { margin: 5px 8px; color: var(--muted); font-size: 12px; }

.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #e9eeea; }
.toolbar, .reader-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 15px; background: #fff; }
.toolbar { border-bottom: 1px solid var(--line); min-height: 55px; }
.reader-name { min-width: 0; display: flex; align-items: center; gap: 8px; }
.reader-name .file-icon { width: 29px; height: 30px; }
.doc-controls, .page-control, .zoom-control, .anchor-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.page-control { color: #41594c; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.page-control > button { display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 4px; width: 25px; height: 24px; padding: 0; }
.page-control > button:hover:not(:disabled) { background: var(--accent-soft); }
.page-control > button .icon { font-size: 14px; }
.page-control input { width: 24px; outline-offset: 0; border: none; background: #f2f5f2; border-radius: 3px; padding: 1px; text-align: center; color: var(--ink); }
.page-control span { white-space: nowrap; }
.zoom-control { margin: 0 4px; padding: 0 4px; border-inline: 1px solid var(--line); }
.zoom-control .icon-button { width: 26px; }
.reading-area { min-height: 0; flex: 1; overflow: auto; scrollbar-color: #c3d1c7 transparent; }
.preview { padding: 25px 9px 34px; width: 100%; }
.surface { position: relative; margin-inline: auto; background: white; box-shadow: 0 2px 13px #243b291b, 0 0 1px #3a514045; }
.pdf-surface canvas { width: 100%; height: 100%; display: block; }
.image-surface { width: min(790px, calc(100% - 42px)); }
.image-surface img { width: 100%; display: block; user-select: none; }
.surface.marking, .surface.marking .textLayer span { cursor: crosshair; user-select: none; }
.textLayer { position: absolute; inset: 0; overflow: clip; opacity: 1; text-align: initial; line-height: 1; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.textLayer :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0 0; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.textLayer .markedContent { display: contents; }
.textLayer ::selection { color: transparent; background: #93ba9f8f; }
.textLayer .endOfContent { position: absolute; inset: 100% 0 0; z-index: 0; pointer-events: none; }
.annotations-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.quote-highlight { position: absolute; background: #ffcf5375; border-radius: 3px; mix-blend-mode: multiply; }
.quote-highlight.selected { background: #ffca43ad; }
.paper-pin { position: absolute; width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 1px solid #dec573; border-radius: 7px 7px 7px 1px; background: #ffedac; color: #6c4c11; pointer-events: auto; transform: translate(-10%, -24%); }
.paper-pin .icon { font-size: 13px; }
.paper-pin:hover, .paper-pin.selected { background: #ffe185; }
.reader-footer { border-top: 1px solid var(--line); min-height: 48px; }
.preview-hint { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.preview-hint .icon { font-size: 13px; }
.anchor-actions { margin-left: auto; }
.reading-sheet, .preview-message { width: min(790px, calc(100% - 42px)); margin-inline: auto; padding: 24px; background: white; }
.reading-sheet h2 { font-size: 19px; overflow-wrap: anywhere; margin: 0 0 12px; }
.reading-sheet p { color: var(--muted); }
.reading-sheet pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0; background: #f3f6f3; border-radius: 8px; padding: 14px; font: 12px/1.7 Consolas, 'Microsoft YaHei UI', monospace; }
.reading-sheet > .quiet { margin: -9px 0 16px -9px; }
.preview-message { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 9px; }
.preview-message > .icon { font-size: 23px; color: #557767; margin-bottom: 9px; }
.preview-message p { color: var(--muted); margin: 5px 0 12px; overflow-wrap: anywhere; }
.preview-message > button { margin-top: 10px; }
.zip-list { display: grid; gap: 5px; }
.zip-entry { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; text-align: left; background: #fff; }
button.zip-entry:hover { border-color: #a6bfb0; color: var(--accent-dark); background: #f8faf8; }
.zip-entry span { overflow-wrap: anywhere; }
.zip-entry small { white-space: nowrap; color: var(--muted); }

.feedback { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.feedback-header { padding: 11px 13px 6px 15px; min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.feedback-header > div { display: flex; align-items: center; gap: 7px; }
.feedback h2 { margin: 0; font-size: 18px; white-space: nowrap; }
.filters { display: flex; gap: 4px; padding: 2px 13px 8px; border-bottom: 1px solid var(--line); }
.filters > button { min-height: 29px; border: 0; padding: 4px 9px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.filters > button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 680; }
.filters > button:hover { background: #edf3ed; }
.thread-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 13px 16px; }
.thread { border: 1px solid #e1e9e3; border-radius: 9px; padding: 11px 10px 8px; margin-bottom: 9px; background: white; }
.thread.focused { border-color: #a8c0b0; background: #f7faf7; }
.thread-top { display: flex; gap: 7px; align-items: center; }
.thread-top strong { font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.note-source { color: var(--muted); font-size: 11px; }
.thread time { color: var(--muted); font-size: 10.5px; }
.thread-top time { margin-left: auto; white-space: nowrap; }
.unread-dot { height: 6px; width: 6px; border-radius: 50%; flex: none; background: #499071; }
.thread-location { display: flex; align-items: center; gap: 5px; max-width: 100%; background: #edf4ef; color: #315847; padding: 3px 5px; border: 0; border-radius: 5px; margin-top: 8px; font-size: 11px; }
.thread-location span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-location .icon { font-size: 12px; }
.thread-location:hover { text-decoration: underline; }
.thread blockquote { margin: 8px 0; padding: 5px 7px; border-left: 2px solid #d8ac4c; background: #fffaed; color: #6d5628; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.thread-body { margin: 7px 0 5px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-actions { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; margin: 2px -4px 0; }
.thread-actions button, .text-button { display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 5px; background: transparent; padding: 5px; color: #416250; font-size: 11px; }
.thread-actions button .icon { font-size: 13px; }
.thread-actions button:hover, .text-button:hover { background: var(--accent-soft); }
.thread-actions .thread-share { justify-content: center; min-width: 32px; min-height: 32px; margin-left: auto; padding-inline: 7px; }
.thread-share.shared { color: var(--accent-dark); background: var(--accent-soft); }
.thread-reply { margin: 8px 0 2px; padding: 7px 8px; border-radius: 6px; border-left: 2px solid #c4d7ca; background: #f4f7f4; }
.thread-reply strong { font-size: 11px; margin-right: 7px; }
.thread-reply p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.empty-feedback { padding: 24px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.composer { padding: 12px 13px 13px; border-top: 1px solid var(--line); background: #f9fbf9; max-height: 55%; overflow: auto; }
.compose-title { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 7px; }
.compose-ref { display: flex; align-items: center; gap: 5px; min-width: 0; color: #345747; background: #eaf2ec; padding: 3px 6px; margin-bottom: 6px; border-radius: 6px; font-size: 12px; }
.compose-ref span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-ref button { border: 0; background: transparent; padding: 3px; }
textarea, .input, select { display: block; width: 100%; color: var(--ink); background: #fff; padding: 8px 9px; border: 1px solid #d7e3db; border-radius: 7px; min-width: 0; }
textarea { min-height: 64px; resize: vertical; font-size: 13px; }
textarea::placeholder, .input::placeholder { color: #63766a; }
.compose-bottom { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.compose-bottom span { font-size: 11px; color: var(--muted); }
.compose-bottom > [type='submit'] { margin-left: auto; }

dialog { width: min(510px, calc(100vw - 24px)); max-height: calc(100dvh - 28px); color: var(--ink); padding: 0; border: 1px solid #d9e4db; border-radius: 14px; box-shadow: 0 20px 80px #1736243b; }
dialog::backdrop { background: #182a2160; }
dialog form { padding: 16px 19px 18px; }
.dialog-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 9px; }
.dialog-title h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.dialog-fields { display: grid; gap: 11px; }
.dialog-fields label:not(.upload-picker), .dialog-fields legend { font-weight: 650; font-size: 13px; }
.dialog-fields label .input, .dialog-fields label textarea, .dialog-fields label select { margin-top: 4px; font-weight: 400; }
.dialog-fields label small { color: var(--muted); }
.dialog-help, .dialog-status { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.dialog-status:not(:empty) { margin-top: 8px; color: #315c49; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-fields fieldset { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px 8px; min-width: 0; }
.file-options { display: grid; gap: 3px; max-height: 188px; overflow: auto; }
.file-options label { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 6px; }
.file-options label:hover { background: #f2f6f3; }
input[type='checkbox'] { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.file-options label > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.file-options small { margin-left: 6px; font-weight: 400; }
.upload-picker { display: grid; gap: 4px; justify-items: center; padding: 16px; border: 1px dashed #a4bdae; border-radius: 8px; background: #f7faf7; color: var(--accent-dark); text-align: center; cursor: pointer; }
.upload-picker > .icon { font-size: 26px; }
.upload-picker input { max-width: 100%; font-size: 12px; margin-top: 7px; }
.invitation-status, .invitation-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invitation-status { color: var(--muted); font-size: 12px; }
.revoke { justify-self: start; color: #8d4559; }
.toast { position: fixed; z-index: 10; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); border-radius: 8px; padding: 9px 13px; background: #264638; color: #fff; box-shadow: 0 3px 10px #223a2b36; font-size: 13px; }
.startup, .unavailable { margin: auto; padding: 18px; text-align: center; }
.unavailable > .icon { color: var(--accent); font-size: 26px; margin-bottom: 10px; }
.unavailable p { color: var(--muted); }
.access {
  display: grid; grid-template-columns: 0.95fr 1fr; width: min(760px, calc(100% - 40px));
  margin: clamp(28px, 10vh, 90px) auto 28px; border: 1px solid var(--line);
  border-radius: 15px; overflow: hidden; background: var(--surface); flex: none;
}
.access-cover { background: #e8efe9 url('/covers/manuscript.webp') center / cover no-repeat; }
.access-form { display: grid; gap: 14px; padding: clamp(25px, 4vw, 46px); }
.access-form h1 { margin-bottom: 7px; font-size: 32px; }
.access-form label { display: grid; gap: 5px; font-size: 14px; font-weight: 550; }
.access-form input { min-height: 42px; font-size: 16px; font-weight: 400; }
.access-form > p { margin: 0; color: #8a4142; font-size: 13px; }
.access-form > p:empty { position: absolute; }
.access-form > .button.primary { margin-top: 3px; min-height: 42px; }

@media (min-width: 1450px) {
  .desk { grid-template-columns: 276px minmax(0, 1fr) 366px; }
  .materials { padding-inline: 16px; }
  .feedback-header, .thread-list, .composer { padding-inline: 16px; }
}

@media (max-width: 1100px) and (min-width: 821px) {
  .desk { grid-template-columns: 210px minmax(0, 1fr) 288px; }
  .materials { padding-inline: 9px; }
  .zoom-control { display: none; }
  .reader-footer { padding-inline: 8px; }
  .preview-hint { font-size: 11px; }
}

@media (max-width: 820px) {
  .topbar, body:has(.collection) .topbar { height: 54px; padding: 0 16px; gap: 10px; }
  .brand { font-size: 19px; gap: 6px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 8px; }
  .brand-icon .icon { font-size: 17px; }
  .breadcrumbs { gap: 6px; padding-left: 10px; font-size: 12px; }
  .top-actions { gap: 7px; }
  .collection { width: calc(100% - 32px); padding: 30px 0 36px; }
  .collection-heading { margin-bottom: 19px; }
  .submission { --submission-inset: 21px; }
  .project-grid { gap: 16px; }
  .project-card-body { padding: 17px 17px 15px; }
  .project-card-footer { padding-inline: 17px 12px; }
  .collection-detail { padding-top: 23px; }
  .project-overview-info { padding-inline: 21px; }
  .versions-heading { margin-top: 25px; }
  .version-row { padding-inline: 14px; gap: 11px; }
  .version-counts { flex-direction: column; align-items: flex-start; gap: 2px; }
  .heading { padding: 11px 14px; gap: 8px; }
  .title-line { flex-wrap: wrap; column-gap: 7px; row-gap: 4px; }
  .title-line h1 { font-size: 21px; }
  .heading-actions .button { font-size: 12px; min-height: 34px; }
  .mobile-tabs { display: flex; background: white; flex: none; border-bottom: 1px solid var(--line); }
  .mobile-tabs button { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 38px; border: 0; border-bottom: 2px solid transparent; background: white; color: var(--muted); font-weight: 610; font-size: 12px; }
  .mobile-tabs button[aria-pressed='true'] { color: var(--accent-dark); background: #f2f7f3; border-color: #58836d; }
  .mobile-tabs .icon { font-size: 14px; }
  .desk { display: block; }
  .desk > * { height: 100%; }
  .desk[data-tab='reader'] :is(.materials, .feedback), .desk[data-tab='materials'] :is(.reader, .feedback), .desk[data-tab='feedback'] :is(.reader, .materials) { display: none; }
  .materials, .feedback { border: 0; }
  .materials { padding: 14px; }
  .preview { padding-top: 13px; }
  .reader-footer, .toolbar { padding-inline: 9px; }
  .doc-controls { gap: 3px; }
  .zoom-control { border: 0; margin: 0; padding: 0; gap: 0; }
  .zoom-control .icon-button { width: 25px; }
  .file-description strong, .reader-name strong { font-size: 12px; }
  .reader-name small { font-size: 10px; }
  .toast { bottom: 51px; }
}

@media (max-width: 600px) {
  .access { grid-template-columns: minmax(0, 1fr); width: min(390px, calc(100% - 32px)); margin-top: 24px; }
  .access-cover { aspect-ratio: 2.7; }
  .access-form h1 { font-size: 27px; }
  .submission { --submission-inset: 16px; padding-top: 24px; }
  .submission-body { grid-template-columns: minmax(0, 1fr); }
  .submission-details, .submission-uploads { padding-block: 19px; }
  .submission-uploads { gap: 22px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .submission h2 { font-size: 20px; }
  .submission-cover-picker { margin-top: 11px; }
  .submission-footer { flex-wrap: wrap; justify-content: flex-end; column-gap: 10px; row-gap: 6px; padding-block: 10px; }
  .submission-footer p { width: 100%; text-align: right; }
  .submission-details :is(input, select, textarea) { font-size: 16px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-cover { aspect-ratio: 2.22; }
  .project-cover .stage-label { top: 12px; left: 13px; }
  .project-overview { grid-template-columns: minmax(0, 1fr); }
  .project-overview-info { padding: 17px; gap: 8px; }
  .project-overview-cover { min-height: 120px; aspect-ratio: 3.1; }
  .versions-heading h2 { font-size: 21px; }
  .version-row {
    grid-template-columns: 30px minmax(0, 1fr) auto 12px;
    row-gap: 5px; column-gap: 9px; padding: 12px; align-items: start;
  }
  .version-file-icon { width: 30px; height: 31px; }
  .version-file-icon .icon { font-size: 16px; }
  .version-title { column-gap: 6px; }
  .version-title h3 { font-size: 16px; }
  .version-info p { font-size: 13px; }
  .version-status { grid-column: 3; grid-row: 1; align-self: start; }
  .version-arrow { grid-column: 4; grid-row: 1 / 3; align-self: center; }
  .version-arrow .icon { font-size: 14px; }
  .version-counts { grid-column: 2 / 4; flex-direction: row; gap: 12px; }
  .version-counts span { font-size: 11px; }
  .reviewer-name > span:last-child { display: none; }
  .top-avatar { width: 27px; height: 27px; }
  .breadcrumbs > a:first-child, .breadcrumbs > .icon { display: none; }
}

@media (max-width: 420px) {
  .breadcrumbs:has(> span:only-child) { display: none; }
  .connection { font-size: 0; }
  .collection-heading > div { gap: 8px; }
  .sample-label { padding-left: 8px; }
  .preview-hint { font-size: 11px; }
  .preview-hint .icon { display: none; }
  .reader-footer { gap: 4px; }
  .reader-footer .button.small { font-size: 11px; padding-inline: 6px; }
  .heading-actions .button { padding-inline: 7px; }
  .reader-name .file-icon { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .file-row, .filters > button, .project-card, .version-row { transition: background-color .13s, border-color .13s; }
}
