:root {
  color-scheme: light;
  --font: "Inter", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #242039;
  --muted: #636078;
  --line: #e7e4ef;
  --surface: #fff;
  --background: #f7f7fc;
  --primary: #5846ad;
  --primary-deep: #43348e;
  --violet-tint: #efebff;
  --radius: 16px;
  --shadow: 0 2px 5px rgb(38 30 69 / 3%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; scroll-padding-top: 24px; }
body { margin: 0; background: var(--background); color: var(--ink); font: 400 1rem/1.55 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, summary, input, select, textarea, canvas { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8674df; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.85rem, 2.9vw, 2.45rem); line-height: 1.22; letter-spacing: -.045em; }
h2 { font-size: 1.17rem; letter-spacing: -.025em; line-height: 1.35; }
h3 { font-size: 1rem; line-height: 1.4; }
p, small { color: var(--muted); }
small { font-size: .83rem; }
svg { flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.number { font-variant-numeric: tabular-nums; }
.wide { width: 100%; }
.js-only { display: none !important; }
.has-js .js-only { display: inline-flex !important; }
.eyebrow { display: inline-block; margin-bottom: 7px; color: var(--primary); font-size: .875rem; font-weight: 750; letter-spacing: .035em; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 1.25rem; font-weight: 760; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { color: var(--primary); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; color: #fff; background: var(--primary); flex-shrink: 0; }
.button { min-height: 43px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-size: .9rem; font-weight: 720; line-height: 1.35; text-align: center; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.button.primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 2px 3px rgb(62 46 140 / 13%); }
.button.primary:hover:not(:disabled) { background: var(--primary-deep); border-color: var(--primary-deep); }
.button.secondary { background: #fff; border-color: #dcd6ed; color: var(--primary-deep); }
.button.secondary:hover:not(:disabled) { background: #f7f4ff; border-color: #b9a9ec; }
.button.subtle { color: var(--primary-deep); background: #eee9ff; }
.button.subtle:hover, .button.subtle:focus-visible { background: #e6dfff; }
.button.small { min-height: 36px; padding: 7px 11px; font-size: .875rem; }
.icon-button, .text-link { border: 0; background: transparent; }
.icon-button { color: var(--muted); display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 8px; padding: 0; }
.icon-button:hover { color: var(--primary-deep); background: var(--violet-tint); }
.text-link { color: var(--primary-deep); padding: 0; font-size: .875rem; font-weight: 720; }
.text-link:hover:not(:disabled) { text-decoration: underline; color: var(--primary); }
.stack { display: grid; gap: 16px; }
.field { display: grid; align-content: start; gap: 7px; color: var(--ink); font-size: .9rem; font-weight: 690; }
input:not([type=checkbox], [type=hidden], [type=file]), select, textarea {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #ddd8eb;
  border-radius: 10px;
  background-color: #fcfbff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 440;
  outline-offset: 2px;
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
input::placeholder, textarea::placeholder { color: #716b84; opacity: 1; }
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color: #bfb2e3; }
input:not([type=checkbox]):focus, select:focus, textarea:focus {
  border-color: #8a77dd;
  background-color: #fff;
  box-shadow: 0 0 0 3px #eee8ff;
  outline: none;
}
input[type=checkbox] { accent-color: var(--primary); width: 17px; height: 17px; margin: 0; flex: 0 0 17px; }
input[type=number] { appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }
select {
  appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #5f537d 50%), linear-gradient(135deg, #5f537d 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea { resize: none; vertical-align: top; line-height: 1.6; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 46px !important; }
.password-wrap button { position: absolute; right: 7px; top: 5px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: #645b7b; }
.password-wrap button:hover { background: #f2effa; }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 10px; margin: 0 0 19px; border: 1px solid; font-size: .9rem; line-height: 1.5; }
.notice > span { flex: 1; }
.notice-soft { color: #504293; border-color: #e5ddff; background: #f2edff; }
.notice-error { color: #9a243a; border-color: #f1d1d8; background: #fff2f3; }
.notice-success { color: #206149; border-color: #d1ece2; background: #ecfaf5; }

.auth-page { min-height: 100vh; background: #fcfbfe; }
.auth-layout { display: grid; grid-template-columns: minmax(350px, .97fr) minmax(460px, 1fr); min-height: 100vh; }
.auth-art { min-height: 100vh; padding: clamp(25px, 4.6vw, 68px); display: flex; flex-direction: column; justify-content: space-between; gap: 14px; overflow: hidden; background: #211d4d; color: white; }
.auth-art .brand { align-self: flex-start; color: #fff; }
.auth-art .brand-mark { background: #e4dcff; color: #392a76; }
.auth-art-content { max-width: 510px; width: 100%; margin: auto; position: relative; }
.auth-illustration { margin: -25px auto -4px; width: min(100%, 420px); aspect-ratio: 1.28; position: relative; overflow: hidden; }
.auth-illustration img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 53%; mask-image: radial-gradient(ellipse 73% 78% at 50% 51%, #000 61%, #0000 99%); }
.auth-art h1 { font-size: clamp(2.15rem, 4.5vw, 4.15rem); line-height: 1.17; letter-spacing: .015em; }
.auth-art p { margin-top: 13px; color: #ded6fa; font-size: 1.04rem; }
.auth-art-footer { display: inline-flex; gap: 8px; align-items: center; font-size: .84rem; color: #d9cff6; }
.auth-main { display: grid; align-items: center; justify-items: center; padding: 45px 9%; }
.auth-form { width: min(100%, 412px); }
.mobile-brand { display: none; }
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 { font-size: clamp(1.95rem, 3.5vw, 2.8rem); line-height: 1.18; letter-spacing: -.055em; }
.auth-heading p { margin-top: 10px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: #eeeaf7; border-radius: 11px; padding: 5px; margin-bottom: 22px; }
.role-switch a { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #615971; font-size: .94rem; font-weight: 700; border-radius: 8px; }
.role-switch a:hover { color: var(--primary-deep); }
.role-switch a.active { background: #fff; color: var(--primary-deep); box-shadow: 0 1px 4px rgb(34 22 72 / 9%); }
.auth-form .stack > .button { min-height: 46px; margin-top: 5px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: .9rem; }
.auth-foot a { font-weight: 740; }
.auth-foot a:hover { text-decoration: underline; }
.auth-foot span { display: inline-flex; align-items: center; gap: 6px; }

.workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { height: 100dvh; min-height: 405px; display: flex; flex-direction: column; gap: 32px; padding: 24px 17px 15px; background: white; border-right: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.sidebar > .brand { margin-left: 5px; align-self: flex-start; }
.nav-label { margin: 0 0 10px 12px; font-size: .81rem; font-weight: 670; color: #716b83; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 46px; border-radius: 9px; padding: 10px 12px; color: #51506a; font-size: .94rem; font-weight: 620; }
.nav-link + .nav-link { margin-top: 5px; }
.nav-link:hover { color: var(--primary-deep); background: #f6f3ff; }
.nav-link.active { color: var(--primary-deep); background: var(--violet-tint); font-weight: 760; }
.sidebar-end { margin-top: auto; }
.sidebar-profile { display: flex; gap: 9px; align-items: center; min-width: 0; margin-top: 12px; padding: 13px 1px 0; border-top: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #eae2fc; color: #4b3995; font-weight: 740; }
.profile-name { min-width: 0; flex: 1; }
.profile-name strong, .profile-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name strong { font-size: .9rem; }
.profile-name small { font-size: .79rem; }
.main-shell { min-width: 0; }
.topbar { height: 66px; background: #fff; display: flex; align-items: center; gap: 11px; padding: 0 clamp(20px, 3.1vw, 48px); border-bottom: 1px solid var(--line); color: var(--ink); font-size: .88rem; font-weight: 700; }
.topbar-path, .topbar-date { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-path { overflow: hidden; white-space: nowrap; }
.topbar-path > span, .topbar-date { font-weight: 520; color: var(--muted); white-space: nowrap; }
.topbar-path .path-divider { color: #9a95aa; }
.topbar-date { margin-left: auto; }
.menu-toggle { display: none; }
.main-content { width: 100%; max-width: 1450px; margin: 0 auto; padding: 29px clamp(20px, 3.1vw, 48px) 45px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-heading > div { min-width: 0; }
.page-heading h1 { margin: 0; }
.page-heading p { margin-top: 7px; font-size: .94rem; }
.page-heading > .badge { margin-bottom: 3px; }
.page-heading .button { flex-shrink: 0; }
.back-row { margin: 0 0 13px; }
.panel { min-width: 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.padded { padding: clamp(18px, 2vw, 26px); }
.padded > h2 { margin-bottom: 9px; }
.padded > h2 + p { font-size: .93rem; margin-bottom: 16px; }
.padded > .tile-icon + h2 { margin-top: 13px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 19px 21px; border-bottom: 1px solid #efedf5; }
.panel-header p { margin-top: 4px; font-size: .88rem; }
.panel-header > .text-link { flex-shrink: 0; }
.panel-foot { padding: 0 21px 20px; }
.overview-banner { position: relative; display: flex; align-items: center; min-height: 195px; overflow: hidden; border-radius: var(--radius); background: #241f53; margin-bottom: 16px; isolation: isolate; }
.banner-content { position: relative; z-index: 1; padding: 23px 28px; max-width: min(100%, 620px); }
.banner-label { display: inline-flex; color: #dfd6ff; align-items: center; gap: 7px; font-size: .86rem; font-weight: 680; margin-bottom: 7px; }
.banner-content h2 { color: #fff; font-size: clamp(1.45rem, 2.65vw, 2.15rem); }
.banner-content p { font-size: .9rem; margin-top: 7px; color: #e0daf5; }
.banner-button { margin-top: 14px; min-height: 36px; padding: 7px 12px; background: #f1eaff; color: #423282; }
.banner-button:hover { background: #fff; color: #40317e; }
.overview-banner > img { position: absolute; inset: 0 1.5% 0 auto; height: 100%; width: min(350px, 34%); object-fit: cover; object-position: center 52%; mask-image: radial-gradient(ellipse 75% 81%, #000 56%, transparent 100%); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.stat-card { display: grid; justify-items: start; gap: 4px; min-width: 0; padding: 15px 16px 14px; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.tile-icon, .empty-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--primary-deep); background: var(--violet-tint); flex-shrink: 0; }
.bg-violet { background: #eee9ff; color: #533da5; }
.bg-green { background: #e5f6ed; color: #196548; }
.bg-amber { background: #fff2d8; color: #80530a; }
.bg-blue { background: #e9f1ff; color: #325a9b; }
.bg-red { background: #fce9ed; color: #a82c46; }
.stat-name { color: #5e5a72; font-size: .875rem; font-weight: 680; margin-top: 4px; }
.stat-card strong { font-size: 1.95rem; font-variant-numeric: tabular-nums; line-height: 1.02; letter-spacing: -.045em; }
.stat-card small { margin-top: 3px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(230px, 1fr); gap: 16px; }
.empty { min-height: 184px; display: grid; justify-items: center; align-content: center; gap: 7px; padding: 22px 16px; text-align: center; }
.empty-icon { width: 49px; height: 49px; border-radius: 13px; }
.empty strong { font-size: .94rem; }
.empty p { font-size: .88rem; max-width: 340px; }
.report-callout-content { padding: 15px 21px 13px; }
.report-callout-content > div { display: flex; align-items: baseline; gap: 8px; }
.report-callout-content strong { font-size: 1.8rem; color: var(--primary-deep); line-height: 1.1; }
.report-callout-content span, .report-callout-content p { font-size: .88rem; }
.report-callout-content p { margin-top: 6px; }
.management-grid, .upload-grid { display: grid; grid-template-columns: minmax(300px, .86fr) minmax(0, 1.45fr); align-items: start; gap: 17px; }
.upload-grid { grid-template-columns: minmax(0, 1.6fr) minmax(240px, .85fr); }
.management-grid > .panel:nth-child(2) { min-height: 255px; }
.file-input { width: 100%; padding: 7px; min-width: 0; min-height: 44px; border: 1px solid #dcd9e9; color: #5f5873; border-radius: 9px; font-size: .87rem; }
.file-input::file-selector-button { border: 0; border-radius: 6px; background: var(--violet-tint); color: var(--primary-deep); padding: 5px 8px; margin-right: 6px; font: inherit; font-weight: 650; cursor: pointer; }
.manual-add { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px; }
.manual-add summary { color: var(--primary-deep); font-size: .91rem; font-weight: 680; cursor: pointer; }
.manual-add form { margin-top: 12px; }
.optional { color: var(--muted); font-size: .83rem; font-weight: 460; }
.inline-filter { min-width: 130px; max-width: 64%; }
.inline-filter select { font-size: .9rem; min-height: 40px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th, td { padding: 12px 16px; border-bottom: 1px solid #efedf4; vertical-align: middle; }
th { padding-top: 10px; padding-bottom: 10px; color: #595571; background: #faf9fd; font-size: .83rem; font-weight: 730; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fdfcff; }
.table-title { display: inline-flex; min-width: 97px; align-items: center; text-align: left; gap: 8px; font-weight: 730; color: var(--ink); overflow-wrap: anywhere; }
.table-title:hover { color: var(--primary); text-decoration: underline; }
.file-icon { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; background: #f0ebff; color: #5b48a9; flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 8px; font-size: .81rem; line-height: 1.35; font-weight: 730; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.compact-form { margin: 0; white-space: nowrap; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .88rem; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 15px 19px; border-bottom: 1px solid #efedf5; }
.search-field { position: relative; color: #706683; flex: 1 1 185px; max-width: 320px; }
.search-field svg { position: absolute; left: 11px; top: 13px; pointer-events: none; }
.search-field input { padding-left: 35px !important; }
.filters select, .filters input { font-size: .9rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 55px; padding: 8px 18px; border-top: 1px solid #efedf5; color: var(--muted); font-size: .85rem; }
.pagination nav { display: flex; gap: 7px; }
.narrow { max-width: 490px; }
.narrow form { margin-top: 14px; }
.narrow .button { justify-self: start; }

.upload-form { padding: clamp(18px, 2.3vw, 30px); }
.upload-form > .button { justify-self: start; }
.drop-zone { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding: 24px 13px; border: 1.5px dashed #c7b9ef; background: #faf8ff; border-radius: 12px; min-height: 210px; }
.drop-zone.dragging { background: #eee8ff; border-color: #8470d4; }
.drop-zone p, .drop-zone small { font-weight: 420; }
.drop-zone > .empty-icon { margin-bottom: 3px; pointer-events: none; }
.drop-actions { display: flex; justify-content: center; gap: 8px; margin: 6px 0 2px; }
.file-button { cursor: pointer; }
.drop-zone:focus-within { outline: 2px solid #8e79df; outline-offset: 3px; }
.photo-consent { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; color: #4d4763; }
.photo-consent input { margin-top: 3px; }
.upload-message { color: #99253d; padding-top: 3px; }
.file-list { list-style: none; display: grid; gap: 8px; padding: 0; margin: 4px 0; }
.file-list li { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.upload-thumb { width: 49px; height: 44px; position: relative; display: grid; place-items: center; color: var(--primary-deep); background: #eee9ff; border-radius: 5px; overflow: hidden; flex-shrink: 0; font-size: .73rem; }
.upload-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-name { min-width: 0; flex: 1; display: grid; }
.upload-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.upload-file-actions button { font-size: .81rem; }
.tip-list { list-style: none; display: grid; gap: 17px; margin: 15px 0 0; padding: 0; }
.tip-list li { display: flex; gap: 9px; align-items: flex-start; }
.tip-list li > span { color: #26735c; margin-top: 2px; }
.tip-list p { font-size: .88rem; margin-top: 3px; }

.manuscript-panel { margin-bottom: 17px; overflow: hidden; }
.manuscript-header h2 { display: flex; align-items: center; gap: 8px; }
.manuscript-header h2 svg { color: #a62640; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.manuscript-toolbar { padding: 10px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.page-switch { display: flex; flex-wrap: wrap; gap: 5px; }
.page-switch button { border: 1px solid transparent; border-radius: 7px; background: transparent; color: #5c5570; padding: 6px 10px; font-size: .88rem; white-space: nowrap; }
.page-switch button:hover { background: #f5f1ff; }
.page-switch button.active { color: var(--primary-deep); background: #eee9ff; border-color: #e6dfff; font-weight: 720; }
.mark-status { padding: 8px 17px; color: #21614a; background: #eef9f1; font-size: .9rem; }
.mark-status.is-error { color: #982b43; background: #fff0f3; }
.paper-stage { display: grid; justify-items: center; background: #eeedf5; min-height: 190px; padding: clamp(8px, 2vw, 24px); }
.paper-image { position: relative; width: fit-content; max-width: 100%; margin: 0; overflow: hidden; line-height: 0; background: #fff; box-shadow: 0 2px 14px rgb(33 21 75 / 12%); }
.paper-image img { display: block; max-width: 100%; height: auto; width: auto; max-height: 1060px; object-fit: contain; }
.paper-image canvas { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.feedback-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(230px, .9fr); gap: 16px; align-items: start; }
.feedback-panel .summary { font-size: 1rem; line-height: 1.7; color: #4b465d; white-space: pre-line; }
.feedback-panel h3 { margin-top: 15px; color: var(--primary-deep); }
.feedback-list { margin: 6px 0 0; padding-left: 20px; color: #4b465d; font-size: .94rem; }
.feedback-list li + li { margin-top: 4px; }
.total-score { display: flex; align-items: baseline; gap: 7px; color: var(--muted); margin: 7px 0 14px; }
.total-score strong { color: var(--primary-deep); font-size: 2.6rem; line-height: 1.1; letter-spacing: -.045em; }
.dimension { display: grid; gap: 5px; margin-bottom: 11px; }
.dimension > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .9rem; }
.dimension strong { color: var(--primary-deep); white-space: nowrap; }
progress { display: block; width: 100%; height: 8px; appearance: none; border: 0; color: var(--primary); background: #eee9fb; border-radius: 10px; overflow: hidden; }
progress::-webkit-progress-bar { background: #eee9fb; border-radius: 10px; }
progress::-webkit-progress-value { background: #7863cc; border-radius: 10px; }
progress::-moz-progress-bar { background: #7863cc; border-radius: 10px; }
.score-caption { border-top: 1px solid var(--line); font-size: .85rem; padding-top: 9px; margin-top: 13px; }

.report-builder form { margin-top: 13px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .9rem; font-weight: 720; margin-bottom: 7px; }
.class-select { display: grid; gap: 6px; max-height: 245px; overflow-y: auto; padding: 2px; }
.class-choice { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; cursor: pointer; }
.class-choice:has(input:checked) { background: #f3efff; border-color: #dfd3ff; }
.class-choice span { flex: 1; overflow-wrap: anywhere; }
.class-choice small { white-space: nowrap; }
.class-select-all { margin-top: 8px; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.range-fields .field { min-width: 0; }
.range-fields input { padding-inline: 7px !important; font-size: .84rem !important; }
.report-time { font-size: .86rem !important; }
.report-classes, .report-charts { margin-bottom: 15px; }
.report-charts { grid-template-columns: 1fr 1fr; align-items: stretch; }
.report-charts h2 { margin-bottom: 14px; }
.distribution progress::-webkit-progress-value { background: #5074af; }
.distribution progress::-moz-progress-bar { background: #5074af; }
.report-focus ol { display: grid; gap: 10px; margin: 12px 0 0; padding-left: 20px; }
.report-focus li { padding-left: 3px; }
.report-focus li > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-focus li p { margin-top: 3px; font-size: .91rem; }

.error-page { display: grid; justify-items: center; align-items: center; min-height: 100vh; padding: 16px; }
.error-card { width: min(100%, 440px); }
.error-inner { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 25px 0 10px; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 202px minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(215px, 1fr); }
  .management-grid { grid-template-columns: minmax(280px, .9fr) minmax(0, 1.2fr); }
}
@media (max-width: 850px) {
  .auth-layout { grid-template-columns: minmax(270px, .8fr) minmax(330px, 1fr); }
  .auth-art { padding: 24px 28px; }
  .auth-illustration { aspect-ratio: 1.12; }
  .main-content { padding-inline: 17px; }
  .topbar { padding-inline: 17px; }
  .management-grid, .upload-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 178px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .auth-layout { display: block; min-height: 100dvh; }
  .auth-art { display: none; }
  .auth-main { padding: 21px 20px 32px; justify-items: center; }
  .mobile-brand { display: inline-flex; width: min(100%, 412px); margin-bottom: 28px; }
  .auth-heading { margin-bottom: 17px; }
  .auth-heading h2 { font-size: 2rem; }
  .workspace { display: block; }
  .sidebar { position: fixed; width: min(81vw, 245px); top: 58px; bottom: 0; height: auto; min-height: 0; overflow: auto; transform: translateX(-101%); visibility: hidden; box-shadow: 9px 0 22px rgb(36 29 74 / 14%); padding-inline: 15px; }
  .menu-open .sidebar { transform: translateX(0); visibility: visible; }
  .menu-toggle { display: inline-grid; flex-shrink: 0; }
  .topbar { height: 58px; position: sticky; top: 0; z-index: 6; padding-inline: 11px; }
  .topbar-path { gap: 5px; }
  .topbar-date { gap: 5px; font-size: .81rem; }
  .main-content { padding: 21px 13px 34px; }
  .page-heading { flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
  .overview-banner { min-height: 170px; }
  .banner-content { padding: 17px 15px; max-width: 76%; }
  .overview-banner > img { right: 0; opacity: .64; width: 40%; }
  .panel-header { padding: 14px 13px; flex-wrap: wrap; }
  .management-grid, .dashboard-grid, .feedback-grid, .report-charts { gap: 12px; }
  .feedback-grid { grid-template-columns: 1fr; }
  .paper-stage { padding: 8px; }
  .manuscript-toolbar { padding-inline: 10px; }
  .manuscript-toolbar { flex-wrap: wrap; }
  th, td, th:first-child, td:first-child, th:last-child, td:last-child { padding-inline: 10px; }
  .notice { align-items: flex-start; flex-wrap: wrap; }
  .notice > span { min-width: 180px; }
}
@media (max-width: 370px) {
  .topbar-path > span { display: none; }
  .overview-banner > img { opacity: .38; }
  .banner-content { max-width: 94%; }
  .stat-card { padding-inline: 10px; }
}
@media print {
  @page { margin: 13mm; }
  body { background: white; color: #171717; print-color-adjust: exact; }
  .topbar, .sidebar, .back-row, .page-heading > .button { display: none !important; }
  .workspace, .main-shell { display: block; }
  .main-content { max-width: none; padding: 0; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-charts { grid-template-columns: 1fr 1fr; }
  .panel, .stat-card { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
}

.upload-single { grid-template-columns: minmax(0, 760px); }
.upload-busy [data-drop], .upload-busy .file-list { pointer-events: none; opacity: .75; }
[data-invite-codes] { font-family: ui-monospace, monospace; }
.invite-copy { margin-top: 9px; }
.assignment-form, .assignment-overview { max-width: 840px; }
.assignment-overview { margin-bottom: 18px; }
.assignment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.assignment-requirements { white-space: pre-wrap; overflow-wrap: anywhere; }
.assignment-actions { display: flex; gap: 8px; margin-top: 12px; }
.subject-settings { margin-top: 14px; }
.summary-only { grid-template-columns: minmax(0, 1fr); }
.paper-image > a { display: block; }
@media (max-width: 520px) {
  .assignment-fields { grid-template-columns: 1fr; }
}

.roster-grid { grid-template-columns: minmax(270px, .85fr) minmax(0, 1.75fr); align-items: start; }
.roster-intro { display: flex; align-items: center; gap: 12px; margin-bottom: 19px; }
.roster-intro p { margin-top: 3px; font-size: .9rem; }
.roster-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px dashed #c2b4e8;
  border-radius: 12px;
  background: #f9f6ff;
  color: var(--primary-deep);
  cursor: pointer;
}
.roster-file:hover, .roster-file:focus-within { border-color: #9278dd; background: #f1ebff; }
.roster-file:focus-within { outline: 3px solid #8a77dd; outline-offset: 2px; }
.roster-file > span:last-child { min-width: 0; }
.roster-file strong, .roster-file small { display: block; }
.roster-file small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-file-icon, .manager-avatar {
  display: grid;
  flex: 0 0 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: #eee6ff;
  color: #51408d;
}
.roster-header { padding: 18px 20px; }
.roster-header .inline-filter { width: min(100%, 176px); max-width: none; }
.roster-header .inline-filter select { min-height: 44px; }
.roster-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #ebe7f4;
  background: #faf9fe;
}
.roster-toolbar .button { height: 44px; min-width: 0; padding: 0 8px; gap: 6px; font-size: .875rem; }
.class-admin-button { border-color: #dcd1fc; background: #eee8ff; color: #46348f; }
.class-admin-button:hover, .class-admin-button[aria-expanded="true"] {
  border-color: #bca9f3;
  background: #e7ddff;
  color: #3a297d;
}
.class-permissions {
  margin: 14px 20px;
  padding: 14px;
  border: 1px solid #e4dcf7;
  border-radius: 12px;
  background: #f9f7ff;
}
.manager-list { list-style: none; padding: 0; margin: 10px 0; }
.manager-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-block: 7px;
  border-bottom: 1px solid #ece7f7;
}
.manager-list li:last-child { border: 0; }
.manager-list li > div { min-width: 0; flex: 1; }
.manager-list strong, .manager-list small { display: block; overflow-wrap: anywhere; }
.manager-avatar { border-radius: 50%; font-weight: 720; }
.grant-manager { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.grant-manager .button { min-height: 46px; }

.assignment-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 15px; }
.assignment-card { min-width: 0; position: relative; }
.assignment-card-link {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 19px 19px 15px;
  border-radius: inherit;
  color: var(--ink);
  transition: box-shadow .16s, background-color .16s;
  background: linear-gradient(150deg, #f7f3ff 0%, #fff 49%);
}
.assignment-card-link:hover { color: var(--ink); box-shadow: 0 7px 20px #37276516; }
.assignment-card-link:hover h2 { color: var(--primary-deep); }
.assignment-card-top { display: flex; align-items: center; gap: 9px; }
.assignment-type-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #eae1ff;
  color: #51399d;
}
.assignment-category { flex: 1; min-width: 0; }
.assignment-category strong, .assignment-category small { display: block; line-height: 1.3; }
.assignment-category strong { font-size: .9rem; }
.assignment-category small { margin-top: 3px; }
.assignment-card-content { flex: 1; min-height: 61px; }
.assignment-card-content h2 { font-size: 1.19rem; }
.assignment-card-content p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  margin-top: 5px;
  font-size: .9rem;
}
.assignment-card-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid #eeeaf5; padding-top: 11px; }
.assignment-byline { display: flex; flex-wrap: wrap; gap: 3px 9px; min-width: 0; color: var(--muted); font-size: .85rem; }
.assignment-byline strong { color: #49425c; }
.assignment-count { flex-shrink: 0; font-size: .84rem; font-weight: 690; color: var(--primary-deep); }

.batch-upload-form { display: grid; gap: 15px; max-width: 890px; }
.batch-groups { display: grid; gap: 13px; }
.batch-group { position: relative; min-width: 0; }
.batch-group-header, .batch-group-header > div { display: flex; align-items: center; gap: 10px; }
.batch-group-header { justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid #ede9f5; }
.batch-group-header > .text-link { color: #8b3852; }
.batch-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 15px 18px 10px; }
.batch-picker { display: grid; grid-template-rows: auto 46px; gap: 6px; min-width: 0; }
.batch-picker-label { font-size: .9rem; font-weight: 690; }
.batch-picker details { position: relative; min-width: 0; }
.batch-picker details[open] { z-index: 3; }
.batch-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #ddd8eb;
  border-radius: 10px;
  background: #fcfbff;
  color: #4b415f;
  font-weight: 590;
  cursor: pointer;
  list-style: none;
}
.batch-picker-trigger::-webkit-details-marker { display: none; }
.batch-picker-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border: solid #6b5d91;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  margin-right: 3px;
}
.batch-picker details[open] .batch-picker-trigger, .batch-picker-trigger:hover { border-color: #a691e8; background: #f7f2ff; }
.batch-picker details[open] .batch-picker-trigger::after { transform: translateY(2px) rotate(225deg); }
.batch-picker-trigger.is-disabled { background: #f3f1f7; color: #756f85; cursor: default; }
.batch-picker-trigger.is-disabled::after { opacity: .45; }
.batch-picker-menu {
  position: absolute;
  z-index: 3;
  inset: calc(100% + 5px) 0 auto;
  display: grid;
  gap: 3px;
  max-height: 215px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #e1d9f1;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 7px 22px #3e276927;
}
.batch-picker details:not([open]) .batch-picker-menu { display: none; }
.batch-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 37px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #302842;
  text-align: left;
  overflow-wrap: anywhere;
}
.batch-picker-option:hover, .batch-picker-option[aria-pressed="true"] { background: #f0eaff; color: var(--primary-deep); }
.batch-picker-option small { flex-shrink: 0; }
.batch-photos { padding: 4px 18px 17px; }
.batch-pick-photos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 8px;
  border: 1px dashed #bfb0e8;
  border-radius: 11px;
  background: #faf7ff;
  color: var(--primary-deep);
}
.batch-pick-photos:hover, .batch-pick-photos.dragging { background: #ede5ff; border-color: #8e73dc; }
.batch-pick-photos strong, .batch-pick-photos small { display: block; text-align: left; }
.batch-page-list { padding: 0; margin: 0 0 9px; display: grid; gap: 6px; list-style: none; }
.batch-page-list > li { display: flex; align-items: center; gap: 8px; border: 1px solid #ebe6f4; border-radius: 9px; padding: 7px; }
.batch-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; }
.batch-footer > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: flex-end; color: var(--muted); font-size: .88rem; }
.upload-busy .batch-group, .upload-busy [data-add-work] { pointer-events: none; opacity: .66; }

.manual-add summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.manual-add summary::-webkit-details-marker { display: none; }
.manual-add summary::after {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  margin-right: 4px;
  border: solid #6b5d91;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.manual-add[open] summary::after { transform: translateY(2px) rotate(225deg); }

@media (max-width: 920px) { .roster-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .roster-header, .roster-toolbar { padding-inline: 12px; }
  .roster-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-admin-button { grid-column: 1 / -1; }
  .class-permissions { margin-inline: 12px; }
  .batch-group-header, .batch-pickers, .batch-photos { padding-inline: 12px; }
  .batch-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .batch-footer > div { display: contents; }
  .batch-footer [data-batch-count] { grid-column: 1 / -1; grid-row: 1; color: var(--muted); }
  .batch-footer [data-add-work] { grid-column: 1; grid-row: 2; padding-inline: 5px; }
  .batch-footer button[type="submit"] { grid-column: 2; grid-row: 2; padding-inline: 5px; }
}

.identity-control { position: relative; margin-top: 3px; }
.identity-control summary { list-style: none; font-size: .82rem; color: var(--primary-deep); cursor: pointer; overflow-wrap: anywhere; }
.identity-control summary::-webkit-details-marker { display: none; }
.identity-control summary::after { display: inline-block; content: "▾"; margin-left: 5px; }
.identity-menu { position: absolute; left: -5px; bottom: calc(100% + 7px); z-index: 9; min-width: 156px; max-width: 190px; padding: 5px; display: grid; gap: 3px; border: 1px solid #e5ddf4; border-radius: 10px; background: #fff; box-shadow: 0 5px 17px #3621572c; }
.identity-control:not([open]) .identity-menu { display: none; }
.identity-menu button { width: 100%; border: none; text-align: left; border-radius: 7px; padding: 7px 9px; background: #fff; font-size: .86rem; color: var(--ink); }
.identity-menu button:hover, .identity-menu button[aria-pressed="true"] { background: #eee7ff; color: var(--primary-deep); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.admin-teacher-list { padding: 8px 16px 15px; }
.admin-teacher + .admin-teacher { border-top: 1px solid var(--line); }
.admin-teacher > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.admin-teacher > summary::-webkit-details-marker { display: none; }
.admin-teacher > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.admin-teacher > summary strong, .admin-teacher > summary small { display: block; overflow-wrap: anywhere; }
.admin-teacher-actions { display: grid; gap: 12px; padding: 5px 0 14px; }
.credentials-list dd { margin: 0 0 14px; font-weight: 700; }
.roster-batch { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; padding: 12px 20px; }
.roster-batch .field { flex: 1 1 152px; }
.roster-batch .button { min-height: 46px; }
.danger-button { border-color: #f0cbd2; color: #9d2440; background: #fff7f8; }
.danger-button:hover { background: #fce9ed; }
.prompt-upload { min-height: 115px; }
.assignment-prompt-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.assignment-prompt-photos img { display: block; object-fit: cover; width: 96px; height: 96px; border-radius: 8px; border: 1px solid var(--line); }
.form-select { position: relative; min-width: 0; width: 100%; }
.form-select[open] { z-index: 4; }
.form-select:not([open]) .batch-picker-menu { display: none; }
.form-select .batch-picker-trigger { overflow: hidden; }
.form-select[open] .batch-picker-trigger { border-color: #a691e8; background: #f7f2ff; }
.form-select[open] .batch-picker-trigger::after { transform: translateY(2px) rotate(225deg); }
.form-select [aria-invalid="true"] { box-shadow: 0 0 0 2px #e5a2b1; }
select.select-native { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); }
.report-analysis { margin-top: 15px; }
.report-analysis h3 { margin-top: 17px; }
.report-analysis li { margin-bottom: 6px; }
.analysis-cards { display: grid; gap: 8px; margin-top: 8px; }
.analysis-cards article { border: 1px solid #ece6f7; border-radius: 9px; padding: 9px 12px; background: #faf8ff; }
.analysis-cards p { margin-top: 4px; }
.analysis-action { color: var(--primary-deep); }
.mark-hotspots { position: absolute; inset: 0; pointer-events: none; }
.mark-hit { position: absolute; pointer-events: auto; padding: 0; background: transparent; border: 0; border-radius: 5px; }
.mark-hit:hover { background: #e7919e31; }
.note-popup { position: fixed; z-index: 20; width: min(340px, calc(100vw - 16px)); inset: auto; margin: 0; border: 1px solid #dcd0ee; border-radius: 12px; box-shadow: 0 8px 28px #3e295945; padding: 13px; color: var(--ink); background: #fff; }
.note-popup form { gap: 9px; }
.note-popup form > div { display: flex; justify-content: flex-end; gap: 7px; }
.note-popup [data-note-error] { color: #a2253e; }
.overall-editor { margin-top: 14px; }
.overall-editor form { margin-top: 12px; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }
