/* 阅伴 Pro · 设计系统 */
:root {
  --bg: #f3f6fb;
  --bg-2: #e9eff8;
  --card: #ffffff;
  --ink: #17243a;
  --ink-2: #45566f;
  --muted: #7b8ba3;
  --line: #e2e9f3;
  --line-2: #cfdaea;
  --primary: #2f6bff;
  --primary-dark: #1e4fd6;
  --primary-soft: #eaf1ff;
  --teal: #0da394;
  --teal-soft: #e4f6f2;
  --amber: #d6860a;
  --amber-soft: #fff4df;
  --red: #d84a4a;
  --red-soft: #fdecec;
  --indigo: #5959d8;
  --indigo-soft: #efefff;
  --nav: #0b1830;
  --nav-2: #112642;
  --nav-ink: #9fb1cc;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 38px rgba(23, 42, 74, 0.08);
  --shadow-sm: 0 4px 14px rgba(23, 42, 74, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.login-mode { background: #081426; }
body.modal-open { overflow: hidden; }
body.nav-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }
code { font-family: var(--mono); background: #eff3fa; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: #2b3d5c; }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.text-ok { color: var(--teal); font-weight: 600; }
.text-warn { color: var(--amber); font-weight: 600; }
.text-danger { color: var(--red); font-weight: 600; }
.right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.icon { flex: 0 0 auto; vertical-align: -2px; }

/* ---------- boot / noscript ---------- */
.boot-splash {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: radial-gradient(1200px 600px at 20% 0%, #16345f, #081426 60%); color: #c8d6ec;
}
.boot-logo {
  width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; font-weight: 800; font-size: 30px;
  color: #fff; background: linear-gradient(140deg, #3d7bff, #0da394); box-shadow: 0 18px 40px rgba(47, 107, 255, 0.35);
}
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #fff; z-index: 9999; font-size: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink); background: #fff; cursor: pointer;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .12s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, #3a78ff, #2459e6); color: #fff; box-shadow: 0 8px 20px rgba(47, 107, 255, 0.25); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 24px rgba(47, 107, 255, 0.34); }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { border-color: #b9c9df; background: #fbfcff; }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-soft:hover { background: #dfe9ff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { color: #fff; background: #c43c3c; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #eff3fa; color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.link-btn {
  border: 0; background: transparent; color: var(--primary); font-size: 12.5px; font-weight: 600;
  cursor: pointer; padding: 2px 4px; white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }
.link-btn .icon { margin-right: 3px; }

/* ---------- forms ---------- */
.field-label { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.field-label em { color: var(--red); font-style: normal; }
.label-hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.input, .select {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 42px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus { border-color: #7aa2ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12); }
.input:disabled, .select:disabled { background: #f5f7fb; color: #8a97a9; }
.select { padding-right: 30px; }
.textarea-lg { min-height: 200px !important; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.tight { gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-error {
  margin-top: 12px; padding: 9px 12px; border-radius: 9px; background: var(--red-soft); color: #b23232;
  font-size: 12.5px; border: 1px solid #f3caca;
}
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkline.inline { display: inline-flex; margin: 0; }
.checkline input { width: 16px; height: 16px; accent-color: var(--primary); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; padding-right: 40px; }
.input-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  width: 30px; height: 30px; border-radius: 7px; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.input-action:hover { background: #eef3fa; color: var(--ink); }
.input-with-action { position: relative; }
.input-with-action .input { padding-right: 42px; }
.inline-form { display: flex; gap: 10px; }
.inline-form .input { flex: 1; }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--teal-soft); color: #0b867a; }
.badge-warning { background: var(--amber-soft); color: #a56606; }
.badge-danger { background: var(--red-soft); color: #b83232; }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); }
.badge-muted { background: #eef2f8; color: #6d7c92; }
.method-pill { display: inline-flex; padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .2px; }
.method-rule { background: #eef2f8; color: #5d6f88; }
.method-ai { background: var(--indigo-soft); color: #4c4cc4; }
.method-manual { background: var(--teal-soft); color: #0a8276; }
.mini-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: #f0f4fa; color: #63748d; font-size: 11px; font-weight: 600; white-space: nowrap; }
.mini-tag.processing { background: var(--primary-soft); color: var(--primary-dark); }
.mini-tag.ghost { background: transparent; border: 1px solid var(--line); }
.type-chip { display: inline-flex; padding: 2px 8px; border-radius: 5px; background: #eef3fb; color: #506684; font-size: 11px; font-weight: 600; }
.type-chip.ai { background: var(--indigo-soft); color: #4c4cc4; }
.type-chip.manual { background: var(--teal-soft); color: #0a8276; }
.score-chip { font-size: 11.5px; color: var(--amber); font-weight: 700; }
.version-tag { display: inline-flex; padding: 1px 7px; border-radius: 5px; background: #eef3fb; color: #5b6d88; font-size: 11px; font-weight: 700; }
.attempt-pill { display: inline-flex; padding: 6px 13px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12.5px; font-weight: 700; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #eef2f8; color: #5d6f88; font-size: 11.5px; font-weight: 700; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: #0a8276; font-size: 11.5px; font-weight: 600; }
.live-chip.idle { background: #eef2f8; color: #70819a; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(13, 163, 148, .45); } 70% { box-shadow: 0 0 0 7px rgba(13, 163, 148, 0); } 100% { box-shadow: 0 0 0 0 rgba(13, 163, 148, 0); } }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 252px; z-index: 50;
  background: radial-gradient(900px 500px at 0% 0%, #193a68 0%, transparent 55%), linear-gradient(180deg, var(--nav), #081426);
  color: #dbe5f5; display: flex; flex-direction: column; padding: 22px 16px 18px;
  transition: transform .25s ease;
}
.sidebar-backdrop { display: none; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; }
.logo-mark {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #3f7dff, #0da394); color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .28); flex: 0 0 auto;
}
.logo-mark.logo-lg { width: 46px; height: 46px; border-radius: 14px; }
.logo-dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #ffd166; border: 2px solid var(--nav); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 19px; letter-spacing: .3px; color: #fff; font-weight: 700; }
.brand-text strong em { font-style: normal; color: #7fb0ff; font-weight: 600; }
.brand-text small { font-size: 10.5px; color: #7f95b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sidebar-role { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 14px; border-radius: 12px; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .06); }
.sidebar-role b { display: block; font-size: 13px; color: #f1f6ff; font-weight: 600; }
.sidebar-role span { display: block; font-size: 10.5px; color: #8da3c1; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; color: var(--nav-ink);
  font-size: 13.5px; font-weight: 500; transition: background .16s, color .16s; animation: navIn .35s ease both; animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes navIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(60, 122, 255, .28), rgba(60, 122, 255, .08)); color: #fff; box-shadow: inset 2px 0 0 #4f8bff; }
.nav-icon { display: inline-flex; color: #8aa3c4; }
.nav-link.active .nav-icon { color: #7fb0ff; }
.nav-label { flex: 1; }
.nav-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #ff6b6b; color: #fff; font-size: 10px; font-weight: 700; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.side-action {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: #8fa6c4; font-size: 12.5px; text-align: left; cursor: pointer;
}
.side-action:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-version { padding: 10px 10px 0; color: #5e7698; font-size: 10.5px; }
.main { margin-left: 252px; width: calc(100% - 252px); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; background: rgba(247, 250, 254, .88); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(210, 222, 238, .7);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h1 { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.topbar-sub { font-size: 11px; color: var(--muted); margin-top: -1px; }
.menu-btn { display: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; position: relative; }
.ai-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #67788f; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.ai-chip.ready { background: var(--teal-soft); border-color: #c7ebe5; color: #0a8276; }
.ai-chip.off { background: var(--amber-soft); border-color: #f1dfba; color: #9c6206; }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.user-chip:hover { background: #eef3fa; }
.topbar-logout { height: 34px; padding: 0 11px; font-size: 12px; color: var(--ink-2); }
.topbar-logout .icon { margin-right: 1px; }
.user-menu {
  position: absolute; right: 0; top: 52px; width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.user-menu.show { opacity: 1; visibility: visible; transform: none; }
.user-menu-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-head b { display: block; font-size: 13px; }
.user-menu-head span { display: block; font-size: 11px; color: var(--muted); }
.user-menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-size: 12.5px; cursor: pointer; text-align: left; }
.user-menu button:hover { background: #f2f6fc; color: var(--ink); }
.maintenance-banner { display: flex; align-items: center; gap: 8px; margin: 14px 30px -4px; padding: 9px 14px; border-radius: 10px; background: var(--amber-soft); color: #8a5a05; font-size: 12.5px; }

.avatar { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; flex: 0 0 auto; }
.avatar-teal { background: linear-gradient(145deg, #16b8a8, #0b867a); }
.avatar-blue { background: linear-gradient(145deg, #5b93ff, #2f6bff); }
.avatar-indigo { background: linear-gradient(145deg, #7c7cf0, #5959d8); }

.view { padding: 28px 30px 64px; width: 100%; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; line-height: 1.3; letter-spacing: -.4px; font-weight: 750; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.page-lead { margin-top: 7px; color: var(--ink-2); font-size: 13px; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.back-link:hover { color: var(--primary); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 13px; flex-wrap: wrap; }
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.section-head.spaced { margin-top: 24px; }
.section-hint { font-size: 11.5px; color: var(--muted); }
.section-link { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }

/* ---------- stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
  position: relative; display: flex; align-items: flex-start; gap: 13px; padding: 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.stat-card::after { content: ""; position: absolute; right: -30px; top: -36px; width: 96px; height: 96px; border-radius: 50%; background: currentColor; opacity: .045; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: var(--primary-soft); color: var(--primary); }
.stat-main { min-width: 0; }
.stat-value { font-size: 27px; font-weight: 750; line-height: 1.15; letter-spacing: -.6px; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.stat-extra { margin-left: auto; align-self: flex-end; }
.stat-note { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tone-teal .stat-icon { background: var(--teal-soft); color: var(--teal); }
.tone-amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.tone-indigo .stat-icon { background: var(--indigo-soft); color: var(--indigo); }
.tone-red .stat-icon { background: var(--red-soft); color: var(--red); }
.tone-teal .stat-value { color: #087a70; }
.tone-amber .stat-value { color: #9a5f00; }
.tone-indigo .stat-value { color: #4646bb; }
.tone-red .stat-value { color: #b53535; }

/* ---------- panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 16px 20px; margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 14.5px; font-weight: 700; }
.panel-head .tabs { margin: 0; flex: 1; }
.panel-actions { display: flex; gap: 8px; margin-top: 14px; }
.panel-text { color: var(--ink-2); font-size: 12.5px; margin-bottom: 14px; }
.compact-panel { padding: 16px 18px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.dashboard-side { display: flex; flex-direction: column; gap: 18px; }
.quick-links { display: flex; flex-direction: column; }
.quick-links a { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.quick-links a:last-child { border-bottom: 0; }
.quick-links a .icon:last-child { margin-left: auto; color: #b6c3d6; }
.quick-links a:hover { color: var(--primary); }
.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.kv-list span { color: var(--muted); }
.kv-list b { font-weight: 600; text-align: right; max-width: 65%; }

/* ---------- tables ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: auto; box-shadow: var(--shadow-sm); }
.panel.flush .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.data-table th {
  position: sticky; top: 0; z-index: 2; background: #f6f9fd; color: #6b7d96; font-size: 11px; font-weight: 700;
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #edf2f9; font-size: 12.5px; vertical-align: middle; color: var(--ink-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafcff; }
.data-table .row-muted td { color: #98a5b7; }
.data-table td .btn-sm { height: 30px; }
.table-main { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.table-main a, .table-main b { color: var(--ink); font-weight: 650; }
.table-main a:hover { color: var(--primary); }
.table-main .cell-muted { font-size: 11px; }
.person-cell { display: flex; flex-direction: column; line-height: 1.35; }
.person-cell b { font-weight: 650; color: var(--ink); }
.person-cell span { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.cell-muted { color: var(--muted); font-size: 11.5px; }
.cell-clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-detail { max-width: 420px; font-size: 11.5px; color: var(--ink-2); }
.row-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0 14px; flex-wrap: wrap; }
.panel.flush .table-toolbar { padding: 16px 20px 12px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-actions .select { width: auto; min-width: 132px; }
.search-box { position: relative; min-width: 230px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { width: 100%; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--line-2); border-radius: 9px; font-size: 12.5px; outline: none; background: #fff; }
.search-box input:focus { border-color: #7aa2ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }
.filter-panel { padding: 14px 18px 6px; margin-bottom: 8px; }
.filter-tabs { padding-bottom: 8px; }
.inline-progress { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.inline-progress span { font-size: 11px; color: var(--muted); min-width: 34px; }
.progress { height: 6px; border-radius: 999px; background: #e9eff8; overflow: hidden; flex: 1; min-width: 60px; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4d86ff, #2f6bff); }
.progress-fill.teal { background: linear-gradient(90deg, #22c3b2, #0da394); }
.attempt-score { display: inline-flex; min-width: 34px; justify-content: center; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #f1f5fb; color: #5d6f88; }
.attempt-score.good { background: var(--teal-soft); color: #0a8276; }
.attempt-score.warn { background: var(--amber-soft); color: #9a5f00; }
.attempt-score.bad { background: var(--red-soft); color: #b53535; }
.attempt-score.muted { background: #f1f5fb; color: #8391a5; }
.final-score b { font-size: 14px; color: var(--ink); }
.action-tag { display: inline-flex; padding: 2px 7px; border-radius: 5px; background: #f0f4fa; color: #5c6e87; font-size: 10.5px; font-weight: 600; white-space: nowrap; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 3px; background: #eef3fa; border-radius: 10px; }
.tab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; color: #66788f; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(23, 42, 74, .08); }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e4ebf5; color: #5d6f88; font-size: 10px; }
.tab.active .tab-count { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- callouts / feedback ---------- */
.callout { display: flex; gap: 11px; padding: 13px 15px; border-radius: 12px; background: #f1f6ff; border: 1px solid #dbe7fb; color: #35507a; margin-bottom: 16px; }
.callout .icon { margin-top: 1px; color: var(--primary); }
.callout b { font-size: 12.5px; display: block; color: var(--ink); }
.callout p { font-size: 12px; margin-top: 2px; color: var(--ink-2); }
.callout-warn { background: var(--amber-soft); border-color: #f0dfbc; }
.callout-warn .icon { color: var(--amber); }
.callout-danger { background: var(--red-soft); border-color: #f4cccc; }
.callout-danger .icon { color: var(--red); }
.callout-success { background: var(--teal-soft); border-color: #c9ece6; }
.callout-success .icon { color: var(--teal); }
.callout-info { background: var(--primary-soft); border-color: #d8e5ff; }
.callout.compact { margin: 12px 0 0; padding: 10px 12px; }

/* ---------- login ---------- */
.login-page { position: relative; min-height: 100vh; overflow: hidden; background: radial-gradient(1100px 700px at 12% 8%, #1a4076 0%, #0a1a33 48%, #071223 100%); color: #eaf1ff; display: flex; flex-direction: column; }
.login-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(120, 160, 220, .28) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 160, 220, .28) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 35% 30%, #000 20%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse at 35% 30%, #000 20%, transparent 72%); }
.login-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.orb-one { width: 460px; height: 460px; background: #2f6bff; left: -100px; top: -120px; }
.orb-two { width: 380px; height: 380px; background: #0da394; right: 3%; bottom: -160px; opacity: .32; }
.login-wrap { position: relative; z-index: 2; width: 100%; max-width: 1180px; margin: auto; padding: 48px 40px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 70px; align-items: center; }
.login-brand { padding: 10px 0; }
.brand-line { display: flex; align-items: center; gap: 13px; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .4px; }
.brand-line b { color: #8db8ff; font-weight: 600; }
.login-brand h1 { margin-top: 34px; font-size: 47px; line-height: 1.24; letter-spacing: -1.5px; font-weight: 750; color: #f4f8ff; }
.login-brand h1 span { background: linear-gradient(100deg, #7fb0ff, #4fe0cd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-lead { margin-top: 18px; font-size: 14px; color: #a9bdd9; max-width: 460px; line-height: 1.8; }
.feature-list { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 14px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(127, 176, 255, .13); border: 1px solid rgba(127, 176, 255, .24); color: #8db8ff; flex: 0 0 auto; }
.feature-list b { display: block; font-size: 13px; color: #e4edfb; font-weight: 650; }
.feature-list small { display: block; font-size: 11.5px; color: #8fa6c6; margin-top: 2px; }
.login-note { margin-top: 28px; display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: #7fd7ca; padding: 7px 12px; border-radius: 999px; background: rgba(13, 163, 148, .09); border: 1px solid rgba(13, 163, 148, .18); }
.login-card { background: rgba(255, 255, 255, .985); color: var(--ink); border-radius: 24px; padding: 38px 36px 30px; box-shadow: 0 40px 90px rgba(0, 0, 0, .42); border: 1px solid rgba(255, 255, 255, .5); }
.login-card-head h2 { font-size: 26px; font-weight: 750; letter-spacing: -.5px; }
.login-card-head p { font-size: 12.5px; color: var(--muted); margin: 5px 0 24px; }
.login-card .field-label { margin-top: 15px; }
.login-card .input { height: 46px; background: #f8fafd; border-color: #dde6f2; }
.login-card .input:focus { background: #fff; }
.login-card .btn-lg { margin-top: 24px; height: 48px; font-size: 14.5px; }
.login-help { display: flex; align-items: flex-start; gap: 7px; margin-top: 20px; font-size: 11.5px; color: var(--muted); }
.login-help .icon { margin-top: 2px; }
.login-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10.5px; color: #97a5b9; text-align: center; }
.login-copyright { position: relative; z-index: 2; text-align: center; padding: 0 20px 26px; font-size: 10.5px; color: #5e7698; }
.login-page .form-error { margin-top: 14px; }

/* ---------- classes ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.class-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s; }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9d9ef; }
.class-card.archived { opacity: .72; }
.class-card-top { display: flex; gap: 12px; align-items: flex-start; }
.class-avatar { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, #e8f0ff, #d7e5ff); color: #2f5fb8; display: grid; place-items: center; font-size: 18px; font-weight: 750; flex: 0 0 auto; }
.class-title { flex: 1; min-width: 0; }
.class-title h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 2px; }
.class-title h3 a { color: var(--ink); }
.class-title p { font-size: 11.5px; color: var(--muted); }
.class-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 15px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.class-stats > div { text-align: center; }
.class-stats b { display: block; font-size: 17px; font-weight: 750; }
.class-stats span { font-size: 10.5px; color: var(--muted); }
.class-foot { display: flex; align-items: center; gap: 10px; }
.class-code { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.class-foot .btn { margin-left: auto; }
.class-foot .text-warn, .class-foot .text-ok { font-size: 11px; }
.class-mini-list { display: flex; flex-direction: column; }
.class-mini { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.class-mini:last-child { border-bottom: 0; }
.class-mini b { display: block; font-size: 12.5px; color: var(--ink); }
.class-mini span { display: block; font-size: 10.5px; color: var(--muted); }
.class-mini .icon:last-child { margin-left: auto; color: #b6c3d6; }
.class-dot { width: 8px; height: 8px; border-radius: 3px; background: #8fb1e8; flex: 0 0 auto; }
.assignment-list { display: flex; flex-direction: column; gap: 10px; }
.assignment-row { display: flex; align-items: center; gap: 18px; padding: 15px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); color: inherit; transition: border-color .15s, transform .15s; }
.assignment-row:hover { border-color: #c9d9ef; transform: translateY(-1px); color: inherit; }
.assignment-row.static { box-shadow: none; }
.assignment-row-main { flex: 1; min-width: 0; }
.assignment-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assignment-name b { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.assignment-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.assignment-progress { width: 210px; flex: 0 0 auto; }
.progress-line { display: flex; align-items: center; gap: 8px; }
.progress-line span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.assignment-meta { display: flex; gap: 10px; font-size: 10.5px; margin-top: 5px; color: var(--muted); }
.assignment-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.row-arrow { color: #b6c3d6; }
.todo-list { display: flex; flex-direction: column; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.todo-row:last-child { border-bottom: 0; }
.todo-row .icon:last-child { color: #b6c3d6; margin-left: auto; }
.todo-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); flex: 0 0 auto; }
.todo-icon.danger { background: var(--red-soft); color: var(--red); }
.todo-main { flex: 1; min-width: 0; }
.todo-main b { display: block; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-main span { display: block; font-size: 10.5px; color: var(--muted); }
.roster-result { margin-top: 16px; }

/* ---------- student works ---------- */
.photo-callout { display: flex; align-items: center; gap: 13px; padding: 14px 16px; margin-bottom: 18px; border-radius: 13px; background: linear-gradient(120deg, #eef5ff, #f4fbff); border: 1px solid #ccdfff; }
.photo-callout > .icon { color: var(--primary); flex: 0 0 auto; }
.photo-copy { flex: 1; min-width: 0; }
.photo-copy b { display: block; font-size: 13px; color: var(--ink); }
.photo-copy p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.photo-callout .btn { flex: 0 0 auto; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.work-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .16s, box-shadow .16s; }
.work-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.work-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.work-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.work-score { font-size: 12px; color: var(--muted); white-space: nowrap; }
.work-score b { font-size: 22px; font-weight: 750; color: var(--ink); letter-spacing: -.5px; }
.work-score.empty { font-size: 11px; color: #a4b1c3; }
.work-card h3 { font-size: 15.5px; margin: 13px 0 6px; font-weight: 700; }
.work-card h3 a { color: var(--ink); }
.work-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; flex-wrap: wrap; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #c0cbdb; margin: 0 3px; }
.work-progress { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 15px 0 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.attempt-chip { padding: 2px 8px; border-radius: 5px; background: #f1f5fb; color: #5d6f88; font-size: 10.5px; font-weight: 600; }
.attempt-chip.bad { background: var(--red-soft); color: #b53535; }
.attempt-left { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.work-foot { display: flex; align-items: center; margin-top: auto; gap: 10px; }
.teacher-line { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.work-foot .btn { margin-left: auto; }
.question-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.q-head { display: flex; gap: 13px; margin-bottom: 14px; }
.q-number { width: 34px; height: 34px; border-radius: 10px; background: #eef3fb; color: #48617f; display: grid; place-items: center; font-size: 13px; font-weight: 750; flex: 0 0 auto; }
.q-number.small { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.q-number.tiny { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.q-title { min-width: 0; flex: 1; }
.q-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.q-stem { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; line-height: 1.75; }
.q-image { display: block; width: 100%; max-height: 620px; object-fit: contain; margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.q-image-note { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #eef5ff; color: var(--primary); font-size: 12px; }
.q-options { margin: 8px 0 0; padding: 9px 12px; background: #f7f9fd; border-radius: 8px; font-family: var(--font); font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; }
.answer-input { min-height: 86px; }
.form-section { margin-top: 22px; }
.ref-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ref-thumb { position: relative; width: 108px; height: 108px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f2f6fc; display: block; }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumb.removed { opacity: .35; }
.ref-toggle { position: absolute; right: 4px; bottom: 4px; border: 0; border-radius: 5px; background: rgba(10, 22, 40, .72); color: #fff; font-size: 10px; padding: 3px 6px; cursor: pointer; }
.ref-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.upload-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pdf-chip { display: inline-flex; margin-top: 8px; padding: 5px 9px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-dark); font-size: 11px; font-weight: 600; }

/* ---------- uploads ---------- */
.upload-zone { border: 1.5px dashed #c7d6ea; border-radius: 14px; background: #fafcff; padding: 18px; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone.dragging { border-color: #7aa2ff; background: #f4f8ff; }
.upload-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px; color: var(--muted); }
.upload-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 9px; }
.upload-empty b { font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.upload-empty small { font-size: 11px; }
.image-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.image-preview { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f2f6fc; aspect-ratio: 4/3; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.page-tag, .image-size { position: absolute; left: 6px; top: 6px; background: rgba(10, 22, 40, .7); color: #fff; font-size: 9.5px; padding: 2px 6px; border-radius: 4px; }
.image-size { left: auto; right: 6px; top: auto; bottom: 6px; }
.remove-btn { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: rgba(10, 22, 40, .72); color: #fff; cursor: pointer; display: grid; place-items: center; }
.upload-inline { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; font-weight: 600; color: var(--primary); cursor: pointer; }
.submit-bar { position: sticky; bottom: 14px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding: 13px 18px; border-radius: 14px; background: rgba(255, 255, 255, .94); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(23, 42, 74, .13); backdrop-filter: blur(10px); }
.submit-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.attempt-list { display: flex; flex-direction: column; }
.attempt-row { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.attempt-row:last-child { border-bottom: 0; }
.attempt-row .icon:last-child { margin-left: auto; color: #b6c3d6; }
.attempt-round { font-weight: 650; color: var(--ink); min-width: 56px; }
.attempt-time { color: var(--muted); font-size: 10.5px; margin-left: auto; }

/* ---------- score result ---------- */
.score-hero { display: flex; align-items: center; gap: 30px; padding: 28px 30px; background: linear-gradient(120deg, #fff, #f5f9ff); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.score-ring { --p: 0; width: 148px; height: 148px; border-radius: 50%; background: conic-gradient(#0da394 calc(var(--p) * 1%), #e8eef7 0); display: grid; place-items: center; position: relative; flex: 0 0 auto; }
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.score-ring-inner { position: relative; z-index: 1; text-align: center; }
.score-ring-inner b { display: block; font-size: 38px; font-weight: 780; letter-spacing: -1.5px; line-height: 1.05; }
.score-ring-inner span { font-size: 11.5px; color: var(--muted); }
.score-hero.processing .score-ring { background: conic-gradient(#2f6bff 25%, #e8eef7 0); animation: rotateRing 2s linear infinite; }
@keyframes rotateRing { to { transform: rotate(360deg); } }
.score-copy { flex: 1; }
.score-copy .eyebrow { display: flex; gap: 6px; align-items: center; }
.score-copy h2 { font-size: 22px; font-weight: 750; margin: 6px 0 5px; }
.score-copy p { font-size: 12.5px; color: var(--ink-2); }
.score-copy .btn { margin-top: 12px; }
.page-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.page-thumb { position: relative; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; padding: 0; cursor: pointer; aspect-ratio: 4/3; }
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }
.page-thumb span { position: absolute; left: 6px; bottom: 6px; font-size: 9.5px; background: rgba(10, 22, 40, .7); color: #fff; padding: 2px 6px; border-radius: 4px; }
.result-card { background: var(--card); border: 1px solid var(--line); border-left: 3px solid #d9e3f1; border-radius: 13px; padding: 17px 19px; margin-bottom: 12px; transition: box-shadow .2s, border-color .2s; }
.result-card.status-correct { border-left-color: #12b5a4; }
.result-card.status-partial { border-left-color: #e2a32a; }
.result-card.status-incorrect { border-left-color: #e06363; }
.result-card.status-pending, .result-card.status-unclear { border-left-color: #b0bfd4; }
.result-card.flash { box-shadow: 0 0 0 3px rgba(47, 107, 255, .18); }
.result-head { display: flex; gap: 12px; align-items: flex-start; }
.result-title { flex: 1; min-width: 0; }
.small-stem { font-size: 12.5px; color: var(--ink-2); }
.result-score { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 80px; }
.score-value { font-size: 17px; font-weight: 750; color: var(--ink); }
.score-max { font-size: 11px; color: var(--muted); }
.score-empty { color: var(--muted); }
.result-score.pending .score-value { color: var(--amber); }
.answer-block { margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: #f7f9fd; }
.answer-block.reference { background: #f3fbf9; }
.answer-label { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 3px; }
.answer-text { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.feedback { display: flex; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line); }
.feedback-icon { width: 24px; height: 24px; border-radius: 7px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: 0 0 auto; }
.feedback b { font-size: 11.5px; color: var(--ink); }
.feedback p { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.feedback.warn .feedback-icon { background: var(--amber-soft); color: var(--amber); }
.confidence { font-size: 10px; color: var(--muted); }
.attempt-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.attempt-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.attempt-tab span { font-size: 10.5px; color: var(--muted); }
.attempt-tab.active { border-color: #a9c3ff; background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- viewer / annotations ---------- */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
.viewer-main { min-width: 0; }
.viewer-stage { background: #eef3fa; border-radius: 12px; padding: 12px; min-height: 300px; display: flex; align-items: flex-start; justify-content: center; }
.viewer-page { display: none; position: relative; max-width: 100%; }
.viewer-page.active { display: block; }
.viewer-page img { display: block; max-height: 68vh; width: auto; max-width: 100%; border-radius: 8px; }
.viewer-pages { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.viewer-thumb, .viewer-tab { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 11px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.viewer-thumb.active, .viewer-tab.active { background: var(--primary-soft); border-color: #a9c3ff; color: var(--primary-dark); font-weight: 600; }
.viewer-side { background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.viewer-side h4 { font-size: 12.5px; margin-bottom: 10px; }
.viewer-note { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 10px; margin-bottom: 7px; cursor: pointer; }
.viewer-note:hover { border-color: #b9cdf0; }
.viewer-note-number { font-size: 10.5px; font-weight: 700; color: var(--ink); }
.viewer-note small { color: var(--muted); font-size: 10px; }
.anno-box { position: absolute; border: 2px solid #0da394; border-radius: 5px; background: rgba(13, 163, 148, .07); pointer-events: none; }
.anno-ok { border-color: #0da394; background: rgba(13, 163, 148, .08); }
.anno-warn { border-color: #e2a32a; background: rgba(226, 163, 42, .09); }
.anno-bad { border-color: #e06363; background: rgba(224, 99, 99, .08); }
.anno-muted { border-color: #8fa3bd; background: rgba(143, 163, 189, .08); border-style: dashed; }
.anno-box.pulse { animation: annoPulse 1.6s ease; }
@keyframes annoPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 107, 255, .5); } 50% { box-shadow: 0 0 0 8px rgba(47, 107, 255, 0); } }

/* ---------- assignment editor ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.editor-main .panel { padding: 20px; }
.editor-side { position: sticky; top: 92px; }
.sticky-panel { position: sticky; top: 92px; }
.score-summary { display: flex; align-items: center; gap: 18px; padding: 10px 14px; background: #f7f9fd; border-radius: 10px; font-size: 12px; color: var(--ink-2); margin-bottom: 14px; flex-wrap: wrap; }
.score-summary b { font-size: 14px; color: var(--ink); }
.material-quick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 12px 0 8px; border: 1px solid #cbdcff; border-radius: 13px; background: linear-gradient(120deg, #eef5ff, #f6fbff); flex-wrap: wrap; }
.material-quick-copy { flex: 1; min-width: 230px; }
.material-quick-copy b { display: block; font-size: 13px; color: var(--ink); }
.material-quick-copy span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.material-quick-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.material-status { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #f7f9fd; color: var(--muted); font-size: 11.5px; }
.material-status b { color: var(--ink-2); }
.material-mode { border-top: 1px dashed var(--line); padding: 14px 0; }
.material-mode:first-of-type { border-top: 0; padding-top: 4px; }
.material-mode-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.material-mode-title span { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); }
.pdf-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pdf-upload-card { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 11px; background: #fbfcff; }
.pdf-upload-card b { display: block; font-size: 12.5px; }
.pdf-upload-card p { margin: 3px 0 9px; font-size: 11px; color: var(--muted); }
.pdf-upload-card .pdf-chip { margin-top: 8px; }
.question-editor-list { display: flex; flex-direction: column; gap: 12px; }
.q-editor { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: #fcfdff; }
.q-paper { background: #f5faff; border-color: #bfd8ff; }
.q-image-editor { background: #fbfdff; border-color: #cfe0fb; }
.q-image-preview { margin-top: 8px; padding: 8px; border: 1px dashed #cfe0fb; border-radius: 9px; background: #fff; text-align: center; }
.q-image-preview img { max-width: 100%; max-height: 300px; object-fit: contain; border-radius: 6px; }
.q-image-hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.q-paper-title { font-size: 13px; font-weight: 700; color: var(--ink); padding: 9px 0; }
.q-paper-title span { margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: #e7f0ff; color: var(--primary); font-size: 10px; font-weight: 600; }
.q-paper-body { padding: 10px 12px; border-radius: 8px; background: #ffffff; border: 1px dashed #cfe0fb; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.q-editor-head { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.q-order { width: 28px; height: 28px; border-radius: 8px; background: #eef3fb; color: #5b708d; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: 0 0 auto; margin-bottom: 3px; }
.q-fields { display: grid; grid-template-columns: .8fr 1.1fr .8fr 1.3fr; gap: 10px; flex: 1; }
.q-editor-body { display: flex; flex-direction: column; gap: 10px; }
.q-editor-body .form-grid { grid-template-columns: 1fr 1fr; }
.q-editor-head .icon-btn { margin-bottom: 2px; }
.ref-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.check-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.check-list li.ok .icon { color: var(--teal); }
.check-list li.bad .icon, .check-list li.warn .icon { color: var(--amber); }
.publish-note { display: flex; gap: 7px; padding: 10px; border-radius: 9px; background: #f5f9ff; color: #64778f; font-size: 11px; line-height: 1.6; }
.publish-note .icon { color: var(--primary); margin-top: 1px; }
.editor-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.editor-actions .btn { width: 100%; }

/* ---------- review ---------- */
.review-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr); gap: 20px; align-items: start; }
.review-left, .review-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.review-viewer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; }
.review-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.viewer-actions { display: flex; align-items: center; gap: 10px; }
.review-page { background: #eef3fa; border-radius: 12px; padding: 12px; display: flex; justify-content: center; max-height: 72vh; overflow: auto; }
.review-image-wrap { position: relative; max-width: 100%; }
.review-image-wrap img { display: block; max-width: 100%; max-height: 68vh; border-radius: 6px; }
.review-no-image { background: #fff; border: 1px dashed var(--line-2); border-radius: 14px; padding: 42px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); text-align: center; }
.review-no-image b { color: var(--ink-2); font-size: 13px; }
.review-no-image p { font-size: 12px; }
.text-answer-list { display: flex; flex-direction: column; gap: 10px; }
.text-answer { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fbfcff; }
.text-answer-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; margin-bottom: 5px; }
.text-answer pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 12px; color: var(--ink-2); }
.score-panel { padding: 18px; }
.score-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.big-score { font-size: 40px; font-weight: 780; letter-spacing: -1.5px; line-height: 1.05; }
.big-score small { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.score-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--muted); }
.score-meta b { color: var(--ink); }
.score-summary-text { margin-top: 10px; font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 10px; }
.review-total { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--primary-soft); font-size: 11.5px; color: #41577a; }
.review-total b { font-size: 20px; color: var(--primary-dark); margin-left: auto; }
.review-q-list { display: flex; flex-direction: column; gap: 12px; }
.review-q { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px; box-shadow: var(--shadow-sm); }
.review-q-head { display: flex; align-items: flex-start; gap: 10px; }
.review-q-title { flex: 1; min-width: 0; }
.review-q-stem { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; white-space: pre-wrap; }
.review-award { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.review-award .score-input { width: 66px; text-align: center; height: 36px; font-weight: 700; }
.review-award span { font-size: 11px; color: var(--muted); }
.review-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.answer-box { background: #f7f9fd; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; min-height: 38px; }
.answer-box.reference { background: #f3fbf9; }
.keyword-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; font-size: 10.5px; color: var(--muted); }
.keyword-chip { padding: 1px 7px; border-radius: 4px; background: #eef3fb; color: #536b8b; }

/* ---------- settings / dev ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.settings-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.settings-side { display: flex; flex-direction: column; gap: 18px; }
.help-list { display: flex; flex-direction: column; gap: 12px; }
.help-list > div { display: flex; gap: 8px; font-size: 11.5px; color: var(--ink-2); line-height: 1.65; }
.help-list .icon { color: var(--teal); margin-top: 2px; flex: 0 0 auto; }
.help-list .icon.alert { color: var(--amber); }
.providers { display: flex; gap: 8px; flex-wrap: wrap; }
.provider-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 1px solid var(--line); background: #fbfcff; border-radius: 9px; padding: 7px 11px; font-size: 11.5px; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.provider-chip small { font-size: 9.5px; color: var(--muted); font-weight: 400; }
.provider-chip:hover { border-color: #a9c3ff; background: var(--primary-soft); }
.provider-chip.danger { color: var(--red); }
.grading-flow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.flow-step { display: flex; gap: 10px; align-items: flex-start; flex: 1; }
.flow-step > span { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.flow-step b { display: block; font-size: 12.5px; }
.flow-step p { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.flow-arrow { color: #b7c6da; flex: 0 0 auto; }
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.info-cell { background: #fff; padding: 14px 16px; min-width: 0; }
.info-cell span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.info-cell b { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tools-grid .panel { padding: 20px; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.health-card { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.health-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.health-card span { display: block; font-size: 10.5px; color: var(--muted); }
.health-card b { display: block; font-size: 20px; font-weight: 750; line-height: 1.3; }
.health-card small { display: block; font-size: 10px; color: var(--muted); }
.health-card.tone-teal .health-icon { background: var(--teal-soft); color: var(--teal); }
.health-card.tone-amber .health-icon { background: var(--amber-soft); color: var(--amber); }
.health-card.tone-red .health-icon { background: var(--red-soft); color: var(--red); }
.health-card.tone-indigo .health-icon { background: var(--indigo-soft); color: var(--indigo); }
.audit-mini { display: flex; flex-direction: column; }
.audit-mini-row { display: flex; gap: 9px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.audit-mini-row:last-child { border-bottom: 0; }
.audit-dot { width: 6px; height: 6px; border-radius: 50%; background: #a9c3ff; margin-top: 7px; flex: 0 0 auto; }
.audit-mini-row b { display: block; font-size: 11px; font-weight: 600; color: var(--ink); }
.audit-mini-row span { display: block; font-size: 10px; color: var(--muted); }

/* ---------- modal / toast / empty ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(9, 20, 38, .52); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 30px; overflow-y: auto; opacity: 0; transition: opacity .18s; }
.modal-overlay.show { opacity: 1; }
.modal { width: 100%; max-width: 560px; background: #fff; border-radius: 18px; box-shadow: 0 40px 100px rgba(5, 15, 32, .4); transform: translateY(10px); transition: transform .18s; display: flex; flex-direction: column; max-height: 88vh; }
.modal-overlay.show .modal { transform: none; }
.modal.modal-wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcff; border-radius: 0 0 18px 18px; }
.modal-text { font-size: 13px; color: var(--ink-2); }
.modal-hint { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.7; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.credential-box { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: #f2f7ff; border: 1px dashed #bcd2f5; }
.credential-box code { background: transparent; font-size: 16px; letter-spacing: 1px; color: var(--primary-dark); flex: 1; word-break: break-all; }
.toasts { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; min-width: 240px; max-width: 380px; padding: 11px 14px; border-radius: 11px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(9, 20, 38, .16); font-size: 12.5px; color: var(--ink-2); transform: translateX(16px); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: auto; }
.toast.show { opacity: 1; transform: none; }
.toast-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.toast-success .toast-icon { background: var(--teal-soft); color: var(--teal); }
.toast-error .toast-icon { background: var(--red-soft); color: var(--red); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-art { width: 62px; height: 62px; border-radius: 18px; background: #eef3fa; color: #8fa5c2; display: grid; place-items: center; margin-bottom: 13px; }
.empty h3 { font-size: 14px; color: var(--ink-2); font-weight: 650; }
.empty p { font-size: 12px; margin-top: 4px; max-width: 360px; }
.empty-action { margin-top: 14px; }
.loading-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: var(--muted); font-size: 12.5px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid #dbe5f3; border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-xs { width: 11px; height: 11px; border-width: 1.6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inline { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; padding: 14px 0; }
.error-block { display: flex; align-items: flex-start; gap: 12px; padding: 18px; border: 1px solid #f3cccc; background: var(--red-soft); border-radius: 12px; color: #9c3636; }
.error-block strong { display: block; font-size: 13px; }
.error-block p { font-size: 12px; margin-top: 2px; }
.error-block .btn { margin-left: auto; }
.flash { animation: flashCard 1.5s ease; }
@keyframes flashCard { 0%, 100% { box-shadow: var(--shadow-sm); } 30% { box-shadow: 0 0 0 3px rgba(47, 107, 255, .22); } }

/* ---------- misc ---------- */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action-card { display: flex; align-items: center; gap: 16px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.action-card > div { flex: 1; }
.action-card b { display: block; font-size: 12.5px; }
.action-card span { font-size: 11px; color: var(--muted); }
.action-card .btn { flex: 0 0 auto; }
.rich-text { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; line-height: 1.8; }
.small-table { margin-top: 12px; }
.small-table .data-table { min-width: 420px; }
.small-table .data-table td, .small-table .data-table th { padding: 8px 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stats-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .review-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr); }
  .login-wrap { gap: 44px; }
  .login-brand h1 { font-size: 40px; }
}
@media (max-width: 1100px) {
  .dashboard-grid, .settings-layout { grid-template-columns: 1fr; }
  .dashboard-side, .settings-side { display: grid; grid-template-columns: 1fr 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .sticky-panel, .editor-side { position: static; }
  .editor-actions { flex-direction: row; }
  .editor-actions .btn { flex: 1; }
  .review-layout { grid-template-columns: 1fr; }
  .grading-flow { flex-wrap: wrap; }
  .flow-arrow { display: none; }
  .flow-step { min-width: 240px; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(8, 18, 34, .5); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .sidebar-backdrop.show { opacity: 1; visibility: visible; }
  .main { margin-left: 0; width: 100%; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .view { padding: 22px 18px 54px; }
  .login-wrap { grid-template-columns: 1fr; max-width: 560px; gap: 32px; padding: 34px 22px; }
  .login-brand { text-align: center; }
  .login-brand h1 { font-size: 34px; margin-top: 22px; }
  .login-lead { margin-left: auto; margin-right: auto; }
  .feature-list { display: none; }
  .login-note { margin-top: 18px; }
  .login-card { padding: 28px 24px 24px; }
  .login-copyright { display: none; }
}
@media (max-width: 760px) {
  .stats-grid, .stats-grid.four, .stats-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding: 18px 14px 46px; }
  .topbar { height: 64px; }
  .topbar-left h1 { font-size: 16px; }
  .topbar-sub { display: none; }
  .topbar-logout { width: 34px; padding: 0; font-size: 0; }
  .topbar-logout .icon { margin: 0; }
  .ai-chip { display: none; }
  .user-chip span { display: none; }
  .page-head h1 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-head { align-items: flex-start; }
  .dashboard-side, .settings-side { grid-template-columns: 1fr; }
  .form-grid, .form-row, .review-answer-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .work-grid, .class-grid { grid-template-columns: 1fr; }
  .assignment-row { flex-wrap: wrap; gap: 10px; }
  .assignment-progress { width: 100%; }
  .assignment-actions { margin-left: auto; }
  .score-hero { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; }
  .score-ring { width: 124px; height: 124px; }
  .score-ring-inner b { font-size: 31px; }
  .tools-grid, .action-grid, .status-grid { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: 1fr; }
  .ref-editor { grid-template-columns: 1fr; }
  .pdf-upload-grid { grid-template-columns: 1fr; }
  .material-quick-actions { width: 100%; }
  .material-quick-actions .btn { flex: 1 1 auto; }
  .q-fields { grid-template-columns: 1fr 1fr; }
  .q-editor-body .form-grid { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; }
  .viewer-side { max-height: 220px; overflow: auto; }
  .submit-bar { flex-direction: column; align-items: stretch; gap: 9px; }
  .submit-bar .btn { width: 100%; }
  .photo-callout { flex-wrap: wrap; }
  .photo-callout .btn { width: 100%; }
  .login-brand h1 { font-size: 29px; letter-spacing: -.8px; }
  .login-card { border-radius: 18px; }
  .login-note { font-size: 10px; }
  .page-lead { font-size: 12px; }
  .stat-value { font-size: 23px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 34px; height: 34px; }
  .modal-overlay { padding: 4vh 10px 20px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .login-help { font-size: 10.5px; }
  .data-table { min-width: 680px; }
  .table-toolbar { align-items: stretch; }
  .search-box { min-width: 0; flex: 1; }
}
@media (max-width: 460px) {
  .stats-grid, .stats-grid.four, .stats-grid.five { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { flex-direction: column; gap: 8px; }
  .stat-extra { align-self: flex-start; margin-left: 0; }
  .login-card { padding: 24px 18px 20px; }
  .login-brand h1 { font-size: 25px; }
  .page-actions .btn { flex: 1; }
}
