/* 全局表面统一为清爽中性色；深绿主色与黄色操作、状态提示保持不变。 */
:root {
  --primary: #1f4f45;
  --primary-strong: #173f38;
  --primary-soft: #e3f2ec;
  --accent: #0e6b50;
  --accent-soft: #ddf6ea;
  --warning: #8a5a12;
  --warning-soft: #fff4c2;
  --danger: #b23a22;
  --danger-soft: #ffe2d6;
  --violet-soft: #efeaf8;
  --blue: #1f5a8c;
  --blue-soft: #ddefff;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --surface-hover: #edf2ef;
  --surface-muted: #e8eeea;
  --background: #f6f8f6;
  --text: #2c3654;
  --text-secondary: #5a6280;
  --text-muted: #5a6280;
  --border: #e0e7e3;
  --border-strong: #c6d4cc;
  --shadow-sm: none;
  --shadow-md: 0 6px 16px rgba(44, 54, 84, .12);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --font-caption: 12px;
  --font-label: 13px;
  --font-body: 15px;
  --sidebar-width: 266px;
  --topbar-height: 70px;
  --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--background);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", ui-sans-serif, sans-serif;
  font-size: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
::selection { color: #fff; background: var(--primary); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 3000; top: 12px; left: 12px; padding: 10px 14px;
  color: #fff; background: var(--primary-strong); border-radius: var(--radius-sm);
  transform: translateY(-160%); transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0); }
.icon { display: inline-flex; width: 20px; height: 20px; flex: 0 0 auto; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100dvh; }

/* Account-private work editor: reuse the existing drawer, no new page theme. */
#personal-work-editor { min-width: 0; }
.personal-work-inputs { margin: 18px 0; padding: 0; border: 0; min-width: 0; }
.personal-work-inputs details { margin-bottom: 20px; }
.personal-work-inputs summary { cursor: pointer; font-weight: 700; }
.personal-work-row { margin: 18px 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.personal-work-row legend { padding: 0 6px; font-weight: 700; overflow-wrap: anywhere; }
.personal-work-row-actions, .personal-work-toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.personal-work-row-actions .text-button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.personal-work-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.personal-work-fields label { display: grid; gap: 5px; min-width: 0; }
.personal-work-fields input, .personal-work-fields select { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.personal-work-check { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; }
.personal-work-check input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: var(--primary); }
.personal-work-row-result, .personal-work-hint { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); overflow-wrap: anywhere; }
.personal-work-row-result[data-pw-status="ready"], .personal-work-success { color: var(--primary); background: var(--primary-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.personal-work-row-result[data-pw-status="invalid"], .personal-work-row-result[data-pw-status="conflict"] { color: var(--danger); background: var(--danger-soft); }
.personal-work-review { border-top: 1px solid var(--border); padding-top: 18px; }
.personal-work-toolbar { margin: 20px 0; }
.personal-work-toolbar small, .personal-work-saved small { display: block; color: var(--text-secondary); }
.personal-work-saved-list { display: grid; gap: 12px; }
.personal-work-saved { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.personal-work-revoke-confirm { grid-column: 1/-1; }
.personal-work-revoke-confirm button { margin: 0 8px 8px 0; }
.calendar-event.personal-work, .dashboard-calendar-event.personal-work { background: var(--primary-soft); color: var(--primary); }
.calendar-footnote > button { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 600px) {
  .personal-work-fields { grid-template-columns: minmax(0,1fr); }
  .personal-work-row { padding: 12px; }
  .personal-work-review > button, .personal-work-inputs > button { width: 100%; }
  .calendar-footnote { flex-wrap: wrap; }
  .calendar-footnote > span:not(.icon) { flex: 1; min-width: 0; }
  .calendar-footnote > button { flex-basis: 100%; }
}

/* App frame */
.sidebar {
  position: fixed; z-index: 100; inset: 0 auto 0 0; display: flex; width: var(--sidebar-width);
  flex-direction: column; overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface-soft);
}
.brand {
  display: flex; min-height: var(--topbar-height); align-items: center; gap: 11px;
  padding: 0 20px; border-bottom: 1px solid var(--border);
}
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--primary); }
.brand-mark span { position: absolute; width: 11px; height: 15px; border: 2px solid rgba(255,255,255,.94); border-radius: 70% 20% 70% 20%; }
.brand-mark span:nth-child(1) { left: 7px; top: 7px; transform: rotate(-38deg); }
.brand-mark span:nth-child(2) { right: 7px; top: 7px; transform: rotate(38deg) scaleX(-1); }
.brand-mark span:nth-child(3) { left: 16px; bottom: 5px; width: 2px; height: 12px; border: 0; border-radius: 2px; background: #fff; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .07em; }
.brand small { margin-top: -2px; color: var(--text-muted); font-size: var(--font-label); letter-spacing: .09em; }
.sidebar-nav { flex: 0 0 auto; padding: 14px 12px 12px; }
.nav-label { margin: 8px 11px 10px; color: var(--text-muted); font-size: 11px; font-weight: 750; letter-spacing: .09em; }
.nav-item {
  position: relative; display: flex; width: 100%; min-height: 58px; align-items: center; gap: 10px;
  margin: 2px 0; padding: 7px 9px; color: var(--text); border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left; text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: color var(--transition), background var(--transition);
}
.nav-item > .icon { width: 34px; height: 34px; padding: 7px; color: var(--primary-strong); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 7%, white); }
.nav-copy { display: grid; min-width: 0; gap: 1px; }
.nav-copy strong { font-size: 14px; font-weight: 750; line-height: 1.3; }
.nav-copy small { color: var(--text-muted); font-size: 11.5px; font-weight: 500; line-height: 1.35; }
.nav-item:hover { background: var(--surface-soft); }
.nav-item:active { background: var(--primary-soft); }
.nav-item.active { color: var(--primary-strong); background: var(--primary-soft); }
.nav-item.active > .icon { background: var(--primary-soft); }
.nav-item.active .nav-copy small { color: var(--primary); }
.nav-group { margin: 9px 0 8px; padding-top: 9px; border-top: 1px solid var(--border); }
.nav-group-heading { display: flex; align-items: center; gap: 2px; }
.nav-group-heading .nav-item { min-width: 0; width: auto; flex: 1; }
.nav-disclosure {
  display: inline-flex; width: 38px; min-height: 44px; flex: 0 0 38px; align-items: center; justify-content: center;
  padding: 0; color: var(--text-muted); border: 0; border-radius: var(--radius-sm); background: transparent;
  cursor: pointer; touch-action: manipulation; transition: color var(--transition), background var(--transition);
}
.nav-disclosure:hover { color: var(--primary-strong); background: var(--primary-soft); }
.nav-disclosure .icon { width: 17px; height: 17px; transition: transform var(--transition); }
.nav-disclosure[aria-expanded="true"] .icon { transform: rotate(180deg); }
.sidebar-subnav { display: grid; gap: 1px; margin: 1px 0 4px 25px; padding: 2px 0 3px 15px; border-left: 1px solid var(--border-strong); }
.subnav-heading { margin: 9px 9px 2px; color: var(--text-muted); font-size: 11px; font-weight: 750; letter-spacing: .05em; line-height: 1.5; }
.subnav-heading:first-child { margin-top: 4px; }
.subnav-item {
  position: relative; display: flex; min-height: 36px; align-items: center; padding: 5px 10px 5px 13px;
  color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; line-height: 1.3;
  text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: color var(--transition), background var(--transition);
}
.subnav-item:hover { color: var(--text); background: var(--border); }
.subnav-item.active { color: var(--primary-strong); background: var(--primary-soft); font-weight: 750; }
.subnav-item.active::before { position: absolute; top: calc(50% - 3px); left: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); content: ""; }
.subnav-item[aria-disabled="true"] { color: var(--text-muted); opacity: .55; }
.subnav-item[aria-disabled="true"]:hover { background: transparent; }
.nav-direct { margin-top: 5px; }
@media (prefers-reduced-motion: reduce) {
  .nav-disclosure .icon { transition: none; }
}
.nav-count { min-width: 22px; margin-left: auto; padding: 1px 6px; color: var(--primary-strong); border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: var(--font-label); text-align: center; }
.admin-nav-badge { min-width: 34px; color: var(--warning); border-color: #efd5b2; background: var(--warning-soft); }
.sidebar-personal-nav { margin-top: auto; padding: 8px 12px 6px; border-top: 1px solid var(--border); }
.sidebar-footer { margin: 0 12px 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.school-card { display: flex; width: 100%; align-items: center; gap: 9px; padding: 10px; color: var(--text); border: 0; border-radius: var(--radius-sm); background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.school-card:hover { background: var(--primary-soft); }
.school-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 34%, transparent); outline-offset: 2px; }
.school-card > .icon { color: var(--primary); }
.school-card > span:nth-child(2) { min-width: 0; flex: 1; }
.school-card strong, .school-card small { display: block; }
.school-card strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.school-card small { margin-top: 1px; color: var(--text-muted); font-size: var(--font-caption); }
.school-card .school-card-edit { width: 14px; height: 14px; color: var(--text-muted); opacity: 0; transform: translateX(-2px); transition: opacity var(--transition), transform var(--transition); }
.school-card:hover .school-card-edit, .school-card:focus-visible .school-card-edit { opacity: 1; transform: translateX(0); }
.school-profile-form { display: grid; gap: 14px; }
.school-profile-preview { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--primary-soft); }
.school-profile-preview .icon { color: var(--primary); }
.school-profile-preview strong, .school-profile-preview small { display: block; }
.school-profile-preview small { margin-top: 2px; color: var(--text-secondary); }
.sync-status { display: flex; align-items: center; gap: 7px; padding: 10px; color: var(--text-muted); font-size: var(--font-caption); }
.sync-status[data-mode="connecting"] .status-dot,
.sync-status[data-mode="syncing"] .status-dot { background: #b48032; }
.sync-status[data-mode="offline"] .status-dot,
.sync-status[data-mode="error"] .status-dot { background: #b35656; }
.status-dot { width: 8px; height: 8px; border: 2px solid #cfe7de; border-radius: 50%; background: var(--accent); box-sizing: content-box; }
.workspace { min-height: 100dvh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky; z-index: 60; top: 0; display: flex; height: var(--topbar-height); align-items: center;
  gap: 18px; padding: 0 24px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
}
.global-search {
  display: flex; width: min(540px, 48vw); min-width: 0; min-height: 44px; align-items: center; gap: 10px; padding: 0 12px;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); text-align: left;
  transition: border var(--transition), background var(--transition);
}
.global-search:hover { border-color: var(--border-strong); background: #fff; }
.global-search > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { padding: 2px 7px; color: var(--text-muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; background: #fff; font-family: inherit; font-size: var(--font-label); }
.topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; margin-left: auto; }
.topbar-client-download { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; padding: 0 8px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--font-label); font-weight: 600; white-space: nowrap; text-decoration: none; text-underline-offset: 4px; }
.topbar-client-download .icon { width: 18px; height: 18px; }
.topbar-client-download:hover, .topbar-client-download:focus-visible { color: var(--primary); }
.topbar-client-download:hover > span:not(.icon):not(.sr-only) { text-decoration: underline; }
.icon-button, .primary-button, .secondary-button, .profile-button { min-height: 44px; border-radius: var(--radius-sm); transition: transform var(--transition), border-color var(--transition), background var(--transition); }
.icon-button:active, .primary-button:active, .secondary-button:active, .profile-button:active { transform: scale(.97); }
.icon-button { position: relative; display: inline-flex; width: 44px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); background: #fff; }
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.icon-button.subtle { border-color: transparent; background: var(--surface-soft); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; font-weight: 700; text-decoration: none; }
.primary-button { color: #fff; border: 1px solid var(--primary); background: var(--primary); }
.primary-button:hover { border-color: var(--primary-strong); background: var(--primary-strong); }
.primary-button.compact,.secondary-button.compact { padding: 0 13px; }
.secondary-button { color: var(--primary-strong); border: 1px solid var(--border); background: #fff; }
.secondary-button:hover { background: var(--primary-soft); }
.secondary-button.full { width: calc(100% - 36px); margin: 14px 18px 18px; }
.homework-quick-trigger .icon { width: 18px; height: 18px; }
.notification-badge { position: absolute; top: 3px; right: 3px; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; color: #fff; border: 2px solid #fff; border-radius: 999px; background: var(--danger); font-size: 10px; font-weight: 700; }
.notification-badge[hidden] { display:none; }
.profile-button { display: flex; align-items: center; gap: 9px; padding: 4px 7px 4px 4px; border: 1px solid transparent; background: transparent; text-align: left; }
.profile-button:hover { border-color: var(--border); background: var(--surface-soft); }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; color: var(--primary); border-radius: var(--radius-sm); background: #deeee8; font-weight: 750; }
.profile-copy strong, .profile-copy small { display: block; white-space: nowrap; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: var(--text-muted); font-size: var(--font-caption); }
.profile-button .chevron { width: 15px; height: 15px; color: var(--text-muted); }
.menu-button { display: none; }
.mobile-tabbar { display: none; }

/* Personal hub */
.me-heading { margin-bottom: 14px; }
.me-profile-card {
  display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 15px;
  margin-bottom: 14px; padding: 18px;
}
.me-avatar { display: grid; width: 56px; height: 56px; place-items: center; color: var(--primary); border-radius: var(--radius-md); background: #deeee8; font-size: 20px; font-weight: 750; }
.me-profile-copy { min-width: 0; }
.me-profile-copy small,.me-profile-copy strong,.me-profile-copy > span { display: block; }
.me-profile-copy small { color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.me-profile-copy strong { margin-top: 2px; font-size: 18px; }
.me-profile-copy > span { margin-top: 2px; color: var(--text-secondary); font-size: var(--font-label); }
.me-link-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.me-link-card {
  display: grid; min-width: 0; min-height: 92px; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 14px 15px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); text-align: left;
}
.client-download-card { text-decoration: none; }
.client-download-card:hover { background: var(--surface-soft); }
.auth-client-entries { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
.auth-classroom-entry { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 8px; color: var(--primary); font-weight: 600; text-decoration: none; text-underline-offset: 4px; }
.auth-classroom-entry:hover > span:not(.icon):not(.sr-only) { text-decoration: underline; }
.auth-classroom-hint { margin: 0 0 8px; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.6; }
.auth-client-downloads { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; }
.auth-client-download { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; color: var(--primary); font-size: var(--font-label); text-underline-offset: 4px; }
button.me-link-card { transition: border-color var(--transition), background var(--transition), transform var(--transition); }
button.me-link-card:hover { border-color: var(--border); background: var(--surface-soft); }
button.me-link-card:active { transform: scale(.99); }
.me-link-icon { width: 42px; height: 42px; padding: 10px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.me-link-card strong,.me-link-card small { display: block; }
.me-link-card strong { font-size: 13px; }
.me-link-card small { margin-top: 4px; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.55; }
.me-link-arrow { width: 17px; height: 17px; color: var(--text-muted); }
.me-privacy-card { box-shadow: none; background: #f6fbf9; }
.me-privacy-card .me-link-icon { color: var(--accent); background: var(--accent-soft); }

/* Shared page components */
main { width: 100%; max-width: 1620px; margin: 0 auto; padding: 26px 26px 48px; }
.page-view { display: none; animation: page-in 220ms ease-out; }
.page-view.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; min-height: 78px; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.page-heading h1 { margin: 0 0 5px; font-size: clamp(25px, 2vw, 31px); line-height: 1.25; letter-spacing: -.025em; }
.page-heading p:last-child { margin: 0; color: var(--text-secondary); }
.welcome-heading { align-items: center; }
.eyebrow { margin: 0 0 4px; color: var(--text-secondary); font-size: var(--font-caption); font-weight: 650; letter-spacing: 0; text-transform: none; }
h1, h2, p { margin-top: 0; }
h2 { margin-bottom: 0; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.text-link { min-height: 44px; padding: 0 6px; color: var(--primary-strong); border: 0; background: transparent; font-weight: 700; }
.text-link:hover { text-decoration: underline; }
.role-badge, .status-chip, .current-week { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; color: var(--primary-strong); border-radius: 999px; background: var(--primary-soft); font-size: var(--font-label); font-weight: 700; white-space: nowrap; }
.status-chip.current { color: var(--warning); background: var(--warning-soft); }
.status-chip.success { color: var(--primary); background: var(--accent-soft); }
.status-chip.muted { color: var(--text-muted); background: var(--border); }

/* Dashboard */
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .8fr); grid-template-areas: "today calendar" "focus calendar"; gap: 16px; align-items: start; }
.today-card { grid-area: today; }
.dashboard-calendar-card { grid-area: calendar; }
.focus-card { grid-area: focus; }
.today-agenda { padding: 7px 18px 12px; }
.agenda-row { position: relative; display: grid; width: 100%; grid-template-columns: 62px 6px minmax(0,1fr); align-items: center; gap: 13px; min-height: 70px; padding: 8px 6px 8px 0; color: var(--text); border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; transition: background var(--transition); }
.agenda-row:hover { background: var(--surface-soft); }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row time { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.agenda-line { width: 4px; height: 40px; border-radius: 4px; background: var(--border-strong); }
.agenda-row.lesson .agenda-line { background: var(--primary); }
.agenda-row.duty .agenda-line, .agenda-row.route .agenda-line { background: var(--accent); }
.agenda-row.meeting .agenda-line { background: var(--warning); }
.agenda-row.school-event .agenda-line { background: var(--blue); }
.agenda-row.school-event.school-meeting .agenda-line { background: var(--warning); }
.agenda-row.school-event.school-service .agenda-line { background: var(--accent); }
.agenda-section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; margin-top: 4px; color: var(--text-secondary); border-bottom: 1px solid var(--border); font-size: var(--font-label); font-weight: 750; }
.agenda-section-label small { color: var(--text-muted); font-size: var(--font-caption); font-weight: 650; }
.agenda-copy strong, .agenda-copy small { display: block; }
.agenda-copy strong { margin-bottom: 2px; }
.agenda-copy small { color: var(--text-muted); }
.focus-list { padding: 6px 18px 12px; }
.focus-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 70px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.focus-item:last-child { border-bottom: 0; }
.focus-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.focus-item strong, .focus-item small { display: block; }
.focus-item small { color: var(--text-muted); font-size: var(--font-label); }
.focus-item.done strong { color: var(--text-muted); text-decoration: line-through; }
.priority-text { color: var(--danger); font-size: var(--font-label); font-weight: 700; }
.task-status-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; padding: 12px 18px 3px; }
.task-status-tab { display: flex; min-width: 0; min-height: 44px; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); font-weight: 700; }
.task-status-tab b { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 999px; background: #fff; font-size: var(--font-caption); }
.task-status-tab.active { color: var(--primary-strong); border-color: var(--border); background: var(--primary-soft); }
.task-state { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; color: var(--text-secondary); border-radius: 999px; background: var(--border); font-size: var(--font-caption); font-weight: 750; white-space: nowrap; }
.status-doing .task-state { color: var(--warning); background: var(--warning-soft); }
.status-follow_up .task-state { color: var(--primary); background: var(--accent-soft); }
.status-done .task-state { color: var(--text-secondary); background: var(--border); }
.status-done .task-copy strong { color: var(--text-muted); text-decoration: line-through; }
.task-copy { min-width: 0; }
.task-edit { width:100%; min-height:44px; padding:4px 0; color:var(--text); border:0; background:transparent; text-align:left; border-radius:var(--radius-sm); }
.task-edit:hover { color:var(--primary-strong); }
.task-edit:focus-visible { outline:3px solid rgba(31,79,69,.25); outline-offset:2px; }
.task-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-copy small.overdue { color: var(--danger); font-weight: 700; }
.task-transition { min-width: 96px; padding-inline: 12px; }
.task-empty { display: grid; min-height: 156px; place-items: center; align-content: center; gap: 6px; color: var(--text-secondary); text-align: center; }
.task-empty small { color: var(--text-muted); }
.task-empty button { margin-top: 8px; }
.dashboard-month-bar { display: grid; min-height: 52px; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; align-items: center; gap: 4px; padding: 4px 14px 0; }
.dashboard-month-bar strong { text-align: center; font-size: 12px; }
.dashboard-month-bar .icon-button { width: 44px; min-height: 44px; }
.dashboard-calendar-insights { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 14px 3px; }
.calendar-insight { display: flex; min-width: 0; min-height: 104px; flex-direction: column; justify-content: space-between; gap: 9px; padding: 12px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); text-align: left; transition: border-color var(--transition), background var(--transition), box-shadow var(--transition); }
.calendar-insight:hover { border-color: var(--border-strong); background: var(--surface-soft); box-shadow: 0 4px 14px rgba(43,39,74,.06); }
.calendar-insight:focus-visible { outline: 3px solid rgba(31,79,69,.25); outline-offset: 2px; }
.calendar-insight-top,.calendar-insight-bottom { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-insight-top small,.calendar-insight-bottom small { min-width: 0; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.35; }
.calendar-insight-top small { flex: 1; }
.calendar-insight-bottom small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-insight-top strong { color: var(--primary-strong); font-family: ui-serif, Georgia, serif; font-size: 22px; font-weight: 650; white-space: nowrap; }
.calendar-insight-bottom > span { flex: 0 0 auto; color: var(--primary-strong); font-size: var(--font-caption); font-weight: 750; }
.term-progress { display: block; width: 100%; height: 7px; overflow: hidden; border-radius: 99px; background: var(--border); }
.term-progress > i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }
.countdown-insight { background: #fff8f5; }
.countdown-insight:hover { background: #fff4ef; }
.countdown-insight .icon { width: 17px; height: 17px; color: #b35f4e; }
.countdown-value { color: #c45f4d; font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1; }
.countdown-insight { min-height: 132px; }
.countdown-metrics { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 10px; }
.countdown-metrics > span { color: var(--danger); font-size: var(--font-caption); font-weight: 700; text-align: right; }
.countdown-edit-button,.countdown-date-button { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; gap: 5px; padding: 0 7px; color: var(--danger); border: 0; border-radius: var(--radius-sm); background: transparent; font-size: var(--font-caption); font-weight: 750; }
.countdown-edit-button:hover,.countdown-date-button:hover { background: rgba(196,95,77,.1); }
.countdown-edit-button:focus-visible,.countdown-date-button:focus-visible { outline: 3px solid rgba(196,95,77,.22); outline-offset: 1px; }
.countdown-edit-button .icon { width: 14px; height: 14px; }
.countdown-preview { display: flex; min-height: 78px; flex-direction: column; justify-content: center; gap: 5px; padding: 13px 15px; border: 1px solid #efd8d1; border-radius: var(--radius-sm); background: #fff8f5; }
.countdown-preview small { color: var(--text-secondary); font-size: var(--font-caption); }
.countdown-preview strong { color: var(--danger); font-size: 15px; }
.form-error { margin: 0; color: var(--danger); font-size: var(--font-label); line-height: 1.5; }
.countdown-ai-panel { display:grid; gap:10px; margin:16px 20px 0; padding:14px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.countdown-ai-heading { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:9px; }
.countdown-ai-heading > span:nth-child(2) strong,.countdown-ai-heading > span:nth-child(2) small { display:block; }
.countdown-ai-heading > span:nth-child(2) strong { font-size:12px; }
.countdown-ai-heading > span:nth-child(2) small { margin-top:2px; color:var(--text-secondary); font-size: var(--font-caption); line-height:1.45; }
.countdown-ai-icon { width:34px; height:34px; padding:8px; color:var(--primary); border-radius:var(--radius-sm); background:var(--primary-soft); }
.countdown-conversation { display:grid; max-height:160px; gap:8px; overflow-y:auto; padding:10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; }
.countdown-message { display:flex; min-width:0; }
.countdown-message span { max-width:88%; padding:9px 11px; border-radius:10px 10px 10px 3px; background:var(--primary-soft); font-size: var(--font-label); line-height:1.6; overflow-wrap:anywhere; }
.countdown-message.user { justify-content:flex-end; }
.countdown-message.user span { color:#fff; border-radius:10px 10px 3px 10px; background:var(--primary); }
.countdown-examples { display:flex; flex-wrap:wrap; gap:8px; }
.countdown-examples button { min-height:44px; padding:0 11px; color:var(--primary-strong); border:1px solid var(--border); border-radius:999px; background:#fff; font-size: var(--font-caption); font-weight:700; }
.countdown-examples button:hover { border-color:var(--primary); background:var(--primary-soft); }
.countdown-ai-label { color:var(--text-secondary); font-size: var(--font-label); font-weight:700; }
.countdown-ai-compose { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:stretch; gap:8px; }
.countdown-ai-compose textarea { min-width:0; min-height:64px; resize:vertical; padding:10px 11px; color:var(--text); border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; font:inherit; line-height:1.5; }
.countdown-ai-compose .secondary-button { align-self:stretch; }
.countdown-ai-panel button:focus-visible,.countdown-ai-compose textarea:focus-visible { outline:3px solid rgba(31,79,69,.22); outline-offset:1px; }
.countdown-ai-panel button:disabled { cursor:wait; opacity:.55; }
.dashboard-today-button { min-height: 44px; padding: 0 9px; color: var(--primary-strong); border: 0; border-radius: var(--radius-sm); background: transparent; font-size: var(--font-caption); font-weight: 750; }
.dashboard-today-button:hover { background: var(--primary-soft); }
.dashboard-calendar-weekdays, .dashboard-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding-inline: 14px; }
.dashboard-calendar-weekdays { padding-block: 5px 3px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; text-align: center; }
.dashboard-date { position: relative; display: grid; min-width: 0; min-height: 44px; place-items: center; padding: 0; color: var(--text-secondary); border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; font-size: var(--font-caption); font-variant-numeric: tabular-nums; transition: color var(--transition), border-color var(--transition), background var(--transition); }
.dashboard-date:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.dashboard-date.outside { color: var(--border-strong); }
.dashboard-date.selected { color: #fff; border-color: var(--primary); background: var(--primary); font-weight: 750; }
.dashboard-date i { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.dashboard-date.selected i { background: #fff; }
.dashboard-calendar-agenda { margin-top: 10px; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.dashboard-calendar-agenda-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.dashboard-calendar-agenda-title strong { font-size: var(--font-label); }
.dashboard-calendar-agenda-title span { color: var(--text-muted); font-size: var(--font-caption); }
.dashboard-calendar-events { display: grid; gap: 4px; }
.dashboard-calendar-event { display: grid; width: 100%; min-height: 48px; grid-template-columns: 6px minmax(0, 1fr) 16px; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: var(--radius-sm); background: var(--surface-soft); text-align: left; }
.dashboard-calendar-event:hover { background: var(--surface-soft); }
.dashboard-calendar-event > i { width: 6px; height: 6px; border-radius: 2px; background: var(--text-muted); }
.dashboard-calendar-event.meeting > i { background: var(--warning); }
.dashboard-calendar-event.activity > i { background: var(--primary); }
.dashboard-calendar-event.safety > i { background: var(--danger); }
.dashboard-calendar-event.service > i { background: var(--accent); }
.dashboard-calendar-event strong, .dashboard-calendar-event small { display: block; }
.dashboard-calendar-event strong { font-size: var(--font-caption); line-height: 1.35; }
.dashboard-calendar-event small { margin-top: 1px; color: var(--text-muted); font-size: var(--font-caption); }
.dashboard-calendar-event > .icon { width: 14px; height: 14px; color: var(--text-muted); }
.dashboard-calendar-more { min-height: 36px; color: var(--primary-strong); border: 0; background: transparent; font-size: var(--font-caption); font-weight: 700; text-align: center; }
.dashboard-calendar-empty { display: grid; min-height: 56px; place-items: center; color: var(--text-muted); border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--font-caption); }

/* Schedule */
.schedule-import-status { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cde4db; border-radius: var(--radius-md); background: #f5fbf8; }
.schedule-import-status[hidden] { display: none; }
.schedule-import-status > span:nth-child(2) strong, .schedule-import-status > span:nth-child(2) small { display: block; }
.schedule-import-status > span:nth-child(2) small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.import-status-icon { width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: #dff1e9; }
.mapping-state { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 0 10px; color: var(--warning); border-radius: 999px; background: var(--warning-soft); font-size: var(--font-caption); font-weight: 700; white-space: nowrap; }
.mapping-state .icon { width: 15px; height: 15px; }
.schedule-edit-toggle.is-active { color: #fff; border-color: var(--primary); background: var(--primary); }
.schedule-edit-toggle.is-active:hover { background: var(--primary-strong); }
.schedule-edit-banner { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; color: var(--primary-strong); border: 1px solid #bfdccf; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--primary-soft), var(--surface-soft)); }
.schedule-edit-banner[hidden] { display: none; }
.schedule-edit-banner > span:nth-child(2) strong, .schedule-edit-banner > span:nth-child(2) small { display: block; }
.schedule-edit-banner > span:nth-child(2) strong { font-size: 13px; }
.schedule-edit-banner > span:nth-child(2) small { margin-top: 2px; color: var(--text-secondary); font-size: var(--font-label); }
.schedule-edit-banner-icon { width: 40px; height: 40px; padding: 10px; color: #fff; border-radius: var(--radius-sm); background: var(--primary); }
.schedule-edit-banner .secondary-button { min-height: 40px; background: rgba(255, 255, 255, .82); }
.schedule-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.week-switcher, .legend { display: flex; align-items: center; gap: 9px; }
.week-switcher strong { font-size: 15px; }
.week-switcher .icon-button { width: 38px; min-height: 38px; }
.legend { color: var(--text-secondary); font-size: var(--font-label); flex-wrap: wrap; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-dot.lesson { background: var(--primary); }
.legend-dot.duty { background: var(--accent); }
.legend-dot.meeting { background: var(--warning); }
.legend-dot.personal { background: var(--text-muted); }
.schedule-board-card { overflow-x: auto; border-radius: var(--radius-md); }
.schedule-board { display: grid; min-width: 1000px; grid-template-columns: 112px repeat(5, minmax(168px, 1fr)); }
.board-corner, .board-day, .board-time, .board-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.board-day { position: sticky; top: 0; z-index: 3; min-height: 62px; padding: 12px 8px; background: var(--surface-soft); text-align: center; }
.board-day strong, .board-day small { display: block; }
.board-day small { color: var(--text-muted); font-size: var(--font-caption); }
.board-day.today { color: var(--primary-strong); background: var(--primary-soft); }
.board-corner { display: grid; min-height: 62px; place-items: center; color: var(--text-muted); background: var(--surface-soft); font-size: var(--font-label); font-weight: 700; }
.board-time { display: flex; min-height: 86px; flex-direction: column; justify-content: center; padding: 9px 10px 9px 12px; border-left: 4px solid var(--primary); background: var(--surface-soft); }
.board-time em { align-self: flex-start; margin-bottom: 4px; padding: 2px 6px; color: var(--primary-strong); border-radius: 999px; background: var(--primary-soft); font-size: var(--font-caption); font-style: normal; font-weight: 700; }
.board-time strong { font-size: var(--font-label); }
.board-time span { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); font-variant-numeric: tabular-nums; }
.board-cell { min-height: 86px; padding: 6px; background: #fff; }
.board-time.slot-routine { border-left-color: var(--blue); background: #f7fafe; }
.board-time.slot-routine em { color: var(--blue); background: var(--blue-soft); }
.board-time.slot-break { min-height: 60px; border-left-color: var(--text-muted); background: var(--surface-soft); }
.board-time.slot-break em { color: var(--text-secondary); background: var(--border); }
.board-cell.slot-break { min-height: 60px; background: #fafafa; }
.board-cell.slot-break .empty-slot { min-height: 46px; }
.board-time.slot-duty { min-height: 72px; border-left-color: var(--accent); background: #f5fbf8; }
.board-time.slot-duty em { color: var(--primary); background: var(--accent-soft); }
.board-cell.slot-duty { min-height: 72px; background: #fbfdfc; }
.board-cell.slot-duty .empty-slot { min-height: 56px; }
.board-cell:nth-child(6n) { border-right: 0; }
.board-event-wrap { position: relative; }
.board-event-wrap + .board-event-wrap { margin-top: 5px; }
.board-event { display: block; width: 100%; min-height: 70px; padding: 8px; color: var(--primary-strong); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); text-align: left; transition: transform var(--transition), border-color var(--transition); }
.board-event:hover { transform: translateY(-1px); border-color: #bfdccf; }
.board-event strong, .board-event small, .board-event time { display: block; }
.board-event strong { overflow: hidden; font-size: var(--font-label); text-overflow: ellipsis; white-space: nowrap; }
.board-event small { margin-top: 2px; color: var(--text-secondary); font-size: var(--font-caption); }
.board-event time { margin-top: 5px; color: var(--text-muted); font-size: var(--font-caption); font-variant-numeric: tabular-nums; }
.board-event.duty, .board-event.duty-evening, .board-event.route { color: var(--primary); border-color: #cce2da; border-left-color: var(--accent); background: var(--accent-soft); }
.board-event.meeting { color: var(--warning); border-color: #f0d9ba; border-left-color: var(--warning); background: var(--warning-soft); }
.board-event.personal { color: var(--text-secondary); border-color: var(--border); border-left-color: var(--text-muted); background: var(--surface-soft); }
.schedule-board.editing .board-cell { background: var(--surface-soft); }
.schedule-board.editing .board-cell.slot-duty { background: #f8fcfa; }
.schedule-board.editing .board-event { padding-right: 52px; }
.board-event-delete { position: absolute; top: 4px; right: 4px; z-index: 2; display: inline-flex; width: 44px; min-height: 44px; align-items: center; justify-content: center; color: var(--danger); border: 1px solid #efc8ca; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .92); transition: transform var(--transition), background var(--transition); }
.board-event-delete:hover { background: var(--danger-soft); }
.board-event-delete:active { transform: scale(.96); }
.board-event-delete .icon { width: 17px; height: 17px; }
.empty-slot { display: flex; min-height: 70px; align-items: center; justify-content: center; color: var(--border-strong); border: 1px dashed transparent; border-radius: var(--radius-sm); font-size: var(--font-caption); }
.schedule-board.editing .empty-slot { color: var(--primary-strong); border-color: #bfdccf; background: var(--surface-soft); font-weight: 700; }
.schedule-board.editing .empty-slot:hover { border-color: var(--primary); background: var(--primary-soft); }
.empty-slot-placeholder { display: flex; min-height: 70px; align-items: center; justify-content: center; color: var(--border-strong); font-size: var(--font-caption); }
.board-cell.slot-break .empty-slot-placeholder { min-height: 46px; }
.board-cell.slot-duty .empty-slot-placeholder { min-height: 56px; }
.schedule-footnote { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 12px 14px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); font-size: 12px; }
.schedule-footnote .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--primary); }

/* Daily routine scoring */
.class-context-bar { display: grid; grid-template-columns: minmax(260px,1.25fr) minmax(220px,1fr) auto; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm); }
.class-context-bar label { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; color: var(--text-secondary); font-size: var(--font-caption); font-weight: 750; }
.class-context-bar select { width: 100%; min-height: 44px; padding: 0 38px 0 12px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background-color: var(--surface-soft); font-size: 12px; font-weight: 750; }
.class-context-bar select:focus-visible { border-color: var(--primary); outline: 3px solid rgba(31,79,69,.14); outline-offset: 1px; }
.class-context-bar select:disabled { color: var(--text); opacity: 1; cursor: default; }
.class-context-relation { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 0 4px; }
.class-context-relation > .icon { width: 30px; height: 30px; padding: 7px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.class-context-relation small,.class-context-relation strong { display: block; }
.class-context-relation small { color: var(--text-muted); font-size: var(--font-caption); }
.class-context-relation strong { margin-top: 3px; overflow: hidden; font-size: var(--font-label); text-overflow: ellipsis; white-space: nowrap; }
.class-context-count { padding: 6px 9px; color: var(--text-secondary); border-radius: 999px; background: var(--surface-soft); font-size: var(--font-caption); font-weight: 750; white-space: nowrap; }
.class-work-taskbar { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 4px 10px 4px 4px; border-bottom: 1px solid var(--border); }
.class-work-taskbar[hidden] { display: none; }
.class-work-taskbar button { display: inline-flex; min-height: 42px; align-items: center; gap: 6px; padding: 0 9px; color: var(--primary-strong); border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: var(--font-label); font-weight: 750; cursor: pointer; touch-action: manipulation; }
.class-work-taskbar button:hover,.class-work-taskbar button:focus-visible { background: var(--primary-soft); }
.class-work-taskbar button .icon { width: 18px; height: 18px; }
.class-work-taskbar strong { overflow: hidden; color: var(--text-secondary); font-size: var(--font-label); text-overflow: ellipsis; white-space: nowrap; }
.class-student-tabs { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.class-student-tabs[hidden] { display: none; }
.class-student-tabs button { display: inline-flex; min-height: 42px; align-items: center; gap: 7px; padding: 0 13px; color: var(--text-secondary); border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: var(--font-caption); font-weight: 750; cursor: pointer; transition: color var(--transition),background var(--transition); }
.class-student-tabs button:hover,.class-student-tabs button:focus-visible { color: var(--primary-strong); background: var(--surface-soft); }
.class-student-tabs button.active { color: var(--primary-strong); background: var(--primary-soft); }
.class-student-tabs button:disabled { color: var(--text-muted); cursor: not-allowed; }
.class-student-tabs .icon { width: 17px; height: 17px; }
.class-work-panel[hidden] { display: none; }
.class-work-panel[data-class-work-panel="home"]:not([hidden]) { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.8fr); gap: 14px; }
.class-home-card,.class-home-actions-card { overflow: hidden; }
.class-home-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 0 18px 14px; }
.class-home-metrics article { display: grid; min-height: 92px; align-content: center; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.class-home-metrics .icon { width: 19px; height: 19px; color: var(--primary); }
.class-home-metrics strong { margin-top: 3px; font-size: 18px; font-variant-numeric: tabular-nums; }
.class-home-metrics small { color: var(--text-muted); font-size: var(--font-caption); }
.class-home-status-list { padding: 0 18px 14px; }
.class-home-status-list article { display: grid; min-height: 64px; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.class-home-status-icon { width: 34px; height: 34px; padding: 8px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.class-home-status-list strong,.class-home-status-list small { display: block; }
.class-home-status-list strong { font-size: var(--font-label); }
.class-home-status-list small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.class-home-status-list em { padding: 4px 7px; color: var(--text-secondary); border-radius: 999px; background: var(--surface-soft); font-size: var(--font-caption); font-style: normal; font-weight: 750; white-space: nowrap; }
.class-home-actions { display: grid; gap: 8px; padding: 0 16px 16px; }
.class-home-actions > button { display: grid; min-height: 66px; grid-template-columns: 34px minmax(0,1fr) 16px; align-items: center; gap: 10px; padding: 10px 11px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; transition: border-color 160ms ease,background 160ms ease,transform 160ms ease; }
.class-home-actions > button:hover,.class-home-actions > button:focus-visible { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.class-home-actions > button:disabled { color: var(--text-muted); background: var(--surface-soft); cursor: not-allowed; transform: none; }
.class-home-action-icon { width: 34px; height: 34px; padding: 8px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.class-home-actions button:disabled .class-home-action-icon { color: var(--text-muted); background: var(--border); }
.class-home-actions strong,.class-home-actions small { display: block; }
.class-home-actions strong { font-size: var(--font-label); }
.class-home-actions small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.4; }
.class-home-action-arrow { width: 15px; height: 15px; color: var(--text-muted); }
.class-home-empty { display: grid; min-height: 210px; place-items: center; align-content: center; gap: 7px; padding: 24px; text-align: center; }
.class-home-empty strong { font-size: 14px; }
.class-home-empty small { max-width: 420px; color: var(--text-muted); line-height: 1.6; }
.class-home-empty .primary-button { margin-top: 8px; }
.class-homework-card { overflow: hidden; }
.homework-header { align-items: center; }
.homework-save-state { color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; white-space: nowrap; }
.homework-save-state[data-state="error"] { color: var(--danger); }
.homework-save-state[data-state="saved"] { color: var(--success); }
.homework-toolbar { display: grid; grid-template-columns: minmax(170px,.42fr) minmax(0,1fr) auto; align-items: end; gap: 12px; padding: 0 18px 14px; border-bottom: 1px solid var(--border); }
.homework-toolbar > label { display: grid; gap: 5px; color: var(--text-secondary); font-size: var(--font-caption); font-weight: 750; }
.homework-toolbar input { min-height: 44px; padding: 0 11px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); font: inherit; font-size: var(--font-label); }
.homework-toolbar input:focus-visible { border-color: var(--primary); outline: 3px solid rgba(31,79,69,.14); outline-offset: 1px; }
.homework-subject-filters { display: flex; min-width: 0; flex-wrap: wrap; gap: 7px; }
.homework-subject-filters button { min-height: 44px; padding: 0 13px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: var(--font-caption); font-weight: 750; transition: border-color 160ms ease,background 160ms ease,color 160ms ease; }
.homework-subject-filters button:hover,.homework-subject-filters button:focus-visible { color: var(--primary-strong); border-color: var(--primary); }
.homework-subject-filters button.active { color: var(--primary-strong); border-color: var(--border); background: var(--primary-soft); }
.homework-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(240px,.55fr); gap: 14px; padding: 16px 18px 18px; background: var(--surface-soft); }
.homework-batch-list { display: grid; align-content: start; gap: 10px; min-width: 0; }
.class-homework-empty { display: flex; min-height: 220px; align-items: center; justify-content: center; gap: 13px; padding: 24px; color: var(--text-secondary); border: 1px dashed var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; }
.class-homework-icon { width: 42px; height: 42px; padding: 10px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.class-homework-empty strong,.class-homework-empty small { display: block; }
.class-homework-empty strong { color: var(--text); font-size: 13px; }
.class-homework-empty small { max-width: 560px; margin-top: 5px; font-size: var(--font-caption); line-height: 1.65; }
.homework-overview { align-self: start; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.homework-overview h3 { margin-top: 3px; font-size: 13px; }
.homework-overview dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.homework-overview dl div { min-height: 74px; padding: 11px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.homework-overview dt { color: var(--text-muted); font-size: var(--font-caption); }
.homework-overview dd { margin-top: 7px; color: var(--text); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.homework-overview > p { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px; padding-top: 12px; color: var(--text-secondary); border-top: 1px solid var(--border); font-size: var(--font-caption); line-height: 1.6; }
.homework-overview > p .icon { width: 17px; height: 17px; flex: 0 0 auto; color: var(--primary); }
.homework-batch-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.homework-batch-card[data-status="draft"] { border-style: dashed; }
.homework-batch-main { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 14px 15px 10px; }
.homework-batch-subject { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-strong); font-size: var(--font-caption); font-weight: 800; }
.homework-batch-card h3 { margin-top: 4px; font-size: 14px; line-height: 1.45; }
.homework-batch-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 7px; color: var(--text-muted); font-size: var(--font-caption); }
.homework-status-badge { align-self: start; padding: 5px 8px; color: var(--text-secondary); border-radius: 999px; background: var(--surface-soft); font-size: var(--font-caption); font-weight: 800; white-space: nowrap; }
.homework-status-badge.active { color: var(--primary); background: #e7f5ef; }
.homework-status-badge.closed { color: var(--text-secondary); background: var(--border); }
.homework-item-list { display: grid; margin: 0 15px; border-top: 1px solid var(--border); }
.homework-item-row { display: grid; min-height: 56px; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.homework-item-row:last-child { border-bottom: 0; }
.homework-item-index { display: grid; width: 24px; height: 24px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: var(--font-caption); font-weight: 800; }
.homework-item-copy strong,.homework-item-copy small { display: block; }
.homework-item-copy strong { font-size: var(--font-label); line-height: 1.45; }
.homework-item-copy small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.homework-item-progress { color: var(--text-secondary); font-size: var(--font-caption); font-weight: 750; white-space: nowrap; }
.homework-batch-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 15px 14px; }
.homework-batch-actions button { min-height: 44px; }
.homework-loading { display: grid; min-height: 220px; place-items: center; color: var(--text-muted); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-caption); }

.homework-editor-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.homework-editor-summary article { min-height: 68px; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.homework-editor-summary small,.homework-editor-summary strong { display: block; }
.homework-editor-summary small { color: var(--text-muted); font-size: var(--font-caption); }
.homework-editor-summary strong { margin-top: 5px; font-size: var(--font-label); }
.homework-form { display: grid; gap: 14px; }
.homework-form fieldset { margin: 0; padding: 0; border: 0; }
.homework-form legend { margin-bottom: 8px; font-size: var(--font-label); font-weight: 800; }
.homework-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.homework-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: var(--font-caption); font-weight: 750; }
.homework-form input,.homework-form select,.homework-form textarea { width: 100%; min-height: 44px; padding: 10px 11px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: var(--font-label); line-height: 1.5; }
.homework-form textarea { min-height: 72px; resize: vertical; }
.homework-form input:focus-visible,.homework-form select:focus-visible,.homework-form textarea:focus-visible { border-color: var(--primary); outline: 3px solid rgba(31,79,69,.14); outline-offset: 1px; }
.homework-form-help { color: var(--text-muted); font-size: var(--font-caption); line-height: 1.55; }
.homework-editor-items { display: grid; gap: 8px; }
.homework-editor-item { display: grid; grid-template-columns: 28px minmax(0,1fr) minmax(112px,.34fr) 44px; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.homework-editor-item > b { display: grid; width: 28px; height: 44px; place-items: center; color: var(--primary-strong); font-size: var(--font-caption); }
.homework-editor-item .icon-button { width: 44px; height: 44px; }
.homework-editor-item:first-child [data-homework-remove-item] { visibility: hidden; }
.homework-form-error { margin: 0; padding: 9px 11px; color: var(--danger); border-radius: var(--radius-sm); background: #fff0f0; font-size: var(--font-caption); }
.homework-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.homework-form-actions button { min-height: 44px; }

.homework-quick-picker { display: grid; gap: 14px; }
.homework-quick-picker > p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.homework-quick-class-list { display: grid; gap: 9px; }
.homework-quick-class {
  display: grid; width: 100%; min-height: 68px; grid-template-columns: 40px minmax(0,1fr) auto 18px; align-items: center; gap: 11px;
  padding: 10px 12px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  font: inherit; text-align: left; cursor: pointer; transition: border-color var(--transition),background var(--transition),transform var(--transition);
}
.homework-quick-class:hover,.homework-quick-class:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.homework-quick-class:active { transform: scale(.99); }
.homework-quick-class-icon { display: grid; width: 40px; height: 40px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); }
.homework-quick-class-icon .icon { width: 20px; height: 20px; }
.homework-quick-class-copy { min-width: 0; }
.homework-quick-class-copy strong,.homework-quick-class-copy small { display: block; }
.homework-quick-class-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.homework-quick-class-copy small { margin-top: 3px; overflow: hidden; color: var(--text-muted); font-size: var(--font-caption); text-overflow: ellipsis; white-space: nowrap; }
.homework-quick-current { padding: 4px 8px; color: var(--primary-strong); border-radius: 999px; background: var(--primary-soft); font-size: var(--font-caption); font-weight: 750; white-space: nowrap; }
.homework-quick-class > .icon { width: 18px; height: 18px; color: var(--text-muted); }
.homework-quick-empty { display: grid; justify-items: start; gap: 10px; }
.homework-quick-empty > .icon { width: 36px; height: 36px; padding: 8px; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); }
.homework-quick-empty strong,.homework-quick-empty p { margin: 0; }
.homework-quick-empty p { color: var(--text-secondary); line-height: 1.65; }

.homework-detail-items { display: grid; gap: 10px; }
.homework-detail-item { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.homework-detail-item > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.homework-detail-item h4 { font-size: 12px; }
.homework-detail-item header small { color: var(--text-muted); font-size: var(--font-caption); }
.homework-student-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 8px; margin-top: 10px; }
.homework-review-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0; padding: 14px 0; border-block: 1px solid var(--border); }
.homework-review-entry strong, .homework-review-entry small { display: block; }
.homework-review-entry small { margin-top: 4px; color: var(--text-secondary); }
.homework-review-entry button { min-height: 44px; flex-shrink: 0; }
.hw-review-dialog { width: min(1160px,calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--text); background: var(--surface); box-shadow: var(--shadow-md); }
.hw-review-dialog[open] { display: flex; flex-direction: column; }
.hw-review-dialog::backdrop { background: rgba(25,24,39,.5); }
.hw-review-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.hw-review-header h2 { margin: 0; font-size: 24px; line-height: 1.35; }
.hw-review-header p { margin: 5px 0 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.hw-review-header .icon-button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.hw-review-body { padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--border-strong) var(--surface-soft); min-height: 0; }
.hw-review-body p { line-height: 1.6; }
.hw-review-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.hw-review-intro strong { font-size: 17px; }
.hw-review-intro p { margin: 5px 0 0; color: var(--text-secondary); max-width: 68ch; }
.hw-review-scope { white-space: nowrap; color: var(--primary-strong); font-weight: 650; font-variant-numeric: tabular-nums; }
.hw-review-tools { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.hw-review-tools button { min-height: 58px; min-width: 106px; padding: 7px 14px; text-align: left; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.hw-review-tools strong, .hw-review-tools small { display: block; }
.hw-review-tools small { font-size: var(--font-caption); color: var(--text-secondary); }
.hw-review-tools button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); outline: 1px solid var(--primary); color: var(--primary-strong); }
.hw-review-tools button[aria-pressed="true"] small { color: var(--primary-strong); }
.hw-review-grid-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.hw-review-grid-heading p { margin: 0; color: var(--text-secondary); font-size: var(--font-label); }
.hw-review-grid-heading button { flex-shrink: 0; min-height: 44px; }
.hw-review-grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 8px; }
.hw-review-student { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 84px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; color: var(--text); transition: background var(--transition), border-color var(--transition); }
.hw-review-student-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: var(--font-caption); color: var(--text-secondary); }
.hw-review-number { font-variant-numeric: tabular-nums; }
.hw-review-student strong { font-size: 16px; overflow-wrap: anywhere; }
.hw-review-student small { font-size: 12px; line-height: 1.35; color: var(--text-secondary); }
.hw-review-student[data-outcome="needs_correction"] { border-color: var(--warning); background: var(--warning-soft); }
.hw-review-student[data-outcome="excellent"] { border-color: var(--accent); background: var(--accent-soft); }
.hw-review-student[data-outcome="passed"] { border-color: var(--primary); background: var(--primary-soft); }
.hw-review-student[data-outcome="skipped"] { border-style: dashed; background: var(--surface-soft); }
.hw-review-student[data-conflict="true"] { border-color: var(--danger); background: var(--danger-soft); }
.hw-review-student[data-conflict="true"] small { color: var(--danger); }
.hw-review-student:hover:not(:disabled) { border-color: var(--primary); }
.hw-review-student:active:not(:disabled), .hw-review-tools button:active:not(:disabled) { background: var(--primary-soft); }
.hw-review-dialog button:disabled { cursor: not-allowed; opacity: .55; }
.hw-review-outside { margin-top: 20px; color: var(--text-secondary); }
.hw-review-outside summary { cursor: pointer; padding-block: 10px; min-height: 44px; }
.hw-review-outside p { margin: 6px 0; font-size: var(--font-label); }
.hw-review-reset { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: var(--font-label); color: var(--text-muted); }
.hw-review-reset button { min-height: 44px; }
.hw-review-footer { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 24px max(16px,env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.hw-review-footer p { margin: 0 0 3px; font-size: var(--font-label); font-variant-numeric: tabular-nums; }
.hw-review-footer small { color: var(--text-secondary); font-size: var(--font-caption); }
.hw-review-footer small[data-state="error"] { color: var(--danger); }
.hw-review-footer small[data-state="saved"] { color: var(--accent); }
.hw-review-footer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.hw-review-footer-actions button { min-height: 44px; }
.hw-review-preview { max-width: 760px; margin-inline: auto; }
.hw-review-preview h3, .hw-review-success h3 { margin: 0 0 10px; font-size: 22px; }
.hw-review-result-line { margin-bottom: 24px; color: var(--text-secondary); font-size: 17px; }
.hw-review-result-line strong { color: var(--text); font-variant-numeric: tabular-nums; }
.hw-review-result-list details { border-top: 1px solid var(--border); padding: 8px 0; }
.hw-review-result-list details:last-child { border-bottom: 1px solid var(--border); }
.hw-review-result-list summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.hw-review-result-list summary span { margin-left: 14px; color: var(--text-secondary); font-size: var(--font-label); }
.hw-review-result-list p { margin: 0 0 10px; color: var(--text-secondary); overflow-wrap: anywhere; }
.hw-review-confirm { display: flex; align-items: flex-start; gap: 10px; padding: 14px; margin-top: 18px; border-radius: var(--radius-sm); background: var(--primary-soft); cursor: pointer; color: var(--primary-strong); }
.hw-review-confirm input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--primary); }
.hw-review-success { padding: 24px 0; max-width: 68ch; }
@media (max-width: 1000px) {
  .hw-review-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .homework-review-entry { flex-direction: column; align-items: stretch; }
  .hw-review-dialog { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .hw-review-header { padding: 16px; }
  .hw-review-header h2 { font-size: 21px; }
  .hw-review-header p { font-size: var(--font-label); }
  .hw-review-body { padding: 16px; }
  .hw-review-intro { flex-direction: column; gap: 8px; }
  .hw-review-intro p { font-size: var(--font-label); }
  .hw-review-tools { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hw-review-tools button { min-width: 0; padding: 8px; overflow-wrap: anywhere; }
  .hw-review-tools strong { font-size: var(--font-label); }
  .hw-review-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hw-review-student { padding: 8px; }
  .hw-review-student-top { flex-wrap: wrap; }
  .hw-review-footer { padding: 12px 16px max(12px,env(safe-area-inset-bottom)); gap: 10px; }
  .hw-review-footer-actions { width: 100%; flex-wrap: wrap; }
  .hw-review-footer-actions button { flex: 1; padding-inline: 10px; }
  .hw-review-reset { align-items: flex-start; flex-direction: column; gap: 0; }
  .hw-review-preview h3 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-review-student { transition: none; }
}
.homework-student-button { display: grid; min-height: 56px; align-content: center; gap: 3px; padding: 8px 10px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); text-align: left; }
.homework-student-button:hover,.homework-student-button:focus-visible { border-color: var(--primary); }
.homework-student-button strong { font-size: var(--font-caption); }
.homework-student-button small { color: var(--text-muted); font-size: var(--font-caption); }
.homework-grading-intro { margin: 0; color: var(--text-secondary); line-height: 1.7; }
.homework-grading-form { gap: 24px; }
.homework-grading-form .homework-form-help { margin: 4px 0 12px; font-weight: 400; }
.homework-grading-form legend,.homework-grading-preview h3 { font-size: var(--font-body); }
.homework-grading-presets { display: flex; flex-wrap: wrap; gap: 10px; }
.homework-grading-presets button { display: grid; justify-items: start; gap: 4px; padding: 12px 16px; text-align: left; }
.homework-grading-presets small { color: var(--text-secondary); font-weight: 400; }
.homework-grading-row { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--border); }
.homework-grading-row-main { display: grid; grid-template-columns: minmax(90px,.25fr) minmax(0,1fr); gap: 12px; }
.homework-grading-row-main input[name="markLabel"] { color: var(--primary-strong); font-weight: 750; }
.homework-grading-row-options { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: end; gap: 12px; }
.homework-grading-row-options > button { min-height: 44px; margin-bottom: 1px; }
.homework-grading-form [data-grading-add] { margin-top: 8px; }
.homework-grading-preview { padding-top: 18px; border-top: 1px solid var(--border); }
.homework-grading-preview h3 { margin: 0 0 10px; }
.homework-mark-samples { display: flex; flex-wrap: wrap; gap: 8px; }
.homework-mark-sample { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 6px; color: var(--primary-strong); background: var(--primary-soft); font-weight: 750; overflow-wrap: anywhere; }
.homework-mark-sample small { color: inherit; font-size: var(--font-caption); font-weight: 400; }
.homework-mark-sample[data-outcome="needs_correction"] { color: var(--warning); background: var(--warning-soft); }
.homework-mark-sample[data-outcome="excellent"] { color: var(--accent); background: var(--accent-soft); }
.homework-grading-scope { margin: 0; padding: 12px 0 0; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.7; }
.homework-grading-saved { margin: 0; color: var(--accent); font-weight: 700; }
.homework-grading-summary { display: grid; gap: 10px; margin: 14px 0 20px; padding-block: 12px; border-block: 1px solid var(--border); }
.homework-grading-summary strong,.homework-grading-summary small { display: block; }
.homework-grading-summary small { margin-top: 4px; color: var(--text-secondary); font-size: var(--font-caption); }
.homework-grade-section > h3,.homework-grade-history > h3 { margin: 0 0 8px; font-size: var(--font-body); }
.homework-grade-buttons { display: grid; gap: 8px; }
.homework-grade-button { display: grid; grid-template-columns: minmax(56px,.25fr) minmax(0,1fr); gap: 12px; align-items: center; min-height: 68px; padding: 12px 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); text-align: left; }
.homework-grade-button:hover:not(:disabled),.homework-grade-button:focus-visible { border-color: var(--primary); background: var(--surface-soft); }
.homework-grade-button.is-default { background: var(--primary-soft); border-color: var(--primary); }
.homework-grade-button:disabled { opacity: .6; cursor: not-allowed; }
.homework-grade-symbol { color: var(--primary-strong); font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.homework-grade-button[data-outcome="needs_correction"] .homework-grade-symbol { color: var(--warning); }
.homework-grade-button[data-outcome="excellent"] .homework-grade-symbol { color: var(--accent); }
.homework-grade-button strong { display: block; font-size: var(--font-label); overflow-wrap: anywhere; }
.homework-grade-button small { display: block; margin-top: 3px; color: var(--text-secondary); font-size: var(--font-caption); }
.homework-grade-history ol { list-style: none; margin: 0; padding: 0; }
.homework-grade-history li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--font-label); }
.homework-grade-history li > span:last-child { flex: 1; overflow-wrap: anywhere; }
.homework-grade-history li small { display: block; color: var(--text-muted); font-size: var(--font-caption); }
.homework-grade-history .homework-mark-sample { min-width: 56px; justify-content: center; }
@media (max-width: 600px) {
  .homework-grading-row-main { grid-template-columns: 90px minmax(0,1fr); gap: 8px; }
  .homework-grading-row-options { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
  .homework-grading-row-options > button { grid-column: 2; justify-self: end; }
  .homework-grading-presets { flex-direction: column; }
  .homework-header .card-header-actions { flex-wrap: wrap; }
  .homework-header [data-homework-grading-settings] { min-height: 44px; }
}
.card-header-actions { display: flex; align-items: center; gap: 8px; }
.intercom-class-row.current-class { border-color: #bfdccf; box-shadow: inset 4px 0 0 var(--primary); }
.class-section-card { overflow: hidden; }
.compact-label { min-height: 44px; padding: 0 12px; font-size: var(--font-label); }
.class-student-overview-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 10px; padding: 16px 18px 18px; }
.class-student-card { position: relative; display: grid; min-height: 86px; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; transition: border-color 160ms ease,background 160ms ease,box-shadow 160ms ease; }
.class-student-card:hover,.class-student-card:focus-visible { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(31,79,69,.1); }
.class-student-avatar { display: grid; width: 42px; height: 42px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: 15px; font-weight: 800; }
.class-student-copy,.class-student-meta { min-width: 0; }
.class-student-copy strong,.class-student-copy small,.class-student-meta b,.class-student-meta small { display: block; }
.class-student-copy strong { font-size: 12px; }
.class-student-copy small { margin-top: 4px; overflow: hidden; color: var(--text-muted); font-size: var(--font-caption); text-overflow: ellipsis; white-space: nowrap; }
.class-student-meta { text-align: right; }
.class-student-meta b { font-size: 14px; font-variant-numeric: tabular-nums; }
.class-student-meta small { color: var(--text-muted); font-size: var(--font-caption); }
.class-student-attention { grid-column: 2 / -1; width: max-content; padding: 3px 7px; color: var(--danger); border-radius: 999px; background: var(--danger-soft); font-size: var(--font-caption); font-weight: 750; }
.class-student-number { position: absolute; top: 7px; right: 8px; color: var(--border-strong); font-size: var(--font-caption); }
.class-panel-empty { grid-column: 1 / -1; display: grid; min-height: 190px; place-items: center; align-content: center; gap: 10px; padding: 28px; color: var(--text-muted); text-align: center; }
.class-panel-empty strong { color: var(--text); font-size: 13px; }
.class-panel-empty span { max-width: 480px; line-height: 1.7; }
.class-followup-list,.class-history-list { padding: 4px 18px 14px; }
.class-followup-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 82px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.class-followup-item:last-child { border-bottom: 0; }
.class-followup-icon { width: 38px; height: 38px; padding: 9px; color: var(--danger); border-radius: var(--radius-sm); background: var(--danger-soft); }
.class-followup-item strong,.class-followup-item small,.class-followup-item em { display: block; }
.class-followup-item strong { font-size: 12px; }
.class-followup-item small { margin-top: 4px; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.55; }
.class-followup-item em { margin-top: 5px; color: var(--text-muted); font-size: var(--font-caption); font-style: normal; }
.class-followup-item .secondary-button { min-height: 40px; padding: 0 11px; font-size: var(--font-caption); }
.class-history-item { display: grid; grid-template-columns: 76px minmax(0,1fr) 44px; align-items: center; gap: 12px; min-height: 68px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.class-history-item:last-child { border-bottom: 0; }
.class-history-item time,.class-history-item time small,.class-history-item span strong,.class-history-item span small { display: block; }
.class-history-item time { color: var(--text-secondary); font-size: var(--font-caption); font-variant-numeric: tabular-nums; }
.class-history-item time small,.class-history-item span small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.class-history-item span strong { font-size: var(--font-label); }
.class-history-item > b { justify-self: end; min-width: 36px; padding: 5px 7px; border-radius: var(--radius-sm); text-align: center; }
.class-history-item > b.plus,.student-profile-history b.plus { color: var(--accent); background: var(--accent-soft); }
.class-history-item > b.minus,.student-profile-history b.minus { color: var(--danger); background: var(--danger-soft); }
.class-profile-summary { padding: 18px; }
.class-profile-match { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 13px 14px; border: 1px solid; border-radius: var(--radius-sm); }
.class-profile-match.success { border-color: #cce1d8; background: var(--accent-soft); }
.class-profile-match.warning { border-color: #ead8ae; background: #fff9ec; }
.class-profile-match > .icon { width: 38px; height: 38px; padding: 9px; color: var(--accent); border-radius: var(--radius-sm); background: #fff; }
.class-profile-match.warning > .icon { color: var(--warning); }
.class-profile-match strong,.class-profile-match small { display: block; }
.class-profile-match strong { font-size: 12px; }
.class-profile-match small { margin-top: 4px; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.5; }
.class-profile-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.class-profile-metrics article { display: grid; min-height: 112px; align-content: center; justify-items: start; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.class-profile-metrics .icon { width: 20px; height: 20px; color: var(--primary); }
.class-profile-metrics strong { font-size: 14px; }
.class-profile-metrics small,.class-profile-roles span { color: var(--text-muted); font-size: var(--font-caption); }
.class-profile-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.class-profile-roles div { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.class-profile-roles span,.class-profile-roles strong { display: block; }
.class-profile-roles strong { margin-top: 5px; font-size: 12px; }
.class-profile-linked { margin: 16px 0; padding-top: 16px; border-top: 1px solid var(--border); }
.class-profile-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.class-profile-section-heading small,.class-profile-section-heading strong { display: block; }
.class-profile-section-heading small { color: var(--text-muted); font-size: var(--font-caption); }
.class-profile-section-heading strong { margin-top: 3px; font-size: 13px; }
.class-profile-section-heading em { color: var(--primary); font-size: var(--font-caption); font-style: normal; font-weight: 750; }
.student-profile-summary { display: flex; align-items: center; gap: 12px; }
.student-profile-summary strong,.student-profile-summary small { display: block; }
.student-profile-summary small { margin-top: 4px; color: var(--text-muted); font-size: var(--font-caption); }
.student-profile-history article { display: grid; grid-template-columns: 64px minmax(0,1fr) 38px; align-items: center; gap: 10px; min-height: 62px; border-bottom: 1px solid var(--border); }
.student-profile-history article:last-child { border-bottom: 0; }
.student-profile-history time { color: var(--text-muted); font-size: var(--font-caption); }
.student-profile-history strong,.student-profile-history small { display: block; }
.student-profile-history strong { font-size: var(--font-caption); }
.student-profile-history small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.student-profile-history b { padding: 4px 6px; border-radius: var(--radius-sm); text-align: center; }
.score-summary { margin-bottom: 16px; }
.score-total { text-align: right; }
.score-total strong, .score-total span { display: block; }
.score-total strong { color: var(--primary-strong); font-size: 23px; font-variant-numeric: tabular-nums; }
.score-total span { color: var(--text-muted); font-size: var(--font-caption); }
.score-dimensions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 18px; }
.score-dimensions > div { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.score-dimensions span, .score-dimensions strong, .score-dimensions small, .score-dimensions b { display: block; }
.score-dimensions strong { font-size: 12px; }
.score-dimensions small { color: var(--text-muted); font-size: var(--font-caption); }
.score-dimensions b { margin: 12px 0 7px; font-size: 20px; font-variant-numeric: tabular-nums; }
.score-dimensions b.bonus { color: var(--accent); }
.score-dimensions b.deduction { color: var(--danger); }
.score-dimensions i { display: block; height: 5px; overflow: hidden; border-radius: 4px; background: var(--border); }
.score-dimensions em { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.duty-list { padding: 7px 18px 11px; }
.duty-list button { display: grid; grid-template-columns: 54px 7px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 68px; padding: 7px 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.duty-list button:last-child { border-bottom: 0; }
.duty-list time { color: var(--text-muted); font-size: var(--font-caption); font-variant-numeric: tabular-nums; }
.duty-list strong, .duty-list small { display: block; }
.duty-list small { color: var(--text-muted); font-size: var(--font-caption); }
.duty-marker { width: 5px; height: 38px; border-radius: 5px; background: var(--accent); }
.duty-marker.active { background: var(--warning); }
.duty-marker.muted { background: var(--border-strong); }
.class-work-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); grid-template-areas: "score record"; gap: 16px; align-items: start; }
.routine-date-toolbar { display: flex; min-height: 58px; align-items: center; gap: 9px; margin-bottom: 16px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm); }
.routine-date-toolbar[hidden] { display: none; }
.routine-date-toolbar label { display: flex; align-items: center; gap: 9px; color: var(--text-secondary); font-size: var(--font-label); font-weight: 700; }
.routine-date-toolbar input { min-height: 44px; padding: 0 11px; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font: inherit; font-variant-numeric: tabular-nums; }
.routine-date-toolbar .icon-button { flex: 0 0 44px; width: 44px; min-height: 44px; }
.routine-date-state { margin-left: auto; padding: 6px 9px; color: #2d6c5a; border-radius: 999px; background: var(--accent-soft); font-size: var(--font-caption); font-weight: 750; }
.routine-date-state.history { color: var(--primary-strong); background: var(--primary-soft); }
.routine-today-button { min-height: 44px; }
.routine-roster-card { grid-area: score; overflow: hidden; }
.record-card { grid-area: record; }
.routine-roster-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(142px,1fr)); gap: 10px; padding: 16px 18px 18px; }
.routine-student-tile { position: relative; display: grid; min-height: 94px; grid-template-columns: 30px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 9px; padding: 12px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; touch-action: manipulation; transition: border-color 160ms ease,background 160ms ease,box-shadow 160ms ease; }
.routine-student-tile:hover,.routine-student-tile:focus-visible { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(31,79,69,.11); }
.routine-student-tile.has-bonus { border-color: #b9ddd1; }
.routine-student-tile.has-deduction { border-color: #efc7cb; }
.routine-student-index { display: grid; width: 30px; height: 30px; grid-row: 1 / 3; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: var(--font-caption); font-weight: 750; }
.routine-student-tile strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.routine-student-tile > small { color: var(--text-muted); font-size: var(--font-caption); }
.routine-student-score { display: flex; grid-column: 1 / -1; align-items: baseline; justify-content: space-between; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); }
.routine-student-score b { font-size: 14px; font-variant-numeric: tabular-nums; }
.routine-student-score em { color: var(--text-muted); font-size: var(--font-caption); font-style: normal; }
.has-bonus .routine-student-score em { color: var(--accent); }
.has-deduction .routine-student-score em { color: var(--danger); }
.routine-roster-empty { grid-column: 1 / -1; gap: 12px; }
.student-score-person { display: flex; align-items: center; gap: 12px; }
.student-score-person strong,.student-score-person small { display: block; }
.student-score-person small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.student-score-avatar { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-md); background: var(--primary-soft); font-size: 17px; font-weight: 800; }
.student-score-picker { padding: 0; overflow: hidden; }
.student-score-category-tabs { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; padding: 14px; border-bottom: 1px solid var(--border); }
.student-score-category-tabs button { min-height: 58px; padding: 8px 6px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-label); font-weight: 750; }
.student-score-category-tabs button small { display: block; margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.student-score-category-tabs button.active { color: var(--primary-strong); border-color: var(--primary); background: var(--primary-soft); }
.student-score-context { display: flex; align-items: flex-start; gap: 9px; padding: 13px 16px 4px; }
.student-score-context span { flex: 0 0 auto; padding: 4px 7px; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: var(--font-caption); font-weight: 750; }
.student-score-context p { margin: 1px 0 0; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.6; }
.student-score-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; padding: 12px 16px 18px; }
.student-score-action { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; }
.student-score-action:hover,.student-score-action:focus-visible { border-color: var(--border-strong); background: var(--surface-soft); }
.student-score-action span { font-size: var(--font-label); line-height: 1.45; }
.student-score-action b { min-width: 36px; padding: 4px 7px; border-radius: var(--radius-sm); text-align: center; }
.student-score-action.plus b { color: var(--accent); background: var(--accent-soft); }
.student-score-action.minus b { color: var(--danger); background: var(--danger-soft); }
.student-score-boundary { display: flex; align-items: flex-start; gap: 10px; color: var(--text-secondary); }
.student-score-boundary strong,.student-score-boundary small { display: block; }
.student-score-boundary small { margin-top: 3px; font-size: var(--font-caption); line-height: 1.55; }
.score-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 18px 10px; }
.score-controls label > span { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: var(--font-label); font-weight: 700; }
.score-controls select { width: 100%; min-height: 44px; padding: 0 11px; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.score-rule-context { display: flex; align-items: flex-start; gap: 9px; padding: 2px 18px 10px; }
.score-rule-context p { margin: 1px 0 0; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.6; }
.score-base-badge { flex: 0 0 auto; padding: 4px 7px; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: var(--font-caption); font-weight: 750; }
.rule-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 4px 18px 14px; }
.rule-button { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; }
.rule-button:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.rule-button span { font-size: var(--font-label); }
.rule-button b { min-width: 34px; padding: 3px 6px; border-radius: var(--radius-sm); font-size: var(--font-label); text-align: center; }
.rule-button.minus b { color: var(--danger); background: var(--danger-soft); }
.rule-button.plus b { color: var(--accent); background: var(--accent-soft); }
.score-helper { display: flex; align-items: center; gap: 7px; padding: 11px 18px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--surface-soft); font-size: var(--font-label); }
.score-helper .icon { width: 16px; height: 16px; }
.handover-list { padding: 8px 18px 13px; }
.handover-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.handover-item:last-child { border-bottom: 0; }
.handover-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.handover-item-top strong { font-size: 12px; }
.handover-item p { margin: 0 0 7px; color: var(--text-secondary); font-size: var(--font-label); }
.handover-meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: var(--font-caption); }
.record-list { min-height: 120px; padding: 6px 18px 12px; }
.record-count { color: var(--text-muted); font-size: var(--font-label); font-weight: 700; }
.record-row { display: grid; grid-template-columns: 60px minmax(0,1fr) 92px 44px 58px 46px; align-items: center; gap: 10px; min-height: 54px; border-bottom: 1px solid var(--border); }
.record-row:last-child { border-bottom: 0; }
.record-row time, .record-row small { color: var(--text-muted); font-size: var(--font-caption); }
.record-row strong { font-size: 12px; }
.record-row .delta { justify-self: start; padding: 3px 7px; border-radius: var(--radius-sm); font-size: var(--font-label); font-weight: 750; }
.record-row .delta.minus { color: var(--danger); background: var(--danger-soft); }
.record-row .delta.plus { color: var(--accent); background: var(--accent-soft); }
.undo-button { min-width: 44px; min-height: 44px; color: var(--primary-strong); border: 0; border-radius: var(--radius-sm); background: transparent; font-size: var(--font-caption); font-weight: 700; }
.undo-button:hover { background: var(--primary-soft); }
.score-revoke-modal form { width: min(540px, calc(100vw - 32px)); }
.score-revoke-modal textarea { width: 100%; min-height: 96px; resize: vertical; }
.empty-state { display: grid; min-height: 110px; place-items: center; color: var(--text-muted); text-align: center; }
.student-score-card { margin-top: 16px; }
.student-score-table-wrap { overflow-x: auto; }
.student-score-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.student-score-table th, .student-score-table td { height: 52px; padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: center; font-variant-numeric: tabular-nums; }
.student-score-table thead th { height: 46px; color: var(--text-secondary); background: var(--surface-soft); font-size: var(--font-caption); font-weight: 750; }
.student-score-table thead th:first-child, .student-score-table tbody th { text-align: left; }
.student-score-table thead small { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 600; }
.student-score-table tbody th { min-width: 110px; font-size: 12px; }
.student-score-table tbody tr:last-child th, .student-score-table tbody tr:last-child td { border-bottom: 0; }
.student-roster-intro p { color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.student-roster-section-heading { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.student-roster-section-heading > small { color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; letter-spacing: .06em; }
.student-import-entry { padding-inline: 12px; }
.student-import-entry .icon { width: 17px; height: 17px; }
.student-roster-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.student-roster-form .form-field { min-width: 0; }
.student-roster-form .primary-button { min-height: 44px; }
.student-roster-editor > :is(p, button) { grid-column: 1 / -1; }
.student-roster-editor > p { margin: 0; }
.student-roster-error { grid-column: 1 / -1; margin: 0; padding: 9px 11px; color: var(--danger); border-radius: var(--radius-sm); background: var(--danger-soft); font-size: var(--font-label); }
.student-roster-error[hidden] { display: none; }
.student-roster-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.student-roster-heading small { color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; letter-spacing: .06em; }
.student-roster-heading span { color: var(--text-secondary); font-size: var(--font-label); font-weight: 700; }
.student-roster-list { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.student-roster-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; min-height: 62px; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); }
.student-roster-row.removed { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 14px; }
.student-roster-row .text-link { min-height: 44px; }
.student-roster-student { min-width: 0; overflow-wrap: anywhere; }
.student-roster-select { display: flex; min-height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.student-roster-select input, .student-roster-select-all input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.student-roster-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.student-roster-select-all { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.student-roster-batch > span { color: var(--text-secondary); font-size: 14px; }
.student-roster-batch > button { margin-inline-start: auto; min-height: 44px; color: var(--danger); }
.student-roster-batch button:disabled { color: var(--text-muted); cursor: not-allowed; opacity: .65; }
.student-roster-empty, .student-roster-removed > p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.student-roster-empty { padding: 12px 16px; }
.student-roster-removed summary { padding-block: 12px; color: var(--primary-strong); font-weight: 700; cursor: pointer; }
.student-roster-removed > p { margin: 0 0 12px; }
.student-roster-row:last-child { border-bottom: 0; }
.student-roster-index { display: grid; width: 28px; height: 28px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: var(--font-caption); font-weight: 750; }
.student-roster-row strong, .student-roster-row small { display: block; }
.student-roster-row strong { font-size: 16px; }
.student-roster-row small { margin-top: 3px; color: var(--text-secondary); font-size: 14px; }
.student-roster-delete { display: inline-flex; width: 44px; min-height: 44px; align-items: center; justify-content: center; color: var(--danger); border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; transition: border-color var(--transition), background var(--transition); }
.student-roster-delete:hover { border-color: #efc8ca; background: var(--danger-soft); }
.student-roster-delete .icon { width: 17px; height: 17px; }

.score-value { display: inline-flex; min-width: 34px; min-height: 28px; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.score-value.bonus, .score-total-value.bonus { color: var(--accent); background: var(--accent-soft); }
.score-value.deduction, .score-total-value.deduction { color: var(--danger); background: var(--danger-soft); }
.score-total-value { display: inline-flex; min-width: 44px; min-height: 30px; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 13px; }

/* Teacher directory */
.teacher-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.personal-reference-source-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.personal-reference-source-switch button { min-height: 44px; }
.personal-reference-source-switch[hidden] { display: none; }
.personal-reference-week:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.personal-reference-scroll-hint { color: var(--text-secondary); font-size: var(--font-caption); }
.teacher-mode-switch button { display: flex; min-height: 64px; align-items: center; gap: 11px; padding: 10px 14px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; text-align: left; transition: border-color var(--transition), background var(--transition), color var(--transition); }
.teacher-mode-switch button:hover { border-color: #bfdccf; background: var(--surface-soft); }
.teacher-mode-switch button.active { color: var(--primary-strong); border-color: #bfdccf; background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.teacher-mode-switch .icon { width: 22px; height: 22px; flex: 0 0 auto; }
.teacher-mode-switch strong, .teacher-mode-switch small { display: block; }
.teacher-mode-switch strong { font-size: 12px; }
.teacher-mode-switch small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.teacher-data-note { display: flex; min-height: 44px; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 12px; color: var(--primary); border: 1px solid #d2e5de; border-radius: var(--radius-sm); background: #f4faf7; }
.teacher-data-note .import-status-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.teacher-data-note strong, .teacher-data-note small { display: block; }
.teacher-data-note strong { font-size: var(--font-label); }
.teacher-data-note small { margin-top: 1px; color: var(--text-muted); font-size: var(--font-caption); }
.teacher-search-panel { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.teacher-search-panel-detailed { grid-template-columns: 1fr; }
.teacher-query-field > span:first-child { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.large-search { display: flex; min-height: 48px; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-soft); }
.large-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,79,69,.12); }
.large-search .icon { color: var(--text-muted); }
.large-search input { width: 100%; border: 0; outline: 0; background: transparent; }
.teacher-search-helper { margin: -2px 1px 0; color: var(--text-muted); font-size: var(--font-caption); }
.filter-field > span { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.filter-field select, .filter-field input { width: 100%; min-height: 32px; padding: 0 8px; color: var(--text); border: 0; outline: 0; background: transparent; font-weight: 650; }
.filter-field { padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.filter-field:has(select:disabled), .filter-field:has(input:disabled) { background: var(--surface-soft); opacity: .58; }
.filter-field select:disabled, .filter-field input:disabled { cursor: not-allowed; }
#teacher-query-area { display: grid; gap: 8px; }
#teacher-query-area[hidden] { display: none; }
.result-heading { display: flex; justify-content: space-between; margin: 0 2px 10px; }
.result-heading span { color: var(--text-muted); font-size: var(--font-label); }
.teacher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.teacher-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.teacher-card-head { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.directory-card .teacher-card-head { grid-template-columns: 44px minmax(0,1fr); }
.teacher-avatar { display: grid; width: 44px; height: 44px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: 15px; font-weight: 750; }
.teacher-card-head strong, .teacher-card-head small { display: block; }
.teacher-card-head small { color: var(--text-muted); font-size: var(--font-caption); }
.availability { display: inline-flex; align-items: center; gap: 5px; font-size: var(--font-caption); font-weight: 700; }
.availability::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.availability.free { color: var(--accent); }
.availability.flexible { color: var(--warning); }
.availability.busy { color: var(--text-muted); }
.availability.scheduled { color: var(--primary-strong); }
.availability.unknown { color: var(--warning); }
.teacher-slot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 10px 11px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.teacher-slot span, .teacher-slot small { display: block; }
.teacher-slot span { font-size: var(--font-label); font-weight: 650; }
.teacher-slot small { color: var(--text-muted); font-size: var(--font-caption); }
.teacher-slot b { color: var(--accent); font-size: var(--font-label); }
.teacher-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 14px 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--border); }
.teacher-facts span { padding: 9px 11px; background: var(--surface-soft); }
.teacher-facts strong, .teacher-facts small { display: block; }
.teacher-facts strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.teacher-facts small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.teacher-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.teacher-card-actions.single { grid-template-columns: 1fr; }
.teacher-card-actions button { min-height: 44px; border-radius: var(--radius-sm); font-size: var(--font-label); font-weight: 700; }
.teacher-card-actions .view { color: var(--primary-strong); border: 1px solid var(--border); background: #fff; }
.directory-summary-row { display: grid; min-height: 52px; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 9px; margin: 12px 0; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.directory-summary-row .icon { width: 19px; height: 19px; color: var(--primary-strong); }
.directory-summary-row strong,.directory-summary-row small { display: block; overflow-wrap: anywhere; }
.directory-summary-row strong { font-size: var(--font-label); }
.directory-summary-row small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.class-avatar { color: var(--primary); background: var(--accent-soft); }
.directory-link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.directory-link-chip,.directory-text-chip { display: inline-flex; min-height: 36px; align-items: center; padding: 7px 10px; color: var(--primary-strong); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--font-caption); font-weight: 700; }
.directory-link-chip { min-height: 44px; cursor: pointer; }
.directory-link-chip:hover,.directory-link-chip:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.directory-person-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.directory-person-link { display: grid; min-height: 64px; grid-template-columns: 40px minmax(0,1fr) 18px; align-items: center; gap: 9px; padding: 9px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; cursor: pointer; }
.directory-person-link:hover,.directory-person-link:focus-visible { border-color: #bfdccf; background: var(--surface-soft); }
.directory-person-link .teacher-avatar { width: 40px; height: 40px; }
.directory-person-link strong,.directory-person-link small { display: block; }
.directory-person-link small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.directory-empty { padding: 14px; color: var(--text-secondary); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-soft); }
.directory-empty strong,.directory-empty small { display: block; }
.directory-empty small { margin-top: 4px; color: var(--text-muted); }
.directory-duty-row { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.directory-duty-row:last-child { border-bottom: 0; }
.directory-duty-row .icon { width: 20px; height: 20px; color: var(--accent); }
.directory-duty-row strong,.directory-duty-row small { display: block; }
.directory-duty-row small { margin-top: 3px; color: var(--text-muted); }
.teacher-card-actions button:disabled, .drawer-actions button:disabled { color: var(--text-muted); border-color: var(--border); background: var(--border); cursor: not-allowed; }
.teacher-load-more { display: flex; min-width: 220px; min-height: 44px; align-items: center; justify-content: center; margin: 18px auto 0; padding: 0 18px; color: var(--primary-strong); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-label); font-weight: 750; }
.teacher-load-more:hover { background: var(--primary-soft); }
.teacher-load-more[hidden] { display: none; }
.no-results { grid-column: 1 / -1; display: grid; min-height: 220px; place-items: center; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: #fff; text-align: center; }

/* Placeholder */
.placeholder-card { display: flex; min-height: 62vh; flex-direction: column; align-items: center; justify-content: center; padding: 40px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; text-align: center; }
.placeholder-icon { width: 54px; height: 54px; margin-bottom: 18px; padding: 14px; color: var(--primary); border-radius: var(--radius-md); background: var(--primary-soft); }
.placeholder-card h1 { margin: 0 0 8px; }
.placeholder-card > p:not(.eyebrow) { max-width: 460px; margin-bottom: 22px; color: var(--text-secondary); }

/* Dialogs and drawers */
.scrim { position: fixed; z-index: 90; inset: 0; background: rgba(20,20,28,.48); }
dialog { color: var(--text); }
.modal, .command-palette { padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-md); }
.modal { width: min(680px, calc(100vw - 32px)); max-height: min(84vh, 820px); overflow: auto; }
.import-modal { width: min(920px, calc(100vw - 32px)); }
.modal::backdrop, .command-palette::backdrop { background: rgba(20,20,28,.5); backdrop-filter: blur(2px); }
.modal-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 19px; }
.event-slot-context { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; margin: 16px 20px 0; padding: 10px 12px; color: var(--primary); border: 1px solid #cfe5dc; border-radius: var(--radius-sm); background: var(--accent-soft); }
.event-slot-context[hidden] { display: none; }
.event-slot-context > .icon { width: 32px; height: 32px; padding: 7px; border-radius: var(--radius-sm); background: rgba(255,255,255,.72); }
.event-slot-context strong, .event-slot-context small { display: block; }
.event-slot-context strong { font-size: var(--font-label); }
.event-slot-context small { margin-top: 2px; color: #4f7469; font-size: var(--font-caption); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px; }
.form-field > span, .scope-field legend { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: var(--font-label); font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.form-field textarea { resize: vertical; }
.full-span { grid-column: 1 / -1; }
.scope-field { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; border: 0; }
.scope-field legend { width: 100%; }
.scope-field label { position: relative; display: block; cursor: pointer; }
.scope-field input { position: absolute; opacity: 0; }
.scope-field label > span { display: block; min-height: 68px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.scope-field label > span strong, .scope-field label > span small { display: block; }
.scope-field label > span strong { font-size: var(--font-label); }
.scope-field label > span small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.scope-field input:checked + span { color: var(--primary-strong); border-color: var(--primary); background: var(--primary-soft); }
.scope-field input:focus-visible + span { outline: 3px solid rgba(31,79,69,.2); }
.inline-alert { display: flex; align-items: flex-start; gap: 8px; margin: 0 20px; padding: 10px 12px; color: var(--warning); border: 1px solid #efd5b2; border-radius: var(--radius-sm); background: var(--warning-soft); font-size: var(--font-label); }
.inline-alert .icon { width: 17px; height: 17px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 15px 20px 20px; }
.modal-description { margin: 16px 20px 0; color: var(--text-secondary); font-size: 12px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 20px 4px; color: var(--text-muted); font-size: var(--font-label); font-weight: 650; }
.stepper > span { display: inline-flex; align-items: center; gap: 6px; }
.stepper b { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: var(--border); font-size: var(--font-caption); }
.stepper span.active { color: var(--primary-strong); }
.stepper span.active b { color: #fff; background: var(--primary); }
.stepper i { width: 42px; height: 1px; background: var(--border); }
.import-step { display: none; }
.import-step.active { display: block; }
.upload-zone { display: flex; min-height: 210px; flex-direction: column; align-items: center; justify-content: center; margin: 20px; padding: 24px; color: var(--text-secondary); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-soft); cursor: pointer; text-align: center; }
.upload-zone:hover { border-color: var(--primary); background: var(--surface-soft); }
.upload-zone .upload-icon { width: 48px; height: 48px; margin-bottom: 12px; padding: 12px; color: var(--primary); border-radius: var(--radius-md); background: var(--primary-soft); }
.upload-zone strong { color: var(--text); font-size: 14px; }
.upload-zone > span:not(.icon) { margin-top: 5px; color: var(--text-muted); font-size: var(--font-label); }
.upload-zone input { max-width: 100%; margin-top: 14px; font-size: var(--font-label); }
.period-upload-zone { min-height: 178px; margin-bottom: 12px; }
.period-file-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 20px 12px; }
.period-file-tips > div { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.period-file-tips .icon { width: 34px; height: 34px; padding: 8px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.period-file-tips strong, .period-file-tips small { display: block; }
.period-file-tips strong { font-size: var(--font-label); }
.period-file-tips small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.import-notice { display: flex; align-items: center; gap: 7px; margin: 0 20px; padding: 10px 12px; color: var(--text-secondary); border-radius: var(--radius-sm); background: var(--blue-soft); font-size: var(--font-label); }
.import-notice .icon { width: 16px; height: 16px; color: var(--blue); }
.import-notice strong { color: var(--text); }
.recognition-progress { margin: 12px 20px 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.recognition-progress[hidden] { display: none; }
.recognition-progress > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--font-label); }
.recognition-progress progress { width: 100%; height: 7px; margin: 9px 0 5px; border: 0; border-radius: 999px; overflow: hidden; background: var(--border); }
.recognition-progress progress::-webkit-progress-bar { background: var(--border); }
.recognition-progress progress::-webkit-progress-value { border-radius: 999px; background: var(--primary); }
.recognition-progress progress::-moz-progress-bar { border-radius: 999px; background: var(--primary); }
.recognition-progress small { color: var(--text-muted); font-size: var(--font-caption); }
.import-error { margin: 10px 20px 0; padding: 10px 12px; color: var(--danger); border: 1px solid #f0c9cc; border-radius: var(--radius-sm); background: var(--danger-soft); font-size: var(--font-label); }
.recognition-summary { display: flex; align-items: center; gap: 10px; margin: 18px 20px 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.recognition-summary > .icon { color: var(--accent); }
.recognition-summary > span:nth-child(2) { flex: 1; }
.recognition-summary strong, .recognition-summary small { display: block; }
.recognition-summary small { color: var(--text-muted); font-size: var(--font-caption); }
.import-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 20px 12px; }
.import-metrics > div { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.import-metrics strong, .import-metrics span { display: block; }
.import-metrics strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.import-metrics span { margin-top: 1px; color: var(--text-muted); font-size: var(--font-caption); }
.import-findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 20px 14px; }
.finding-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.finding-row > .icon { width: 28px; height: 28px; padding: 6px; border-radius: var(--radius-sm); }
.finding-row.success > .icon { color: var(--accent); background: var(--accent-soft); }
.finding-row.warning > .icon { color: var(--warning); background: var(--warning-soft); }
.finding-row.neutral > .icon { color: var(--blue); background: var(--blue-soft); }
.finding-row strong, .finding-row small { display: block; }
.finding-row strong { font-size: var(--font-label); }
.finding-row small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.class-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 20px 8px; }
.class-preview-header strong, .class-preview-header small { display: block; }
.class-preview-header small { margin-top: 1px; color: var(--text-muted); font-size: var(--font-caption); }
.class-preview-header select { min-height: 40px; padding: 0 32px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.table-wrap { margin: 0 20px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--font-label); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--text-muted); background: var(--surface-soft); font-size: var(--font-caption); }
tr:last-child td { border-bottom: 0; }
td input { width: 16px; height: 16px; accent-color: var(--primary); }
.table-status { color: var(--accent); font-weight: 700; }
.table-status.warning { color: var(--warning); }
.schedule-preview-wrap { max-height: 270px; overflow: auto; }
.schedule-preview-table { min-width: 650px; table-layout: fixed; }
.schedule-preview-table th:first-child { width: 72px; }
.schedule-preview-table tbody th { color: var(--text-secondary); background: var(--surface-soft); font-size: var(--font-caption); text-align: left; }
.schedule-preview-table td { white-space: normal; }
.teacher-preview-table td strong, .teacher-preview-table td small { display: block; }
.teacher-preview-table td small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.preview-free { color: var(--text-muted); }
.import-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 20px 0; }
#personal-timetable-fields { margin: 20px; line-height: 1.7; }
#personal-timetable-fields .import-options { margin: 14px 0; }
#personal-timetable-fields .checkbox-label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin-top: 12px; padding: 8px 0; cursor: pointer; }
#personal-timetable-fields .checkbox-label[hidden] { display: none; }
#personal-timetable-fields .checkbox-label input { flex: 0 0 20px; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--primary); }
#personal-timetable-fields input[type="date"], #personal-timetable-fields input[type="time"] { min-width: 0; width: 100%; }
#personal-timetable-source .secondary-button { margin: 4px 0; }
.import-complete { max-width: 620px; margin: 0 auto; padding: 34px 24px 18px; text-align: center; }
.complete-icon { width: 54px; height: 54px; margin: 0 auto 14px; padding: 14px; color: #fff; border-radius: 50%; background: var(--accent); }
.import-complete h3 { margin: 0 0 7px; font-size: 21px; }
.import-complete > p { color: var(--text-secondary); }
.next-data-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 10px; margin-top: 20px; padding: 14px; color: var(--warning); border: 1px solid #efd5b2; border-radius: var(--radius-sm); background: var(--warning-soft); text-align: left; }
.next-data-card > .icon { width: 36px; height: 36px; padding: 8px; border-radius: var(--radius-sm); background: rgba(255,255,255,.7); }
.next-data-card strong, .next-data-card small { display: block; }
.next-data-card small { margin-top: 4px; color: var(--warning); font-size: var(--font-caption); }
.period-next-card { color: var(--primary-strong); border-color: var(--border); background: var(--surface-soft); }
.period-next-card small { color: var(--text-secondary); }
.period-review-layout { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(430px, 1.3fr); gap: 12px; margin: 0 20px; }
.period-source-card, .period-review-panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.period-source-heading, .period-review-heading { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.period-source-heading strong, .period-source-heading small, .period-review-heading strong, .period-review-heading small { display: block; }
.period-source-heading small, .period-review-heading small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.period-source-preview { display: grid; max-height: 360px; min-height: 260px; place-items: start stretch; overflow: auto; background: var(--surface-soft); }
.period-source-preview img { display: block; width: 100%; height: auto; }
.period-source-preview pre { min-height: 260px; margin: 0; padding: 14px; overflow: visible; color: var(--text-secondary); background: #fff; font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.period-review-error { margin: 10px 10px 0; }
.period-review-list { max-height: 294px; overflow-y: auto; }
.period-review-row { display: grid; grid-template-columns: 28px minmax(250px, 1fr) minmax(220px, .8fr) 108px; align-items: center; gap: 9px; min-height: 78px; padding: 10px; border-bottom: 1px solid var(--border); }
.period-review-row:last-child { border-bottom: 0; }
.period-review-row:has(.period-row-enabled:not(:checked)) { opacity: .52; background: var(--surface-soft); }
.period-review-row.has-error { background: var(--danger-soft); }
.period-review-row.has-error select, .period-review-row.has-error input { border-color: var(--danger); }
.period-row-enabled { width: 18px; height: 18px; accent-color: var(--primary); }
.period-review-row select, .period-review-row input[type="text"], .period-review-row input[type="time"] { width: 100%; min-height: 40px; padding: 0 8px; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-label); }
.period-review-identity { display: grid; min-width: 0; grid-template-columns: 104px minmax(120px, 1fr); gap: 6px; }
.period-review-identity label { min-width: 0; }
.period-review-identity > small { grid-column: 1 / -1; overflow: hidden; color: var(--text-muted); font-size: var(--font-caption); text-overflow: ellipsis; white-space: nowrap; }
.period-review-time-pair { display: grid; grid-template-columns: minmax(92px, 1fr) 12px minmax(92px, 1fr); align-items: center; gap: 6px; }
.period-review-time-pair > span { color: var(--text-muted); text-align: center; }
.period-review-state { display: grid; min-width: 0; justify-items: stretch; gap: 4px; }
.period-review-state label { min-width: 0; }
.period-review-state .period-row-target { min-height: 32px; padding: 0 5px; color: var(--primary-strong); font-size: var(--font-caption); font-weight: 700; }
.confidence-chip { justify-self: end; padding: 3px 7px; color: var(--primary); border-radius: 999px; background: var(--accent-soft); font-size: var(--font-caption); font-weight: 700; white-space: nowrap; }
.confidence-chip.medium { color: var(--warning); background: var(--warning-soft); }
.confidence-chip.low { color: var(--text-secondary); background: var(--border); }
.period-sync-option { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px; margin: 14px 20px 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); cursor: pointer; }
.period-sync-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.period-sync-option strong, .period-sync-option small { display: block; }
.period-sync-option strong { font-size: var(--font-label); }
.period-sync-option small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.period-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 20px 0; }
.period-editor-toolbar[hidden] { display: none; }
.period-editor-toolbar strong, .period-editor-toolbar small { display: block; }
.period-editor-toolbar strong { font-size: var(--font-label); }
.period-editor-toolbar small { margin-top: 1px; color: var(--text-muted); font-size: var(--font-caption); }
.period-editor-toolbar .secondary-button { min-height: 40px; padding: 0 12px; font-size: var(--font-label); }
.period-editor { max-height: 50vh; margin: 16px 20px 0; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.period-editor-head { position: sticky; z-index: 1; top: 0; display: grid; grid-template-columns: 104px minmax(120px,1fr) 108px 12px 108px 44px; align-items: center; gap: 7px; padding: 8px 10px; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--surface-soft); font-size: var(--font-caption); font-weight: 700; }
.period-row { display: grid; grid-template-columns: 104px minmax(120px,1fr) 108px 12px 108px 44px; align-items: center; gap: 7px; padding: 9px 10px 9px 7px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--primary); }
.period-row:last-child { border-bottom: 0; }
.period-row > label { min-width: 0; }
.period-row input, .period-row select { width: 100%; min-height: 40px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.period-row .period-name-input { padding-inline: 10px; font-weight: 700; }
.period-row span { color: var(--text-muted); text-align: center; }
.period-row.kind-routine { border-left-color: var(--blue); background: #fbfdff; }
.period-row.kind-break { border-left-color: var(--text-muted); background: var(--surface-soft); }
.period-row.kind-duty { border-left-color: var(--accent); background: #f9fdfb; }
.period-kind-select { color: var(--primary-strong); font-size: var(--font-caption); font-weight: 700; }
.period-kind-select.kind-routine { color: var(--blue); background: var(--blue-soft); }
.period-kind-select.kind-break { color: var(--text-secondary); background: var(--border); }
.period-kind-select.kind-duty { color: var(--primary); background: var(--accent-soft); }
.period-delete-button { display: inline-flex; width: 44px; min-height: 44px; align-items: center; justify-content: center; color: var(--danger); border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; transition: border-color var(--transition), background var(--transition); }
.period-delete-button:hover { border-color: #efc8ca; background: var(--danger-soft); }
.period-delete-button .icon { width: 17px; height: 17px; }
.period-row.read-only { background: var(--surface-soft); }
.period-row.read-only input, .period-row.read-only select { color: var(--text-secondary); border-color: transparent; background: transparent; cursor: default; opacity: 1; }

/* School calendar */
.calendar-toolbar { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.month-switcher, .calendar-filters { display: flex; align-items: center; gap: 9px; }
.month-switcher strong { min-width: 96px; text-align: center; font-size: 15px; }
.calendar-filters label { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.calendar-filters select { min-height: 40px; padding: 0 34px 0 11px; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-label); }
.school-calendar-card { overflow: hidden; }
.calendar-weekdays, .school-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { min-height: 42px; align-items: center; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--surface-soft); font-size: var(--font-caption); font-weight: 700; text-align: center; }
.calendar-day { min-width: 0; min-height: 154px; padding: 9px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: var(--surface-soft); }
.calendar-day.outside .calendar-date { opacity: .48; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-date { display: flex; min-height: 26px; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.calendar-date > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; font-size: var(--font-label); font-weight: 750; }
.calendar-day.today .calendar-date > span { color: #fff; background: var(--primary); }
.calendar-date small { color: var(--text-muted); font-size: var(--font-caption); }
.calendar-day-events { display: grid; align-content: start; gap: 4px; }
.calendar-event { display: grid; width: 100%; min-height: 30px; grid-template-columns: 6px minmax(0, 1fr); align-items: start; gap: 6px; padding: 6px 7px; color: var(--text-secondary); border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--font-caption); line-height: 1.35; text-align: left; }
.calendar-event:hover { border-color: var(--border-strong); filter: brightness(.985); }
.calendar-event i { width: 6px; height: 6px; margin-top: 3px; border-radius: 2px; background: var(--text-muted); }
.calendar-event.meeting { color: var(--warning); background: var(--warning-soft); }
.calendar-event.meeting i { background: var(--warning); }
.calendar-event.activity { color: var(--primary); background: var(--primary-soft); }
.calendar-event.activity i { background: var(--primary); }
.calendar-event.safety { color: var(--danger); background: var(--danger-soft); }
.calendar-event.safety i { background: var(--danger); }
.calendar-event.service { color: var(--primary); background: var(--accent-soft); }
.calendar-event.service i { background: var(--accent); }
.calendar-empty-mark { color: var(--border-strong); font-size: var(--font-caption); }
.calendar-empty-state { grid-column: 1 / -1; display: grid; min-height: 420px; place-items: center; align-content: center; gap: 9px; padding: 30px; text-align: center; }
.calendar-empty-state > .icon { width: 44px; height: 44px; padding: 11px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.calendar-empty-state h2, .calendar-empty-state p { margin: 0; }
.calendar-empty-state p { color: var(--text-muted); font-size: var(--font-label); }
.drawer-note { padding: 12px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--font-label); }

.calendar-import-modal { width: min(1080px, calc(100vw - 32px)); }
.calendar-review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 20px 8px; }
.calendar-review-toolbar strong, .calendar-review-toolbar small { display: block; }
.calendar-review-toolbar small { color: var(--text-muted); font-size: var(--font-caption); }
.calendar-review-toolbar select { min-height: 40px; padding: 0 34px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.calendar-review-list { max-height: 390px; margin: 0 20px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.calendar-review-row { display: grid; min-height: 64px; grid-template-columns: 26px 132px minmax(180px, 1fr) 126px; align-items: center; gap: 9px; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.calendar-review-row:last-child { border-bottom: 0; }
.calendar-review-row.excluded { opacity: .48; background: var(--surface-soft); }
.calendar-review-row > input { width: 18px; height: 18px; accent-color: var(--primary); }
.calendar-review-row label { min-width: 0; }
.calendar-review-row input[type="date"], .calendar-review-row input[type="text"], .calendar-review-row select { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-label); }
.calendar-review-title input { font-weight: 650; }

/* Admin data center */
.admin-heading { margin-bottom: 14px; }
.admin-notice { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 13px 15px; color: var(--warning); border: 1px solid #efd5b2; border-radius: var(--radius-md); background: var(--warning-soft); }
.admin-notice > .icon { width: 38px; height: 38px; padding: 9px; border-radius: var(--radius-sm); background: rgba(255,255,255,.72); }
.admin-notice strong, .admin-notice small { display: block; }
.admin-notice small { margin-top: 2px; color: var(--warning); font-size: var(--font-caption); }
.admin-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-metric-grid article { display: flex; min-height: 92px; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
.admin-metric-grid article > .icon { width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.admin-metric-grid strong, .admin-metric-grid small { display: block; }
.admin-metric-grid strong { font-size: 23px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.admin-metric-grid small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.admin-flow-card { margin-bottom: 14px; }
.admin-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 20px 18px; list-style: none; }
.admin-flow li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 56px; padding-right: 26px; }
.admin-flow li:not(:last-child)::after { position: absolute; top: 27px; right: 8px; width: 12px; height: 1px; background: var(--border-strong); content: ""; }
.admin-flow b { display: grid; width: 32px; height: 32px; place-items: center; color: var(--primary-strong); border-radius: 50%; background: var(--primary-soft); font-size: var(--font-label); }
.admin-flow strong, .admin-flow small { display: block; }
.admin-flow strong { font-size: 12px; }
.admin-flow small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.admin-content-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.admin-source-list { display: grid; gap: 0; }
.admin-data-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 11px; min-height: 88px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.admin-data-card:last-child { border-bottom: 0; }
.admin-data-icon { width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.admin-data-card > span:nth-child(2) strong, .admin-data-card > span:nth-child(2) small { display: block; }
.admin-data-card > span:nth-child(2) small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.admin-card-actions { display: flex; align-items: center; gap: 4px; }
.admin-card-actions .secondary-button { min-height: 38px; padding: 0 11px; font-size: var(--font-label); }
.admin-card-actions .text-link { min-height: 38px; font-size: var(--font-label); }
.derived-view-list { display: grid; padding: 5px 16px 10px; }
.derived-view-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 66px; border-bottom: 1px solid var(--border); }
.derived-view-list article:last-child { border-bottom: 0; }
.derived-view-list article > .icon { width: 32px; height: 32px; padding: 7px; color: var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.derived-view-list strong, .derived-view-list small { display: block; }
.derived-view-list strong { font-size: var(--font-label); }
.derived-view-list small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.permission-card { margin-bottom: 14px; }
.permission-table-wrap { overflow-x: auto; }
.permission-table { min-width: 720px; }
.permission-table td { white-space: normal; vertical-align: top; }
.drawer-form { grid-template-columns: 1fr; }

/* Personal local library */
.library-heading { margin-bottom: 14px; }
.library-local-notice { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; margin-bottom: 14px; padding: 15px 17px; color: var(--primary); border: 1px solid #c9e4da; border-radius: var(--radius-md); background: #f3faf7; }
.library-local-notice > .icon { width: 40px; height: 40px; padding: 9px; border-radius: var(--radius-sm); background: #dfeee9; }
.library-local-notice strong, .library-local-notice small { display: block; }
.library-local-notice small { margin-top: 3px; color: #527066; font-size: var(--font-caption); line-height: 1.6; }
.library-data-policy { margin-bottom: 14px; }
.library-policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.library-policy-grid > div { padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.library-policy-grid > div:first-child { border-color: #c9e4da; background: #f3faf7; }
.library-policy-grid strong, .library-policy-grid p { display: block; }
.library-policy-grid strong { font-size: var(--font-label); }
.library-policy-grid p { margin: 5px 0 0; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.65; }
.library-policy-footnote { margin: 12px 0 0; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.65; }
.library-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.library-metric-grid article { display: flex; min-height: 92px; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
.library-metric-grid article > .icon { width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.library-metric-grid strong, .library-metric-grid small { display: block; }
.library-metric-grid strong { font-size: 23px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.library-metric-grid small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.library-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: start; gap: 14px; }
.library-source-list { display: grid; }
.library-source-card { display: grid; min-height: 78px; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.library-source-card:last-child { border-bottom: 0; }
.library-source-card.is-empty { background: var(--surface-soft); }
.library-source-icon { width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.library-source-card.is-empty .library-source-icon { color: var(--text-muted); background: var(--surface-soft); }
.library-source-card > span:nth-child(2) strong, .library-source-card > span:nth-child(2) small { display: block; }
.library-source-card > span:nth-child(2) small { margin-top: 4px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.55; overflow-wrap: anywhere; }
.library-source-card .secondary-button { min-height: 44px; padding-inline: 14px; white-space: nowrap; }
.library-import-hub { margin-bottom: 18px; padding: 18px; }
.library-import-hub .card-header { align-items: flex-start; }
.library-import-hub .card-header p:last-child { margin: 6px 0 0; color: var(--text-secondary); font-size: var(--font-label); line-height: 1.65; }
.library-import-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.library-import-choice-grid > button { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 76px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.library-import-choice-grid > button:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.library-import-choice-grid > button:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent); outline-offset: 2px; }
.library-import-choice-grid .icon { width: 36px; height: 36px; padding: 8px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); }
.library-import-choice-grid strong, .library-import-choice-grid small { display: block; }
.library-import-choice-grid strong { font-size: 12px; }
.library-import-choice-grid small { margin-top: 4px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.library-side-stack { display: grid; gap: 14px; }
.library-owner { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; padding: 17px; border-bottom: 1px solid var(--border); }
.library-owner strong, .library-owner small { display: block; }
.library-owner small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.library-storage-facts { margin: 0; padding: 5px 17px 13px; }
.library-storage-facts div { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.library-storage-facts div:last-child { border-bottom: 0; }
.library-storage-facts dt { color: var(--text-muted); font-size: var(--font-caption); }
.library-storage-facts dd { margin: 0; font-size: var(--font-caption); font-weight: 700; text-align: right; }
.library-next-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-soft); box-shadow: var(--shadow-sm); }
.library-step { display: grid; width: 40px; height: 40px; place-items: center; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-weight: 750; }
.library-next-card h2 { margin: 4px 0 7px; font-size: 15px; }
.library-next-card p:last-child { margin: 0; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.7; }
.library-import-card { grid-template-columns: 42px minmax(0, 1fr); }
.library-import-actions { display: grid; gap: 8px; margin-top: 13px; }
.library-import-actions button { width: 100%; min-height: 44px; justify-content: center; }
.profile-import-intro { display: grid; gap: 12px; }
.profile-import-upload { position: relative; display: grid; min-height: 132px; place-items: center; align-content: center; gap: 7px; padding: 20px; border: 1px dashed #bfdccf; border-radius: var(--radius-sm); background: var(--surface-soft); text-align: center; cursor: pointer; }
.profile-import-upload:hover { border-color: var(--primary); background: var(--primary-soft); }
.profile-import-upload:focus-within { outline: 3px solid rgba(31,79,69,.2); outline-offset: 2px; }
.profile-import-upload > .icon { width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: #fff; }
.profile-import-upload strong, .profile-import-upload small { display: block; }
.profile-import-upload small { color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.6; }
.profile-import-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-import-columns { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-import-columns span { padding: 5px 8px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: var(--font-caption); }
.profile-import-review-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.profile-import-review-header strong, .profile-import-review-header small { display: block; }
.profile-import-review-header small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.profile-import-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.profile-import-counts span { padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); font-size: var(--font-caption); font-weight: 700; }
.profile-import-counts .ready { color: var(--primary); background: var(--accent-soft); }
.profile-import-counts .changed { color: var(--primary); background: var(--primary-soft); }
.profile-import-counts .duplicate { color: var(--text-secondary); background: var(--border); }
.profile-import-counts .conflict { color: var(--warning); background: #fff0e9; }
.profile-import-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.profile-import-table { width: 100%; min-width: 860px; border-collapse: collapse; }
.profile-import-table th { padding: 9px 8px; color: var(--text-muted); background: var(--surface-soft); font-size: var(--font-caption); text-align: left; }
.profile-import-table td { padding: 8px; border-top: 1px solid var(--border); vertical-align: top; }
.profile-import-table input[type="text"] { width: 100%; min-height: 40px; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-label); }
.profile-import-table input[type="checkbox"] { width: 20px; height: 20px; margin-top: 10px; accent-color: var(--primary); }
.profile-import-row.conflict { background: #fffaf7; }
.profile-import-row.invalid { background: #fff7f7; }
.profile-import-row small { display: block; max-width: 180px; margin-top: 4px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.profile-import-state { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 8px; border-radius: 999px; background: var(--surface-soft); font-size: var(--font-caption); font-weight: 700; white-space: nowrap; }
.profile-import-state.matched, .profile-import-state.new { color: var(--primary); background: var(--accent-soft); }
.profile-import-state.changed { color: var(--primary); background: var(--primary-soft); }
.profile-import-state.duplicate { color: var(--text-secondary); background: var(--border); }
.profile-import-state.conflict, .profile-import-state.invalid { color: var(--warning); background: #fff0e9; }
.profile-import-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.profile-import-footer p { margin: 0; color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.6; }
.profile-import-footer button { min-width: 132px; min-height: 44px; }
.profile-import-result { display: grid; place-items: center; min-height: 250px; padding: 28px; text-align: center; }
.profile-import-result > .icon { width: 54px; height: 54px; padding: 14px; color: var(--primary); border-radius: var(--radius-md); background: var(--accent-soft); }
.profile-import-result h3 { margin: 14px 0 7px; }
.profile-import-result p { max-width: 480px; margin: 0; color: var(--text-secondary); line-height: 1.7; }
.duty-template-intro { padding-bottom: 0; }
.duty-template-summary, .duty-template-footer, .duty-template-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.duty-template-summary strong, .duty-template-summary small, .duty-template-strip strong, .duty-template-strip small { display: block; }
.duty-template-summary small, .duty-template-strip small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.5; }
.duty-template-strip { padding: 11px 12px; border: 1px solid #d9e9e3; border-radius: var(--radius-sm); background: #f5fbf8; }
.duty-template-strip > span { min-width: 0; }
.duty-template-strip small { overflow-wrap: anywhere; }
.duty-template-list { display: grid; gap: 8px; margin-top: 12px; }
.duty-template-row { display: grid; grid-template-columns: 82px minmax(150px,1fr) 116px 116px 44px; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.duty-template-row label { display: grid; gap: 5px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.duty-template-row input { width: 100%; min-height: 44px; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: var(--font-caption); }
.duty-template-row input:focus, .duty-review-row input:focus { border-color: var(--primary); outline: 3px solid rgba(31,79,69,.16); }
.duty-template-delete { width: 44px; height: 44px; color: var(--danger); }
.duty-template-footer { margin-top: 12px; }
.duty-import-intro { display: grid; gap: 14px; }
.duty-import-start { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(280px, 1.15fr); gap: 14px; align-items: stretch; }
.duty-image-preview { display: grid; min-height: 132px; margin: 0; overflow: hidden; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.duty-image-preview[hidden] { display: none; }
.duty-image-preview img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.duty-image-preview figcaption { width: 100%; padding: 7px 10px; color: var(--text-muted); background: #fff; font-size: var(--font-caption); text-align: center; }
.duty-recognition-actions { display: flex; min-height: 44px; align-items: center; gap: 12px; }
.duty-recognition-actions > span { color: var(--text-muted); font-size: var(--font-caption); line-height: 1.5; }
.duty-progress { margin: 0; padding: 10px 12px; color: var(--primary-strong); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: var(--font-caption); font-weight: 700; }
.duty-text-fallback { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.duty-text-fallback summary { min-height: 44px; padding: 12px 14px; cursor: pointer; font-size: var(--font-label); font-weight: 700; }
.duty-text-fallback label { display: grid; gap: 6px; padding: 0 14px 10px; color: var(--text-secondary); font-size: var(--font-caption); }
.duty-text-fallback textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; line-height: 1.6; }
.duty-text-fallback .secondary-button { margin: 0 14px 14px; }
.duty-import-review { display: grid; gap: 12px; }
.duty-review-heading, .duty-review-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.duty-review-heading strong, .duty-review-heading small { display: block; }
.duty-review-heading small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.duty-warning { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; color: var(--warning); border-radius: var(--radius-sm); background: #fff5e6; font-size: var(--font-caption); line-height: 1.55; }
.duty-warning .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.duty-batch-toolbar { display: grid; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.duty-review-filters, .duty-selection-actions, .duty-batch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.duty-review-filters button, .duty-selection-actions button { min-height: 44px; padding: 7px 10px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: var(--font-caption); font-weight: 700; cursor: pointer; }
.duty-review-filters button[aria-pressed="true"] { color: var(--primary-strong); border-color: #bfdccf; background: var(--primary-soft); }
.duty-batch-label { margin-right: 2px; color: var(--text-secondary); font-size: var(--font-caption); font-weight: 750; }
.duty-batch-actions label { display: flex; min-height: 44px; align-items: center; gap: 6px; padding: 0 8px; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-caption); font-weight: 700; }
.duty-batch-actions input { width: 82px; min-height: 38px; border: 0; background: transparent; font: inherit; font-size: var(--font-caption); }
.duty-batch-actions .secondary-button { min-height: 44px; }
.duty-selection-actions { padding-top: 2px; border-top: 1px solid var(--border); }
.duty-selection-actions > span { margin-left: auto; color: var(--text-muted); font-size: var(--font-caption); }
.duty-review-list { display: grid; gap: 8px; }
.duty-review-row { display: grid; grid-template-columns: 28px minmax(100px,1.1fr) 78px minmax(112px,1fr) minmax(112px,1fr) 44px; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.duty-review-row.conflict, .duty-review-row.invalid { background: #fffaf7; }
.duty-review-row.changed { border-color: #bfdccf; background: var(--surface-soft); }
.duty-review-row.duplicate { background: var(--surface-soft); }
.duty-review-row label:not(.duty-check) { display: grid; gap: 5px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.duty-review-row input:not([type="checkbox"]) { width: 100%; min-height: 40px; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: var(--font-caption); }
.duty-check { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.duty-check input { width: 20px; height: 20px; accent-color: var(--primary); }
.duty-time-pair { display: grid; grid-template-columns: minmax(82px,1fr) auto minmax(82px,1fr); align-items: center; gap: 5px; }
.duty-time-pair i { color: var(--text-muted); font-style: normal; }
.duty-time-field { grid-column: 2 / 4; grid-row: 2; }
.duty-location-field { grid-column: 4 / 6; grid-row: 2; }
.duty-review-row > .profile-import-state { grid-column: 2; grid-row: 3; align-self: center; justify-self: start; }
.duty-match-reason { grid-column: 3 / 7; grid-row: 3; display: block; align-self: center; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.duty-row-delete { grid-column: 6; grid-row: 1; width: 44px; height: 44px; color: var(--text-muted); }
.duty-review-footer { color: var(--text-muted); font-size: var(--font-caption); }
.duty-review-footer > span { flex: 1; }
.duty-maintenance-summary, .duty-maintenance-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.duty-maintenance-summary strong, .duty-maintenance-summary small { display: block; }
.duty-maintenance-summary small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.duty-maintenance-summary > div { display: flex; gap: 8px; }
.duty-maintenance-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; gap: 12px; margin: 12px 0; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.duty-maintenance-toolbar > label { display: grid; gap: 5px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.duty-maintenance-toolbar input, .duty-maintenance-row input, .duty-maintenance-row select { width: 100%; min-height: 44px; padding: 8px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: var(--font-caption); }
.duty-maintenance-list { display: grid; gap: 9px; }
.duty-maintenance-row { padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.duty-maintenance-row.pending-delete { border-color: #efc8ca; background: var(--danger-soft); }
.duty-maintenance-row-head { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.duty-maintenance-row-head strong, .duty-maintenance-row-head small { display: block; }
.duty-maintenance-row-head small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.duty-maintenance-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.duty-maintenance-fields label { display: grid; gap: 5px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.duty-maintenance-fields input:focus, .duty-maintenance-fields select:focus, .duty-maintenance-toolbar input:focus { border-color: var(--primary); outline: 3px solid rgba(31,79,69,.16); }
.duty-maintenance-row.pending-delete input, .duty-maintenance-row.pending-delete select { opacity: .55; }
.danger-button { min-height: 44px; padding: 0 14px; color: var(--danger); border: 1px solid #efc8ca; border-radius: var(--radius-sm); background: #fff; font-weight: 700; cursor: pointer; }
.danger-button:hover { background: var(--danger-soft); }
.duty-pending-delete { display: flex; align-items: center; gap: 7px; margin: 9px 0 0; color: var(--danger); font-size: var(--font-caption); line-height: 1.5; }
.duty-pending-delete .icon { width: 16px; height: 16px; flex: 0 0 16px; }
.duty-maintenance-footer { position: sticky; bottom: 0; margin-top: 12px; padding: 11px 0 2px; border-top: 1px solid var(--border); background: #fff; }
.duty-maintenance-footer > span { color: var(--text-muted); font-size: var(--font-caption); line-height: 1.5; }
.duty-maintenance-footer .primary-button { flex: 0 0 auto; }
.directory-duty-row { display: grid; width: 100%; min-height: 56px; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; color: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: left; cursor: pointer; }
.directory-duty-row + .directory-duty-row { margin-top: 7px; }
.directory-duty-row > .icon { width: 32px; height: 32px; padding: 7px; color: var(--primary); border-radius: var(--radius-sm); background: var(--accent-soft); }
.directory-duty-row strong, .directory-duty-row small { display: block; }
.directory-duty-row small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.library-period-preview { display: grid; overflow: hidden; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.library-period-preview > div { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--border); }
.library-period-preview > div:last-child { border-bottom: 0; }
.library-period-preview strong, .library-period-preview small { display: block; }
.library-period-preview small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.library-period-preview time { color: var(--text-secondary); font-size: var(--font-caption); font-variant-numeric: tabular-nums; }
.library-relations { margin-top: 14px; }
.backup-security-note { display:grid; grid-template-columns:42px minmax(0,1fr); gap:12px; padding:14px; border:1px solid #c9e4da; border-radius:var(--radius-sm); background:#f3faf7; }
.backup-security-note > .icon { width:40px; height:40px; padding:9px; color:var(--primary); border-radius:var(--radius-sm); background:#dfeee9; }
.backup-security-note strong,.backup-security-note p { display:block; }
.backup-security-note p,.backup-action-block > p { margin:4px 0 0; color:var(--text-secondary); font-size: var(--font-caption); line-height:1.65; }
.backup-summary { margin-top:8px; }
.backup-preview-list { overflow:hidden; margin:10px 0 0; border:1px solid var(--border); border-radius:var(--radius-sm); }
.backup-preview-list div { display:grid; grid-template-columns:112px minmax(0,1fr); gap:12px; align-items:center; min-height:46px; padding:9px 11px; border-bottom:1px solid var(--border); }
.backup-preview-list div:last-child { border-bottom:0; }
.backup-preview-list dt { color:var(--text-muted); font-size: var(--font-caption); }
.backup-preview-list dd { min-width:0; margin:0; overflow-wrap:anywhere; font-size: var(--font-caption); font-weight:700; text-align:right; }
.backup-action-block { padding-top:18px; border-top:1px solid var(--border); scroll-margin-top:94px; }
.backup-action-block form { display:grid; gap:12px; margin-top:12px; }
.backup-action-block form button { width:100%; justify-content:center; }
.backup-action-block input[type="file"] { min-height:50px; padding:9px; border:1px dashed #bfdccf; background:var(--surface-soft); }
.backup-preview { display:grid; gap:12px; margin-top:14px; padding:14px; border:1px solid #c9e4da; border-radius:var(--radius-sm); background:#fbfefd; }
.backup-preview-heading { display:grid; grid-template-columns:36px minmax(0,1fr); gap:10px; align-items:center; }
.backup-preview-heading > .icon { width:34px; height:34px; padding:8px; color:var(--primary); border-radius:var(--radius-sm); background:#dfeee9; }
.backup-preview-heading strong,.backup-preview-heading small { display:block; }
.backup-preview-heading small { margin-top:2px; color:var(--text-muted); font-size: var(--font-caption); }
.backup-danger { padding:12px; color:var(--danger); border:1px solid #efc8ca; border-radius:var(--radius-sm); background:var(--danger-soft); }
.backup-danger p { margin:4px 0 0; font-size: var(--font-caption); line-height:1.6; }
.backup-preview .danger-button { width:100%; }
.danger-button:disabled { color:var(--text-muted); border-color:var(--border); background:var(--border); cursor:not-allowed; }
.assistant-intro { display:grid; grid-template-columns:44px minmax(0,1fr); gap:12px; padding:15px; color:var(--primary-strong); border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.assistant-intro > .icon { width:42px; height:42px; padding:10px; border-radius:var(--radius-sm); background:var(--primary-soft); }
.assistant-intro strong,.assistant-intro p { display:block; }
.assistant-intro p { margin:4px 0 0; color:var(--text-secondary); font-size: var(--font-caption); line-height:1.7; }
.assistant-source { display:grid; gap:12px; }
.assistant-upload { display:grid; grid-template-columns:42px minmax(0,1fr); gap:12px; align-items:center; min-height:82px; padding:14px; border:1px dashed #bfdccf; border-radius:var(--radius-sm); background:var(--surface-soft); cursor:pointer; }
.assistant-upload:focus-within { outline:3px solid rgba(31,79,69,.2); border-color:var(--primary); }
.assistant-upload > .icon { width:40px; height:40px; padding:9px; color:var(--primary); border-radius:var(--radius-sm); background:#fff; }
.assistant-upload strong,.assistant-upload small { display:block; }
.assistant-upload small { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.5; }
.assistant-upload input.sr-only { width:1px; height:1px; min-height:0; }
.assistant-or { display:flex; align-items:center; gap:10px; color:var(--text-muted); font-size: var(--font-caption); }
.assistant-or::before,.assistant-or::after { content:""; height:1px; flex:1; background:var(--border); }
.assistant-source textarea { min-height:132px; resize:vertical; }
.assistant-examples { display:flex; flex-wrap:wrap; gap:8px; }
.assistant-examples button { min-height:38px; padding:0 11px; color:var(--primary-strong); border:1px solid var(--border); border-radius:999px; background:#fff; cursor:pointer; }
.assistant-source > .primary-button { width:100%; justify-content:center; }
.assistant-processing { margin:0; color:var(--primary-strong); font-size: var(--font-caption); text-align:center; }
.assistant-result { display:grid; gap:13px; padding:15px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.assistant-result-heading { display:grid; grid-template-columns:40px minmax(0,1fr) auto; gap:10px; align-items:center; }
.assistant-result-heading > .icon { width:38px; height:38px; padding:9px; color:var(--primary); border-radius:var(--radius-sm); background:var(--primary-soft); }
.assistant-result-heading small,.assistant-result-heading strong { display:block; }
.assistant-result-heading small { color:var(--text-muted); font-size: var(--font-caption); }
.assistant-result-heading strong { margin-top:2px; font-size:14px; }
.assistant-result > p { margin:0; color:var(--text-secondary); font-size: var(--font-caption); line-height:1.65; }
.assistant-confidence { padding:6px 9px; border-radius:999px; font-size: var(--font-caption); font-weight:700; white-space:nowrap; }
.assistant-confidence.high { color:var(--primary); background:var(--accent-soft); }
.assistant-confidence.medium { color:var(--warning); background:#fff2d8; }
.assistant-confidence.low { color:var(--danger); background:var(--danger-soft); }
.assistant-evidence { display:flex; flex-wrap:wrap; gap:7px; }
.assistant-evidence > small { width:100%; color:var(--text-muted); }
.assistant-evidence > span { display:inline-flex; min-height:30px; align-items:center; gap:5px; padding:5px 8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; font-size: var(--font-caption); }
.assistant-evidence .icon { width:13px; height:13px; color:var(--primary); }
.assistant-write-boundary,.assistant-local-note { display:grid; grid-template-columns:34px minmax(0,1fr); gap:9px; align-items:center; padding:11px; border-radius:var(--radius-sm); background:#f3faf7; }
.assistant-write-boundary .icon,.assistant-local-note .icon { width:32px; height:32px; padding:7px; color:var(--primary); border-radius:var(--radius-sm); background:#dfeee9; }
.assistant-write-boundary strong,.assistant-write-boundary small,.assistant-local-note strong,.assistant-local-note small { display:block; }
.assistant-write-boundary small,.assistant-local-note small { margin-top:2px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.5; }
.assistant-result > .primary-button { width:100%; justify-content:center; }
.assistant-visual-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.assistant-visual-summary > span { padding:10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; }
.assistant-visual-summary strong,.assistant-visual-summary small { display:block; }
.assistant-visual-summary strong { font-size:16px; }
.assistant-visual-summary small { margin-top:2px; color:var(--text-muted); font-size: var(--font-caption); }
.assistant-visual-sample,.assistant-vision-warnings { display:grid; gap:6px; padding:10px 12px; border-radius:var(--radius-sm); background:#fff; border:1px solid var(--border); }
.assistant-visual-sample > span { color:var(--text-secondary); font-size: var(--font-caption); line-height:1.5; }
.assistant-visual-sample > span strong { display:inline-block; min-width:62px; color:var(--text); }
.assistant-visual-sample em { color:var(--primary); font-size: var(--font-caption); font-style:normal; }
.assistant-vision-warnings { color:var(--warning); border-color:#ead5b2; background:#fffaf1; font-size: var(--font-caption); }
.assistant-matrix-audit { display:grid; gap:4px; padding:12px 14px; border:1px solid #b9dbcf; border-radius:var(--radius-sm); color:var(--primary); background:#f2faf6; line-height:1.5; }
.assistant-matrix-audit.blocked { border-color:#e7c7a1; color:var(--warning); background:#fff8ed; }
.assistant-matrix-audit span,.assistant-matrix-audit small { color:inherit; font-size:var(--font-caption); }
.guard-matrix-overview { display:grid; gap:12px; }
.guard-matrix-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; font-variant-numeric:tabular-nums; }
.guard-matrix-counts > span { padding:11px; border:1px solid var(--border); border-radius:var(--radius-sm); }
.guard-matrix-counts strong,.guard-matrix-counts small { display:block; }
.guard-matrix-counts strong { font-size:18px; }
.guard-matrix-counts small { color:var(--text-secondary); font-size:var(--font-caption); }
.guard-matrix-issues { padding:12px 14px; color:var(--warning); border:1px solid #e7c7a1; border-radius:var(--radius-sm); background:#fff8ed; font-size:var(--font-caption); line-height:1.55; }
.guard-matrix-issues ul { margin:7px 0 0; padding-left:20px; }
.guard-matrix-issues li + li { margin-top:4px; }
.guard-matrix-scope { display:grid; gap:8px; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.guard-matrix-scope > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.guard-matrix-scope label { display:grid; gap:4px; color:var(--text-secondary); font-size:var(--font-caption); }
.guard-matrix-scope input { width:100%; min-height:44px; padding:8px 9px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; font:inherit; }
.guard-matrix-scope small { color:var(--text-secondary); line-height:1.5; }
.guard-matrix-hint { margin:0; color:var(--text-secondary); font-size:var(--font-caption); line-height:1.6; }
.guard-matrix-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:10px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.guard-matrix-toolbar label { display:grid; flex:1 1 160px; gap:4px; font-size:var(--font-caption); font-weight:700; }
.guard-matrix-toolbar select { min-height:44px; padding:8px 10px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; font:inherit; }
.guard-matrix-toolbar > span { color:var(--text-secondary); font-size:var(--font-caption); }
.guard-matrix-row-head { display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px; }
.guard-matrix-row-head strong { flex:1 1 230px; }
.guard-matrix-row-head > span { color:var(--text-secondary); font-size:var(--font-caption); font-variant-numeric:tabular-nums; }
.work-source-link { min-height:36px; padding:5px 9px; color:var(--primary-strong); border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.guard-matrix-list .work-review-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
.guard-matrix-list .work-review-fields input { min-height:44px; padding:8px 9px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; font:inherit; font-size:var(--font-caption); }
.guard-matrix-row-foot { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.guard-matrix-row-foot > small { flex:1 1 180px; color:var(--text-secondary); line-height:1.5; }
.guard-matrix-row-foot .work-review-check { min-height:38px; font-size:var(--font-caption); }
.guard-matrix-row-foot .work-review-check input { width:20px; height:20px; accent-color:var(--primary); }
.guard-matrix-footer { gap:8px; padding:12px 0; border-top:1px solid var(--border); }
.guard-matrix-footer > span { flex:1 1 210px; color:var(--text-secondary); font-size:var(--font-caption); line-height:1.5; }
.guard-matrix-toolbar button:disabled,.guard-matrix-footer button:disabled { opacity:.55; cursor:not-allowed; }
.guard-matrix-toolbar button:focus-visible,.guard-matrix-footer button:focus-visible,.work-source-link:focus-visible { outline:3px solid var(--primary); outline-offset:2px; }
.work-review-list { display:grid; gap:9px; }
.work-review-row { display:grid; gap:8px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; }
.work-review-row.conflict,.work-review-row.invalid { border-color:#ead5b2; background:#fffaf1; }
.work-review-row.duplicate { opacity:.65; }
.work-review-check { display:flex; align-items:center; gap:8px; color:var(--primary-strong); font-weight:700; }
.work-review-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.work-review-fields label { display:grid; gap:4px; color:var(--text-muted); font-size: var(--font-caption); }
.work-review-fields input { min-width:0; width:100%; }
.work-review-row > small { color:var(--text-muted); }
.work-review-footer { position:sticky; bottom:0; display:flex; align-items:center; justify-content:space-between; gap:12px; background:#fff; }
@media(max-width:620px) {
  .assistant-visual-summary { grid-template-columns:1fr; }
  .work-review-fields { grid-template-columns:1fr 1fr; }
  .guard-matrix-list .work-review-fields { grid-template-columns:1fr 1fr; }
  .work-review-footer { align-items:stretch; flex-direction:column; }
  .work-review-footer .primary-button { width:100%; justify-content:center; }
  .guard-matrix-counts strong { font-size:15px; }
  .guard-matrix-footer { position:static; }
  .guard-matrix-footer > span { flex:none; }
  .guard-matrix-footer button { width:100%; justify-content:center; }
}
.assistant-local-note { margin-bottom:0; }
.reminder-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 18px; border-bottom:1px solid var(--border); }
.reminder-summary strong,.reminder-summary small { display:block; }
.reminder-summary small { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); }
.reminder-tabs { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding:12px 18px 5px; }
.reminder-tabs button { min-height:44px; color:var(--text-secondary); border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); font-weight:700; }
.reminder-tabs button[aria-selected="true"] { color:var(--primary-strong); border-color:var(--border); background:var(--primary-soft); }
.reminder-list { display:grid; gap:8px; padding:10px 18px 16px; }
.reminder-row { display:grid; width:100%; min-height:70px; grid-template-columns:5px minmax(0,1fr) auto; align-items:center; gap:12px; padding:10px 12px 10px 0; color:var(--text); border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; text-align:left; transition:border-color var(--transition),background var(--transition); }
.reminder-row:hover { border-color:var(--border-strong); background:var(--surface-soft); }
.reminder-row:focus-visible { outline:3px solid rgba(31,79,69,.25); outline-offset:2px; }
.reminder-mark { width:4px; height:42px; border-radius:0 4px 4px 0; background:var(--primary); }
.reminder-row.urgent .reminder-mark { background:var(--danger); }
.reminder-row.today .reminder-mark { background:var(--warning); }
.reminder-row.soon .reminder-mark { background:var(--accent); }
.reminder-row strong,.reminder-row small { display:block; }
.reminder-row small { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); }
.reminder-row.read { opacity:.72; }
.reminder-action { display:flex; min-height:44px; align-items:center; gap:5px; padding:0 4px; color:var(--primary-strong); font-size: var(--font-caption); font-weight:700; white-space:nowrap; }
.reminder-empty { display:grid; min-height:190px; place-items:center; align-content:center; gap:7px; color:var(--text-secondary); text-align:center; }
.reminder-empty > .icon { width:42px; height:42px; padding:10px; color:var(--primary); border-radius:var(--radius-sm); background:var(--accent-soft); }
.reminder-empty small { color:var(--text-muted); }
.reminder-boundary { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:center; gap:10px; margin:0 18px 18px; padding:11px 12px; color:var(--text-secondary); border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.reminder-boundary > .icon { width:30px; height:30px; padding:7px; color:var(--primary); border-radius:var(--radius-sm); background:var(--primary-soft); }
.reminder-boundary strong,.reminder-boundary small { display:block; }
.reminder-boundary small { margin-top:2px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.5; }
.relationship-flow { display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) 30px minmax(0, 1fr); align-items: stretch; gap: 8px; padding: 16px; border-bottom: 1px solid var(--border); }
.relationship-flow article { display: grid; min-height: 106px; grid-template-columns: 38px minmax(0, 1fr); align-content: center; gap: 4px 11px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.relationship-flow article > .icon { grid-row: 1 / 3; width: 38px; height: 38px; padding: 9px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.relationship-flow strong, .relationship-flow small { display: block; }
.relationship-flow strong { align-self: end; font-size: 12px; }
.relationship-flow small { align-self: start; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.55; }
.relationship-arrow { display: grid; place-items: center; color: var(--primary); font-size: 20px; font-weight: 700; }
.relationship-status-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.relationship-status { display: grid; min-height: 72px; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.relationship-status > .icon { width: 34px; height: 34px; padding: 8px; color: var(--text-muted); border-radius: var(--radius-sm); background: var(--surface-soft); }
.relationship-status.ready > .icon { color: var(--primary); background: var(--accent-soft); }
.relationship-status.pending > .icon { color: var(--warning); background: #fff6e6; }
.relationship-status strong, .relationship-status small, .relationship-status b { display: block; }
.relationship-status strong { font-size: var(--font-caption); }
.relationship-status small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); line-height: 1.45; }
.relationship-status > span:last-child { text-align: right; }
.relationship-status b { font-size: 14px; font-variant-numeric: tabular-nums; }
.relationship-schema-list { display: grid; overflow: hidden; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.relationship-schema-list article { display: grid; min-height: 54px; grid-template-columns: 94px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.relationship-schema-list article:last-child { border-bottom: 0; }
.relationship-schema-list strong { font-size: var(--font-caption); }
.relationship-schema-list span { color: var(--text-secondary); font-size: var(--font-caption); line-height: 1.55; }
.command-palette { width: min(640px, calc(100vw - 28px)); margin-top: 11vh; }
.search-box { display: flex; min-height: 66px; align-items: center; gap: 11px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search-box > .icon, .search-box > button { flex-shrink: 0; }
.search-box > button { min-width: 44px; min-height: 44px; }
.search-results { max-height: 420px; overflow-y: auto; padding: 8px; }
.search-group-title { padding: 7px 9px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.search-result { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 7px 9px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; }
.search-result:hover { background: var(--surface-soft); }
.search-result > .icon { width: 36px; height: 36px; padding: 8px; color: var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--text-muted); font-size: var(--font-caption); }
.search-hint { display: flex; justify-content: space-between; padding: 10px 16px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--surface-soft); font-size: var(--font-caption); }
.detail-drawer { position: fixed; z-index: 110; inset: 0 0 0 auto; width: min(430px, 92vw); overflow-y: auto; padding: 0; border-left: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-md); transform: translateX(104%); transition: transform 240ms ease; }
.detail-drawer.open { transform: translateX(0); }
.detail-drawer.wide { width: min(780px, 96vw); }
.drawer-header { position: sticky; z-index: 2; top: 0; display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.95); }
.drawer-header h2 { font-size: 20px; }
.drawer-content { padding: 18px; }
.drawer-block { margin-bottom: 20px; }
.drawer-block > small { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; letter-spacing: .06em; }
.drawer-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-info > div { padding: 11px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.drawer-info strong, .drawer-info span { display: block; }
.drawer-info strong { font-size: 12px; }
.drawer-info span { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.drawer-actions { display: grid; gap: 8px; }
.drawer-actions button { width: 100%; }
.account-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.account-card.admin { border-color: #ead6b8; background: #fffaf1; }
.account-avatar { display: grid; width: 48px; height: 48px; place-items: center; color: var(--primary); border-radius: var(--radius-md); background: #deeee8; font-size: 17px; font-weight: 750; }
.account-card.admin .account-avatar { color: var(--warning); background: #f7e9d3; }
.account-card strong, .account-card small { display: block; }
.account-card small { margin-top: 2px; color: var(--text-muted); font-size: var(--font-caption); }
.account-permission-list { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.account-permission-list span { display: flex; min-height: 48px; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: var(--font-label); }
.account-permission-list span:last-child { border-bottom: 0; }
.account-permission-list .icon { width: 18px; height: 18px; color: var(--accent); }
.account-permission-list span:last-child .icon { color: var(--primary); }
.mini-schedule { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mini-schedule > div { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.mini-schedule > div:last-child { border-bottom: 0; }
.mini-schedule time, .mini-schedule span { color: var(--text-muted); font-size: var(--font-caption); }
.mini-schedule strong { font-size: var(--font-label); }
.teacher-weekly-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.teacher-weekly-table { min-width: 670px; table-layout: fixed; }
.teacher-weekly-table th, .teacher-weekly-table td { height: 72px; padding: 8px; white-space: normal; vertical-align: top; }
.teacher-weekly-table thead th { height: auto; text-align: center; }
.teacher-weekly-table tbody th { width: 92px; background: var(--surface-soft); }
.teacher-weekly-table tbody th strong, .teacher-weekly-table tbody th small, .teacher-weekly-table td strong, .teacher-weekly-table td small { display: block; }
.teacher-weekly-table tbody th small, .teacher-weekly-table td small { margin-top: 3px; color: var(--text-muted); font-size: var(--font-caption); }
.teacher-weekly-table td.busy-cell { background: var(--surface-soft); }
.teacher-weekly-table td.free-cell { color: #4f7f70; background: #f8fcfa; text-align: center; vertical-align: middle; }
.teacher-weekly-table td.selected { box-shadow: inset 0 0 0 2px var(--primary); }
.mapping-state.success { color: var(--primary); background: var(--accent-soft); }
.toast-region { position: fixed; z-index: 2500; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; min-width: 240px; max-width: 380px; align-items: center; gap: 9px; padding: 12px 14px; color: #fff; border-radius: var(--radius-sm); background: var(--text-secondary); box-shadow: var(--shadow-md); transition: opacity var(--transition), transform var(--transition); }
.toast-region .toast:not(:last-child) { display: none; }
.toast .icon { width: 18px; height: 18px; color: #b9eedb; }
.assistant-model-control { display:grid; gap:12px; padding:14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-soft); }
.assistant-cloud-consent,.assistant-local-mode { display:flex; align-items:flex-start; gap:10px; }
.assistant-cloud-consent input { width:20px; height:20px; margin-top:2px; accent-color:var(--primary); }
.assistant-cloud-consent span,.assistant-local-mode span { display:grid; gap:3px; }
.assistant-cloud-consent small,.assistant-local-mode small { color:var(--muted); line-height:1.5; }
.assistant-model-picker { margin:0; }
.assistant-model-used { display:flex; align-items:center; gap:7px; color:var(--primary); font-size:13px; }
.assistant-model-used .icon { width:16px; height:16px; }

@media (max-width: 1180px) {
  .dashboard-layout { grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); }
  .primary-button.compact span:not(.icon),.secondary-button.compact span:not(.icon) { display: none; }
  .primary-button.compact,.secondary-button.compact { width: 44px; padding: 0; }
  .teacher-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .score-dimensions { grid-template-columns: repeat(3, 1fr); }
  .admin-content-grid { grid-template-columns: 1fr; }
  .library-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 230px; }
  .topbar { gap: 10px; padding-inline: 16px; }
  .global-search { width: auto; min-width: 0; flex: 1; }
  .profile-button { display: none; }
  .primary-button.compact span:not(.icon),.secondary-button.compact span:not(.icon) { display: none; }
  .primary-button.compact,.secondary-button.compact { width: 44px; padding: 0; }
  .class-context-bar { grid-template-columns: 1fr; padding: 8px; }
  .class-context-bar label { grid-template-columns: 1fr; gap: 0; }
  .class-context-bar label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .class-context-bar select { min-height: 48px; padding-left: 12px; font-size: 16px; }
  .class-context-relation,.class-context-count { display: none; }
  .class-work-grid { grid-template-columns: 1fr; grid-template-areas: "score" "record"; }
  .class-work-panel[data-class-work-panel="home"]:not([hidden]) { grid-template-columns: 1fr; }
  .teacher-search-panel, .teacher-search-panel-detailed { grid-template-columns: 1fr; }
  .teacher-mode-switch { grid-template-columns: 1fr 1fr; }
  .record-row { grid-template-columns: 54px minmax(0,1fr) 68px 40px 44px; }
  .record-row > small { display: none; }
  .period-review-layout { grid-template-columns: 1fr; }
  .period-source-preview { max-height: 190px; min-height: 150px; }
  .period-source-preview pre { min-height: 150px; }
  .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relationship-status-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .admin-flow li:nth-child(2)::after { display: none; }
  .calendar-review-row { grid-template-columns: 26px 128px minmax(180px, 1fr); }
  .calendar-review-row > label:last-child { grid-column: 3; }
  .class-profile-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .homework-layout { grid-template-columns: 1fr; }
  .homework-overview { display: grid; grid-template-columns: minmax(160px,.55fr) minmax(0,1fr); gap: 12px; }
  .homework-overview dl { margin-top: 0; }
  .homework-overview > p { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .menu-button { display: none; }
  .mobile-tabbar {
    position: fixed; z-index: 80; right: 0; bottom: 0; left: 0; display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr)); min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 4px max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));
    border-top: 1px solid var(--border); background: rgba(255,255,255,.97); box-shadow: 0 -10px 30px rgba(28,27,39,.06); backdrop-filter: blur(14px);
  }
  .mobile-tab {
    position: relative; display: flex; min-width: 0; min-height: 56px; align-items: center; justify-content: center; flex-direction: column; gap: 3px;
    color: var(--text-secondary); border-radius: var(--radius-sm); text-decoration: none; font-size: var(--font-label); font-weight: 650; transition: color var(--transition), background var(--transition);
    touch-action: manipulation;
  }
  .mobile-tab .icon { width: 22px; height: 22px; }
  .mobile-tab.active { color: var(--primary-strong); font-weight: 800; }
  .mobile-tab.active .icon { padding: 3px; border-radius: var(--radius-sm); background: var(--primary-soft); }
  .mobile-tab.active::before { position: absolute; top: 0; width: 24px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); content: ""; }
  body.auth-locked .mobile-tabbar,body.data-loading .mobile-tabbar { display: none; }
  .topbar { position: fixed; right: 0; left: 0; height: auto; min-height: calc(64px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0; gap: 9px; }
  .global-search { width: auto; min-width: 0; flex: 1; }
  .global-search kbd, .profile-button, .topbar-actions > .icon-button, .topbar-client-download { display: none; }
  .primary-button.compact span:not(.icon),.secondary-button.compact span:not(.icon) { display: none; }
  .primary-button.compact,.secondary-button.compact { width: 44px; padding: 0; }
  main { padding: calc(82px + env(safe-area-inset-top, 0px)) 14px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .page-heading, .welcome-heading { min-height: 0; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .heading-actions { width: 100%; }
  .heading-actions > button { flex: 1; }
  .dashboard-layout { grid-template-columns: 1fr; grid-template-areas: "today" "focus" "calendar"; }
  .schedule-toolbar { align-items: flex-start; flex-direction: column; }
  .schedule-edit-banner { grid-template-columns: 38px minmax(0, 1fr); }
  .schedule-edit-banner-icon { width: 38px; height: 38px; padding: 9px; }
  .schedule-edit-banner .secondary-button { grid-column: 2; justify-self: start; }
  .schedule-import-status { grid-template-columns: 38px minmax(0, 1fr); }
  .schedule-import-status .mapping-state, .schedule-import-status .text-link { grid-column: 2; justify-self: start; }
  .import-findings { grid-template-columns: 1fr; }
  .score-dimensions { grid-template-columns: repeat(2, 1fr); }
  .routine-date-toolbar { flex-wrap: wrap; }
  .routine-date-toolbar label { flex: 1 1 180px; }
  .routine-date-toolbar input { min-width: 0; flex: 1; }
  .routine-date-state { width: 100%; margin-left: 0; text-align: center; }
  .student-score-card { display: none; }
  .class-context-bar { grid-template-columns: minmax(0,1fr) auto; margin-bottom: 10px; }
  .class-context-bar label { grid-column: 1 / -1; }
  .class-context-relation { min-height: 38px; }
  .class-work-taskbar { min-height: 48px; padding-inline: 0 4px; }
  .class-work-taskbar button { min-height: 44px; }
  .class-student-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .class-student-tabs[hidden] { display: none; }
  .class-student-tabs button { justify-content: center; padding-inline: 6px; }
  .class-work-panel[data-class-work-panel="home"]:not([hidden]) { grid-template-columns: 1fr; }
  .class-home-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .homework-toolbar { grid-template-columns: minmax(150px,.45fr) minmax(0,1fr); }
  .homework-toolbar > .status-chip { grid-column: 1 / -1; justify-self: start; }
  .homework-layout { padding: 12px; }
  .homework-editor-item { grid-template-columns: 28px minmax(0,1fr) 44px; }
  .homework-editor-item > label:last-of-type { grid-column: 2; }
  .homework-editor-item .icon-button { grid-column: 3; grid-row: 1; }
  .class-student-overview-grid { grid-template-columns: 1fr; padding: 12px; }
  .class-followup-item { grid-template-columns: 38px minmax(0,1fr); }
  .class-followup-item .secondary-button { grid-column: 2; justify-self: start; }
  .score-dimensions > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .teacher-grid { grid-template-columns: 1fr; }
  .scope-field { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .record-row { grid-template-columns: 48px minmax(0,1fr) 38px 42px; }
  .record-row .record-category, .record-row > small { display: none; }
  .admin-notice { grid-template-columns: 38px minmax(0, 1fr); }
  .admin-notice .status-chip { grid-column: 2; justify-self: start; }
  .library-local-notice { grid-template-columns: 38px minmax(0, 1fr); }
  .library-local-notice .status-chip { grid-column: 2; justify-self: start; }
  .library-policy-grid { grid-template-columns: 1fr; }
  .admin-data-card { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .admin-data-card .admin-card-actions { grid-column: 2 / -1; justify-self: start; }
  .period-review-row { grid-template-columns: 26px minmax(0, 1fr) auto; align-items: start; }
  .period-review-row .period-review-identity { grid-column: 2 / -1; }
  .period-review-row .period-review-time-pair { grid-column: 2 / -1; width: 100%; }
  .period-review-row .period-review-state { grid-column: 2 / -1; display: flex; align-items: center; justify-content: flex-end; }
  .period-review-row .period-review-state label { min-width: 126px; flex: 1; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .month-switcher { justify-content: center; }
  .calendar-filters { justify-content: space-between; }
  .calendar-filters label { flex: 1; }
  .calendar-filters select { min-width: 0; flex: 1; }
  .calendar-review-row { grid-template-columns: 26px minmax(0, 1fr); align-items: start; }
  .calendar-review-row > label, .calendar-review-row > label:last-child { grid-column: 2; }
  .me-profile-card { grid-template-columns: 52px minmax(0,1fr); padding: 15px; }
  .me-avatar { width: 50px; height: 50px; border-radius: var(--radius-md); }
  .me-profile-card .secondary-button { grid-column: 1 / -1; width: 100%; }
  .me-link-grid { grid-template-columns: 1fr; gap: 10px; }
  .me-link-card { min-height: 84px; }
  .toast-region { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .page-heading h1 { font-size: 24px; }
  .class-heading { gap: 6px; margin-bottom: 12px; }
  .class-heading > div { width: 100%; }
  .class-heading p:last-child { max-width: 34ch; font-size: var(--font-label); line-height: 1.5; }
  .score-controls, .rule-buttons { grid-template-columns: 1fr; }
  .routine-date-toolbar { padding: 8px; }
  .routine-date-toolbar label { order: -1; flex-basis: calc(100% - 106px); }
  .routine-date-toolbar .routine-today-button { flex: 1; }
  .class-context-bar { grid-template-columns: 1fr; padding: 8px; }
  .class-context-bar label { grid-template-columns: 1fr; gap: 0; }
  .class-context-bar label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .class-context-bar select { min-height: 48px; padding-left: 12px; font-size: 15px; }
  .class-context-relation,.class-context-count { display: none; }
  .class-home-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 12px 12px; }
  .class-home-status-list { padding: 0 12px 12px; }
  .class-home-status-list article { grid-template-columns: 32px minmax(0,1fr); }
  .class-home-status-list em { grid-column: 2; justify-self: start; }
  .class-home-actions { grid-template-columns: 1fr 1fr; padding: 0 12px 12px; }
  .class-home-actions > button { min-height: 76px; grid-template-columns: 32px minmax(0,1fr); }
  .class-home-action-arrow { display: none; }
  .card-header-actions { align-items: flex-end; flex-direction: column; }
  .homework-header { align-items: flex-start; }
  .homework-header .card-header-actions { width: 100%; align-items: stretch; }
  .homework-header .primary-button { width: 100%; }
  .homework-toolbar { grid-template-columns: 1fr; padding-inline: 12px; }
  .homework-toolbar > .status-chip { grid-column: auto; }
  .homework-subject-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .homework-subject-filters button { width: 100%; padding-inline: 7px; }
  .homework-layout { padding: 10px; }
  .class-homework-empty { min-height: 180px; align-items: center; flex-direction: column; text-align: center; }
  .homework-overview { display: block; }
  .homework-overview dl { margin-top: 12px; }
  .homework-batch-main { grid-template-columns: 1fr; }
  .homework-status-badge { justify-self: start; }
  .homework-item-row { grid-template-columns: 24px minmax(0,1fr); }
  .homework-item-progress { grid-column: 2; }
  .homework-batch-actions { display: grid; grid-template-columns: 1fr; }
  .homework-batch-actions button { width: 100%; }
  .homework-editor-summary,.homework-form-grid { grid-template-columns: 1fr; }
  .homework-editor-item { grid-template-columns: 28px minmax(0,1fr) 44px; padding: 8px; }
  .homework-editor-item > label:last-of-type { grid-column: 2; }
  .homework-form-actions { display: grid; grid-template-columns: 1fr; }
  .homework-quick-class { min-height: 72px; grid-template-columns: 40px minmax(0,1fr) 18px; }
  .homework-quick-current { display: none; }
  .homework-form-actions button { width: 100%; }
  .homework-student-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .class-profile-metrics,.class-profile-roles { grid-template-columns: 1fr; }
  .class-profile-match { grid-template-columns: 38px minmax(0,1fr); }
  .class-profile-match > :last-child { grid-column: 2; justify-self: start; }
  .class-history-item { grid-template-columns: 62px minmax(0,1fr) 38px; gap: 8px; }
  .score-revoke-modal textarea { font-size: 16px; }
  .teacher-mode-switch { grid-template-columns: 1fr; }
  .teacher-mode-switch button { min-height: 56px; }
  .student-roster-form { grid-template-columns: 1fr; }
  .student-roster-form .primary-button { width: 100%; }
  .directory-person-list { grid-template-columns: 1fr; }
  .heading-actions .secondary-button:first-child { flex-basis: 100%; }
  .agenda-row { grid-template-columns: 52px 5px minmax(0,1fr); }
  .duty-list button { grid-template-columns: 48px 6px minmax(0,1fr); }
  .duty-list .status-chip { grid-column: 3; justify-self: start; }
  .score-dimensions { grid-template-columns: 1fr 1fr; }
  .stepper { gap: 5px; }
  .stepper i { width: 18px; }
  .stepper span { font-size: 0; }
  .stepper b { font-size: var(--font-caption); }
  .period-editor-head { display: none; }
  .period-row { grid-template-columns: minmax(100px, .7fr) 10px minmax(120px, 1fr) 44px; gap: 7px 6px; padding: 10px 8px; }
  .period-row .period-kind-field { grid-column: 1; }
  .period-row .period-name-field { grid-column: 2 / 4; }
  .period-row .period-start-field { grid-column: 1; }
  .period-row .period-separator { grid-column: 2; }
  .period-row .period-end-field { grid-column: 3; }
  .period-row .period-delete-button { grid-column: 4; grid-row: 1; }
  .import-metrics { grid-template-columns: 1fr 1fr; }
  .import-options { grid-template-columns: 1fr; }
  .class-preview-header { align-items: stretch; flex-direction: column; }
  .class-preview-header select { width: 100%; }
  .modal-actions > button { flex: 1; }
  .period-file-tips { grid-template-columns: 1fr; }
  .admin-metric-grid { grid-template-columns: 1fr 1fr; }
  .admin-metric-grid article { min-height: 82px; padding: 12px; }
  .library-metric-grid { grid-template-columns: 1fr 1fr; }
  .library-metric-grid article { min-height: 82px; padding: 12px; }
  .library-source-card { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; }
  .library-source-card .secondary-button { grid-column: 2; justify-self: start; }
  .library-import-choice-grid { grid-template-columns: 1fr; }
  .profile-import-review-header, .profile-import-footer { align-items: stretch; flex-direction: column; }
  .profile-import-counts { justify-content: flex-start; }
  .profile-import-footer button { width: 100%; }
  .profile-import-table { min-width: 0; }
  .profile-import-table thead { display: none; }
  .profile-import-table tbody, .profile-import-table tr, .profile-import-table td { display: block; }
  .profile-import-table tr { padding: 8px 10px; border-top: 1px solid var(--border); }
  .profile-import-table tr:first-child { border-top: 0; }
  .profile-import-table td { display: grid; min-height: 44px; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 0; border: 0; }
  .profile-import-table td::before { content: attr(data-label); color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
  .profile-import-table td > input, .profile-import-table td > span, .profile-import-table td > small { grid-column: 2; }
  .profile-import-table td > small { max-width: none; }
  .profile-import-table input[type="checkbox"] { margin: 0; }
  .duty-template-summary, .duty-template-footer, .duty-template-strip { align-items: stretch; flex-direction: column; }
  .duty-template-summary button, .duty-template-footer button, .duty-template-strip button { width: 100%; }
  .duty-template-row { grid-template-columns: repeat(2,minmax(0,1fr)) 44px; align-items: end; }
  .duty-template-row > label:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .duty-template-row > label:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  .duty-template-row > label:nth-of-type(3) { grid-column: 1; grid-row: 2; }
  .duty-template-row > label:nth-of-type(4) { grid-column: 2; grid-row: 2; }
  .duty-template-row > .duty-template-delete { grid-column: 3; grid-row: 1; }
  .duty-import-start { grid-template-columns: 1fr; }
  .duty-recognition-actions, .duty-review-heading, .duty-review-footer { align-items: stretch; flex-direction: column; }
  .duty-recognition-actions button, .duty-review-footer button { width: 100%; }
  .duty-review-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .duty-review-filters button { padding-inline: 5px; }
  .duty-batch-actions { align-items: stretch; flex-direction: column; }
  .duty-batch-actions label, .duty-batch-actions .secondary-button { width: 100%; }
  .duty-batch-actions input { min-width: 0; flex: 1; }
  .duty-selection-actions > span { width: 100%; margin-left: 0; }
  .duty-review-row { grid-template-columns: 28px minmax(0,1fr) 44px; align-items: center; }
  .duty-review-row > label:not(.duty-check), .duty-review-row > .profile-import-state, .duty-review-row > .duty-match-reason { grid-column: 2 / 4; }
  .duty-review-row > .duty-check { grid-column: 1; grid-row: 1; }
  .duty-review-row > .duty-row-delete { grid-column: 3; grid-row: 1; }
  .duty-review-row > .profile-import-state { justify-self: start; }
  .duty-review-row > .duty-time-field, .duty-review-row > .duty-location-field, .duty-review-row > .duty-match-reason { grid-row: auto; }
  .duty-maintenance-summary, .duty-maintenance-footer { align-items: stretch; flex-direction: column; }
  .duty-maintenance-summary > div { display: grid; grid-template-columns: 1fr 1fr; }
  .duty-maintenance-toolbar { grid-template-columns: 1fr; }
  .duty-maintenance-fields { grid-template-columns: 1fr; }
  .duty-maintenance-row-head { align-items: flex-start; }
  .duty-maintenance-row-head button { flex: 0 0 auto; }
  .duty-maintenance-footer .primary-button { width: 100%; }
  .relationship-flow { grid-template-columns: 1fr; }
  .relationship-arrow { min-height: 18px; transform: rotate(90deg); }
  .relationship-status-list { grid-template-columns: 1fr; }
  .admin-flow { grid-template-columns: 1fr; }
  .admin-flow li:not(:last-child)::after { top: auto; right: auto; bottom: -5px; left: 16px; width: 1px; height: 10px; }
  .admin-data-card { grid-template-columns: 38px minmax(0, 1fr); }
  .admin-data-card > .status-chip { grid-column: 2; justify-self: start; }
  .admin-data-card .admin-card-actions { grid-column: 2; flex-wrap: wrap; }
  .calendar-weekdays { display: none; }
  .school-calendar-grid { grid-template-columns: 1fr; }
  .calendar-day { display: grid; min-height: 0; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 10px 12px; border-right: 0; }
  .calendar-day:not(.has-events) { display: none; }
  .calendar-date { align-content: start; flex-direction: column; justify-content: flex-start; gap: 2px; margin: 0; }
  .calendar-date small { font-size: var(--font-caption); }
  .calendar-event { min-height: 38px; align-items: center; padding: 8px; font-size: var(--font-caption); }
  .calendar-filters { align-items: stretch; flex-direction: column; }
  .calendar-review-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-review-toolbar select { width: 100%; }
  .toast-region { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); left: 12px; }
  .toast { min-width: 0; max-width: none; }
}
@media (max-height: 650px) and (orientation: landscape) {
  .calendar-review-list { max-height: 210px; }
  .modal { max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) {
  html, *, *::before, *::after { scroll-behavior: auto !important; }
  .page-view, .modal, .drawer, .toast { animation: none !important; }
  button, a, input, select, textarea, .term-progress > i { transition-duration: 80ms !important; }
  button:active, a:active { transform: none !important; }
}
[hidden] { display: none !important; }
#data-loading-panel { display: none; }
.data-loading .app-shell { visibility: hidden; }
.data-loading #data-loading-panel { display: grid; gap: 18px; position: fixed; z-index: 1000; inset: 0; align-content: center; justify-items: center; padding: 32px; background: var(--surface-soft); text-align: center; }
#data-loading-panel strong { font-size: 24px; }
#data-loading-panel p { max-width: 560px; line-height: 1.8; }
#data-loading-panel a { color: var(--primary); }
.teacher-review-note { padding: 14px 18px; margin: 0 0 20px; background: var(--surface-soft); color: var(--primary); border-radius: var(--radius-sm); line-height: 1.7; font-size: 14px; }
.review-empty { padding: 32px; }
.review-empty p { color: var(--text-secondary); line-height: 1.8; }
.review-source { white-space: pre-wrap; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-soft); font-family: inherit; }
.auth-locked .app-shell { display:none; }
#personal-schedule-modal input,#personal-schedule-modal select {min-height:44px;font-size:16px;}
#personal-schedule-modal {overflow:hidden;max-height:calc(100dvh - 32px);}
#personal-schedule-form {display:flex;flex-direction:column;max-height:min(calc(100dvh - 34px),820px);}
#personal-schedule-form .form-grid {overflow-y:auto;min-height:0;}
#personal-schedule-form .modal-header,#personal-schedule-form .modal-actions {flex-shrink:0;}
#personal-schedule-form .modal-description {flex-shrink:0;}
#ps-error {color:var(--danger);margin:0;}
#ps-scope-hint {color:var(--text-secondary);margin:0;line-height:1.6;}
#personal-schedule-history {margin:16px 0;line-height:1.8;}
#personal-schedule-history summary {cursor:pointer;min-height:44px;padding:8px 0;}
#calendar-countdown-modal input { min-height:44px; font-size:16px; }
#calendar-countdown-form { display:flex; max-height:min(calc(100dvh - 34px),720px); flex-direction:column; }
#calendar-countdown-form .form-grid { overflow-y:auto; min-height:0; }
#calendar-countdown-form .modal-header,#calendar-countdown-form .modal-actions,#calendar-countdown-form .modal-description { flex-shrink:0; }
.task-modal { overflow:hidden; max-height:calc(100dvh - 32px); }
#task-form { display:flex; max-height:min(calc(100dvh - 34px),760px); flex-direction:column; }
#task-form .form-grid { overflow-y:auto; min-height:0; }
#task-form-error { margin:0 20px; flex-shrink:0; max-height:28dvh; overflow-y:auto; font-size:14px; }
#task-form .modal-header,#task-form .modal-actions,#task-form .modal-description { flex-shrink:0; }
.task-source-note { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:10px; margin:0 20px 4px; padding:11px 12px; color:var(--primary); border:1px solid #c9e4da; border-radius:var(--radius-sm); background:#f3faf7; }
.task-source-note > .icon { width:32px; height:32px; padding:7px; border-radius:var(--radius-sm); background:#dfeee9; }
.task-source-note strong,.task-source-note small { display:block; }
.task-source-note small { margin-top:2px; color:#527066; font-size: var(--font-caption); line-height:1.5; }
.task-modal-actions { display:grid; grid-template-columns:auto 1fr auto auto; }
@media(max-width:520px) {
  .routine-roster-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 12px; }
  .routine-student-tile { min-height: 88px; padding: 10px; }
  .student-score-category-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .student-score-category-tabs button:last-child { grid-column: 1 / -1; }
  .student-score-actions { grid-template-columns: 1fr; }
  .student-score-context { flex-direction: column; }
  .countdown-ai-panel { margin-inline:14px; padding:12px; }
  .countdown-ai-heading { grid-template-columns:34px minmax(0,1fr); }
  .countdown-ai-heading .status-chip { grid-column:2; justify-self:start; }
  .countdown-ai-compose { grid-template-columns:1fr; }
  .countdown-ai-compose textarea { font-size:16px; }
  .countdown-ai-compose .secondary-button { width:100%; }
  .task-status-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); padding-inline:14px; }
  .task-item { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .task-item .task-state { grid-column:1; justify-self:start; }
  .task-item .task-copy { grid-column:1; }
  .task-item .task-transition { grid-column:2; grid-row:1 / span 2; min-width:88px; }
  .task-modal-actions { grid-template-columns:1fr 1fr; }
  .task-modal-actions > span { display:none; }
  .task-modal-actions .danger-button { grid-column:1 / -1; }
  .reminder-summary { align-items:stretch; flex-direction:column; }
  .reminder-summary .secondary-button { width:100%; }
  .reminder-row { grid-template-columns:5px minmax(0,1fr); }
  .reminder-action { grid-column:2; min-height:32px; padding:0; }
}
.auth-panel { min-height:100dvh; display:grid; place-items:center; padding:24px; background:var(--bg); }
.auth-card { width:min(100%,460px); padding:32px; border:1px solid var(--border); border-radius:20px; background:#fff; box-shadow:var(--shadow-sm); }
.auth-card h1 { font-size:26px; margin:12px 0; }
.auth-card p { color:var(--text-secondary); line-height:1.7; }
.auth-card form { display:grid; gap:20px; }
.auth-card input { font-size:16px; min-width:0; width:100%; }
.auth-card .password-input { display:flex; gap:8px; }
.remember-device-option { display:grid; grid-template-columns:20px minmax(0,1fr); align-items:start; gap:10px; cursor:pointer; }
.auth-card .remember-device-option input { width:20px; min-width:20px; height:20px; margin:2px 0 0; accent-color:var(--primary); cursor:pointer; }
.remember-device-option strong,.remember-device-option small { display:block; }
.remember-device-option strong { color:var(--text); font-size:14px; line-height:1.5; }
.remember-device-option small { margin-top:2px; color:var(--text-secondary); font-size:12px; line-height:1.5; }
.auth-card code { font-size: .9em; }
.password-input button { min-width:48px; min-height:44px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); color:var(--primary-strong); }
#auth-error { color:var(--danger); min-height:24px; }
#auth-error[data-tone="success"] { color:var(--primary); }
.auth-helper { font-size:13px; }
.auth-table-wrap { overflow-x:auto; }
.auth-table { width:100%; border-collapse:collapse; }
.auth-table th,.auth-table td { padding:12px 8px; border-bottom:1px solid var(--border); text-align:left; }
.auth-table small { display:block; color:var(--text-secondary); }
#account-create-form,#assignment-form { display:grid; gap:16px; }
.personal-settings-intro { display:flex; align-items:flex-start; gap:12px; }
.personal-settings-intro > .icon { flex:0 0 40px; width:40px; height:40px; padding:10px; color:var(--accent); border-radius:var(--radius-sm); background:var(--accent-soft); }
.personal-settings-intro strong,.personal-settings-intro small { display:block; }
.personal-settings-intro small { margin-top:4px; color:var(--text-secondary); line-height:1.6; }
#personal-responsibility-form { display:grid; gap:14px; }
.settings-section-heading { display:flex; align-items:center; gap:10px; }
.settings-section-heading > .icon { width:20px; height:20px; color:var(--primary); }
.settings-section-heading strong,.settings-section-heading small { display:block; }
.settings-section-heading small { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.55; }
.responsibility-detected { display:grid; gap:6px; padding:11px 12px; color:var(--text-secondary); border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); font-size: var(--font-label); }
.responsibility-detected strong { color:var(--text); }
.settings-loading { min-height:80px; display:grid; place-items:center; color:var(--text-muted); }
.class-invitations-region .drawer-block { display:grid; gap:12px; min-width:0; }
.class-invitations-region form { display:grid; gap:16px; min-width:0; }
.class-invitations-region summary { cursor:pointer; min-height:44px; padding-block:10px; color:var(--text); font-weight:700; }
.class-invitations-region details > p { margin-block:12px 16px; }
.class-invitation-dates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.class-invitation-row { padding-block:16px; border-top:1px solid var(--border); overflow-wrap:anywhere; }
.class-invitation-row p { margin-block:8px; }
.class-invitation-row .drawer-actions { margin-top:12px; }
.class-invitation-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.class-invitations-region .form-error { margin:0; }
.class-self-subject-confirm { display:flex; align-items:center; gap:10px; min-height:44px; cursor:pointer; }
.class-self-subject-confirm input { width:20px; height:20px; margin:0; accent-color:var(--primary); flex:0 0 20px; }
@media(max-width:600px) { .class-invitation-dates { grid-template-columns:minmax(0,1fr); } }
#personal-responsibility-form .primary-button { justify-self:start; min-height:44px; }

/* Step 19: classroom call identity and interaction prototype */
.class-intercom-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:16px; padding:2px 2px 0; }
.class-intercom-heading > div:first-child { min-width:0; }
.class-intercom-heading h2 { margin:3px 0 5px; font-size:clamp(21px,1.7vw,27px); line-height:1.25; letter-spacing:-.02em; }
.class-intercom-heading p:last-child { margin:0; color:var(--text-secondary); }
.class-work-back-button { display:inline-flex; min-height:44px; align-items:center; gap:6px; margin:0 0 10px; padding:0 10px 0 7px; color:var(--primary-strong); border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; font-size: var(--font-caption); font-weight:750; cursor:pointer; transition:border-color var(--transition),background var(--transition); }
.class-work-back-button:hover,.class-work-back-button:focus-visible { border-color:var(--primary); background:var(--primary-soft); }
.class-work-back-button .icon { width:18px; height:18px; }
.intercom-stage-note { display:grid; grid-template-columns:40px minmax(0,1fr) auto; align-items:center; gap:12px; margin-bottom:16px; padding:14px 16px; color:var(--primary); border:1px solid #c9e4da; border-radius:var(--radius-md); background:#f3faf7; }
.intercom-stage-note > .icon { width:40px; height:40px; padding:9px; border-radius:var(--radius-sm); background:#dfeee9; }
.intercom-stage-note strong,.intercom-stage-note small { display:block; }
.intercom-stage-note small { margin-top:3px; color:#527066; font-size: var(--font-caption); line-height:1.6; }
.intercom-call-panel { margin-bottom:16px; padding:16px; border-color:#bfdccf; }
.intercom-call-panel[hidden],.intercom-call-panel [hidden] { display:none; }
.intercom-call-heading { display:flex; align-items:center; gap:11px; }
.intercom-call-heading > div { flex:1; min-width:0; }
.intercom-call-heading .eyebrow { margin:0 0 2px; }
.intercom-call-heading h3 { margin:0; font-size:17px; }
.intercom-call-heading p:last-child { margin:3px 0 0; color:var(--text-secondary); font-size:var(--font-caption); }
.intercom-call-badge { padding:6px 10px; color:var(--primary-strong); border-radius:999px; background:var(--primary-soft); font-size:var(--font-caption); font-weight:750; white-space:nowrap; }
.intercom-call-panel[data-state="connected"] .intercom-call-badge { color:var(--primary); background:var(--accent-soft); }
.intercom-call-panel[data-state="error"] .intercom-call-badge { color:var(--danger); background:var(--danger-soft); }
#intercom-call-status { margin:13px 0; color:var(--text-secondary); line-height:1.6; }
.intercom-call-panel .form-error { margin:0 0 12px; }
.intercom-call-controls { display:flex; flex-wrap:wrap; gap:8px; }
.intercom-call-controls button,.intercom-call-audio button { min-height:44px; }
.intercom-call-hangup { color:var(--danger); border-color:#d9aca4; }
.intercom-call-hangup:hover { border-color:#b56358; background:#fff0ed; }
.intercom-call-audio { display:grid; grid-template-columns:auto minmax(180px,1fr) auto; align-items:center; gap:10px; margin-top:14px; padding:11px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.intercom-call-audio span { color:var(--text-secondary); font-size:var(--font-caption); font-weight:700; }
.intercom-call-audio audio { width:100%; min-width:0; }
.intercom-call-privacy { margin:13px 0 0; color:var(--text-muted); font-size:var(--font-caption); line-height:1.6; }
.intercom-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); align-items:start; gap:16px; }
.intercom-side-stack { display:grid; gap:16px; }
.intercom-class-list { display:grid; }
.intercom-class-row { display:grid; min-height:82px; grid-template-columns:44px minmax(0,1fr) auto auto; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); }
.intercom-class-row:last-child { border-bottom:0; }
.intercom-class-avatar { display:grid; width:42px; height:42px; place-items:center; color:var(--primary-strong); border-radius:var(--radius-sm); background:var(--primary-soft); font-size:14px; font-weight:800; }
.intercom-class-row strong,.intercom-class-row small { display:block; }
.intercom-class-row small { margin-top:4px; color:var(--text-muted); font-size: var(--font-caption); }
.intercom-device-state { display:flex; align-items:center; gap:6px; color:var(--text-muted); font-size: var(--font-caption); font-weight:700; }
.intercom-device-state i { width:7px; height:7px; border-radius:50%; background:var(--text-muted); }
.intercom-device-state[data-state="paired"] { color:var(--primary); }
.intercom-device-state[data-state="paired"] i { background:#2c8a70; box-shadow:0 0 0 3px #dff2ec; }
.intercom-device-state[data-state="pending"] { color:var(--warning); }
.intercom-device-state[data-state="pending"] i { background:#c8872d; box-shadow:0 0 0 3px #fbedd8; }
.intercom-class-row .secondary-button,.intercom-class-row .primary-button { min-height:44px; white-space:nowrap; }
.intercom-class-row .secondary-button:disabled { cursor:default; opacity:.68; }
.intercom-row-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; min-width:0; }
.intercom-row-actions:empty { display:none; }
.intercom-row-actions > button:disabled { cursor:default; opacity:.65; }
.intercom-access-intro strong { display:block; font-size:18px; }
.intercom-access-intro p,.intercom-access-section-heading p { margin:5px 0 0; color:var(--text-secondary); font-size:var(--font-label); line-height:1.65; }
.intercom-access-notice { margin:0; padding:11px 13px; color:var(--primary); border:1px solid #c9e4da; border-radius:var(--radius-sm); background:#f3faf7; font-size:var(--font-label); }
.intercom-access-confirm { border-color:#e8c5bd; background:#fff6f3; }
.intercom-access-confirm strong { display:block; color:var(--danger); }
.intercom-access-confirm p { margin:6px 0 0; color:var(--danger); font-size:var(--font-label); line-height:1.6; }
.intercom-access-danger { color:var(--danger); border-color:#d9aca4; background:#fff; }
.intercom-access-danger:hover { border-color:#b56358; background:#fff0ed; }
.intercom-access-section { min-width:0; }
.intercom-access-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.intercom-access-section-heading > div { min-width:0; }
.intercom-access-section-heading h3 { margin:0; font-size:17px; }
.intercom-access-section-heading .secondary-button { flex:0 0 auto; min-height:44px; }
.intercom-access-device-list,.intercom-access-teacher-list { display:grid; gap:0; margin:14px 0 0; padding:0; list-style:none; }
.intercom-access-device-list li,.intercom-access-teacher { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; padding:12px 0; border-top:1px solid var(--border); }
.intercom-access-device-list li > span,.intercom-access-teacher-copy { min-width:0; }
.intercom-access-device-list strong,.intercom-access-device-list small,.intercom-access-teacher strong,.intercom-access-teacher small { display:block; overflow-wrap:anywhere; }
.intercom-access-device-list small,.intercom-access-teacher small { margin-top:3px; color:var(--text-muted); font-size:var(--font-caption); line-height:1.5; }
.intercom-access-device-list .text-link,.intercom-access-right .text-link { flex:0 0 auto; min-height:44px; }
.intercom-access-empty { margin:14px 0 0; padding:14px; color:var(--text-secondary); border-radius:var(--radius-sm); background:var(--surface-soft); font-size:var(--font-label); line-height:1.6; }
.intercom-access-search { display:grid; gap:7px; margin-top:14px; }
.intercom-access-search input { width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; color:var(--text); font-size:16px; }
.intercom-access-rights { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; min-width:0; }
.intercom-access-rights .secondary-button { min-height:44px; font-size:var(--font-caption); }
.intercom-access-right { display:flex; align-items:center; gap:5px; min-height:44px; padding-inline:9px 3px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.intercom-access-right-label { color:var(--text-secondary); font-size:var(--font-caption); white-space:nowrap; }
.intercom-mode-card article { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:11px; padding:14px 16px; border-top:1px solid var(--border); }
.intercom-mode-card article:first-of-type { border-top:0; }
.intercom-mode-icon { width:40px; height:40px; padding:10px; border-radius:var(--radius-sm); }
.intercom-mode-icon.announce { color:var(--primary); background:#dff4ef; }
.intercom-mode-icon.call { color:var(--primary-strong); background:var(--primary-soft); }
.intercom-mode-card strong,.intercom-mode-card small { display:block; }
.intercom-mode-card small { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.55; }
.intercom-mode-card em { color:var(--text-muted); font-size: var(--font-caption); font-style:normal; font-weight:750; }
.intercom-mode-card article.is-future { background:var(--surface-soft); }
.intercom-mode-card article.is-future .intercom-mode-icon { color:var(--text-muted); background:var(--border); }
.intercom-empty { display:grid; justify-items:center; gap:7px; padding:28px 18px; color:var(--text-muted); text-align:center; }
.intercom-empty > .icon { width:38px; height:38px; padding:9px; border-radius:50%; background:var(--surface-soft); }
.intercom-empty strong { color:var(--text); }
.intercom-empty small { max-width:300px; line-height:1.6; }
.intercom-empty .secondary-button { margin-top:5px; }
.intercom-safety-card { margin-top:16px; }
.intercom-safety-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid var(--border); }
.intercom-safety-grid article { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:start; gap:10px; padding:16px; border-right:1px solid var(--border); }
.intercom-safety-grid article:last-child { border-right:0; }
.intercom-safety-grid .icon { width:36px; height:36px; padding:8px; color:var(--primary); border-radius:var(--radius-sm); background:#e6f5f1; }
.intercom-safety-grid strong,.intercom-safety-grid small { display:block; }
.intercom-safety-grid small { margin-top:4px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.6; }
.intercom-pairing { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:center; gap:11px; }
.intercom-pairing > .icon { width:42px; height:42px; padding:10px; color:var(--primary); border-radius:var(--radius-sm); background:var(--primary-soft); }
.intercom-pairing strong,.intercom-pairing small { display:block; }
.intercom-pairing-form { display:grid; gap:14px; }
.intercom-pairing-form .form-field { min-width:0; }
.intercom-first-claim { color:var(--warning); border-color:#e8d5af; background:#fff9ed; }
.intercom-first-claim strong { display:block; }
.intercom-first-claim p { margin:5px 0 0; color:var(--warning); font-size:var(--font-label); line-height:1.65; }
.intercom-pair-target { display:grid; gap:3px; padding:12px 14px; border:1px solid #c8e3da; border-radius:var(--radius-sm); background:#f3faf7; }
.intercom-pair-target small,.intercom-pair-target span { color:#527066; font-size:var(--font-caption); }
.intercom-pair-target strong { color:var(--primary); font-size:17px; }
.intercom-pairing-form #intercom-pair-code { font-size:24px; font-weight:800; letter-spacing:.16em; font-variant-numeric:tabular-nums; }
.intercom-pairing-form > small { margin-top:-8px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.6; }
.intercom-pairing-form .primary-button { width:100%; min-height:48px; }
.intercom-pairing-result { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:start; gap:12px; color:var(--primary); border-color:#c8e3da; background:#f3faf7; }
.intercom-pairing-result > .icon { width:42px; height:42px; padding:10px; border-radius:var(--radius-sm); background:#dff1eb; }
.intercom-pairing-result strong,.intercom-pairing-result small { display:block; }
.intercom-pairing-result p { margin:8px 0 0; color:#527066; font-size: var(--font-label); line-height:1.65; }
.intercom-pairing-wait { display:grid; grid-template-columns:30px minmax(0,1fr); align-items:center; gap:12px; }
.intercom-pairing-wait strong,.intercom-pairing-wait small { display:block; }
.intercom-pairing-wait small { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.55; }
.intercom-pairing-spinner { width:26px; height:26px; border:3px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:intercom-spin .8s linear infinite; }
@keyframes intercom-spin { to { transform:rotate(360deg); } }
.intercom-pair-code { margin:12px 0; padding:18px; color:var(--primary-strong); border:1px dashed #bfdccf; border-radius:var(--radius-sm); background:var(--primary-soft); text-align:center; font-size:34px; font-weight:850; letter-spacing:.18em; font-variant-numeric:tabular-nums; }
.intercom-pair-code[data-state="waiting"] { color:var(--text-secondary); font-size:17px; letter-spacing:.02em; }
.intercom-pair-steps { display:grid; gap:9px; margin:12px 0 0; padding-left:22px; color:var(--text-secondary); font-size: var(--font-label); line-height:1.65; }
.intercom-build-boundary { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:10px; color:var(--warning); border-color:#edd9b7; background:#fff9ed; }
.intercom-build-boundary .icon { width:32px; height:32px; padding:7px; border-radius:var(--radius-sm); background:#f9ebce; }
.intercom-build-boundary strong,.intercom-build-boundary small { display:block; }
.intercom-build-boundary small { margin-top:3px; line-height:1.55; }
.intercom-history-refresh { min-height:44px; white-space:nowrap; }
.intercom-history-list { display:grid; }
.intercom-history-row { display:grid; min-height:72px; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:10px; width:100%; padding:11px 14px; color:var(--text); border:0; border-bottom:1px solid var(--border); background:#fff; text-align:left; cursor:pointer; transition:background var(--transition); }
.intercom-history-row:last-child { border-bottom:0; }
.intercom-history-row:hover { background:var(--surface-soft); }
.intercom-history-row:active { background:var(--primary-soft); }
.intercom-history-icon { width:34px; height:34px; padding:8px; color:var(--primary-strong); border-radius:var(--radius-sm); background:var(--primary-soft); }
.intercom-history-row strong,.intercom-history-row small { display:block; }
.intercom-history-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.intercom-history-row small { margin-top:4px; color:var(--text-muted); font-size: var(--font-caption); }
.intercom-announcement-badge { display:inline-flex; min-height:26px; align-items:center; padding:0 8px; color:var(--warning); border:1px solid #ead9b8; border-radius:999px; background:#fff8e9; font-size: var(--font-caption); font-weight:750; white-space:nowrap; }
.intercom-announcement-badge[data-status="received"],.intercom-announcement-badge[data-status="playing"] { color:var(--blue); border-color:#c8ddeb; background:#f0f7fb; }
.intercom-announcement-badge[data-status="completed"] { color:var(--primary); border-color:#c6e1d8; background:#eef9f5; }
.intercom-announcement-badge[data-status="failed"],.intercom-announcement-badge[data-status="partial"],.intercom-announcement-badge[data-status="expired"],.intercom-announcement-badge[data-status="cancelled"] { color:var(--danger); border-color:#ecc9c2; background:#fff3f0; }
.intercom-announcement-target { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:12px; padding:15px; border:1px solid #c8e3da; border-radius:var(--radius-md); background:#f3faf7; }
.intercom-announcement-target small,.intercom-announcement-target strong { display:block; }
.intercom-announcement-target p { margin:4px 0 0; color:#527066; font-size: var(--font-caption); }
.intercom-announcement-form { display:grid; gap:16px; }
.intercom-announcement-form[hidden] { display:none; }
.intercom-announcement-form fieldset { min-width:0; margin:0; padding:0; border:0; }
.intercom-announcement-form legend,.intercom-announcement-form label > span { display:block; margin-bottom:7px; color:var(--text-secondary); font-size: var(--font-label); font-weight:750; }
.intercom-phrase-list { display:flex; flex-wrap:wrap; gap:8px; }
.intercom-phrase-list button { min-height:44px; padding:8px 12px; color:var(--primary-strong); border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--primary-soft); text-align:left; line-height:1.45; cursor:pointer; transition:border-color var(--transition),background var(--transition); }
.intercom-phrase-list button:hover { border-color:#bfdccf; background:var(--primary-soft); }
#intercom-announcement-body { width:100%; min-height:118px; resize:vertical; padding:11px 12px; color:var(--text); border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:#fff; line-height:1.65; }
.intercom-announcement-helper { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-top:-9px; color:var(--text-muted); }
.intercom-announcement-helper small { max-width:390px; font-size: var(--font-caption); line-height:1.6; }
.intercom-announcement-helper output { flex:0 0 auto; font-size: var(--font-caption); font-variant-numeric:tabular-nums; }
.intercom-announcement-form > .primary-button { width:100%; min-height:48px; }
.intercom-announcement-form > .primary-button:disabled { cursor:wait; opacity:.72; }
.intercom-button-spinner { width:17px; height:17px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; animation:intercom-spin .75s linear infinite; }
.intercom-announcement-result { padding:16px; color:var(--text-secondary); border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-soft); }
.intercom-announcement-result[data-status="completed"] { color:var(--primary); border-color:#c8e3da; background:#f3faf7; }
.intercom-announcement-result[data-status="failed"],.intercom-announcement-result[data-status="partial"],.intercom-announcement-result[data-status="expired"],.intercom-announcement-result[data-status="cancelled"] { color:var(--danger); border-color:#ecc9c2; background:#fff5f2; }
.intercom-announcement-result-heading { display:grid; grid-template-columns:44px minmax(0,1fr); align-items:center; gap:12px; }
.intercom-announcement-result-heading small,.intercom-announcement-result-heading strong { display:block; }
.intercom-announcement-result-heading strong { margin-top:2px; color:inherit; font-size:20px; }
.intercom-announcement-result-icon { width:42px; height:42px; padding:10px; color:var(--primary-strong); border-radius:var(--radius-sm); background:var(--primary-soft); }
.intercom-announcement-result[data-status="completed"] .intercom-announcement-result-icon { color:var(--primary); background:#dff1eb; }
.intercom-announcement-result[data-status="failed"] .intercom-announcement-result-icon,.intercom-announcement-result[data-status="partial"] .intercom-announcement-result-icon,.intercom-announcement-result[data-status="expired"] .intercom-announcement-result-icon,.intercom-announcement-result[data-status="cancelled"] .intercom-announcement-result-icon { color:var(--danger); background:#f9ded8; }
.intercom-announcement-result > p { margin:12px 0 0; font-size: var(--font-label); line-height:1.65; }
.intercom-announcement-error { font-weight:700; }
.intercom-announcement-copy { padding:15px; border:1px solid var(--border); border-radius:var(--radius-md); background:#fff; }
.intercom-announcement-copy blockquote { margin:0; padding:13px 14px; color:var(--text); border-left:3px solid var(--primary); border-radius:0 9px 9px 0; background:var(--primary-soft); font-size:15px; font-weight:650; line-height:1.7; }
.intercom-announcement-copy > div { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-top:12px; }
.intercom-announcement-copy strong,.intercom-announcement-copy small { display:block; }
.intercom-announcement-copy small,.intercom-announcement-copy time { margin-top:3px; color:var(--text-muted); font-size: var(--font-caption); }
.intercom-announcement-progress { padding:15px; border:1px solid var(--border); border-radius:var(--radius-md); background:#fff; }
.intercom-announcement-progress ol { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0 0; padding:0; list-style:none; }
.intercom-announcement-progress li { display:grid; justify-items:center; gap:5px; min-width:0; color:var(--text-muted); font-size: var(--font-caption); font-weight:700; text-align:center; }
.intercom-announcement-progress li .icon { width:28px; height:28px; padding:7px; border:1px solid var(--border); border-radius:50%; background:#fff; }
.intercom-announcement-progress li.done { color:var(--primary); }
.intercom-announcement-progress li.done .icon { color:var(--primary); border-color:#b8dbcf; background:#e9f6f1; }
.intercom-announcement-progress li.current { color:var(--primary-strong); }
.intercom-announcement-progress li.current .icon { color:#fff; border-color:var(--primary); background:var(--primary); box-shadow:0 0 0 4px var(--primary-soft); }
.intercom-announcement-devices { padding:15px; border:1px solid var(--border); border-radius:var(--radius-md); background:#fff; }
.intercom-announcement-devices ul { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.intercom-announcement-devices li { display:flex; min-height:44px; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; border-radius:var(--radius-sm); background:var(--surface-soft); }
.intercom-announcement-devices strong,.intercom-announcement-devices small { display:block; }
.intercom-announcement-devices small { margin-top:2px; color:var(--text-muted); font-size: var(--font-caption); }
.intercom-announcement-poll-note { margin:-8px 0 18px; color:var(--text-muted); font-size: var(--font-caption); line-height:1.6; text-align:center; }
@media(max-width:900px) {
  .intercom-layout { grid-template-columns:1fr; }
  .intercom-safety-grid { grid-template-columns:1fr; }
  .intercom-safety-grid article { border-right:0; border-bottom:1px solid var(--border); }
  .intercom-safety-grid article:last-child { border-bottom:0; }
}
@media(max-width:620px) {
  .class-intercom-heading { align-items:stretch; flex-direction:column; gap:14px; }
  .class-intercom-heading .heading-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
  .class-intercom-heading .heading-actions > * { width:100%; min-height:44px; }
  .intercom-stage-note { grid-template-columns:38px minmax(0,1fr); }
  .intercom-stage-note .status-chip { grid-column:2; justify-self:start; }
  .intercom-call-heading { flex-wrap:wrap; }
  .intercom-call-badge { margin-left:51px; }
  .intercom-call-audio { grid-template-columns:1fr; }
  .intercom-class-row { grid-template-columns:42px minmax(0,1fr) auto; }
  .intercom-row-actions { grid-column:2 / 4; justify-content:stretch; }
  .intercom-row-actions > .secondary-button,.intercom-row-actions > .primary-button { flex:1 1 150px; }
  .intercom-access-teacher { align-items:flex-start; flex-direction:column; }
  .intercom-access-rights { justify-content:flex-start; width:100%; }
  .intercom-access-section-heading { align-items:stretch; flex-direction:column; }
  .intercom-access-section-heading .secondary-button { align-self:flex-start; }
  .intercom-announcement-target { grid-template-columns:42px minmax(0,1fr); }
  .intercom-announcement-target .intercom-device-state { grid-column:2; }
  .intercom-announcement-helper { display:grid; gap:5px; }
  #intercom-announcement-body { min-height:132px; font-size:16px; }
  .intercom-announcement-progress ol { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 8px; }
  .intercom-history-row { grid-template-columns:34px minmax(0,1fr); }
  .intercom-history-row .intercom-announcement-badge { grid-column:2; justify-self:start; }
  .intercom-history-row strong { white-space:normal; }
  .intercom-announcement-copy > div { display:grid; }
}
@media(max-width:420px) {
  .class-intercom-heading .heading-actions { grid-template-columns:1fr; }
}
@media (max-width:520px) {
  #personal-responsibility-form .primary-button { width:100%; }
  #personal-responsibility-form select { min-height:44px; font-size:16px; }
}
@media(max-width:480px) { .auth-panel {padding:16px;} .auth-card {padding:24px;} }
@media (max-width: 760px) {
  .profile-button { display: none; }
}


/* 粉笔荧光浅色：主要按钮统一为胶囊形（2026-09-28） */
.primary-button, .secondary-button { border-radius: 999px; }


/* ===== 粉笔荧光浅色 · 主题层（2026-09-28）=====
   只改外观，不改布局结构与类名。系统中文字体，不依赖网络字体。 */
body {
  background-color: var(--background);
  background-image: none;
  background-size: 18px 18px;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.page-heading h1 { color: var(--primary); font-weight: 800; letter-spacing: .01em; }
.eyebrow { color: var(--text-muted); }
.topbar { background: var(--background); }
.global-search { border-radius: 999px; background: #fff; }
.icon-button, .profile-button { border-radius: 999px; }

/* 侧边栏：电脑端为悬浮的白色圆角卡片，当前项为黑板绿胶囊 */
@media (min-width: 761px) {
  .sidebar {
    inset: 14px auto 14px 14px; width: calc(var(--sidebar-width) - 24px);
    border: 1px solid var(--border); border-radius: 28px; background: #fff; box-shadow: 0 4px 0 #e1e8e4;
  }
}
.nav-item { border-radius: 999px; }
.nav-item > .icon { border-radius: 12px; background: var(--surface-soft); }
.nav-item:hover { background: var(--surface-hover); }
.nav-item.active { color: #fff9f0; background: var(--primary); }
.nav-item.active > .icon { color: #5a4700; background: #ffe45c; }
.nav-item.active .nav-copy small { color: #cfe0da; }

/* 卡片：底部一道暖色实影，像贴在纸上 */
.card { box-shadow: 0 4px 0 #e1e8e4; }

/* 首页两个常用入口：换成大色块 */

/* 作业「今日概览」：四格换成荧光笔色块，数字放大 */
.homework-overview { border-radius: 28px; }
.homework-overview dl div { border-radius: 20px; }
.homework-overview dl div:nth-child(1) { background: #fff1b8; }
.homework-overview dl div:nth-child(2) { background: #ddefff; }
.homework-overview dl div:nth-child(3) { background: #ffdccf; }
.homework-overview dl div:nth-child(4) { background: #d5f4e6; }
.homework-overview dl div:nth-child(1) dt, .homework-overview dl div:nth-child(1) dd { color: #5a4700; }
.homework-overview dl div:nth-child(2) dt, .homework-overview dl div:nth-child(2) dd { color: #0d3b66; }
.homework-overview dl div:nth-child(3) dt, .homework-overview dl div:nth-child(3) dd { color: #5e1a08; }
.homework-overview dl div:nth-child(4) dt, .homework-overview dl div:nth-child(4) dd { color: #0b4a36; }
.homework-overview dd { font-size: 30px; line-height: 1.1; }

/* ---------- 以下为效果图对齐补充（2026-09-28 第二轮） ---------- */

/* 顶栏：奶油半透明，无底线；按钮、搜索、头像全部胶囊或圆形 */
.topbar { border-bottom: 0; background: var(--background); }
.global-search { border-color: var(--border); }
.global-search:hover { background: #fff; }
.icon-button, .profile-button, .primary-button, .secondary-button, .danger-button { border-radius: 999px; }
.primary-button { color: #fff9f0; }
.danger-button { color: #8a2a10; border-color: #f2a68c; }
.danger-button:hover { background: #ffdccf; }
.avatar { border-radius: 999px; color: #0d3b66; background: #ddefff; }
kbd { border-radius: 8px; }

/* 侧栏：品牌区去掉分隔线；二级菜单当前项为薄荷胶囊 */
.brand { border-bottom: 0; }
.brand-mark { border-radius: 12px; }
.nav-group { border-top: 1px dashed var(--border); }
.nav-disclosure { border-radius: 999px; }
.sidebar-subnav { border-left: 1.5px solid var(--border); }
.subnav-item { border-radius: 999px; }
.subnav-item:hover { background: var(--surface-hover); }
.subnav-item.active { color: #0b4a36; background: #d5f4e6; font-weight: 700; }
.subnav-item.active::before { display: none; }
.nav-count { color: #5e1a08; border-color: transparent; background: #ffdccf; font-weight: 700; }
.sidebar-personal-nav, .sidebar-footer { border-top-style: dashed; }
.school-card { border-radius: 18px; }

/* 页面大标题 */
.page-heading h1 { font-size: clamp(28px, 2.3vw, 34px); letter-spacing: 0; }

/* 卡片 */
.card { border-radius: var(--radius-lg); }
.card-header { border-bottom: 1px dashed var(--border); }
.card-header h2 { font-weight: 800; }

/* 状态胶囊：荧光笔色，同色系深字 */
.role-badge, .status-chip, .current-week { font-weight: 700; }
.status-chip.current { color: #5a4700; background: #fff1b8; }
.status-chip.success { color: #0b4a36; background: #d5f4e6; }
.status-chip.muted { color: #4a5270; background: var(--surface-soft); }

/* 页签：统一为胶囊，当前项黑板绿 */
.task-status-tab { border-radius: 999px; }
.task-status-tab.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.task-status-tab.active b { color: #5a4700; background: #ffe45c; }
.class-student-tabs { border-radius: 999px; }
.class-student-tabs button { border-radius: 999px; }
.class-student-tabs button.active { color: #fff9f0; background: var(--primary); }
.class-student-tabs button.active:hover, .class-student-tabs button.active:focus-visible { color: #fff9f0; background: var(--primary-strong); }

/* 班级头部 */
.class-context-bar { border-radius: 24px; box-shadow: 0 4px 0 #e1e8e4; }
.class-context-bar select { border-radius: 999px; }
.class-work-taskbar { border-bottom-style: dashed; }
.class-work-taskbar button { border-radius: 999px; }

/* 班级概览四格：荧光笔色块，数字放大 */
.class-home-metrics article { border: 0; border-radius: 22px; }
.class-home-metrics strong { font-size: 28px; font-weight: 800; line-height: 1.1; }
.class-home-metrics article:nth-child(1) { background: #fff1b8; }
.class-home-metrics article:nth-child(2) { background: #d5f4e6; }
.class-home-metrics article:nth-child(3) { background: #ffdccf; }
.class-home-metrics article:nth-child(4) { background: #ddefff; }
.class-home-metrics article:nth-child(1), .class-home-metrics article:nth-child(1) .icon, .class-home-metrics article:nth-child(1) small { color: #5a4700; }
.class-home-metrics article:nth-child(2), .class-home-metrics article:nth-child(2) .icon, .class-home-metrics article:nth-child(2) small { color: #0b4a36; }
.class-home-metrics article:nth-child(3), .class-home-metrics article:nth-child(3) .icon, .class-home-metrics article:nth-child(3) small { color: #5e1a08; }
.class-home-metrics article:nth-child(4), .class-home-metrics article:nth-child(4) .icon, .class-home-metrics article:nth-child(4) small { color: #0d3b66; }

/* 表单：输入框和下拉为胶囊，多行文本大圆角 */
.form-field input, .form-field select { border-radius: 999px; padding-left: 16px; padding-right: 16px; }
.form-field textarea { border-radius: 18px; }
.scope-field label > span { border-radius: 18px; }

/* 弹窗与抽屉 */
.scrim { background: rgba(31, 63, 56, .32); }
.modal, .command-palette { border-radius: var(--radius-lg); }
.modal::backdrop, .command-palette::backdrop, .hw-review-dialog::backdrop { background: rgba(31, 63, 56, .36); }
.modal-header, .drawer-header { border-bottom-style: dashed; }
.modal-header h2, .drawer-header h2 { color: var(--primary); font-weight: 800; }
.detail-drawer { border-left: 0; border-radius: 28px 0 0 28px; box-shadow: -14px 0 40px rgba(44, 54, 84, .16); }
.drawer-note { border-radius: 16px; }

/* 提示条：深绿胶囊 */
.toast { padding: 12px 20px; color: #fff9f0; border-radius: 999px; background: var(--primary); box-shadow: 0 12px 28px rgba(31, 79, 69, .28); }
.toast .icon { color: #ffe45c; }

/* 手机：悬浮深绿底栏，当前项柠檬黄 */
@media (max-width: 760px) {
  .mobile-tabbar {
    right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: max(12px, env(safe-area-inset-left, 0px));
    min-height: 64px; padding: 6px; border: 0; border-radius: 999px; background: var(--primary); box-shadow: 0 10px 24px rgba(31, 79, 69, .25);
  }
  .mobile-tab { min-height: 52px; color: #cfe0da; border-radius: 999px; }
  .mobile-tab.active { color: #4a3a00; background: #ffe45c; }
  .mobile-tab.active .icon { padding: 0; background: transparent; }
  .mobile-tab.active::before { display: none; }
  .topbar { background: var(--surface); }
  .toast-region { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .detail-drawer { transition: none; }
}

/* 侧栏：带二级菜单的分组，当前项由二级菜单的薄荷胶囊标出，一级项只保留黄色图标 */
.nav-group-heading .nav-item.active { color: var(--primary-strong); background: transparent; }
.nav-group-heading .nav-item.active .nav-copy small { color: var(--text-muted); }

/* ===== 界面改版 · 等我处理 + 待复核中心（2026-09-28）===== */
.review-nav-count { margin-left: auto; }

.review-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.review-filter { min-height: 38px; padding: 0 14px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; background: #fff; font-weight: 600; }
.review-filter:hover { border-color: var(--border-strong); }
.review-filter.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.review-card { padding: 18px 20px 22px; overflow: visible; }
.review-list { display: grid; gap: 18px; }
.review-group { display: grid; gap: 8px; }
.review-group-title { display: flex; align-items: center; gap: 10px; margin: 2px 0 2px; }
.review-group-title small { color: var(--text-muted); font-size: var(--font-label); }
.review-group-pill { display: inline-flex; min-height: 28px; align-items: center; padding: 0 12px; border-radius: 999px; font-size: var(--font-label); font-weight: 700; }
.review-group-pill.coral { color: #5e1a08; background: #ffdccf; }
.review-group-pill.lemon { color: #5a4700; background: #fff1b8; }
.review-group-pill.lilac { color: #4e3f86; background: #efeaf8; }
.review-group-pill.mint { color: #0b4a36; background: #d5f4e6; }
.review-row { display: grid; grid-template-columns: 24px minmax(90px, 130px) minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.review-row.selected { border-color: #e6cf6a; background: #fffbea; }
.review-row.reopen { background: #faf8fd; }
.review-check { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.review-check:disabled { cursor: not-allowed; }
.review-who { display: grid; cursor: pointer; }
.review-who strong { font-size: 15px; }
.review-who small, .review-what small { color: var(--text-muted); font-size: var(--font-caption); }
.review-what { display: grid; min-width: 0; }
.review-what strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.review-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.review-round { display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px; color: #8a2a10; border: 1.5px solid #e8603c; border-radius: 999px; font-size: var(--font-caption); font-weight: 700; }
.review-last { display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px; color: #5e1a08; border-radius: 999px; background: #ffdccf; font-size: var(--font-caption); font-weight: 700; }
.review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.review-mark { min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.review-mark.pass { color: #0b4a36; border: 1.5px solid #d5f4e6; background: #d5f4e6; }
.review-mark.pass:hover { border-color: #0e6b50; }
.review-mark.redo { color: #8a2a10; border: 1.5px solid #f2a68c; background: #fff; }
.review-mark.redo:hover { background: #ffdccf; }
.review-mark:disabled { cursor: wait; opacity: .55; }
.review-row.done { grid-template-columns: 24px minmax(0, 1fr) auto auto; background: var(--surface-soft); border-color: transparent; }
.review-row.done > .icon { width: 18px; height: 18px; color: #0e6b50; }
.review-done-copy { color: var(--text-muted); text-decoration: line-through; }
.review-done-mark { display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px; color: #0b4a36; border-radius: 999px; background: #d5f4e6; font-size: var(--font-caption); font-weight: 700; }
.review-note { color: var(--text-muted); font-size: var(--font-caption); }
.review-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 26px 8px; color: var(--text-secondary); }
.review-empty .icon { color: #0e6b50; }
#view-review { padding-bottom: 96px; }
.review-batch-bar { position: fixed; z-index: 70; bottom: 24px; left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2); display: flex; width: max-content; max-width: calc(100vw - var(--sidebar-width) - 48px); align-items: center; gap: 12px; padding: 8px 8px 8px 20px; transform: translateX(-50%); color: #fff9f0; border-radius: 999px; background: var(--primary); box-shadow: 0 14px 34px rgba(31, 79, 69, .3); }
.review-batch-bar[hidden] { display: none; }
.review-batch-count { font-weight: 700; white-space: nowrap; }
.review-batch-bar .secondary-button { white-space: nowrap; color: #fff9f0; border-color: rgba(255, 255, 255, .35); background: transparent; }
.review-batch-bar .secondary-button:hover { background: rgba(255, 255, 255, .1); }
.review-batch-bar .primary-button { color: #4a3a00; border-color: #ffe45c; background: #ffe45c; }
.review-batch-bar .primary-button:hover { border-color: #f5d63a; background: #f5d63a; }
@media (max-width: 1100px) {
  .review-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .review-what { grid-column: 2 / -1; grid-row: 2; }
  .review-tags { grid-column: 2 / -1; grid-row: 3; }
  .review-actions { grid-column: 2 / -1; grid-row: 4; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .review-filters { justify-content: flex-start; }
  .review-card { padding: 14px; }
  .review-row { gap: 10px; padding: 12px; }
  #view-review { padding-bottom: 150px; }
  .review-batch-bar { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 12px; width: auto; max-width: none; flex-wrap: wrap; border-radius: 24px; padding: 10px; transform: none; }
  .review-batch-bar .primary-button { flex: 1 1 100%; }
  .review-batch-count { flex: 1 1 auto; padding-left: 8px; }
  .review-batch-bar .secondary-button.compact { width: auto; padding: 0 14px; }
}

/* ===== 界面改版 · 作业登分册（2026-09-28）===== */
.homework-toolbar { grid-template-columns: minmax(0,1fr) auto; }
.homework-subject-filters button { min-height: 36px; }
.homework-subject-filters button.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.homework-layout { grid-template-columns: 240px minmax(0,1fr); align-items: start; }
.homework-batch-list { gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 22px; background: #fff; }
.gb-list-title { margin: 0 4px 2px; font-size: 15px; font-weight: 800; }
.gb-date { margin: 8px 4px 2px; color: var(--text-muted); font-size: var(--font-caption); font-weight: 700; }
.gb-batch { display: grid; gap: 2px; width: 100%; padding: 10px 14px; color: var(--text); border: 1px solid var(--border); border-radius: 16px; background: #fff; text-align: left; cursor: pointer; }
.gb-batch:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.gb-batch strong { font-size: 13px; line-height: 1.4; }
.gb-batch small { color: var(--text-muted); font-size: var(--font-caption); }
.gb-batch.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.gb-batch.active small { color: #cfe0da; }
.gb-batch[data-status="draft"]:not(.active) { border-style: dashed; }
.gradebook { display: grid; min-width: 0; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 24px; background: #fff; }
.gradebook[hidden] { display: none; }
.gb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.gb-head h3 { margin: 0; color: var(--primary); font-size: 20px; font-weight: 800; }
.gb-head p { margin: 2px 0 0; color: var(--text-muted); font-size: var(--font-label); }
.gb-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.gb-actions [data-gradebook-bulk-toggle] { width: auto; min-width: max-content; min-height: 44px; padding: 0 16px; white-space: nowrap; }
.gb-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.gb-filter { min-height: 34px; padding: 0 13px; border: 1.5px solid transparent; border-radius: 999px; font-size: var(--font-label); font-weight: 600; cursor: pointer; }
.gb-filter.all { color: var(--text-secondary); border-color: var(--border); background: #fff; }
.gb-filter.active { color: #fff9f0 !important; border-color: var(--primary) !important; background: var(--primary) !important; }
.gb-table-wrap { overflow-x: auto; border-radius: 16px; }
.gb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gb-table th, .gb-table td { padding: 5px 10px; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
.gb-table thead th { padding-top: 6px; padding-bottom: 8px; border-top: 0; color: var(--text-muted); font-size: var(--font-caption); font-weight: 600; }
.gb-table tbody th { font-weight: 600; }
.gb-table tbody tr:hover { background: var(--surface-hover); }
.gb-num { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; color: #4a5270; border-radius: 14px; background: var(--surface-soft); font-size: var(--font-caption); font-weight: 700; font-variant-numeric: tabular-nums; }
.gb-cell { min-width: 64px; min-height: 30px; padding: 0 12px; border: 1.5px solid transparent; border-radius: 999px; font-size: var(--font-label); font-weight: 700; cursor: pointer; }
.gb-cell:hover { filter: brightness(.97); box-shadow: 0 0 0 2px rgba(31, 79, 69, .15); }
.gb-cell.dim { opacity: .45; }
.gb-filter.passed, .gb-cell.passed { color: #0b4a36; background: #d5f4e6; }
.gb-filter.unreviewed, .gb-cell.unreviewed { color: #5a4700; background: #fff1b8; }
.gb-filter.correction, .gb-cell.correction { color: #5e1a08; background: #ffdccf; }
.gb-filter.resubmitted, .gb-cell.resubmitted { color: #8a2a10; border-color: #e8603c; background: #fff; }
.gb-filter.missing, .gb-cell.missing { color: #4a5270; border-color: var(--border-strong); border-style: dashed; background: #fff; }
.gb-filter.unconfirmed, .gb-cell.unconfirmed { color: #4a5270; background: var(--surface-soft); }
.gb-filter.exempt, .gb-cell.exempt { color: #4e3f86; background: #efeaf8; }
.gb-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 16px; color: var(--text-secondary); border-radius: 16px; background: var(--surface-soft); font-size: var(--font-label); }
.gb-summary b { color: var(--text); }
.gb-updated { margin-left: auto; }
.gb-note, .gb-hint { margin: 0; color: var(--text-muted); font-size: var(--font-label); }
.gb-note { padding: 18px 4px; }
.gb-bulk { display: grid; gap: 12px; min-width: 0; padding: 16px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-strong); }
.gb-bulk-heading, .gb-bulk-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.gb-bulk-item { display: grid; flex: 1 1 220px; min-width: 0; gap: 6px; overflow-wrap: anywhere; font-size: 14px; }
.gb-bulk-item select { min-width: 0; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.gb-bulk-marks { display: flex; flex-wrap: wrap; gap: 8px; }
.gb-bulk-marks button { min-width: 76px; }
.gb-bulk-marks [aria-pressed="true"] { border-color: var(--primary); color: var(--surface); background: var(--primary); }
.gb-bulk button { min-height: 44px; }
.gb-bulk button:disabled { opacity: .55; cursor: not-allowed; }
.gb-bulk-footer p { flex: 1 1 240px; margin: 0; font-size: 13px; line-height: 1.6; }
.gb-bulk-status { margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.gb-bulk-status[data-error="true"] { color: var(--danger); }
.gb-bulk [data-gradebook-bulk-reload] { justify-self: start; }
.gb-bulk [data-gradebook-bulk-count] { font-variant-numeric: tabular-nums; font-weight: 700; }
.gb-table .gb-select-cell { width: 76px; padding: 0 8px; }
.gb-check { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; cursor: pointer; }
.gb-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.gb-table tr.gb-selected, .gb-table tr.gb-selected th { background: var(--primary-soft); }
.gb-check input:focus-visible, .gb-bulk :is(button,select):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 760px) {
  .gb-bulk { padding: 12px; }
  .gb-bulk-item { flex-basis: 100%; }
  .gb-bulk-footer > button { width: 100%; white-space: normal; }
}
@media (max-width: 1100px) {
  .homework-layout { grid-template-columns: 1fr; }
  .homework-batch-list { display: flex; overflow-x: auto; gap: 8px; padding: 10px; }
  .gb-list-title, .gb-date { display: none; }
  .gb-batch { min-width: 200px; }
}
@media (max-width: 760px) {
  .gradebook { padding: 14px; border-radius: 20px; }
  .gb-head { flex-direction: column; }
  .gb-actions { justify-content: flex-start; }
  .gb-updated { margin-left: 0; }
  .homework-toolbar { grid-template-columns: 1fr; }
}
@media print {
  body.print-gradebook * { visibility: hidden !important; }
  body.print-gradebook #homework-gradebook, body.print-gradebook #homework-gradebook * { visibility: visible !important; }
  body.print-gradebook #homework-gradebook { position: absolute; top: 0; left: 0; width: 100%; border: 0; box-shadow: none; }
  body.print-gradebook .gb-actions, body.print-gradebook .gb-filters, body.print-gradebook .gb-hint { display: none !important; }
  body.print-gradebook .gb-bulk, body.print-gradebook .gb-select-cell { display: none !important; }
  body.print-gradebook .gb-table-wrap { overflow: visible; }
  body.print-gradebook .gb-cell { min-height: 0; padding: 0 6px; border: 0 !important; background: none !important; color: #000 !important; }
  body.print-gradebook .gb-table th, body.print-gradebook .gb-table td { border-top: 1px solid #999; }
}

/* ===== 界面改版 · 班级页头部与概览（2026-09-28）===== */
.class-heading { min-height: 0; margin-bottom: 12px; }
.class-heading h1 { font-size: clamp(30px, 2.6vw, 38px); }
.class-context-bar { grid-template-columns: minmax(240px, 360px) minmax(200px, 1fr) auto; padding: 8px 10px; box-shadow: none; }
.class-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.class-tabs > button, .class-tabs > a { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; padding: 0 16px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.class-tabs > button:hover, .class-tabs > a:hover { border-color: var(--border-strong); color: var(--text); }
.class-tabs > button.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.class-tabs > button:disabled { color: var(--text-muted); border-style: dashed; background: transparent; cursor: not-allowed; opacity: .7; }
.class-tab-count { min-width: 20px; height: 20px; padding: 0 6px; color: #5e1a08; border-radius: 10px; background: #ffdccf; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.class-tab-count[hidden] { display: none; }
/* 子页导航取代了原来的「返回班级」条和学生三页签（元素保留，供原有代码使用） */
#class-work-taskbar, #class-student-tabs { display: none !important; }

.class-home-metrics { gap: 12px; }
.class-tile { display: flex; min-height: 132px; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px 18px; border: 0; border-radius: 22px; text-align: left; text-decoration: none; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.class-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(44, 54, 84, .1); }
.class-tile.lemon { color: #5a4700; background: #fff1b8; }
.class-tile.mint { color: #0b4a36; background: #d5f4e6; }
.class-tile.coral { color: #5e1a08; background: #ffdccf; }
.class-tile.sky { color: #0d3b66; background: #ddefff; }
.class-tile-label { font-size: 14px; font-weight: 700; }
.class-tile strong { font-size: 34px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.class-tile strong small { margin-left: 4px; font-size: 15px; }
.class-tile-sub { margin-top: auto; font-size: var(--font-caption); opacity: .9; }
@media (max-width: 760px) {
  .class-context-bar { grid-template-columns: 1fr; }
  .class-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -2px; padding: 2px 2px 6px; scrollbar-width: none; }
  .class-tabs > button, .class-tabs > a { flex: 0 0 auto; }
  .class-home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-tile { min-height: 112px; }
  .class-tile strong { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .class-tile { transition: none; } }

/* ===== 界面改版 · 班级呼叫：快速叫号、在线状态、撤回（2026-09-28）===== */
.intercom-quick { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 22px 24px; color: #fff9f0; border-radius: 28px; background: var(--primary); }
.intercom-quick[hidden] { display: none; }
.intercom-quick .eyebrow { color: #cfe0da; }
.intercom-quick h3 { margin: 2px 0 4px; font-size: 24px; font-weight: 800; }
.intercom-quick-copy p:last-child { margin: 0; max-width: 560px; color: #e6efe9; font-size: var(--font-label); }
.intercom-quick-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.intercom-quick-state { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px; border-radius: 999px; font-size: var(--font-label); font-weight: 700; }
.intercom-quick-state i { width: 9px; height: 9px; border-radius: 50%; }
.intercom-quick-state[data-state="online"] { color: #0b4a36; background: #d5f4e6; }
.intercom-quick-state[data-state="online"] i { background: #1e9e6a; }
.intercom-quick-state[data-state="offline"] { color: #5e1a08; background: #ffdccf; }
.intercom-quick-state[data-state="offline"] i { background: #e8603c; }
.intercom-quick-state[data-state="unpaired"] { color: #5a4700; background: #fff1b8; }
.intercom-quick-state[data-state="unpaired"] i { background: #c9a300; }
.intercom-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.intercom-quick .primary-button { color: #4a3a00; border-color: #ffe45c; background: #ffe45c; }
.intercom-quick .primary-button:hover { border-color: #f5d63a; background: #f5d63a; }
.intercom-quick .secondary-button { color: #fff9f0; border-color: rgba(255,255,255,.35); background: transparent; }
.intercom-quick .text-link { color: #cfe0da; }
.intercom-device-state[data-state="offline"] { color: #8a2a10; }
.intercom-device-state[data-state="offline"] i { background: #e8603c; box-shadow: 0 0 0 3px #ffdccf; }

.intercom-history-item { display: flex; align-items: center; border-bottom: 1px solid var(--border); background: #fff; }
.intercom-history-item:last-child { border-bottom: 0; }
.intercom-history-item .intercom-history-row { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
.intercom-history-recall { flex: 0 0 auto; min-height: 34px; margin-right: 12px; padding: 0 14px; color: #8a2a10; border: 1.5px solid #f2a68c; border-radius: 999px; background: #fff; font-weight: 700; cursor: pointer; }
.intercom-history-recall:hover { background: #ffdccf; }
.intercom-history-recall:disabled { cursor: wait; opacity: .6; }
.intercom-recall-block { display: grid; gap: 6px; }
.intercom-recall-button { justify-self: start; color: #8a2a10 !important; border-color: #f2a68c !important; }
.intercom-recall-block small { color: var(--text-muted); font-size: var(--font-caption); }

.intercom-student-picker { margin: 0; padding: 0; border: 0; }
.intercom-student-picker legend { margin-bottom: 6px; color: var(--text-secondary); font-size: var(--font-label); font-weight: 700; }
.intercom-student-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 172px; overflow-y: auto; padding: 2px; }
.intercom-student-chips button { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 0 12px 0 5px; color: var(--text); border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: var(--font-label); cursor: pointer; }
.intercom-student-chips button b { display: inline-grid; width: 24px; height: 24px; place-items: center; color: #4a5270; border-radius: 12px; background: var(--surface-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.intercom-student-chips button.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.intercom-student-chips button.active b { color: #4a3a00; background: #ffe45c; }
@media (max-width: 760px) {
  .intercom-quick { flex-direction: column; align-items: stretch; padding: 18px; }
  .intercom-quick-side { align-items: flex-start; }
  .intercom-quick-actions { justify-content: flex-start; }
}

/* ===== 界面改版 · 我的课表（2026-09-29）===== */
.schedule-toolbar { min-height: 0; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
#view-schedule .page-heading { min-height: 0; align-items: center; margin-bottom: 14px; }
#view-schedule .page-heading h1 { margin-bottom: 2px; }
#view-schedule .page-heading p:last-child { font-size: var(--font-label); }
.teacher-review-note { margin: 0 0 12px; padding: 10px 16px; color: var(--text-secondary); border-radius: 16px; background: var(--surface-soft); font-size: var(--font-label); }
.week-switcher { gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: #fff; }
.week-switcher strong { min-width: 132px; font-size: 15px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.week-switcher .icon-button { width: 34px; min-height: 34px; border: 0; background: transparent; }
.week-switcher .current-week { margin-right: 4px; padding: 0 12px; color: #0b4a36; border-radius: 999px; background: #d5f4e6; font-size: var(--font-label); font-weight: 700; line-height: 30px; }
.legend { gap: 6px; }
.legend > span { min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: var(--font-caption); font-weight: 600; }
.legend > span:nth-child(1) { color: #0b4a36; background: #d5f4e6; }
.legend > span:nth-child(2) { color: #0d3b66; background: #ddefff; }
.legend > span:nth-child(3) { color: #5a4700; background: #fff1b8; }
.legend > span:nth-child(4) { color: #5e1a08; background: #ffdccf; }
.legend > span:nth-child(5) { color: #4e3f86; border: 1px dashed #b9a8e0; background: #f8f5fd; }
.legend .legend-dot { display: none; }

.schedule-board-card { padding: 10px; border-radius: 24px; }
.schedule-board { min-width: 860px; grid-template-columns: 96px repeat(5, minmax(142px, 1fr)); gap: 4px; }
.board-corner, .board-day, .board-time, .board-cell { border: 0; }
.board-corner { min-height: 54px; border-radius: 14px; background: transparent; }
.board-day { min-height: 54px; padding: 8px 6px; border-radius: 16px; background: var(--surface-hover); }
.board-day strong { font-size: 15px; }
.board-day.today { color: #fff9f0; background: var(--primary); }
.board-day.today small { color: #cfe0da; }
.board-day.past { opacity: .6; }
.board-day.holiday { color: #5a4700; background: #fff1b8; }
.board-day-tag { display: inline-block; margin-top: 2px; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,.65); font-size: 11px; font-weight: 700; line-height: 18px; }
.board-day.today .board-day-tag { color: #4a3a00; background: #ffe45c; }
.board-time { min-height: 62px; padding: 6px 8px; border-left: 0; border-radius: 14px; background: transparent; }
.board-time strong { font-size: 14px; font-weight: 700; }
.board-time span { color: var(--text-muted); }
.board-time em { margin-bottom: 3px; padding: 1px 8px; font-size: 11px; }
.board-time.slot-routine, .board-time.slot-break, .board-time.slot-duty { background: transparent; }
.board-time.slot-break, .board-cell.slot-break { min-height: 46px; }
.board-time.slot-duty, .board-cell.slot-duty { min-height: 56px; }
.board-cell { min-height: 62px; padding: 0; border-radius: 14px; background: var(--surface-soft); }
.board-cell.today { background: #f2f8f5; }
.board-cell.past { opacity: .62; }
.board-cell.slot-break, .board-cell.slot-duty { background: var(--surface-soft); }
.board-cell.holiday { background-color: #fffbea; background-image: repeating-linear-gradient(135deg, rgba(201,163,0,.1) 0 8px, transparent 8px 16px); }
/* 假期当天导入的课仍然保留，但淡显，免得误以为要上。 */
.board-cell.holiday .board-event { opacity: .45; }
.board-cell.holiday .board-event:hover, .board-cell.holiday .board-event:focus-visible { opacity: 1; }
.board-cell:nth-child(6n) { border-right: 0; }

.board-event { min-height: 100%; padding: 7px 9px; border: 1.5px solid transparent; border-left: 1.5px solid transparent; border-radius: 14px; box-shadow: none; }
.board-event:hover { transform: none; border-color: currentColor; }
.board-event strong { font-size: 13px; font-weight: 700; }
.board-event small, .board-event time { color: inherit; opacity: .8; }
.board-event time { margin-top: 3px; }
.board-event.tone-own { color: #0b4a36; background: #d5f4e6; }
.board-event.tone-teach { color: #0d3b66; background: #ddefff; }
.board-event.tone-duty { color: #5a4700; background: #fff1b8; }
.board-event.tone-school { color: #5e1a08; background: #ffdccf; }
.board-event.tone-private { color: #4e3f86; border-style: dashed; border-color: #b9a8e0; background: #f8f5fd; }
.schedule-board.editing .board-cell { background: var(--surface-soft); }
.schedule-board.editing .board-cell.slot-duty { background: var(--surface-soft); }
.empty-slot { min-height: 100%; border-radius: 14px; }
.schedule-board.editing .empty-slot { color: var(--primary); border-color: var(--border-strong); border-style: dashed; background: transparent; font-weight: 600; }
.schedule-board.editing .empty-slot:hover { border-color: var(--primary); background: #e3f2ec; }

@media (max-width: 900px) {
  .schedule-board-card { padding: 8px; }
  .schedule-board { min-width: 720px; grid-template-columns: 76px repeat(5, minmax(124px, 1fr)); }
  .board-corner, .board-time { position: sticky; left: 0; z-index: 2; background: #fff; }
  .board-time { border-radius: 0 14px 14px 0; box-shadow: 6px 0 8px -6px rgba(44,54,84,.14); }
  .schedule-toolbar { gap: 8px; }
  .legend { width: 100%; }
}
@media (max-width: 760px) {
  /* 手机：标题和两个按钮同一行，按钮只留图标，少占两行 */
  #view-schedule .page-heading { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  #view-schedule .page-heading > div { width: auto; min-width: 0; }
  #view-schedule .page-heading .eyebrow { display: none; }
  #view-schedule .page-heading h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0; }
  #view-schedule .page-heading p:last-child { display: none; }
  .teacher-review-note { margin-bottom: 10px; padding: 8px 14px; }
  #view-schedule .heading-actions { display: flex; width: auto; flex: 0 0 auto; gap: 8px; }
  #view-schedule .heading-actions .secondary-button:first-child { flex-basis: auto; }
  #view-schedule .heading-actions > button { width: 44px; min-height: 44px; flex: 0 0 auto; padding: 0; }
  #view-schedule .heading-actions > button > span:not(.icon) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .week-switcher { width: 100%; justify-content: space-between; }
  /* 颜色说明只占一行，横向可划，不再占掉两行 */
  .legend { flex-wrap: nowrap; overflow-x: auto; margin-inline: -2px; padding: 2px; scrollbar-width: none; }
  .legend::-webkit-scrollbar { display: none; }
  .legend > span { flex: 0 0 auto; }
  .week-switcher strong { min-width: 0; flex: 1 1 auto; }
  .schedule-board { min-width: 620px; grid-template-columns: 68px repeat(5, minmax(106px, 1fr)); }
  .board-day strong { font-size: 14px; }
  .board-event strong { font-size: 12px; }
  .board-time { padding: 6px; }
  .board-time em { align-self: stretch; padding: 1px 4px; font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .board-time strong { font-size: 13px; }
  .board-time span { font-size: 11px; }
}

/* ===== 界面改版 · 手机一天一屏课表（2026-09-29）===== */
.schedule-days, .schedule-day-list { display: none; }
@media (max-width: 760px) {
  /* 手机上不左右拖：只看选中的那一天 */
  .schedule-board { display: none; }
  .schedule-board-card { padding: 6px 10px 10px; overflow-x: visible; }
  .schedule-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .schedule-day { display: flex; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 2px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 16px; background: #fff; font: inherit; cursor: pointer; }
  .schedule-day strong { font-size: 14px; font-weight: 700; }
  .schedule-day small { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
  .schedule-day.is-holiday { color: #5a4700; border-color: transparent; background: #fff1b8; }
  .schedule-day.is-holiday small { color: #5a4700; }
  .schedule-day.active { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
  .schedule-day.active small { color: #cfe0da; }
  .schedule-day.is-today:not(.active)::after { content: "今天"; margin-top: 1px; padding: 0 6px; color: #4a3a00; border-radius: 999px; background: #ffe45c; font-size: 10px; font-weight: 700; }
  .schedule-day-list { display: grid; gap: 8px; }
  /* 一天一屏：时间写在卡片顶部，没有单独的时间列 */
  .day-card { display: block; width: 100%; min-height: 0; padding: 12px 14px; text-align: left; }
  .day-card em { display: block; margin-bottom: 3px; font-size: 12px; font-style: normal; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
  .day-card strong { display: block; font-size: 16px; font-weight: 800; }
  .day-card small { display: block; margin-top: 2px; font-size: 13px; opacity: .85; }
  .day-gap { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 0; padding: 5px 0; color: var(--text-muted); font-size: var(--font-caption); }
  .day-gap small { color: var(--border-strong); font-variant-numeric: tabular-nums; }
  .day-add { display: flex; min-height: 46px; align-items: center; justify-content: flex-start; padding: 0 14px; }
  .schedule-day-list .board-event-wrap + .board-event-wrap { margin-top: 0; }
  .day-note { margin: 0 0 8px; padding: 8px 14px; color: var(--text-secondary); border-radius: 14px; background: var(--surface-soft); font-size: var(--font-label); font-weight: 600; }
  .day-note.holiday { color: #5a4700; background: #fff1b8; }
  /* 假期当天的课同样淡显 */
  .schedule-day-list.holiday .board-event { opacity: .5; }
  .schedule-day-list.holiday .board-event:hover, .schedule-day-list.holiday .board-event:focus-visible { opacity: 1; }
}

/* ===== 界面改版 · 手机「整周」一屏（2026-09-29）===== */
.schedule-view-switch, .schedule-week-mini { display: none; }
@media (max-width: 760px) {
  .schedule-view-switch { display: inline-flex; gap: 2px; margin-bottom: 10px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: #fff; }
  .schedule-view-switch button { min-height: 34px; padding: 0 18px; color: var(--text-secondary); border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .schedule-view-switch button.active { color: #fff9f0; background: var(--primary); }
  .schedule-days.is-hidden, .schedule-day-list.is-hidden { display: none; }
  #view-schedule.week-mode .teacher-review-note,
  #view-schedule.week-mode .legend,
  #view-schedule.week-mode .schedule-footnote,
  #view-schedule.week-mode .page-heading p:last-child { display: none; }
  #view-schedule .schedule-view-switch { margin-bottom: 8px; }
  #view-schedule.week-mode .schedule-board-card { padding: 8px; }

  .schedule-week-mini { display: grid; grid-template-columns: 26px repeat(5, minmax(0, 1fr)); gap: 3px; }
  .schedule-week-mini.is-hidden { display: none; }
  .mini-corner { min-height: 40px; }
  .mini-day { display: flex; min-height: 40px; flex-direction: column; align-items: center; justify-content: center; padding: 2px; color: var(--text-secondary); border: 0; border-radius: 12px; background: var(--surface-hover); font: inherit; cursor: pointer; }
  .mini-day strong { font-size: 13px; font-weight: 700; }
  .mini-day small { color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
  .mini-day.today { color: #fff9f0; background: var(--primary); }
  .mini-day.today small { color: #cfe0da; }
  .mini-day.holiday { color: #5a4700; background: #fff1b8; }
  .mini-day.holiday small { color: #5a4700; }
  .mini-time { display: flex; min-height: 34px; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .mini-time.slot-break, .mini-time.slot-duty, .mini-time.slot-routine { font-weight: 500; }
  .mini-cell { display: flex; min-height: 34px; flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
  .mini-cell.today { background: #f2f8f5; }
  .mini-cell.holiday { background-color: #fffbea; background-image: repeating-linear-gradient(135deg, rgba(201,163,0,.12) 0 6px, transparent 6px 12px); }
  .mini-cell.holiday .mini-chip { opacity: .5; }
  .mini-chip { display: flex; min-height: 26px; align-items: center; justify-content: center; border-radius: 8px; font-size: 11px; font-weight: 700; line-height: 1.1; }
  .mini-chip.tone-own { color: #0b4a36; background: #d5f4e6; }
  .mini-chip.tone-teach { color: #0d3b66; background: #ddefff; }
  .mini-chip.tone-duty { color: #5a4700; background: #fff1b8; }
  .mini-chip.tone-school { color: #5e1a08; background: #ffdccf; }
  .mini-chip.tone-private { color: #4e3f86; border: 1px dashed #b9a8e0; background: #f8f5fd; }
  .mini-hint { grid-column: 1 / -1; margin: 6px 0 0; color: var(--text-muted); font-size: var(--font-caption); text-align: center; }
}

/* ===== 界面改版 · 首页「此刻」卡片（2026-09-29）===== */
.home-now { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 22px 26px; overflow: hidden; color: #fff9f0; border-radius: 28px; background: var(--primary); }
.home-now[hidden] { display: none; }
/* 右上角一圈黄，呼应样稿里的荧光笔感觉 */
.home-now::before { position: absolute; z-index: 0; top: -70px; right: -50px; width: 190px; height: 190px; border: 22px solid rgba(255, 228, 92, .16); border-radius: 50%; content: ""; }
.now-copy, .now-circle-button { position: relative; z-index: 1; }
.now-copy { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.now-lesson { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; }
.now-lesson > span { font-size: 15px; font-weight: 700; }
.now-lesson > small { color: #ffe45c; font-size: var(--font-label); font-weight: 700; }
.now-lesson[data-state="done"] > small, .now-lesson[data-state="free"] > small { color: #cfe0da; font-weight: 500; }
.now-holiday { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; }
.now-week { align-self: flex-start; padding: 0 14px; color: #0b4a36; border-radius: 999px; background: #d5f4e6; font-size: var(--font-label); font-weight: 700; line-height: 30px; }
.now-circle-button { flex: 0 0 auto; padding: 0; border: 0; background: transparent; cursor: default; }
button.now-circle-button { cursor: pointer; }
button.now-circle-button:hover .now-circle { transform: scale(1.04); }
.now-circle { display: flex; width: 104px; height: 104px; flex-direction: column; align-items: center; justify-content: center; color: #4a3a00; border-radius: 52px; background: #ffe45c; transition: transform var(--transition); }
.now-circle strong { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.now-circle small { margin-top: 2px; font-size: 13px; font-weight: 700; }
.now-circle strong:only-child { font-size: 26px; }
/* 今日时间线的时间做成小色块，和样稿一致 */
.agenda-row > time { padding: 4px 8px; color: var(--primary-strong); border-radius: 12px; background: #e3f2ec; font-size: var(--font-caption); font-weight: 700; line-height: 1.35; text-align: center; font-variant-numeric: tabular-nums; }
.agenda-row.duty > time, .agenda-row.duty-evening > time, .agenda-row.route > time { color: #5a4700; background: #fff1b8; }
.agenda-row.school-event > time, .agenda-row.meeting > time { color: #5e1a08; background: #ffdccf; }
.agenda-row.personal > time { color: #4e3f86; background: #efeaf8; }
@media (max-width: 760px) {
  .home-now { flex-direction: row; align-items: center; gap: 12px; padding: 18px; border-radius: 24px; }
  .now-holiday { font-size: 22px; }
  .now-circle { width: 84px; height: 84px; border-radius: 42px; }
  .now-circle strong { font-size: 32px; }
  .now-circle strong:only-child { font-size: 22px; }
}

/* ===== 界面改版 · 去重（2026-09-29）=====
   首页「等我处理」只放真的在等的事，全都没有就整块不显示；待复核入口挪到作业页右上角。 */
.class-home-status-list[hidden] { display: none; }
.class-work-panel[data-class-work-panel="home"]:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
.class-home-status-list .text-link { font-size: var(--font-label); font-weight: 700; }
.homework-review-entry { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; color: #0b4a36; border-radius: 999px; background: #d5f4e6; font-size: var(--font-label); font-weight: 700; text-decoration: none; white-space: nowrap; }
.homework-review-entry[hidden] { display: none; }
.homework-review-entry b { min-width: 20px; height: 20px; padding: 0 6px; color: #fff; border-radius: 10px; background: #0e6b50; font-size: 11px; line-height: 20px; text-align: center; }
.homework-review-entry:hover { background: #c3eed9; }
@media (max-width: 760px) {
  .class-home-metrics .class-tile:only-child, .class-home-metrics .class-tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; }
  .homework-review-entry { min-height: 34px; padding: 0 10px; }
}

/* ===== 界面改版 · 样稿对齐：粉笔荧光版（样稿 ⑭ 手机「今天」/ ㉒ 桌面「今天」，2026-09-29）=====
   字体：标题用站酷快乐体（ZCOOL KuaiLe），数字用 Fredoka，正文仍用系统中文字体；网络字体读不到时自动退回系统字体。
   颜色：黑板绿 #1F4F45 / #173F38；手机色块用样稿里的荧光笔饱和色，电脑色块用同色相浅色。 */
:root {
  --font-fun: "ZCOOL KuaiLe", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-num: "Fredoka", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --hl-coral: #ff8a6b; --hl-coral-ink: #5e1a08;
  --hl-mint: #6fe3b5; --hl-mint-ink: #0b4a36;
  --hl-yellow: #ffe45c; --hl-yellow-ink: #5a4700;
  --hl-sky: #8ccbff; --hl-sky-ink: #0d3b66;
  --board: #173f38;
}
body { background-color: var(--background); background-image: none; background-size: 18px 18px; color: #2c3654; }

/* 标题字：页面大标题、问候语、品牌名、「等你处理」 */
.page-heading h1, #dashboard-title, .brand strong, .todo-board-heading h2, .now-holiday, .class-context-bar h1 {
  font-family: var(--font-fun); font-weight: 400; letter-spacing: .02em; color: var(--primary);
}
.page-heading h1 { font-size: 32px; line-height: 1.2; }
/* 数字：倒计时、待办数字、时间胶囊、班级色块数字 */
.now-circle strong, .todo-num b, .agenda-row time b, .class-tile strong, .gradebook .no, .nav-count {
  font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums;
}

/* 品牌：黑板绿方块 + 黄色粉笔 */
.brand-mark { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; background: var(--primary); }
.brand-mark span { display: none; }
.brand-mark .icon { width: 20px; height: 20px; color: #ffe45c; stroke-width: 2.2; }
.brand strong { font-size: 22px; }

/* 顶栏按钮：呼叫班级（白底描边）＋ 布置作业（黑板绿） */
.topbar .homework-quick-trigger { color: #fff9f0; border-color: var(--primary); background: var(--primary); }
.topbar .homework-quick-trigger:hover { background: #173d35; }
.topbar .intercom-quick-trigger { color: #2c3654; border: 1.5px solid #eadfcb; background: #fff; }
.topbar .assistant-trigger { color: #5a4700; border-color: #ffe45c; background: #ffe45c; }
.topbar .assistant-trigger:hover { background: #ffdb2e; }

/* 问候：日期小字在上，问候语用标题字；副标题不要了 */
.welcome-heading { position: relative; }
.welcome-heading > div > p:not(.eyebrow) { display: none; }
#today-label { margin-bottom: 2px; color: #6b7390; font-size: 14px; font-weight: 600; }
#dashboard-title { font-size: 34px; }

/* 「此刻」卡片：更深的黑板绿、右下一圈薄荷环、黄色圆稍微歪一点 */
.home-now { padding: 22px 24px 20px; border-radius: 30px; background: var(--board); }
.home-now::before { top: auto; right: -24px; bottom: -34px; width: 120px; height: 120px; border: 14px solid var(--hl-mint); opacity: .35; }
.now-lesson span { color: #c9d8d2; font-size: 14px; font-weight: 600; }
.now-holiday { color: #f4f1e8; font-size: 26px; line-height: 1.3; }
.now-week { color: var(--hl-mint-ink); background: var(--hl-mint); }
.now-circle { width: 100px; height: 100px; border-radius: 50px; color: var(--hl-yellow-ink); background: var(--hl-yellow); transform: rotate(8deg); }
button.now-circle-button:hover .now-circle { transform: rotate(8deg) scale(1.04); }
.now-circle strong { font-size: 48px; }

/* 等你处理 */
.todo-board { margin-bottom: 18px; }
.todo-board.is-quiet { display: none; }
.todo-board-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.todo-board-heading h2 { margin: 0; font-size: 22px; }
.todo-board-heading small { color: #6b7390; font-size: 13px; font-weight: 600; }
.todo-board-grid { display: flex; gap: 16px; }
.todo-tile { display: flex; flex: 1 1 0; min-width: 0; min-height: 132px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 22px; border: 0; border-radius: 26px; font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.todo-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(44, 54, 84, .1); }
.todo-tile.grade { flex-grow: 1.3; color: var(--hl-coral-ink); background: #ffdccf; }
.todo-tile.review { color: var(--hl-mint-ink); background: #d5f4e6; }
.todo-tile.screen { color: var(--hl-yellow-ink); background: #fff1b8; }
.todo-board-grid > .todo-tile:only-child { max-width: 560px; }
.todo-tile-top { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.todo-pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; color: #fff7ec; border-radius: 14px; background: var(--primary); font-size: 13px; font-weight: 600; }
.todo-tile-title, .todo-tile-label { font-size: 16px; font-weight: 600; }
.todo-num { display: flex; align-items: baseline; gap: 5px; }
.todo-num b { font-size: 48px; line-height: 1; }
.todo-num small { font-size: 15px; font-weight: 600; }
.todo-tile-note { font-size: 13px; font-weight: 500; opacity: .85; }
.todo-tile.screen .todo-tile-note { margin-top: 2px; color: #5a6280; font-size: 14px; opacity: 1; }
.todo-go { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; height: 44px; margin-top: auto; border-radius: 22px; background: var(--background); font-size: 15px; font-weight: 600; }
.todo-tile.grade .todo-tile-top { flex-direction: row; align-items: center; }

/* 今天的安排：时间胶囊 + 右侧标签，已过去的变淡，中间一条「现在」线 */
.agenda-row { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; min-height: 58px; border-bottom: 1.5px solid #f3ebdd; }
.agenda-row .agenda-line { display: none; }
.agenda-row > time { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 36px; padding: 2px 10px; border-radius: 18px; line-height: 1.1; }
.agenda-row > time b { font-size: 16px; font-weight: 500; }
.agenda-row > time small { font-family: var(--font-num); font-size: 11px; font-weight: 500; opacity: .75; }
.agenda-row > time small:empty { display: none; }
.agenda-row.lesson > time { color: var(--hl-mint-ink); background: #ddf6ea; }
.agenda-row.school-event > time { color: var(--hl-sky-ink); background: #ddefff; }
.agenda-row.personal > time { color: #2c3654; background: var(--surface-muted); }
.agenda-row .agenda-copy strong { font-size: 16px; font-weight: 600; }
.agenda-row.is-past { opacity: .5; }
.agenda-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 13px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.agenda-tag.mint { color: #0b4a36; background: #ddf6ea; }
.agenda-tag.lemon { color: #5a4700; background: #fff1b8; }
.agenda-tag.coral { color: #7a2c17; background: #ffe2d6; }
.agenda-tag.sky { color: #0d3b66; background: #ddefff; }
.agenda-tag.lilac { color: #4e3f86; background: #efeaf8; }
.agenda-now { display: flex; align-items: center; gap: 10px; height: 30px; }
.agenda-now i { width: 10px; height: 10px; border-radius: 5px; background: var(--hl-coral); }
.agenda-now span { color: #b8612f; font-family: var(--font-num); font-size: 13px; font-weight: 500; }
.agenda-now b { flex: 1 1 auto; height: 2px; border-radius: 1px; background: #ffc9b6; }

/* 学校事项按原表校区分组，避免把不同校区的活动排成重复的全天安排。 */
.school-agenda { min-width: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.school-agenda-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.school-agenda-heading h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }
.school-agenda-heading h3 small { margin-left: 8px; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.school-agenda-filter { display: flex; align-items: center; gap: 8px; max-width: 100%; color: var(--text-muted); font-size: 13px; }
.school-agenda-filter > span { flex-shrink: 0; }
.school-agenda-filter select { width: 160px; max-width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; color: var(--primary); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.school-agenda-hint { margin: 4px 0 12px; color: var(--text-muted); font-size: 12px; }
.school-agenda-group { margin-top: 12px; }
.school-agenda-group h4 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 0; color: var(--primary); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.school-agenda-group h4 small { color: var(--text-muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.school-agenda-event { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; text-align: left; }
.school-agenda-event:last-child { border-bottom: 0; }
.school-agenda-event:hover { background: var(--surface-soft); }
.school-agenda-event-copy { display: flex; flex: 1; min-width: 0; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 3px 14px; }
.school-agenda-event strong { min-width: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.school-agenda-event small { color: var(--text-muted); font-size: 12px; }
.school-agenda-arrow { flex-shrink: 0; color: var(--text-muted); font-size: 20px; }
.school-agenda-empty { padding: 16px 0; color: var(--text-muted); font-size: 14px; }
.calendar-event-campus { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .school-agenda { margin-top: 8px; padding: 14px; border: 1.5px solid var(--border); border-radius: 22px; background: var(--surface); }
  .school-agenda-heading { align-items: flex-start; }
  .school-agenda-heading h3 { min-height: 44px; display: flex; align-items: center; }
  .school-agenda-filter { gap: 6px; }
  .school-agenda-filter select { width: 128px; }
  .school-agenda-event-copy { display: flex; flex-direction: column; align-items: flex-start; }
  .school-agenda-event { padding-inline: 0; }
  .calendar-event-campus { font-size: 12px; }
}

/* 班级色块（班级概览）数字用 Fredoka */
.class-tile strong { font-weight: 600; }

@media (max-width: 760px) {
  /* 右上角一轮黄太阳 */
  #view-dashboard .welcome-heading::before { position: absolute; z-index: 0; top: -60px; right: 0; width: 120px; height: 120px; border-radius: 60px; background: #fff1b8; content: ""; }
  #view-dashboard .welcome-heading > div { position: relative; z-index: 1; }
  #dashboard-title { font-size: 30px; }
  .home-now { position: relative; z-index: 1; }

  /* 等你处理：左边一大块待批，右边两小块；手机上用样稿里的饱和色 */
  .todo-board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .todo-tile { min-height: 0; padding: 16px; }
  .todo-tile.grade { color: var(--hl-coral-ink); background: var(--hl-coral); }
  .todo-tile.review { color: var(--hl-mint-ink); background: var(--hl-mint); }
  .todo-tile.screen { color: var(--hl-yellow-ink); background: var(--hl-yellow); }
  .todo-board[data-layout="grs"] .todo-tile.grade { grid-row: span 2; min-height: 212px; }
  .todo-board-grid > .todo-tile:only-child { grid-column: 1 / -1; max-width: none; }
  .todo-board[data-layout="g"] .todo-tile.grade { min-height: 0; }
  .todo-tile.grade .todo-tile-top { flex-direction: column; align-items: flex-start; }
  .todo-num b { font-size: 56px; }
  .todo-tile.review .todo-num b { font-size: 38px; }
  .todo-tile.review .todo-num small { font-size: 14px; }
  .todo-tile.screen .todo-tile-note { font-size: 13px; }

  /* 今天的安排：每一项是一张白色圆角小卡，私人事项虚线边 */
  .today-card { border: 0; background: transparent; box-shadow: none; }
  .today-card > .card-header { padding-inline: 4px; }
  .today-agenda { display: flex; flex-direction: column; gap: 8px; padding: 0; }
  .agenda-row { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 60px; padding: 12px 14px; border: 1.5px solid #e3d7c2; border-radius: 22px; background: #fff; }
  .agenda-row:last-child { border-bottom: 1.5px solid #e3d7c2; }
  .agenda-row.personal { border-style: dashed; border-color: #d3c6ae; }
  .agenda-row > time { flex-direction: row; min-height: 36px; padding: 0 12px; }
  .agenda-row > time small { display: none; }
  .agenda-row .agenda-copy small { display: none; }
  .agenda-section-label { padding: 6px 4px 0; }
  .agenda-now { padding: 0 4px; }

  /* 底栏：当前项黄底带图标，其余只写字 */
  .mobile-tab:not(.active) .icon { display: none; }
  .mobile-tab { flex-direction: row; gap: 6px; font-size: 15px; font-weight: 600; }
  .mobile-tab.active { color: var(--hl-yellow-ink); background: var(--hl-yellow); }

  /* 班级色块：手机上也用饱和色 */
  .class-tile.lemon { background: var(--hl-yellow); }
  .class-tile.mint { background: var(--hl-mint); }
  .class-tile.coral { background: var(--hl-coral); }
  .class-tile.sky { background: var(--hl-sky); }
}
@media (prefers-reduced-motion: reduce) { .todo-tile { transition: none; } }
/* 只有「大屏断线」一件时，缩成一条细提示，不占大块 */
.todo-board[data-layout="s"] .todo-tile.screen { flex-direction: row; align-items: center; gap: 10px; min-height: 0; padding: 12px 18px; border-radius: 22px; }
.todo-board[data-layout="s"] .todo-tile.screen .todo-tile-label { flex: 0 0 auto; font-size: 15px; }
.todo-board[data-layout="s"] .todo-tile.screen .todo-tile-note { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .now-holiday { font-size: 22px; }
  .now-lesson span { font-size: 13px; }
  .now-circle { width: 88px; height: 88px; border-radius: 44px; }
  .now-circle strong { font-size: 42px; }
}

/* ===== ui11 · 样稿对齐 A：全局外壳与我的班级 ===== */
:root { --chalk-line: var(--border); --chalk-muted: #5a6280; --chalk-paper: var(--surface-soft); --chalk-shadow: 0 4px 0 #e1e8e4; }
::selection { color: #173f38; background: #fff1b8; }
input, textarea { caret-color: #1f4f45; }
:where(button,a,input,select,textarea):focus-visible { outline: 3px solid #2c806c; outline-offset: 3px; }
.page-heading .eyebrow { color: var(--chalk-muted); font-size: 13px; font-weight: 500; }
#class-work-subnav { margin-left: 12px; padding-left: 12px; }
.sidebar-classes { min-width: 0; margin: 8px 0 12px; padding: 0; }
.sidebar-classes[hidden] { display: none; }
.sidebar-classes h2 { margin: 0 10px 8px; color: var(--chalk-muted); font: 500 12px/1.5 var(--font-body, sans-serif); }
#sidebar-class-list { display: grid; gap: 5px; }
.sidebar-class { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 10px; color: #2c3654; border: 0; border-radius: 20px; background: var(--surface-soft); text-align: left; font-size: 13px; }
.sidebar-class > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-class > small { overflow: hidden; max-width: 76px; flex-shrink: 0; padding: 2px 7px; border-radius: 12px; color: #0b4a36; background: #d5f4e6; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-class.active { background: #fff1b8; box-shadow: inset 0 0 0 1px #d7bd60; }
.sidebar-class:hover { background: #e5f5ec; }
.sidebar-classes-more { min-height: 36px; border: 0; background: transparent; color: #1f4f45; font-size: 12px; text-align: left; padding-inline: 10px; }
.sidebar-assistant { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; border: 0; border-radius: 23px; color: #5a4700; background: #ffe45c; font-weight: 600; }
.sidebar-assistant:hover { background: #ffda39; }
.sidebar-account { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 4px; border: 0; border-radius: 18px; background: transparent; text-align: left; }
.sidebar-account > span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-account strong, .sidebar-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { color: #2c3654; font-size: 14px; font-weight: 600; }
.sidebar-account small { color: var(--chalk-muted); font-size: 11px; }
.sidebar-account .avatar { width: 36px; height: 36px; flex-shrink: 0; background: #ddefff; color: #0d3b66; }
.sidebar-account:hover { background: var(--surface-soft); }
@media (min-width: 761px) {
  :root { --sidebar-width: 272px; }
  .sidebar { inset: 20px auto 20px 20px; width: 232px; height: calc(100dvh - 40px); border: 0; border-radius: 32px; box-shadow: var(--chalk-shadow); background: #fff; scrollbar-width: thin; scrollbar-color: #c6d4cc transparent; }
  .sidebar .brand { padding: 22px 20px 16px; }
  .sidebar .brand strong { font-size: 20px; white-space: nowrap; }
  .sidebar .brand small { font-size: 10px; }
  .sidebar-nav { padding: 8px 12px 12px; }
  .sidebar .nav-label { padding-left: 12px; }
  .sidebar .nav-item { min-height: 48px; padding: 8px 12px; border-radius: 24px; }
  .sidebar .nav-copy strong { font-size: 15px; font-weight: 600; }
  .sidebar .nav-copy small { display: none; }
  .sidebar .nav-item.active { color: #fff9f0; background: #1f4f45; }
  .sidebar .nav-item.active > .icon { background: #ffe45c; color: #173f38; }
  .sidebar .nav-group-heading { border-radius: 24px; }
  .sidebar .nav-group-heading .nav-item { min-width: 0; }
  .sidebar .subnav-item { min-height: 36px; font-size: 13px; border-radius: 18px; }
  .sidebar .subnav-item.active { background: #d5f4e6; color: #0b4a36; }
  .sidebar-personal-nav { margin-top: auto; border-top: 0; }
  .sidebar-footer { padding-top: 10px; border-top: 1px solid #eadfcb; }
  .sidebar-footer .school-card { background: var(--surface-soft); border-radius: 16px; }
  .sidebar-footer .sync-status { padding: 8px 4px; line-height: 1.5; }
  .topbar { gap: 14px; padding-inline: 0 24px; border-bottom: 0; background: var(--background); backdrop-filter: none; }
  .topbar .assistant-trigger { display: none; }
  .global-search { max-width: 440px; flex: 1 1 240px; background: #fff; border-radius: 24px; }
  .topbar .profile-copy { max-width: 110px; }
  .topbar .profile-copy strong, .topbar .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 760px) {
  .sidebar-classes { margin-block: 6px; }
  .sidebar-class, .sidebar-classes-more { min-height: 44px; }
  .sidebar-footer .sidebar-assistant { display: none; }
}

/* ===== ui12 · 样稿对齐 B：班级页与登分册 ===== */
.class-heading h1 { font-family: var(--font-fun); font-size: 32px; font-weight: 400; }
.class-heading h1 + p { margin-top: 8px; color: #5a6280; font-size: 14px; }
.class-context-bar { padding: 12px 16px; border: 0; border-radius: 24px; background: #fff; box-shadow: var(--chalk-shadow); }
.class-context-bar select { min-height: 42px; color: #1f4f45; border-color: #eadfcb; background-color: var(--surface-soft); }
.class-tabs { gap: 8px; margin-top: 20px; }
.class-tabs > button, .class-tabs > a { min-height: 40px; padding-inline: 17px; border-color: #eadfcb; border-radius: 20px; font-weight: 500; }
.class-home-card, .class-student-card { border: 0; border-radius: 28px; background: #fff; box-shadow: var(--chalk-shadow); }
.homework-layout { grid-template-columns: 250px minmax(0,1fr); gap: 18px; }
.homework-batch-list { padding: 16px 12px; border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.gb-list-title { margin: 2px 8px 8px; color: #1f4f45; font-size: 18px; font-weight: 600; }
.gb-date { margin: 14px 8px 4px; color: #5a6280; font-size: 12px; font-weight: 500; }
.gb-batch { padding: 12px 14px; border-color: transparent; border-radius: 20px; gap: 5px; }
.gb-batch strong { font-size: 14px; font-weight: 600; }
.gb-batch small { font-size: 12px; line-height: 1.6; }
.gb-batch.active { color: #5a4700; border-color: transparent; background: #fff1b8; }
.gb-batch.active small { color: #6c5b19; }
.gb-term-summary { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 10px 14px; border: 0; border-radius: 22px; color: #2c3654; background: var(--surface-soft); font-size: 13px; white-space: nowrap; }
.gradebook { gap: 14px; padding: 22px; border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.gb-head { flex-wrap: wrap; }
.gb-head h3 { font-family: var(--font-fun); font-size: 25px; font-weight: 400; }
.gb-assignment-title { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; }
.gb-head p { margin-top: 5px; font-size: 12px; line-height: 1.6; }
.gb-actions { gap: 6px; }
.gb-actions button { min-height: 40px; border-radius: 20px; font-size: 12px; }
.gb-export { color: #fff9f0; border-color: #1f4f45; background: #1f4f45; }
.gb-export:hover { color: #fff9f0; background: #173f38; }
.gb-filter-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.gb-filters { gap: 6px; }
.gb-filter { min-height: 36px; padding-inline: 12px; border: 0; color: #5a6280; background: var(--surface-soft); font-size: 12px; font-weight: 500; }
.gb-filter b { font-family: var(--font-num); font-weight: 600; }
.gb-priority { display: flex; min-height: 36px; align-items: center; gap: 8px; color: #5a6280; font-size: 12px; cursor: pointer; }
.gb-priority input { width: 17px; height: 17px; accent-color: #1f4f45; }
.gb-filter-note { margin: -5px 0 0; color: #5a6280; font-size: 12px; }
.gb-table th, .gb-table td { height: 44px; padding: 6px 10px; border-color: #f3ebdd; }
.gb-table thead th { border-bottom: 2px solid #eadfcb; font-size: 13px; }
.gb-num { background: transparent; color: #5a6280; font-family: var(--font-num); font-weight: 500; }
.gb-column-select { display: inline-flex; min-height: 36px; align-items: center; padding: 5px 10px; border: 0; border-radius: 14px; background: transparent; color: #5a6280; text-align: left; font: inherit; }
.gb-column-select[aria-pressed="true"] { background: #fff1b8; color: #5a4700; }
.gb-cell { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 12px; font-family: var(--font-num); font-size: 15px; font-weight: 600; }
.gb-workflow { color: #84321e; font: 500 12px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.gb-cell[data-tone="pass"], .gb-mark-summary [data-tone="pass"] { color: #0b4a36; background: #d5f4e6; }
.gb-cell[data-tone="star"], .gb-mark-summary [data-tone="star"] { color: #5a4700; background: #fff1b8; }
.gb-cell[data-tone="bee"], .gb-mark-summary [data-tone="bee"] { color: #0d3b66; background: #ddefff; }
.gb-cell[data-tone="fix"], .gb-mark-summary [data-tone="fix"] { color: #5e1a08; background: #ffdccf; }
.gb-cell[data-tone="miss"], .gb-mark-summary [data-tone="miss"] { color: #805213; border: 1px solid #d9b98a; background: #fff; }
.gb-cell[data-tone="gray"], .gb-mark-summary [data-tone="gray"] { color: #5a6280; background: var(--surface-muted); }
.gb-cell[data-tone="rereview"], .gb-mark-summary [data-tone="rereview"] { color: #84321e; border: 1.5px solid #df775e; background: #fff; }
.gb-mark-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 20px; background: var(--surface-soft); }
.gb-mark-summary > strong { margin-right: 4px; font-size: 13px; font-weight: 600; }
.gb-mark-summary > span { display: inline-flex; min-height: 28px; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 14px; font-size: 12px; }
.gb-mark-summary b { font-family: var(--font-num); font-size: 15px; }
.gb-summary { background: transparent; padding: 0 2px; font-size: 12px; }
@media (max-width: 1100px) {
  .homework-layout { grid-template-columns: minmax(0,1fr); }
  .homework-batch-list { padding: 12px; }
  .gb-term-summary { width: auto; flex-shrink: 0; margin: 0; }
}
@media (max-width: 760px) {
  .class-heading h1 { font-size: 25px; }
  .class-heading h1 + p { font-size: 12px; line-height: 1.6; }
  .class-context-bar { padding: 10px 12px; }
  .class-tabs { margin-top: 16px; }
  .gradebook { padding: 16px 12px; border-radius: 24px; }
  .gb-head h3 { font-size: 22px; }
  .gb-actions { width: 100%; }
  .gb-actions button { min-height: 44px; }
  .gb-filters { gap: 6px; }
  .gb-filter { min-height: 40px; padding-inline: 10px; }
  .gb-filter-note { line-height: 1.6; }
  .gb-table th, .gb-table td { padding-inline: 7px; }
  .gb-table tbody th { position: sticky; left: 0; background: #fff; z-index: 1; }
  .gb-mark-summary { padding: 12px; }
  .gb-mark-summary > strong { flex-basis: 100%; }
}
@media print {
  body.print-gradebook .gb-filter-toolbar, body.print-gradebook .gb-filter-note { display: none !important; }
  body.print-gradebook .gb-head { display: block; }
  body.print-gradebook .gb-cell[data-tone] { color: #000; border: 0; background: transparent; }
  body.print-gradebook .gb-table tbody th { position: static; }
}

/* ===== ui13 · 样稿对齐 C：周课表与当前节次 ===== */
.schedule-board-card { padding: 20px; border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.week-board { gap: 6px; }
.board-day { border-radius: 16px; }
.board-day.today { color: #fff9f0; background: #1f4f45; }
.board-day.today small { color: #d4e8df; }
.board-time { border: 0; color: #2c3654; }
.board-time strong { font-size: 14px; font-weight: 500; }
.board-time span, .board-event time, .week-switcher > strong, .board-day small { font-family: var(--font-num); font-weight: 500; }
.board-cell { position: relative; min-width: 0; border-radius: 16px; }
.board-event { min-height: 60px; padding: 10px 12px; border-radius: 16px; border: 0; box-shadow: none; }
.board-event strong { font-size: 14px; font-weight: 600; }
.board-event small { font-size: 12px; }
.board-event.tone-own { background: #d5f4e6; color: #0b4a36; }
.board-event.tone-teach { background: #ddefff; color: #0d3b66; }
.board-event.tone-duty { background: #fff1b8; color: #5a4700; }
.board-event.tone-school { background: #ffe2d6; color: #7a2c17; }
.board-event.tone-private { background: #faf7ff; color: #4e3f86; border: 1px dashed #b6a6d5; }
.board-cell.elapsed:not(.past) .board-event, .day-card.elapsed { opacity: .55; }
.board-now-line { display: none; }
.board-cell.slot-now > .board-now-line { position: absolute; z-index: 3; inset: max(6px, var(--slot-progress)) 0 auto; display: flex; align-items: center; gap: 5px; pointer-events: none; color: #913e1e; font: 500 11px/1 var(--font-num); white-space: nowrap; transform: translateY(-50%); text-shadow: 0 1px #fff; }
.board-now-line::before { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #df775e; content: ""; }
.board-now-line::after { height: 2px; flex: 1; background: #df775e; content: ""; }
.day-card.slot-now { box-shadow: inset 0 0 0 2px #cb674d; }
.day-card.slot-now::after { align-self: flex-start; margin-top: 4px; padding: 1px 8px; border-radius: 10px; color: #7a2c17; background: #ffe2d6; font: 500 11px/1.6 -apple-system, sans-serif; content: "正在进行"; }
@media (max-width: 760px) {
  .schedule-board-card { padding: 12px; border-radius: 24px; }
  .day-card { min-height: 90px; padding: 14px 16px; border-radius: 20px; }
  .day-card strong { font-size: 18px; }
  .day-card em { font-family: var(--font-num); font-size: 12px; font-style: normal; }
  #view-schedule.week-mode .schedule-board-card { padding: 10px; }
  #schedule-week-mini { min-width: 0; }
}

/* ===== ui14 · 样稿对齐 D：按作业复核与固定操作条 ===== */
.review-card { padding: 22px; border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.review-list { gap: 28px; }
.review-group-title { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.review-group-title > strong { flex: 1; min-width: 140px; color: #2c3654; font-size: 15px; font-weight: 600; }
.review-group-title > small { color: #5a6280; font-size: 12px; }
.review-row { grid-template-columns: 22px minmax(80px,110px) minmax(100px,1fr) auto; gap: 12px; padding: 14px; border-color: #eadfcb; border-radius: 20px; }
.review-tags { grid-column: 2 / 4; }
.review-actions { grid-column: 4; grid-row: 1 / 3; max-width: 280px; }
.review-what strong { white-space: normal; }
.review-row.selected { border-color: #d7bd60; background: #fffbea; }
.review-round { border: 0; color: #5a6280; background: var(--surface-muted); font-family: var(--font-num); font-weight: 500; }
.review-last { font-family: var(--font-num); font-weight: 500; }
.review-mark { min-height: 40px; padding-inline: 14px; font-family: var(--font-num); font-weight: 500; }
.review-mark[data-mark-tone="pass"] { color: #0b4a36; background: #d5f4e6; }
.review-mark[data-mark-tone="star"] { color: #5a4700; background: #fff1b8; }
.review-mark[data-mark-tone="bee"] { color: #0d3b66; background: #ddefff; }
.review-mark[data-mark-tone="fix"] { color: #5e1a08; background: #ffdccf; }
.review-empty { min-height: 130px; padding: 24px; border: 1px dashed #d9cbb2; border-radius: 24px; background: var(--surface-soft); font-size: 14px; }
/* Permission copy is a reading block, not the compact review-queue empty row. */
#routine-review-empty { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; min-height: 0; }
#routine-review-empty[hidden] { display: none; }
#routine-review-empty h2 { margin: 0; color: var(--primary); font-size: 20px; line-height: 1.45; }
#routine-review-empty p { margin: 0; overflow-wrap: break-word; }
.review-batch-bar { display: flex; flex-wrap: wrap; width: min(880px,calc(100vw - var(--sidebar-width) - 48px)); gap: 10px; padding: 14px 18px; color: #2c3654; border: 1px solid #eadfcb; border-radius: 26px; background: #fff; box-shadow: 0 10px 28px #2c36541a; }
.review-batch-count { margin-right: auto; font-family: var(--font-num); font-size: 17px; }
.review-batch-bar .secondary-button { color: #1f4f45; border-color: #eadfcb; background: #fff; }
.review-batch-bar .secondary-button:hover { background: var(--surface-soft); }
.review-batch-bar .primary-button { min-height: 44px; color: #fff9f0; border-color: #1f4f45; background: #1f4f45; }
.review-batch-bar .primary-button:hover { background: #173f38; }
.review-batch-note { flex-basis: 100%; color: #5a6280; font-size: 12px; text-align: right; }
#review-batch-correction { color: #7a2c17; border-color: #e5c1b3; }
#view-review { padding-bottom: 160px; }
@media (max-width: 1100px) {
  .review-row { grid-template-columns: 22px minmax(0,1fr); }
  .review-what, .review-tags, .review-actions { grid-column: 2; grid-row: auto; }
  .review-actions { max-width: none; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .review-card { padding: 14px; border-radius: 24px; }
  .review-group-title > strong { flex-basis: calc(100% - 100px); font-size: 14px; }
  .review-row { padding: 12px; gap: 8px; }
  .review-mark { min-height: 44px; }
  .review-batch-bar { width: auto; max-width: none; padding: 12px; gap: 8px; }
  .review-batch-bar .primary-button { flex: 1 1 100%; order: 3; min-height: 48px; padding-block: 8px; font-size: 13px; }
  #review-batch-correction { order: 4; flex: 1 1 100%; min-height: 44px; }
  .review-batch-note { order: 5; text-align: center; font-size: 11px; }
  #view-review { padding-bottom: 260px; }
}
/* ===== 样稿对齐 · 批改记录与批完页 ui14（Record4 / Pick4 / Done4）===== */
:is(.homework-mark-sample, .homework-grade-symbol, .hw-review-tools button, [data-batch-student-mark], .hw-review-success-tile)[data-mark-tone] {
  --mark-bg: #F1ECE3;
  --mark-ink: #5A6280;
  color: var(--mark-ink);
  background: var(--mark-bg);
}
:is(.homework-mark-sample, .homework-grade-symbol, .hw-review-tools button, [data-batch-student-mark], .hw-review-success-tile)[data-mark-tone="pass"] { --mark-bg: #D5F4E6; --mark-ink: #0B4A36; }
:is(.homework-mark-sample, .homework-grade-symbol, .hw-review-tools button, [data-batch-student-mark], .hw-review-success-tile)[data-mark-tone="star"] { --mark-bg: #FFF1B8; --mark-ink: #5A4700; }
:is(.homework-mark-sample, .homework-grade-symbol, .hw-review-tools button, [data-batch-student-mark], .hw-review-success-tile)[data-mark-tone="bee"] { --mark-bg: #DDEFFF; --mark-ink: #0D3B66; }
:is(.homework-mark-sample, .homework-grade-symbol, .hw-review-tools button, [data-batch-student-mark], .hw-review-success-tile)[data-mark-tone="fix"] { --mark-bg: #FFDCCF; --mark-ink: #5E1A08; }
.homework-mark-sample[data-mark-tone], .homework-grade-symbol[data-mark-tone] { display: inline-flex; justify-content: center; align-items: center; min-height: 28px; padding: 3px 12px; border-radius: 14px; font-family: var(--font-num); font-size: 15px; font-weight: 600; line-height: 1.4; }
.homework-mark-sample[data-mark-tone] small { font-family: var(--font-family, "PingFang SC", sans-serif); font-size: 12px; color: inherit; }
.homework-grade-button { grid-template-columns: minmax(60px, .28fr) minmax(0, 1fr); min-height: 76px; border-radius: 22px; background: #fff; border-color: #EADFCB; }
.homework-grade-button.is-default { border-color: #7FCFAE; background: #F2FBF6; }
.homework-grade-button[data-outcome] .homework-grade-symbol { color: var(--mark-ink); background: var(--mark-bg); font-size: 20px; min-height: 40px; padding: 6px 10px; border-radius: 20px; }
.homework-grade-button strong { font-weight: 600; }
.homework-grade-button small { color: #5A6280; }
.homework-grade-history .homework-mark-sample { align-self: start; }
.homework-grading-row-main input[name="markLabel"] { font-family: var(--font-num); font-weight: 600; }
.homework-grading-presets button { border-radius: 22px; }

.hw-review-dialog { border-radius: 30px; background: var(--background); color: #2C3654; }
.hw-review-header { background: #fff; border-color: #EADFCB; padding: 20px 24px; }
.hw-review-header h2 { font-family: var(--font-fun); font-size: 28px; font-weight: 400; color: var(--primary); }
.hw-review-header p { color: #5A6280; line-height: 1.5; }
.hw-review-body { scrollbar-color: #B4CBBF var(--background); }
.hw-review-intro { gap: 14px; }
.hw-review-intro strong { font-weight: 600; color: var(--primary); }
.hw-review-scope { padding: 6px 12px; border-radius: 16px; font-family: var(--font-num); color: #5A4700; background: #FFF1B8; }
.hw-review-tools { gap: 10px; border-color: #EADFCB; }
.hw-review-tools button { min-height: 72px; min-width: 108px; padding: 10px 16px; border: 2px solid transparent; border-radius: 22px; text-align: center; }
.hw-review-tools button strong { font-family: var(--font-num); font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.hw-review-tools button[data-batch-tool="__skip"] strong, .hw-review-tools button[data-batch-tool="__default"] strong { font-family: inherit; font-size: 14px; }
.hw-review-tools button small, .hw-review-tools button[aria-pressed="true"] small { color: inherit; font-size: 12px; }
.hw-review-tools button[aria-pressed="true"] { border-color: var(--primary); outline: none; color: var(--mark-ink); background: var(--mark-bg); box-shadow: 0 3px 0 #D6C8AD; }
.hw-review-tools button:hover:not(:disabled) { border-color: var(--primary); }
.hw-review-grid-heading { align-items: center; padding-block: 14px; }
.hw-review-grid-heading p { line-height: 1.6; }
.hw-review-grid { gap: 10px; }
.hw-review-student { min-height: 106px; padding: 10px; gap: 7px; border: 1.5px solid #E3D7C2; border-radius: 20px; background: #fff; }
.hw-review-student[data-outcome="needs_correction"], .hw-review-student[data-outcome="excellent"], .hw-review-student[data-outcome="passed"] { border-color: #E3D7C2; background: #fff; }
.hw-review-student-top { flex-wrap: wrap; align-items: center; gap: 5px; }
.hw-review-number { display: inline-flex; min-width: 27px; height: 27px; padding-inline: 3px; justify-content: center; align-items: center; border-radius: 14px; background: var(--surface-muted); font-family: var(--font-num); font-size: 13px; font-weight: 500; color: #5A6280; }
.hw-review-student [data-batch-student-mark] { display: inline-flex; max-width: 100%; min-width: 0; min-height: 28px; padding: 3px 8px; align-items: center; border-radius: 14px; font-family: var(--font-num); font-size: 13px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.hw-review-student-name { display: flex; align-items: center; gap: 4px; justify-content: space-between; }
.hw-review-student-name strong { min-width: 0; font-size: 15px; font-weight: 600; }
.hw-review-student-check { flex-shrink: 0; visibility: hidden; color: var(--primary); }
.hw-review-student[aria-pressed="true"] { color: #5A4700; border-color: #CFAD19; background: #FFE45C; }
.hw-review-student[aria-pressed="true"] .hw-review-number { color: #FFE45C; background: #1F4F45; }
.hw-review-student[aria-pressed="true"] .hw-review-student-check { visibility: visible; }
.hw-review-student[aria-pressed="true"] small { color: #5A4700; }
.hw-review-student[data-outcome="skipped"]:not([aria-pressed="true"]) { border-style: dashed; background: var(--surface-soft); }
.hw-review-student[data-conflict="true"] { border-color: var(--danger); background: var(--danger-soft); }
.hw-review-student[data-conflict="true"] small { color: var(--danger); }
.hw-review-student small { color: #5A6280; font-size: 12px; line-height: 1.45; }
.hw-review-student:active:not(:disabled) { transform: translateY(1px); }
.hw-review-student[aria-pressed="true"]:active:not(:disabled) { background: #FFE45C; }
.hw-review-tools button:active:not(:disabled) { background: var(--mark-bg); }
.hw-review-footer { border-radius: 28px 28px 0 0; border-color: #EADFCB; background: #fff; box-shadow: 0 -5px 20px rgba(31, 63, 56, .06); }
.hw-review-footer-actions button { min-height: 46px; border-radius: 23px; }
.hw-review-footer small[data-state="saved"] { color: #0B4A36; }
.hw-review-preview { width: 100%; }
.hw-review-preview h3 { font-family: var(--font-fun); font-size: 26px; font-weight: 400; color: var(--primary); }
.hw-review-result-list details { border-color: #EADFCB; }
.hw-review-result-list summary { line-height: 1.6; }
.hw-review-result-list summary .homework-mark-sample { vertical-align: middle; }
.hw-review-confirm { border-radius: 22px; background: #D5F4E6; color: #0B4A36; }
.hw-review-confirm input { accent-color: #1F4F45; }
.hw-review-dialog :is(button, input, summary):focus-visible, .homework-grade-button:focus-visible { outline: 3px solid #1F4F45; outline-offset: 3px; }

.hw-review-success { max-width: 760px; margin-inline: auto; padding: 0; }
.hw-review-success-board { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px 22px; min-height: 224px; border-radius: 30px; color: #FFF7EC; background: #173F38; text-align: center; }
.hw-review-success-board > svg { color: #6FE3B5; }
.hw-review-success-board h3 { margin: 0; font-family: var(--font-fun); font-size: 44px; font-weight: 400; color: #FFE45C; }
.hw-review-success-total { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 10px; }
.hw-review-success-total strong { font-family: var(--font-num); font-size: 60px; font-weight: 600; line-height: 1; }
.hw-review-success-total span { font-size: 16px; }
.hw-review-success-board p { margin: 4px 0 0; color: #DCE7E2; font-size: 14px; }
.hw-review-success-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-block: 16px; }
.hw-review-success-tile { border-radius: 24px; padding: 16px 18px; min-width: 0; }
.hw-review-success-tile > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.hw-review-success-tile > div > span { font-size: 16px; font-weight: 600; }
.hw-review-success-tile strong { font-family: var(--font-num); font-size: 36px; font-weight: 600; line-height: 1.2; }
.hw-review-success-tile small { display: block; margin-top: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; color: inherit; }
.hw-review-success-note { color: #5A6280; font-size: 13px; }

@media (max-width: 760px) {
  .hw-review-dialog { border-radius: 26px 26px 0 0; }
  .hw-review-header { padding: 16px; }
  .hw-review-header h2 { font-size: 24px; }
  .hw-review-body { padding: 16px 14px; }
  .hw-review-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hw-review-tools button { min-width: 0; min-height: 72px; padding: 8px 6px; border-radius: 20px; }
  .hw-review-tools button strong { font-size: 21px; }
  .hw-review-tools button[data-batch-tool="__skip"] strong, .hw-review-tools button[data-batch-tool="__default"] strong { font-size: 13px; }
  .hw-review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hw-review-student { min-height: 116px; padding: 9px 8px; border-radius: 18px; }
  .hw-review-student-name strong { font-size: 14px; }
  .hw-review-student-check { width: 16px; height: 16px; }
  .hw-review-footer { padding: 14px 14px max(14px, env(safe-area-inset-bottom)); }
  .hw-review-footer-actions button { font-size: 14px; }
  .hw-review-success-board { min-height: 218px; padding: 24px 16px; }
  .hw-review-success-board h3 { font-size: 40px; }
  .hw-review-success-total strong { font-size: 54px; }
  .hw-review-success-total span { font-size: 14px; }
  .hw-review-success-tiles { gap: 10px; }
  .hw-review-success-tile { padding: 14px; border-radius: 22px; }
  .hw-review-success-tile > div > span { font-size: 14px; }
  .hw-review-success-tile strong { font-size: 30px; }
  .hw-review-success-tile small { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-review-student:active:not(:disabled) { transform: none; }
}

/* ===== ui15 · 样稿对齐 E1：呼叫 ===== */
.class-intercom-heading h2 { font-family: var(--font-fun); font-weight: 400; }
.class-intercom-heading p:last-child { max-width: 72ch; font-size: 13px; }
.intercom-quick { color: #2c3654; border: 0; background: #fff; box-shadow: var(--chalk-shadow); }
.intercom-quick .eyebrow, .intercom-quick-copy p:last-child { color: #5a6280; }
.intercom-quick h3 { color: #1f4f45; font-size: 22px; font-weight: 600; }
.intercom-quick .secondary-button { color: #1f4f45; border-color: #eadfcb; background: #fff; }
.intercom-quick .text-link { color: #1f4f45; }
.intercom-quick .primary-button { color: #fff9f0; border-color: #1f4f45; background: #1f4f45; }
.intercom-quick .primary-button:hover { border-color: #173f38; background: #173f38; }
.intercom-stage-note { padding: 12px 16px; border: 0; border-radius: 22px; background: #ddf6ea; }
.intercom-stage-note strong { font-size: 14px; font-weight: 600; }
.intercom-class-card, .intercom-mode-card, .intercom-history-card, .intercom-safety-card, .intercom-call-panel { overflow: hidden; border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.intercom-class-row { gap: 10px; margin: 8px 12px; padding: 14px; border: 1px solid #eadfcb; border-radius: 20px; }
.intercom-class-row:last-child { border-bottom: 1px solid #eadfcb; }
.intercom-class-row.current-class { border-color: #bfdccf; box-shadow: none; background: #f0faf5; }
.intercom-class-avatar { border-radius: 50%; background: #d5f4e6; font-family: var(--font-num); font-weight: 500; }
.intercom-announcement-badge, .intercom-call-badge { min-height: 28px; padding: 5px 10px; font-size: 12px; font-weight: 500; }
.intercom-history-row { padding-block: 14px; }
.intercom-history-row strong { font-size: 14px; font-weight: 600; }
.intercom-history-recall { min-height: 44px; }
.intercom-empty { margin: 12px; border: 1px dashed #d9cbb2; border-radius: 22px; background: #fff; }
@media (max-width: 1100px) {
  .intercom-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .intercom-quick { padding: 18px; border-radius: 24px; }
  .intercom-quick-actions { width: 100%; }
  .intercom-quick-actions > button { flex: 1 1 auto; min-height: 44px; }
  .intercom-stage-note { grid-template-columns: 30px minmax(0,1fr); gap: 10px; }
  .intercom-stage-note > .icon { width: 30px; height: 30px; padding: 7px; }
  .intercom-stage-note > .status-chip { grid-column: 2; justify-self: start; }
  .intercom-class-row { margin-inline: 10px; padding: 12px; }
  .intercom-quick-state { max-width: 100%; white-space: normal; }
}

/* ===== ui16 · 样稿对齐 E2：学生名单与档案 ===== */
[data-class-work-panel="roster"] > .card { border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.class-student-overview-grid { grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 12px; padding: 20px; }
.class-student-card { min-height: 106px; gap: 10px; padding: 16px 14px; border: 1px solid #eadfcb; border-radius: 20px; box-shadow: none; }
.class-student-card:hover { border-color: #8cbaa9; background: #f1fbf5; box-shadow: none; }
.class-student-avatar { border-radius: 50%; background: #ddf6ea; font-weight: 600; }
.class-student-copy strong { font-size: 15px; font-weight: 600; }
.class-student-copy small { font-size: 12px; }
.class-student-meta b, .class-student-number, .student-profile-history time { font-family: var(--font-num); font-weight: 500; }
.class-student-meta b { font-size: 20px; }
.class-student-number { color: #6b7390; }
.class-student-attention { color: #7a2c17; background: #ffdccf; font-weight: 500; }
.class-panel-empty { border: 1px dashed #d9cbb2; border-radius: 24px; background: #fff; }
.class-panel-empty strong { font-size: 16px; }
.student-profile-history article { gap: 12px; padding-block: 12px; border-color: #f3ebdd; }
.student-profile-history strong { font-size: 14px; }
.student-profile-history b { border-radius: 12px; font-family: var(--font-num); }
@media (max-width: 760px) {
  .class-student-overview-grid { grid-template-columns: minmax(0,1fr); padding: 14px; }
  .class-student-card { min-height: 90px; }
}

/* ===== ui17 · 样稿对齐 E3：一日常规 ===== */
.routine-date-toolbar { flex-wrap: wrap; border: 0; border-radius: 24px; box-shadow: var(--chalk-shadow); }
.routine-date-toolbar input { border-color: #eadfcb; border-radius: 18px; font-family: var(--font-num); font-weight: 500; }
.routine-date-state { color: #0b4a36; background: #d5f4e6; font-weight: 500; }
.routine-date-state.history { color: #5a4700; background: #fff1b8; }
.score-summary, .routine-roster-card, .record-card, .student-score-card { border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.score-total strong, .score-dimensions b, .routine-student-index, .routine-student-score b, .student-score-table td { font-family: var(--font-num); font-weight: 500; }
.score-total strong { font-size: 30px; }
.score-dimensions > div { padding: 16px; border: 0; border-radius: 20px; background: var(--surface-soft); }
.score-dimensions strong { font-size: 14px; font-weight: 600; }
.score-dimensions b { margin-block: 10px 8px; font-size: 27px; }
.score-dimensions b.bonus { color: #0b4a36; }
.score-dimensions b.deduction { color: #a14228; }
.routine-student-tile { min-height: 108px; border-color: #eadfcb; border-radius: 20px; }
.routine-student-tile strong { font-size: 14px; font-weight: 600; }
.routine-student-index { color: #5a6280; border-radius: 50%; background: var(--surface-soft); }
.routine-student-tile.has-bonus { border-color: #a8d3bf; background: #f2fbf6; }
.routine-student-tile.has-deduction { border-color: #e9b8a7; background: #fff5ef; }
.routine-student-score b { font-size: 22px; }
.student-score-category-tabs button { border-radius: 18px; }
.student-score-category-tabs button.active { color: #fff9f0; border-color: #1f4f45; background: #1f4f45; }
.student-score-category-tabs button.active small { color: #d4e8df; }
.student-score-action { border: 0; border-radius: 20px; padding: 14px; }
.student-score-action.plus { color: #0b4a36; background: #d5f4e6; }
.student-score-action.minus { color: #5e1a08; background: #ffdccf; }
.student-score-action b { color: inherit; background: transparent; font-family: var(--font-num); font-weight: 500; }
.student-score-table th, .student-score-table td { min-width: 68px; padding: 14px 10px; border-color: #f3ebdd; }
@media (max-width: 1100px) {
  .class-work-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: "score" "record"; }
}
@media (max-width: 760px) {
  .score-dimensions { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px; gap: 10px; }
  .score-dimensions > div:last-child { grid-column: 1 / -1; }
  .score-dimensions > div { padding: 14px; }
  .routine-date-toolbar label { flex-basis: 100%; }
  .routine-date-toolbar input { width: 100%; }
  .routine-roster-grid { padding: 14px; }
  .routine-student-tile { min-height: 106px; }
}

/* ===== ui18 · 样稿对齐 E4：跟进、记录与班级资料 ===== */
[data-class-work-panel="followup"] > .card, [data-class-work-panel="records"] > .card, [data-class-work-panel="profile"] > .card { border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.class-followup-list, .class-history-list { padding: 4px 20px 20px; }
.class-followup-item { margin-top: 10px; padding: 16px; border: 1px solid #eadfcb; border-left: 4px solid #e4aa8b; border-radius: 20px; }
.class-followup-item:last-child { border-bottom: 1px solid #eadfcb; }
.class-followup-item strong { font-size: 15px; font-weight: 600; }
.class-followup-item small { font-size: 13px; }
.class-followup-item em { width: fit-content; padding: 3px 9px; border-radius: 12px; background: var(--surface-soft); }
.class-followup-item .secondary-button { min-height: 44px; }
.class-followup-icon { border-radius: 50%; color: #7a2c17; background: #ffdccf; }
.class-history-item { min-height: 80px; padding: 14px 0; border-color: #f3ebdd; }
.class-history-item time, .class-history-item > b, .class-profile-metrics strong { font-family: var(--font-num); font-weight: 500; }
.class-history-item > b { border-radius: 14px; }
.class-history-item span strong { font-size: 14px; }
.class-profile-metrics article { border: 0; border-radius: 22px; background: var(--surface-soft); }
.class-profile-match, .class-profile-roles div { border-radius: 22px; }
@media (max-width: 760px) {
  .class-followup-list, .class-history-list { padding: 4px 14px 14px; }
  .class-followup-item { padding: 14px 12px; gap: 10px; }
  .class-history-item { grid-template-columns: 58px minmax(0,1fr) 38px; gap: 8px; }
}

/* ===== ui19 · 样稿对齐 E5：日历与校历 ===== */
#dashboard-term-week, .month-switcher > strong, .calendar-date > span { font-family: var(--font-num); font-weight: 500; }
#dashboard-term-week { font-size: 23px; }
.calendar-toolbar { gap: 16px; }
.calendar-filters select { min-height: 44px; border-color: #eadfcb; border-radius: 22px; }
.school-calendar-card { padding: 18px; border: 0; border-radius: 28px; box-shadow: var(--chalk-shadow); }
.calendar-weekdays { margin-bottom: 8px; border: 0; background: #fff; font-size: 12px; font-weight: 500; }
.school-calendar-grid { gap: 7px; }
.calendar-day { min-height: 132px; border: 1px solid #eadfcb; border-radius: 16px; }
.calendar-day:nth-child(7n) { border-right: 1px solid #eadfcb; }
.calendar-day.outside { background: var(--surface-soft); }
.calendar-day.today { border-color: #619682; box-shadow: inset 0 0 0 1px #619682; }
.calendar-day.today .calendar-date > span { color: #fff9f0; background: #1f4f45; }
.calendar-event { border-radius: 10px; padding: 7px; }
.calendar-event.meeting { color: #7a2c17; background: #ffe2d6; }
.calendar-event.activity { color: #0d3b66; background: #ddefff; }
.calendar-event.safety { color: #5a4700; background: #fff1b8; }
.calendar-event.service { color: #0b4a36; background: #d5f4e6; }
.calendar-empty-state { min-height: 250px; border: 1px dashed #d9cbb2; border-radius: 22px; background: #fff; }
@media (max-width: 760px) {
  .school-calendar-card { padding: 12px; border-radius: 24px; }
  .school-calendar-grid { gap: 10px; }
  .calendar-day { min-height: 0; grid-template-columns: 40px minmax(0,1fr); border-right: 1px solid #eadfcb; padding: 12px 10px; }
  .calendar-event { min-height: 44px; font-size: 13px; }
  .calendar-empty-state { padding: 20px; }
}

/* ===== ui20 · 样稿对齐 E6：护校与值守管理抽屉 ===== */
.duty-maintenance-summary { padding: 16px; border-radius: 22px; background: var(--surface-soft); }
.duty-maintenance-summary strong { color: #5a4700; font-size: 18px; font-weight: 600; }
.duty-maintenance-toolbar { padding: 14px; border: 0; border-radius: 22px; background: var(--surface-soft); }
.duty-maintenance-toolbar input, .duty-maintenance-fields input, .duty-maintenance-fields select, .duty-template-row input { min-width: 0; border-color: #eadfcb; border-radius: 14px; font-size: 14px; }
.duty-maintenance-list { gap: 14px; }
.duty-maintenance-row { padding: 18px; border-color: #eadfcb; border-radius: 24px; box-shadow: 0 3px 0 #e1e8e4; }
.duty-maintenance-row-head strong { font-size: 16px; font-weight: 600; }
.duty-maintenance-fields { gap: 12px; }
.duty-maintenance-row.pending-delete { border-color: #ddaf9e; background: #fff0e9; box-shadow: none; }
.duty-review-filters { flex-wrap: wrap; gap: 8px; }
.duty-review-filters > button { min-height: 40px; padding-inline: 14px; border: 1px solid #eadfcb; border-radius: 20px; color: #5a6280; background: #fff; }
.duty-review-filters > button[aria-pressed="true"] { color: #fff9f0; border-color: #1f4f45; background: #1f4f45; }
.duty-template-row, .duty-review-row, .duty-template-strip { border-radius: 20px; border-color: #eadfcb; }
.duty-template-strip { background: var(--surface-soft); }
.duty-template-summary strong, .duty-maintenance-row-head small { font-family: var(--font-num); font-weight: 500; }
.duty-maintenance-footer { gap: 14px; padding: 16px 0 4px; border-color: #eadfcb; }
.duty-maintenance-footer .primary-button { min-height: 48px; }
@media (max-width: 760px) {
  .duty-maintenance-summary { padding: 14px; }
  .duty-maintenance-summary > div { grid-template-columns: minmax(0,1fr); }
  .duty-maintenance-row { padding: 14px; }
  .duty-review-filters > button { flex: 1 1 auto; min-height: 44px; }
}
/* UI21 · 校内教师和班级查询。 */
#view-teachers { min-width: 0; }
#view-teachers .page-heading h1 { color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-weight: 400; }
#view-teachers .teacher-mode-switch { gap: 12px; margin-bottom: 20px; }
#view-teachers .teacher-mode-switch button { min-width: 0; min-height: 76px; padding: 15px 18px; border: 1px solid #eadfcb; border-radius: 24px; color: #2c3654; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-teachers .teacher-mode-switch strong { font-size: 15px; }
#view-teachers .teacher-mode-switch small { color: #5a6280; line-height: 1.5; }
#view-teachers .teacher-mode-switch button.active { color: #fff; border-color: #1f4f45; background: #1f4f45; box-shadow: 0 4px 0 #d9e5d9; }
#view-teachers .teacher-mode-switch button.active small { color: #e1f0e9; }
#view-teachers .teacher-mode-switch button:not(.active):hover { background: var(--surface-hover); border-color: #dfd09e; }
#view-teachers .teacher-data-note { padding: 14px 18px; border: 0; border-radius: 22px; color: #0b4a36; background: #ddf6ea; }
#view-teachers .teacher-data-note small { color: #315f50; }
#view-teachers .teacher-search-panel { gap: 18px; margin-bottom: 22px; padding: 24px; border: 0; border-radius: 28px; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-teachers .teacher-query-field > span:first-child { margin-bottom: 8px; color: #5a6280; font-size: 13px; }
#view-teachers .large-search { min-width: 0; min-height: 54px; gap: 12px; padding-inline: 18px; border-color: #e3d7c2; border-radius: 27px; background: var(--surface-soft); }
#view-teachers .large-search input { min-width: 0; min-height: 50px; font-size: 16px; }
#view-teachers .teacher-search-helper { margin-top: 4px; line-height: 1.6; }
#view-teachers .filter-field { min-width: 0; padding: 8px 12px; border-color: #e3d7c2; border-radius: 16px; }
#view-teachers .filter-field :is(input, select) { min-width: 0; min-height: 44px; padding-inline: 0; font-size: 16px; }
#view-teachers .result-heading { align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
#view-teachers .result-heading strong { font-size: 16px; }
#view-teachers .teacher-grid { gap: 20px; }
#view-teachers .teacher-card { min-width: 0; padding: 22px; border: 0; border-radius: 28px; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-teachers .teacher-card-head { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; }
#view-teachers .directory-card .teacher-card-head { grid-template-columns: 52px minmax(0, 1fr); }
#view-teachers .teacher-avatar { width: 52px; height: 52px; border-radius: 19px; color: #0b4a36; background: #d5f4e6; font-size: 20px; }
#view-teachers .class-avatar { color: #4e3f86; background: #efeaf8; }
#view-teachers .teacher-card-head strong { overflow-wrap: anywhere; font-size: 18px; }
#view-teachers .teacher-card-head small { margin-top: 4px; line-height: 1.5; }
#view-teachers .availability { justify-content: center; min-height: 32px; padding: 6px 10px; border-radius: 18px; white-space: normal; }
#view-teachers .availability.free { color: #0b4a36; background: #ddf6ea; }
#view-teachers .availability.flexible, #view-teachers .availability.unknown { color: #5a4700; background: #fff1b8; }
#view-teachers .availability.busy { color: #5a6280; background: var(--surface-muted); }
#view-teachers .availability.scheduled { color: #0d3b66; background: #ddefff; }
#view-teachers .teacher-facts { margin-block: 20px; gap: 10px; border: 0; border-radius: 0; background: transparent; }
#view-teachers .teacher-facts span { padding: 12px 14px; border-radius: 18px; background: var(--surface-soft); }
#view-teachers .teacher-facts strong { font-family: var(--font-num, "Fredoka"), sans-serif; font-size: 21px; font-weight: 500; }
#view-teachers .directory-summary-row, #view-teachers .teacher-slot { min-width: 0; padding: 13px 14px; border-radius: 18px; background: var(--surface-soft); }
#view-teachers .teacher-slot > span { min-width: 0; overflow-wrap: anywhere; }
#view-teachers .teacher-slot b { flex-shrink: 0; color: #0b4a36; }
#view-teachers .teacher-card-actions { gap: 10px; margin-top: 18px; }
#view-teachers .teacher-card-actions button, #view-teachers .teacher-load-more { min-height: 46px; padding: 10px 16px; border-radius: 24px; font-size: 14px; }
#view-teachers .teacher-card-actions .view { color: #1f4f45; border-color: #e3d7c2; background: #fff; }
#view-teachers .teacher-card-actions button:disabled { color: #646b87; border-color: #eadfcb; background: var(--surface-muted); cursor: not-allowed; }
#view-teachers .teacher-load-more { max-width: 100%; margin-top: 24px; border-color: #e3d7c2; }
#view-teachers .no-results { grid-column: 1 / -1; padding: 36px 24px; border: 2px dashed #e3d7c2; border-radius: 28px; background: #fff; }
@media (max-width: 1180px) { #view-teachers .teacher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  #view-teachers .teacher-mode-switch { grid-template-columns: 1fr; gap: 10px; }
  #view-teachers .teacher-mode-switch button { min-height: 66px; }
  #view-teachers .teacher-grid{ grid-template-columns: minmax(0, 1fr); }
  #view-teachers .teacher-search-panel, #view-teachers .teacher-card { padding: 20px; }
}

/* UI22 · 资料库。保留实际资料服务、导入来源和个人加密备份边界。 */
#view-library { min-width: 0; }
#view-library :is(.page-heading h1, .card-header h2, .library-next-card h2) { color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-weight: 400; }
#view-library .card-header h2, #view-library .library-next-card h2 { font-size: 24px; line-height: 1.35; }
#view-library .card { min-width: 0; border: 0; border-radius: 28px; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-library .library-local-notice { gap: 16px; margin-bottom: 22px; padding: 22px 24px; border: 0; border-radius: 26px; color: #0b4a36; background: #ddf6ea; }
#view-library .library-local-notice > .icon { width: 42px; height: 42px; color: #0b4a36; border-radius: 16px; background: #fff; }
#view-library .library-local-notice small { color: #315f50; font-size: 13px; line-height: 1.65; }
#view-library .library-data-policy, #view-library .library-import-hub { margin-bottom: 22px; padding: 24px; }
#view-library .library-policy-grid { gap: 14px; }
#view-library .library-policy-grid > div { padding: 18px; border: 0; border-radius: 20px; background: var(--surface-soft); }
#view-library .library-policy-grid > div:first-child { background: #ddf6ea; }
#view-library .library-policy-grid strong { color: #2c3654; font-size: 15px; }
#view-library .library-policy-grid p, #view-library .library-policy-footnote { font-size: 13px; line-height: 1.7; }
#view-library .library-import-choice-grid { gap: 14px; margin-top: 20px; }
#view-library .library-import-choice-grid > button { min-width: 0; min-height: 96px; gap: 14px; padding: 18px; border: 1px solid #eadfcb; border-radius: 22px; background: var(--surface-soft); }
#view-library .library-import-choice-grid > button:hover { border-color: #b5d3c5; background: #ddf6ea; transform: none; }
#view-library .library-import-choice-grid > button > .icon { color: #1f4f45; border-radius: 14px; background: #fff; }
#view-library .library-import-choice-grid strong { font-size: 15px; }
#view-library .library-import-choice-grid small { margin-top: 5px; color: #5a6280; line-height: 1.55; overflow-wrap: anywhere; }
#view-library .library-metric-grid { gap: 16px; margin-bottom: 24px; }
#view-library .library-metric-grid article { min-width: 0; min-height: 112px; padding: 22px; border: 0; border-radius: 26px; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-library .library-metric-grid article > .icon { width: 44px; height: 44px; padding: 11px; border-radius: 16px; color: #0d3b66; background: #ddefff; }
#view-library .library-metric-grid article:nth-child(2) > .icon { color: #0b4a36; background: #ddf6ea; }
#view-library .library-metric-grid article:nth-child(3) > .icon { color: #4e3f86; background: #efeaf8; }
#view-library .library-metric-grid article:nth-child(4) > .icon { color: #5a4700; background: #fff1b8; }
#view-library .library-metric-grid strong { font-family: var(--font-num, "Fredoka"), sans-serif; font-size: 32px; font-weight: 500; }
#view-library .library-layout { grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 24px; margin-bottom: 24px; }
#view-library .library-sources > .card-header, #view-library .library-account-card > .card-header, #view-library .library-relations > .card-header { padding: 22px 24px; }
#view-library .library-source-card { min-width: 0; min-height: 94px; gap: 14px; padding: 18px 24px; border-color: #f3ebdd; }
#view-library .library-source-card.is-empty { background: var(--surface-soft); }
#view-library .library-source-icon { width: 40px; height: 40px; border-radius: 15px; color: #1f4f45; background: #ddf6ea; }
#view-library .library-source-card > span:nth-child(2) { min-width: 0; }
#view-library .library-source-card strong { font-size: 15px; }
#view-library .library-source-card :is(small, button) { font-size: 13px; }
#view-library .library-side-stack { gap: 24px; min-width: 0; }
#view-library .library-owner { margin-inline: 24px; padding-block: 6px 18px; }
#view-library .library-owner .account-avatar { border-radius: 18px; color: #4e3f86; background: #efeaf8; }
#view-library .library-storage-facts { padding: 0 24px 20px; }
#view-library .library-storage-facts > div { gap: 14px; padding-block: 13px; border-color: #f3ebdd; }
#view-library .library-storage-facts dd { min-width: 0; overflow-wrap: anywhere; }
#view-library .library-next-card { grid-template-columns: 42px minmax(0, 1fr); gap: 14px; padding: 24px; border: 0; border-radius: 28px; color: #2c3654; background: var(--surface-soft); box-shadow: 0 4px 0 #e1e8e4; }
#view-library .library-step { border-radius: 16px; color: #5a4700; background: #fff; font-family: var(--font-num, "Fredoka"), sans-serif; }
#view-library .library-next-card h2 { color: #5a4700; }
#view-library .library-next-card p { color: #655329; font-size: 13px; line-height: 1.7; }
#view-library .library-import-actions { flex-wrap: wrap; gap: 10px; margin-top: 18px; }
#view-library :is(.primary-button, .secondary-button) { min-height: 44px; padding: 10px 16px; border-radius: 24px; white-space: normal; }
#view-library .relationship-flow { padding: 24px; border-color: #f3ebdd; }
#view-library .relationship-flow article { min-width: 0; padding: 18px; border: 0; border-radius: 20px; background: var(--surface-soft); }
#view-library .relationship-flow strong { font-size: 14px; }
#view-library .relationship-status-list { gap: 14px; padding: 24px; }
#view-library .relationship-status { min-width: 0; padding: 16px; border-color: #eadfcb; border-radius: 20px; }
#view-library .relationship-status > span { min-width: 0; overflow-wrap: anywhere; }
#view-library .relationship-status b { font-family: var(--font-num, "Fredoka"), sans-serif; font-size: 20px; font-weight: 500; }
@media (max-width: 1180px) {
  #view-library .library-layout { grid-template-columns: minmax(0, 1fr); }
  #view-library .library-import-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-library .library-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #view-library .library-local-notice { grid-template-columns: 42px minmax(0, 1fr); padding: 20px; }
  #view-library .library-local-notice > .status-chip { grid-column: 2; justify-self: start; }
  #view-library .library-policy-grid, #view-library .library-import-choice-grid, #view-library .relationship-flow, #view-library .relationship-status-list { grid-template-columns: minmax(0, 1fr); }
  #view-library .library-data-policy, #view-library .library-import-hub, #view-library .library-next-card, #view-library .relationship-flow, #view-library .relationship-status-list { padding: 20px; }
  #view-library .library-metric-grid { gap: 12px; }
  #view-library .library-metric-grid article { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; }
  #view-library .library-source-card { grid-template-columns: 40px minmax(0, 1fr); padding: 18px 20px; }
  #view-library .library-source-card > button { grid-column: 2; justify-self: start; max-width: 100%; }
  #view-library .card-header { flex-wrap: wrap; gap: 12px; }
  #view-library .library-next-card { grid-template-columns: minmax(0, 1fr); }
  #view-library .library-import-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  #view-library .relationship-arrow { transform: rotate(90deg); }
}

/* UI23 · 我。沿用现有六个入口，不添加参考稿中不存在的统计与设置功能。 */
#view-me { min-width: 0; }
#view-me .page-heading h1 { color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-weight: 400; }
#view-me .me-profile-card { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 24px; margin-bottom: 28px; padding: 32px; border: 0; border-radius: 28px; color: #2c3654; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-me .me-avatar { width: 76px; height: 76px; border-radius: 25px; color: #0b4a36; background: #d5f4e6; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 30px; font-weight: 400; }
#view-me .me-profile-copy strong { margin-top: 4px; color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 32px; font-weight: 400; overflow-wrap: anywhere; }
#view-me .me-profile-copy small, #view-me .me-profile-copy > span { color: #5a6280; font-size: 14px; }
#view-me .me-profile-card .secondary-button { min-height: 48px; padding: 10px 20px; color: #1f4f45; border-color: #e3d7c2; border-radius: 25px; background: #fff; }
#view-me .me-link-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
#view-me .me-link-card { min-width: 0; min-height: 154px; grid-template-columns: 52px minmax(0, 1fr) 20px; gap: 15px; padding: 24px; border: 0; border-radius: 28px; color: #2c3654; background: #fff; box-shadow: 0 4px 0 #e1e8e4; }
#view-me button.me-link-card:hover { background: var(--surface-soft); }
#view-me .me-link-icon { width: 52px; height: 52px; padding: 14px; color: #0b4a36; border-radius: 19px; background: #ddf6ea; }
#view-me .me-link-card[data-route-target="intercom"] .me-link-icon { color: #0d3b66; background: #ddefff; }
#view-me .me-link-card[data-route-target="library"] .me-link-icon { color: #5a4700; background: #fff1b8; }
#view-me .me-link-card[data-action="settings"] .me-link-icon { color: #7a2c17; background: #ffe2d6; }
#view-me .me-link-card[data-open-assistant] .me-link-icon { color: #4e3f86; background: #efeaf8; }
#view-me .me-link-card > span { min-width: 0; }
#view-me .me-link-card strong { color: #1f4f45; font-family: inherit; font-size: 18px; font-weight: 600; }
#view-me .me-link-card small { margin-top: 7px; color: #5a6280; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
#view-me .me-link-arrow { width: 20px; height: 20px; color: #6b7390; }
#view-me .me-privacy-card { grid-template-columns: 52px minmax(0, 1fr); background: #ddf6ea; }
#view-me .me-privacy-card .me-link-icon { color: #0b4a36; background: #fff; }
#view-me .me-privacy-card small { color: #315f50; }
#view-me .me-privacy-card .status-chip { grid-column: 2; justify-self: start; color: #0b4a36; background: #fff; }
@media (max-width: 1180px) { #view-me .me-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  #view-me .me-profile-card { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 24px; }
  #view-me .me-avatar { width: 64px; height: 64px; border-radius: 22px; }
  #view-me .me-profile-copy strong { font-size: 28px; }
  #view-me .me-profile-card .secondary-button { grid-column: 1 / -1; width: 100%; margin-top: 4px; }
  #view-me .me-link-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #view-me .me-link-card { min-height: 124px; padding: 22px; }
}

/* UI24 · 设备/通道管理抽屉及现有配对面板。没有独立 devices 路由。 */
#intercom-access-workspace { min-width: 0; color: #2c3654; }
#intercom-access-workspace .intercom-access-intro { padding: 22px; border: 0; border-radius: 24px; color: #0b4a36; background: #ddf6ea; }
#intercom-access-workspace .intercom-access-intro > strong { font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 28px; font-weight: 400; }
#intercom-access-workspace .intercom-access-intro p { margin-top: 8px; color: #315f50; font-size: 14px; line-height: 1.7; }
#intercom-access-workspace .intercom-access-section { min-width: 0; padding: 22px; border: 1px solid #eadfcb; border-radius: 26px; background: #fff; }
#intercom-access-workspace .intercom-access-section-heading { align-items: flex-start; gap: 16px; margin-bottom: 14px; }
#intercom-access-workspace .intercom-access-section-heading > div { min-width: 0; }
#intercom-access-workspace h3 { color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 25px; font-weight: 400; }
#intercom-access-workspace .intercom-access-section-heading p { margin-top: 7px; color: #5a6280; font-size: 13px; line-height: 1.65; }
#intercom-access-workspace .intercom-access-device-list { gap: 12px; }
#intercom-access-workspace .intercom-access-device-list > li { min-width: 0; gap: 14px; padding: 18px; border: 0; border-radius: 20px; background: var(--surface-soft); }
#intercom-access-workspace .intercom-access-device-list > li > span { min-width: 0; overflow-wrap: anywhere; }
#intercom-access-workspace .intercom-access-device-list strong { color: #1f4f45; font-size: 16px; }
#intercom-access-workspace .intercom-access-device-list small { margin-top: 5px; color: #5a6280; line-height: 1.6; }
#intercom-access-workspace :is(button.secondary-button, button.text-link) { min-width: 44px; min-height: 44px; padding: 10px 16px; border-radius: 24px; font-size: 13px; }
#intercom-access-workspace button.secondary-button { color: #1f4f45; border-color: #e3d7c2; background: #fff; }
#intercom-access-workspace button[data-intercom-pair] { flex-shrink: 0; color: #fff; border-color: #1f4f45; background: #1f4f45; }
#intercom-access-workspace :is(button[data-intercom-device-unbind], button[data-intercom-grant-revoke]) { flex-shrink: 0; color: #7a2c17; background: #ffe2d6; }
#intercom-access-workspace .intercom-access-empty { padding: 24px; border: 2px dashed #e3d7c2; border-radius: 22px; color: #5a6280; background: #fff; line-height: 1.65; }
#intercom-access-workspace .intercom-access-search { margin-block: 18px; }
#intercom-access-workspace .intercom-access-search input { width: 100%; min-width: 0; min-height: 48px; padding: 11px 16px; border-color: #e3d7c2; border-radius: 24px; background: var(--surface-soft); font-size: 16px; }
#intercom-access-workspace .intercom-access-teacher { gap: 14px; padding-block: 18px; border-color: #f3ebdd; }
#intercom-access-workspace .intercom-access-teacher-copy { min-width: 0; overflow-wrap: anywhere; }
#intercom-access-workspace .intercom-access-rights { min-width: 0; gap: 8px; }
#intercom-access-workspace .intercom-access-right { max-width: 100%; padding: 6px 10px; border-radius: 18px; background: #ddf6ea; color: #0b4a36; }
#intercom-access-workspace .intercom-access-right-label { white-space: normal; overflow-wrap: anywhere; }
#intercom-access-workspace .intercom-access-notice { padding: 16px 18px; border: 0; border-radius: 20px; color: #0b4a36; background: #ddf6ea; }
#intercom-access-workspace .intercom-access-confirm { padding: 22px; border: 1px solid #f0bca9; border-radius: 24px; color: #7a2c17; background: #ffe2d6; }
#intercom-access-workspace .intercom-access-confirm p { color: #7a2c17; line-height: 1.7; }
#intercom-access-workspace .intercom-access-confirm .drawer-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#intercom-access-workspace button.intercom-access-danger { color: #fff; border-color: #b23a22; background: #b23a22; }
#intercom-access-workspace button:disabled { opacity: .6; cursor: not-allowed; }
#detail-drawer .intercom-pairing { gap: 16px; padding: 22px; border: 0; border-radius: 24px; color: #0d3b66; background: #ddefff; }
#detail-drawer .intercom-pairing p, #detail-drawer .intercom-pairing small { color: #365c7b; line-height: 1.65; }
#detail-drawer .intercom-pairing-form { gap: 18px; }
#detail-drawer .intercom-pair-target { padding: 18px; border: 0; border-radius: 22px; background: #ddf6ea; }
#detail-drawer .intercom-first-claim { padding: 18px; border-color: #e3d39d; border-radius: 22px; color: #5a4700; background: #fff1b8; }
#detail-drawer #intercom-pair-code { width: 100%; min-width: 0; min-height: 58px; border-color: #e3d7c2; border-radius: 20px; font-family: var(--font-num, "Fredoka"), sans-serif; font-size: 28px; letter-spacing: .12em; }
#detail-drawer .intercom-pair-code { padding: 24px 16px; border: 2px dashed #9dc4b4; border-radius: 24px; color: #0b4a36; background: #ddf6ea; font-family: var(--font-num, "Fredoka"), sans-serif; overflow-wrap: anywhere; }
#detail-drawer .intercom-pairing-result, #detail-drawer .intercom-pairing-wait { padding: 18px; border-radius: 22px; background: #ddf6ea; }
#detail-drawer .intercom-pairing-wait { color: #5a4700; background: #fff1b8; }
#detail-drawer .intercom-pair-steps { padding-left: 24px; color: #5a6280; font-size: 14px; line-height: 1.7; }
#detail-drawer .intercom-pairing-form :is(button, a.secondary-button) { min-height: 44px; border-radius: 24px; }
@media (max-width: 760px) {
  #intercom-access-workspace .intercom-access-section { padding: 18px; }
  #intercom-access-workspace .intercom-access-section-heading { flex-direction: column; }
  #intercom-access-workspace button[data-intercom-pair] { width: 100%; }
  #intercom-access-workspace .intercom-access-device-list > li { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
  #intercom-access-workspace .intercom-access-teacher { flex-direction: column; align-items: flex-start; }
  #intercom-access-workspace .intercom-access-rights { width: 100%; justify-content: flex-start; }
  #intercom-access-workspace .intercom-access-confirm .drawer-actions { grid-template-columns: minmax(0, 1fr); }
}

/* UI25 · 发给助理。仅呈现现有 intake / consent / result / continue，不改写入边界。 */
#detail-drawer .assistant-intro { gap: 16px; padding: 24px; border: 0; border-radius: 26px; color: #4e3f86; background: #efeaf8; }
#detail-drawer .assistant-intro > .icon { width: 44px; height: 44px; padding: 11px; border-radius: 16px; color: #4e3f86; background: #fff; }
#detail-drawer .assistant-intro strong { font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 26px; font-weight: 400; line-height: 1.4; }
#detail-drawer .assistant-intro p { margin-top: 8px; color: #605386; font-size: 14px; line-height: 1.7; }
#detail-drawer .assistant-source { gap: 18px; min-width: 0; }
#detail-drawer .assistant-source > small { margin-bottom: 0; color: #5a6280; font-size: 14px; letter-spacing: 0; }
#detail-drawer .assistant-upload { min-width: 0; min-height: 126px; gap: 16px; padding: 24px; border: 2px dashed #d3c3af; border-radius: 26px; color: #1f4f45; background: var(--surface-soft); }
#detail-drawer .assistant-upload:hover, #detail-drawer .assistant-upload:focus-within { border-color: #1f4f45; background: #ddf6ea; }
#detail-drawer .assistant-upload > .icon { width: 44px; height: 44px; padding: 11px; border-radius: 16px; color: #5a4700; background: #fff1b8; }
#detail-drawer .assistant-upload > span { min-width: 0; }
#detail-drawer .assistant-upload strong { font-size: 17px; }
#detail-drawer .assistant-upload small { margin-top: 6px; color: #5a6280; line-height: 1.65; overflow-wrap: anywhere; }
#detail-drawer .assistant-upload.has-file { border-style: solid; border-color: #92b8a7; background: #f0faf5; }
#detail-drawer .assistant-upload.has-file strong { overflow-wrap: anywhere; }
#detail-drawer .assistant-file-feedback { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: -6px; padding: 14px 16px; border-radius: 16px; color: #1f4f45; background: #ddf6ea; }
#detail-drawer .assistant-file-feedback[hidden] { display: none; }
#detail-drawer .assistant-file-feedback strong, #detail-drawer .assistant-file-feedback small { display: block; }
#detail-drawer .assistant-file-feedback small { margin-top: 4px; color: #315f50; font-size: 13px; line-height: 1.6; }
#detail-drawer .assistant-file-feedback button { min-height: 44px; white-space: nowrap; }
#detail-drawer .assistant-file-feedback[data-stage="error"] { color: #7a2c17; background: #ffe2d6; }
#detail-drawer .assistant-file-feedback[data-stage="error"] small { color: #7a2c17; }
.calendar-import-destination { margin: 0 28px 20px; padding: 16px; border-radius: 16px; background: #eef8f2; color: #1f4f45; }
.calendar-import-destination p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
#calendar-selected-summary { display: block; margin-top: 6px; color: #1f4f45; }
@media (max-width: 760px) {
  #detail-drawer .assistant-file-feedback { grid-template-columns: 24px minmax(0, 1fr); }
  #detail-drawer .assistant-file-feedback button { grid-column: 2; justify-self: start; }
  .calendar-import-destination { margin-inline: 16px; }
}
#detail-drawer .assistant-or { color: #6b7390; font-size: 13px; }
#detail-drawer .assistant-source .form-field > span, #detail-drawer .assistant-result .form-field > span { color: #2c3654; font-size: 14px; }
#detail-drawer #assistant-intake-text { min-width: 0; min-height: 176px; padding: 18px; border-color: #e3d7c2; border-radius: 22px; color: #2c3654; background: #fff; font-size: 16px; line-height: 1.65; resize: vertical; }
#detail-drawer .assistant-examples { gap: 10px; }
#detail-drawer .assistant-examples button { min-height: 44px; padding: 10px 15px; border-color: #e3d7c2; border-radius: 24px; color: #5a6280; background: #fff; font-size: 13px; }
#detail-drawer .assistant-examples button:hover { color: #1f4f45; border-color: #9fc0b3; background: #ddf6ea; }
#detail-drawer .assistant-model-control { gap: 16px; padding: 20px; border: 1px solid #eadfcb; border-radius: 24px; background: var(--surface-soft); }
#detail-drawer .assistant-cloud-consent { gap: 12px; min-height: 44px; cursor: pointer; }
#detail-drawer .assistant-cloud-consent input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 3px; accent-color: #1f4f45; }
#detail-drawer .assistant-cloud-consent > span, #detail-drawer .assistant-local-mode > span { min-width: 0; }
#detail-drawer .assistant-cloud-consent strong, #detail-drawer .assistant-local-mode strong { color: #1f4f45; font-size: 15px; }
#detail-drawer .assistant-cloud-consent small, #detail-drawer .assistant-local-mode small { color: #5a6280; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#detail-drawer :is(#assistant-model, #assistant-kind) { width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px; border-color: #e3d7c2; border-radius: 18px; color: #2c3654; background: #fff; font-size: 16px; }
#detail-drawer #assistant-model:disabled { color: #646b87; background: var(--surface-muted); cursor: not-allowed; }
#detail-drawer :is(#assistant-analyze, #assistant-continue) { min-height: 50px; padding: 12px 20px; border-radius: 26px; color: #fff; border-color: #1f4f45; background: #1f4f45; font-size: 15px; }
#detail-drawer :is(#assistant-analyze, #assistant-continue):disabled { color: #646b87; border-color: #eadfcb; background: var(--surface-muted); cursor: not-allowed; }
#detail-drawer .assistant-processing { padding: 16px 18px; border-radius: 20px; color: #5a4700; background: #fff1b8; line-height: 1.65; }
#detail-drawer .assistant-result { gap: 18px; min-width: 0; padding: 24px; border: 1px solid #b5d3c5; border-radius: 28px; color: #2c3654; background: #fff; }
#detail-drawer .assistant-result-heading { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; }
#detail-drawer .assistant-result-heading strong { color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 25px; font-weight: 400; }
#detail-drawer .assistant-confidence { min-height: 32px; padding: 6px 12px; border-radius: 18px; font-size: 12px; white-space: normal; }
#detail-drawer .assistant-confidence.high { color: #0b4a36; background: #ddf6ea; }
#detail-drawer .assistant-confidence.medium { color: #5a4700; background: #fff1b8; }
#detail-drawer .assistant-confidence.low { color: #7a2c17; background: #ffe2d6; }
#detail-drawer .assistant-evidence { gap: 8px; }
#detail-drawer .assistant-evidence > span { max-width: 100%; padding: 7px 12px; border: 0; border-radius: 17px; background: var(--surface-soft); overflow-wrap: anywhere; }
#detail-drawer .assistant-write-boundary, #detail-drawer .assistant-local-note { gap: 12px; padding: 18px; border: 0; border-radius: 22px; color: #0b4a36; background: #ddf6ea; }
#detail-drawer .assistant-write-boundary small, #detail-drawer .assistant-local-note small { color: #315f50; font-size: 13px; line-height: 1.65; }
#detail-drawer .assistant-visual-summary { gap: 10px; }
#detail-drawer .assistant-visual-summary > span { min-width: 0; border-radius: 18px; background: var(--surface-soft); }
#detail-drawer .assistant-vision-warnings, #detail-drawer .assistant-matrix-audit { padding: 16px; border-radius: 20px; overflow-wrap: anywhere; }
#detail-drawer .assistant-matrix-audit.blocked { color: #7a2c17; background: #ffe2d6; }
#detail-drawer .assistant-matrix-audit.ready { color: #0b4a36; background: #ddf6ea; }
#detail-drawer #assistant-intake-error { padding: 14px 18px; border-radius: 20px; color: #7a2c17; background: #ffe2d6; }
@media (max-width: 760px) {
  #detail-drawer .assistant-intro, #detail-drawer .assistant-result { padding: 20px; }
  #detail-drawer .assistant-upload { padding: 20px; }
  #detail-drawer .assistant-result-heading { grid-template-columns: 44px minmax(0, 1fr); }
  #detail-drawer .assistant-confidence { grid-column: 2; justify-self: start; }
  #detail-drawer .assistant-examples { display: grid; grid-template-columns: minmax(0, 1fr); }
  #detail-drawer .assistant-visual-summary { grid-template-columns: minmax(0, 1fr); }
}

/* UI26 · 登录/注册/改密。只美化真实 auth-card，不伪造品牌侧栏、忘记密码或安全声明。 */
#auth-panel { min-height: 100dvh; padding: 48px 24px; background-color: var(--background); background-image: none; background-size: 18px 18px; }
#auth-panel .auth-card { width: min(100%, 520px); padding: 40px; border: 0; border-radius: 32px; color: #2c3654; background: #fff; box-shadow: 0 6px 0 #e1e8e4; }
#auth-panel .auth-card > .eyebrow { margin-bottom: 24px; color: #1f4f45; font-size: 14px; letter-spacing: .02em; }
#auth-panel .auth-card h1 { margin: 0; color: #1f4f45; font-family: var(--font-fun, "ZCOOL KuaiLe"), sans-serif; font-size: 38px; font-weight: 400; line-height: 1.25; letter-spacing: 0; }
#auth-panel .auth-card form { gap: 22px; min-width: 0; }
#auth-panel .auth-card form > p { margin: 0; color: #5a6280; font-size: 14px; line-height: 1.7; }
#auth-panel .auth-card form > label { min-width: 0; color: #2c3654; font-size: 14px; }
#auth-panel .auth-card form > label > span:first-child { display: block; margin-bottom: 8px; }
#auth-panel .auth-card input:not([type="checkbox"]) { width: 100%; min-width: 0; min-height: 52px; padding: 12px 17px; color: #2c3654; border: 1px solid #e3d7c2; border-radius: 26px; background: var(--surface-soft); font-size: 16px; }
#auth-panel .auth-card input::placeholder { color: #6b7390; opacity: 1; }
#auth-panel .auth-card .password-input { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 56px; gap: 10px; }
#auth-panel .password-input button { min-width: 44px; min-height: 52px; padding: 8px; color: #1f4f45; border: 1px solid #e3d7c2; border-radius: 26px; background: #fff; }
#auth-panel .password-input button:hover { background: #ddf6ea; }
#auth-panel .remember-device-option { gap: 12px; min-height: 44px; padding: 16px; border-radius: 22px; background: #ddf6ea; }
#auth-panel .remember-device-option input { width: 20px; min-width: 20px; height: 20px; margin-top: 2px; accent-color: #1f4f45; }
#auth-panel .remember-device-option strong { color: #0b4a36; font-size: 14px; }
#auth-panel .remember-device-option small { margin-top: 4px; color: #315f50; font-size: 12px; line-height: 1.6; }
#auth-panel .auth-card :is(.primary-button, .secondary-button) { min-height: 52px; padding: 12px 20px; border-radius: 27px; font-size: 16px; }
#auth-panel .auth-card .primary-button { color: #fff; border-color: #1f4f45; background: #1f4f45; }
#auth-panel .auth-card .secondary-button { color: #1f4f45; border-color: #e3d7c2; background: #fff; }
#auth-panel .auth-card .text-link { min-height: 44px; padding: 10px 12px; border-radius: 22px; color: #1f4f45; font-size: 14px; text-underline-offset: 4px; }
#auth-panel .auth-card .text-link:hover { background: var(--surface-soft); }
#auth-panel .auth-card button:disabled { opacity: .55; cursor: not-allowed; }
#auth-panel .auth-helper { padding-top: 2px; color: #5a6280; overflow-wrap: anywhere; }
#auth-panel #auth-error { margin-block: 16px 0; font-size: 14px; line-height: 1.65; }
#auth-panel #auth-error:not(:empty) { padding: 14px 16px; border-radius: 20px; color: #7a2c17; background: #ffe2d6; }
#auth-panel #auth-error[data-tone="success"]:not(:empty) { color: #0b4a36; background: #ddf6ea; }
#auth-panel #local-service-link { min-height: 44px; align-items: center; padding: 10px 12px; color: #1f4f45; overflow-wrap: anywhere; }
#auth-panel .auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
#auth-panel .auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
#auth-panel .auth-code-row .form-field { min-width: 0; margin: 0; }
#auth-panel .auth-code-row .form-field > span { display: block; margin-bottom: 8px; }
#auth-panel .auth-code-row .secondary-button { white-space: nowrap; padding-inline: 16px; font-size: 14px; }
#auth-panel .auth-card .auth-code-status { margin-top: -12px; font-size: 13px; overflow-wrap: anywhere; }
#auth-panel .auth-code-status:empty { display: none; }
#auth-panel .auth-card .auth-availability { padding: 12px 16px; border-radius: 16px; background: var(--surface-soft); }
#auth-panel .auth-card .form-field small { margin-top: 6px; color: #5a6280; font-size: 12px; line-height: 1.6; }
#auth-panel [autocomplete="one-time-code"] { letter-spacing: .12em; }
@media (max-width: 480px) {
  #auth-panel { padding: 28px 16px; align-items: center; }
  #auth-panel .auth-card { padding: 28px 22px; border-radius: 28px; }
  #auth-panel .auth-card h1 { font-size: 32px; }
  #auth-panel .auth-card > .eyebrow { margin-bottom: 20px; font-size: 13px; }
  #auth-panel .auth-card form { gap: 20px; }
  #auth-panel .auth-card .password-input { gap: 8px; grid-template-columns: minmax(0, 1fr) 52px; }
}

/* UI30 · 验收修正：导航独立滚动，助理与账号留在底部；手机恢复真实抽屉入口。 */
.sidebar { overflow: hidden; }
.sidebar .brand, .sidebar-personal-nav, .sidebar-footer { flex: 0 0 auto; }
.sidebar-nav { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c6d4cc transparent; }
.sidebar-personal-nav { margin-top: 0; }
.sidebar-close { display: none; }
@media (max-width: 760px) {
  body.sidebar-open { overflow: hidden; }
  .menu-button { display: inline-flex; flex: 0 0 44px; border-color: #eadfcb; border-radius: 22px; }
  .sidebar { inset: 10px auto 10px 10px; width: min(320px, calc(100vw - 40px)); height: calc(100dvh - 20px); border: 0; border-radius: 28px; background: #fff; box-shadow: var(--chalk-shadow); }
  .sidebar.open { display: flex; }
  .sidebar .brand { min-height: 78px; gap: 9px; padding: 14px 12px 14px 16px; }
  .sidebar .brand-mark { flex: 0 0 36px; }
  .sidebar .brand > div:nth-child(2) { min-width: 0; flex: 1; }
  .sidebar .brand strong { font-size: 20px; white-space: nowrap; }
  .sidebar .brand small { font-size: 10px; }
  .sidebar-close { display: inline-flex; flex: 0 0 44px; border-color: #eadfcb; border-radius: 22px; }
  .sidebar-footer .sync-status { padding: 8px 4px; line-height: 1.5; }
}

/* UI50 · PDF 26–27 桌面密度校正：保留所有工具，手机沿用已有布局。 */
@media screen and (min-width: 1101px) {
  #view-class-work > .class-heading { margin-bottom: 8px; }
  #view-class-work > .class-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
  #view-class-work > .class-heading .eyebrow { flex-basis: 100%; margin: 0; }
  #view-class-work > .class-heading h1, #view-class-work > .class-heading h1 + p { margin: 0; }
  #view-class-work > .class-context-bar { margin-bottom: 8px; padding: 0; background: transparent; box-shadow: none; }
  #view-class-work > .class-context-bar .class-context-relation > span:last-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
  #view-class-work > .class-context-bar .class-context-relation strong { margin: 0; }
  #view-class-work > .class-tabs { margin: 8px 0 12px; }

  /* 视图切换、学科筛选与批次数共用一行；内容多时自然换行，不藏功能。 */
  #view-class-work .class-homework-card { display: grid; grid-template-columns: max-content minmax(0, 1fr); }
  #view-class-work .class-homework-card > .homework-header { grid-column: 1 / -1; min-height: 60px; padding: 8px 18px; }
  #view-class-work .class-homework-card > .homework-view-switch { align-items: center; padding: 4px 12px; }
  #view-class-work .class-homework-card > .homework-view-switch button { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  #view-class-work .class-homework-card > .homework-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-width: 0; padding: 4px 18px 4px 8px; }
  #view-class-work .class-homework-card > .homework-toolbar > .homework-subject-filters { flex: 1 1 auto; }
  #view-class-work .class-homework-card > .homework-toolbar > .status-chip { margin-left: auto; }
  #view-class-work .class-homework-card > .homework-layout, #view-class-work .class-homework-card > .homework-report { grid-column: 1 / -1; }
  #view-class-work .class-homework-card > .homework-layout { gap: 16px; padding: 12px; }
  #view-class-work #homework-gradebook { gap: 12px; padding: 18px 20px; }
  #view-class-work #homework-gradebook .gb-head h3 { font-family: inherit; font-size: 19px; font-weight: 600; line-height: 1.4; }

  /* 源稿是 58px 基准行；保留真实班级与起止时间，长内容／同格多事项可增高。 */
  #view-schedule > .page-heading { margin-bottom: 10px; }
  #view-schedule > .teacher-review-note { margin-bottom: 8px; padding: 6px 12px; font-size: 12px; line-height: 1.5; }
  #view-schedule > .schedule-toolbar { margin-bottom: 10px; }
  #view-schedule > .schedule-board-card { padding: 16px 20px; }
  #view-schedule #week-board { gap: 6px; }
  #view-schedule #week-board :is(.board-corner, .board-day) { min-height: 54px; }
  #view-schedule #week-board .board-day { display: flex; align-content: center; justify-content: center; flex-wrap: wrap; gap: 0 6px; padding: 6px; }
  #view-schedule #week-board .board-day strong { font-size: 14px; line-height: 1.3; }
  #view-schedule #week-board .board-day small { order: 3; flex-basis: 100%; font-size: 11px; line-height: 1.4; }
  #view-schedule #week-board .board-day-tag { margin: 0; line-height: 18px; }
  #view-schedule #week-board :is(.board-time, .board-cell) { min-height: 58px; }
  #view-schedule #week-board .board-time { padding: 4px 10px; }
  #view-schedule #week-board .board-time strong { line-height: 1.2; }
  #view-schedule #week-board .board-time span { font-size: 11px; line-height: 1.25; }
  #view-schedule #week-board .board-time em { margin: 0 0 2px; padding: 0; font-size: 10px; line-height: 1.2; }
  #view-schedule #week-board .board-event { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 1px 6px; min-height: 58px; padding: 6px 12px; }
  #view-schedule #week-board .board-event strong { grid-column: 1 / -1; line-height: 1.3; }
  #view-schedule #week-board .board-event small { min-width: 0; margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
  #view-schedule #week-board .board-event time { margin: 0; font-size: 11px; line-height: 1.5; white-space: nowrap; }
  #view-schedule #week-board.editing .board-event { grid-template-columns: minmax(0, 1fr); padding-right: 52px; }
}

/* Mobile task controls, including short touch landscapes; desktop density stays intact. */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .class-tabs > button, .class-tabs > a,
  .gb-filter, .gb-priority, .gb-column-select, .gb-cell,
  .homework-view-switch > button, .homework-subject-filters > button,
  .gb-cell { min-width: 44px; }
  .gb-priority { padding-block: 4px; }
  #routine-review-empty { gap: 8px; padding: 18px; }
  #routine-review-empty h2 { font-size: 18px; }
  #global-search-input { min-height: 44px; font-size: 16px; }
  #class-work-selector { min-height: 44px; font-size: 16px; }
  .search-box { gap: 8px; padding-inline: 12px; }
  .search-box > kbd, .search-hint > span:last-child { display: none; }
  body :is(.form-field input, .form-field select, .form-field textarea, .student-roster-form input) { font-size: 16px; }
  #detail-drawer :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) { font-size: 16px; }
  .student-roster-form input { min-height: 44px; }
}
#global-search-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* ===== 界面改版 · 界面巡检修正（2026-10-15）=====
   1. 主内容区只是切页后的程序聚焦落点（tabindex=-1，不在 Tab 顺序中），不再给整块内容画蓝框；按钮、输入框等控件的焦点样式不变。
   2. 复核按钮的结果附注改用小字，与样稿批改标记 .m 的 <small> 附注一致。
   3. 手机作业页抬头：标题独占一行，操作在下方横排、放不下再换行；「待复核 N」保持单行胶囊（旧版 700px 规则曾把它竖排）。 */
#main-content:focus { outline: none; }
.review-mark small { margin-left: 2px; font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif; font-size: 12px; font-weight: 600; opacity: .8; }
@media (max-width: 760px) {
  .homework-review-entry { flex-direction: row; align-items: center; }
}
@media (max-width: 520px) {
  .homework-header { flex-direction: column; align-items: stretch; }
  .homework-header .card-header-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .homework-header .card-header-actions .homework-save-state { flex-basis: 100%; }
  .homework-header .card-header-actions .primary-button { width: auto; flex: 1 1 auto; }
}

/* 教师端公共框架 · 深绿清爽版（2026-10-17）。所有教师页面共用侧栏、工具栏与移动导航；首页内容仅由 #view-dashboard[data-home-design] 限定，教室端独立。 */
body.teacher-workspace-theme:not(.auth-locked):not(.data-loading) {
  --primary: #214c40; --primary-strong: #173c32; --border: #e0e7e3;
  --surface-soft: #f4f7f5; --background: #f6f8f6; --text-muted: #596b64; --text-secondary: #596b64;
  background: #f6f8f6; color: #263c34;
}
.teacher-workspace-theme:not(.auth-locked) ::selection { color: #173c32; background: #f7e89c; }
.teacher-workspace-theme:not(.auth-locked) :is(button,a,input,select,summary):focus-visible { outline: 3px solid #367b65; outline-offset: 3px; }
.teacher-workspace-theme .sidebar { border-radius: 0; box-shadow: none; border-right: 1px solid #e0e7e3; }
.teacher-workspace-theme .sidebar .brand { border: 0; }
.teacher-workspace-theme .brand strong { font-family: inherit; font-weight: 700; letter-spacing: 0; }
.teacher-workspace-theme .sidebar .nav-label { display: none; }
.teacher-workspace-theme .sidebar .nav-item { border-radius: 10px; }
.teacher-workspace-theme .sidebar .nav-item > .icon { background: transparent; border-radius: 0; }
.teacher-workspace-theme .sidebar .nav-item.active { color: #fff9f0; background: var(--primary); }
.teacher-workspace-theme .sidebar .nav-item.active .nav-copy small { color: #cfe0da; }
.teacher-workspace-theme .sidebar .nav-item.active > .icon { color: #f4d65c; background: transparent; }
.teacher-workspace-theme .sidebar .nav-group { border: 0; }
.teacher-workspace-theme .sidebar-subnav { border-color: #e0e7e3; }
.teacher-workspace-theme .sidebar .sidebar-class { border-radius: 8px; background: #f4f7f5; }
.teacher-workspace-theme .sidebar .sidebar-class.active { background: #fcf3c7; box-shadow: none; }
.teacher-workspace-theme .sidebar-footer { border-color: #e0e7e3; }
.teacher-workspace-theme .sidebar-footer .school-card { background: #f4f7f5; border-radius: 10px; }
.teacher-workspace-theme .sidebar-assistant { border-radius: 10px; color: #4d4010; background: #f4d65c; }
.teacher-workspace-theme .sidebar-nav { scrollbar-color: #c6d4cc transparent; }
.teacher-workspace-theme .topbar { background: #f6f8f6; backdrop-filter: none; }
.teacher-workspace-theme .topbar :is(.global-search,.secondary-button,.icon-button) { border-radius: 10px; border-color: #dce5df; }
.teacher-workspace-theme .topbar .global-search { max-width: 520px; font-size: 13px; }
.teacher-workspace-theme .topbar .homework-quick-trigger { background: #214c40; border-color: #214c40; }
.teacher-workspace-theme .topbar-client-download { order: -1; font-size: 12px; }
.teacher-workspace-theme .profile-copy, .teacher-workspace-theme .profile-button > .chevron { display: none; }
.teacher-workspace-theme .avatar { border-radius: 50%; }
.teacher-workspace-theme #view-dashboard { max-width: 1280px; margin-inline: auto; }
#view-dashboard[data-home-design] .welcome-heading { margin-bottom: 22px; }
#view-dashboard[data-home-design] .welcome-heading::before { display: none; }
#view-dashboard[data-home-design] #dashboard-title { color: #214c40; font-family: inherit; font-size: 30px; line-height: 1.4; font-weight: 700; letter-spacing: -.025em; }
#view-dashboard[data-home-design] #today-label { display: block; margin: 6px 0 0; color: #596b64; font-size: 13px; font-weight: 400; }
#view-dashboard[data-home-design] .home-now { min-height: 142px; margin-bottom: 24px; padding: 26px 30px; border-radius: 16px; background: #214c40; }
#view-dashboard[data-home-design] .home-now::before { display: none; }
#view-dashboard[data-home-design] .now-copy { gap: 12px; flex: 1; }
#view-dashboard[data-home-design] .now-lesson { display: flex; flex-direction: column; gap: 6px; }
#view-dashboard[data-home-design] .now-lesson > span { color: #d4e5dd; font-size: 14px; font-weight: 400; }
#view-dashboard[data-home-design] .now-lesson > small { color: #f4d65c; font-size: 23px; font-weight: 650; line-height: 1.45; }
#view-dashboard[data-home-design] .now-lesson:is([data-state="done"],[data-state="free"]) > small { color: #fff; font-size: 20px; }
#view-dashboard[data-home-design] .now-week { align-self: flex-start; padding: 0; color: #d4e5dd; background: none; font-size: 12px; }
#view-dashboard[data-home-design] .now-holiday-group { display: flex; align-items: center; gap: 16px; flex: 0 1 290px; min-width: 0; padding-left: 24px; border-left: 1px solid #527367; }
#view-dashboard[data-home-design] .now-holiday { margin: 0; color: #e6f0eb; font-family: inherit; font-size: 16px; line-height: 1.6; font-weight: 500; letter-spacing: 0; }
#view-dashboard[data-home-design] .now-circle-button { flex: 0 0 auto; margin-left: auto; border-radius: 50%; }
#view-dashboard[data-home-design] .now-circle { width: 72px; height: 72px; color: #3e3612; background: #f4d65c; transform: none; }
#view-dashboard[data-home-design] .now-circle strong { font-size: 32px; line-height: 1; font-family: inherit; font-weight: 650; }
#view-dashboard[data-home-design] .now-circle small { margin-top: 2px; font-size: 12px; }
#view-dashboard[data-home-design] .now-circle-button:hover .now-circle { transform: none; background: #ffe47e; }
#view-dashboard[data-home-design] .dashboard-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; grid-template-areas: none; gap: 24px; align-items: start; }
.dashboard-main, .dashboard-aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
#view-dashboard[data-home-design] :is(.card,.todo-board) { margin: 0; min-width: 0; border: 1px solid #e0e7e3; border-radius: 16px; background: #fff; box-shadow: none; overflow: clip; }
#view-dashboard[data-home-design] .card-header { padding: 16px 20px 8px; min-height: 60px; border: 0; }
#view-dashboard[data-home-design] :is(.card-header h2,.todo-board-heading h2,.school-agenda-heading h3,.home-classroom-heading h2) { color: #263c34; font-family: inherit; font-size: 17px; font-weight: 650; line-height: 1.5; letter-spacing: 0; margin: 0; }
#view-dashboard[data-home-design] .text-link { color: #245747; font-size: 12px; min-height: 44px; }
#view-dashboard[data-home-design] .today-agenda { display: flex; flex-direction: column; gap: 0; padding: 0 20px 12px; }
#view-dashboard[data-home-design] .agenda-row { grid-template-columns: 62px minmax(0,1fr) auto; gap: 14px; padding: 14px 0; min-height: 70px; border: 0; border-bottom: 1px solid #ecf0ed; border-radius: 0; background: transparent; }
#view-dashboard[data-home-design] .agenda-row:last-child { border-bottom: 0; }
#view-dashboard[data-home-design] .agenda-row:hover { background: #f4f8f5; }
#view-dashboard[data-home-design] .agenda-row > time { min-height: 0; gap: 5px; flex-direction: column; align-items: flex-start; padding: 0; color: #245747; background: none; }
#view-dashboard[data-home-design] .agenda-row > time b { font-size: 16px; font-family: inherit; font-weight: 650; font-variant-numeric: tabular-nums; }
#view-dashboard[data-home-design] .agenda-row > time small { display: block; color: #596b64; opacity: 1; font-family: inherit; font-size: 11px; }
#view-dashboard[data-home-design] .agenda-copy strong { font-size: 14px; font-weight: 600; }
#view-dashboard[data-home-design] .agenda-copy small { display: block; margin-top: 3px; color: #596b64; font-size: 12px; }
#view-dashboard[data-home-design] .agenda-row.is-past { opacity: 1; }
#view-dashboard[data-home-design] .agenda-row.is-past .agenda-copy strong { color: #596b64; font-weight: 400; }
#view-dashboard[data-home-design] .agenda-tag { padding: 0 8px; height: 24px; border-radius: 6px; font-size: 11px; font-weight: 500; }
#view-dashboard[data-home-design] .agenda-section-label { border-color: #e0e7e3; padding-block: 12px 4px; }
#view-dashboard[data-home-design] .todo-board-heading { margin: 0; padding: 16px 20px 8px; }
#view-dashboard[data-home-design] .todo-board-grid { display: flex; flex-direction: column; gap: 0; padding: 0 20px 12px; }
#view-dashboard[data-home-design] .todo-tile { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; max-width: none; min-height: 72px; padding: 14px 0; color: #263c34; border: 0; border-bottom: 1px solid #ecf0ed; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
#view-dashboard[data-home-design] .todo-tile:last-child { border-bottom: 0; }
#view-dashboard[data-home-design] .todo-tile:hover { background: #f4f8f5; }
#view-dashboard[data-home-design] .todo-tile-top { display: flex; flex-direction: row; align-items: center; gap: 10px; }
#view-dashboard[data-home-design] .todo-pill { color: #82431a; background: #fff0e2; flex: 0 0 auto; padding: 4px 8px; height: auto; border-radius: 6px; font-size: 12px; }
#view-dashboard[data-home-design] .todo-tile-title, #view-dashboard[data-home-design] .todo-tile-label { font-size: 14px; font-weight: 600; }
#view-dashboard[data-home-design] .todo-num { align-self: center; grid-column: 2; grid-row: 1; }
#view-dashboard[data-home-design] .todo-num b { font-family: inherit; font-size: 22px; font-weight: 650; }
#view-dashboard[data-home-design] .todo-num small { color: #596b64; font-size: 12px; font-weight: 400; }
#view-dashboard[data-home-design] .todo-go { grid-column: 2; grid-row: 2; min-height: 0; height: auto; padding: 0; color: #245747; background: none; font-size: 12px; justify-self: end; }
#view-dashboard[data-home-design] .todo-tile-note { grid-column: 1; font-size: 12px; color: #596b64; opacity: 1; }
#view-dashboard[data-home-design] .todo-tile.review .todo-tile-label { color: #245747; }
#view-dashboard[data-home-design] .todo-tile.screen { grid-column: 1 / -1; min-height: 0; padding: 12px; margin-top: 8px; border-radius: 8px; background: #fcf5d8; color: #655418; }
#view-dashboard[data-home-design] .todo-tile.screen .todo-tile-note { grid-column: 1 / -1; color: #655418; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
#view-dashboard[data-home-design] .school-agenda { margin: 0; padding: 12px 20px; border: 0; border-radius: 0; background: transparent; }
#view-dashboard[data-home-design] .school-agenda-heading { gap: 12px; }
#view-dashboard[data-home-design] .school-agenda-heading h3 small { color: #596b64; font-size: 12px; }
#view-dashboard[data-home-design] .school-agenda-filter { font-size: 12px; }
#view-dashboard[data-home-design] .school-agenda-filter select { min-height: 44px; max-width: 140px; border-color: #e0e7e3; border-radius: 8px; background: #fff; font-size: 13px; }
#view-dashboard[data-home-design] .school-agenda-hint { color: #596b64; font-size: 12px; }
#view-dashboard[data-home-design] .school-agenda-group h4 { margin: 12px 0 0; padding: 8px 0; font-size: 13px; color: #245747; border-color: #e0e7e3; }
#view-dashboard[data-home-design] .school-agenda-event { min-height: 56px; padding: 12px 0; border-color: #ecf0ed; }
#view-dashboard[data-home-design] .school-agenda-event-copy strong { font-size: 14px; font-weight: 500; }
#view-dashboard[data-home-design] .school-agenda-event-copy small { font-size: 12px; color: #596b64; }
#view-dashboard[data-home-design] .dashboard-calendar-card { display: flex; flex-direction: column; }
#view-dashboard[data-home-design] .home-calendar-settings { order: 1; margin: 0 16px 12px; border-top: 1px solid #e0e7e3; }
#view-dashboard[data-home-design] .home-calendar-settings > summary { cursor: pointer; min-height: 44px; padding: 12px 0; color: #245747; font-size: 12px; }
#view-dashboard[data-home-design] .dashboard-calendar-insights { padding: 0; }
#view-dashboard[data-home-design] .calendar-insight { border-radius: 10px; border-color: #e0e7e3; background: #f4f7f5; }
#view-dashboard[data-home-design] .dashboard-month-bar { padding: 0 12px; gap: 2px; }
#view-dashboard[data-home-design] .dashboard-month-bar strong { font-family: inherit; font-size: 14px; }
#view-dashboard[data-home-design] .dashboard-calendar-weekdays { padding-inline: 16px; }
#view-dashboard[data-home-design] .dashboard-calendar-grid { padding: 0 16px 10px; gap: 2px; }
#view-dashboard[data-home-design] .dashboard-date { min-height: 36px; font-family: inherit; border-radius: 8px; font-size: 13px; }
#view-dashboard[data-home-design] .dashboard-date.selected { background: #214c40; }
#view-dashboard[data-home-design] .dashboard-calendar-agenda { padding: 12px 16px; border-color: #e0e7e3; }
#view-dashboard[data-home-design] .dashboard-calendar-event { padding: 10px 0; border-radius: 0; background: transparent; }
#view-dashboard[data-home-design] .dashboard-calendar-event strong { font-weight: 500; font-size: 12px; }
#view-dashboard[data-home-design] .dashboard-calendar-empty { min-height: 0; padding: 10px 0; }
#view-dashboard[data-home-design] .task-status-tabs { padding: 8px 20px; gap: 6px; }
#view-dashboard[data-home-design] .task-status-tab { min-height: 36px; border-radius: 8px; border-color: #e0e7e3; background: #f4f7f5; }
#view-dashboard[data-home-design] .task-status-tab.active { color: #fff; background: #214c40; }
#view-dashboard[data-home-design] .focus-list { padding: 4px 20px 16px; }
#view-dashboard[data-home-design] .empty-state { min-height: 0; padding: 24px 12px; color: #596b64; }
#home-classroom-status:empty { display: none; }
.home-classroom-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 14px 18px 6px; }
.home-classroom-heading h2 { display: flex; align-items: center; gap: 8px; }
.home-classroom-heading h2 .icon { color: #285e85; }
.home-classroom-list { padding: 0 18px 12px; }
.home-classroom-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid #ecf0ed; }
.home-classroom-row:last-child { border: 0; }
.home-classroom-name { min-width: 0; }
.home-classroom-name strong, .home-classroom-name small { display: block; overflow-wrap: anywhere; }
.home-classroom-name strong { font-size: 14px; font-weight: 600; }
.home-classroom-name small { font-size: 11px; color: #596b64; margin-top: 4px; }
.home-classroom-state { display: inline-flex; gap: 5px; align-items: center; align-self: start; font-size: 12px; color: #596b64; }
.home-classroom-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.home-classroom-state[data-state="online"] { color: #277445; }
.home-classroom-state[data-state="offline"] { color: #936211; }
.home-classroom-action { grid-column: 1 / -1; justify-self: start; min-height: 44px; padding: 8px 12px; border: 1px solid #dce5df; border-radius: 8px; color: #245747; background: #fff; font-size: 12px; }
.home-classroom-action:hover { background: #eef6f1; }
.home-classroom-action:disabled { color: #596b64; cursor: default; background: #f4f7f5; }
.home-classroom-empty { padding: 10px 18px 18px; font-size: 13px; }
.home-classroom-empty p { margin: 8px 0 12px; color: #596b64; font-size: 12px; }
.home-classroom-empty > div { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 761px) {
  body.teacher-workspace-theme { --sidebar-width: 224px; }
  .teacher-workspace-theme .sidebar { inset: 0 auto 0 0; height: 100dvh; width: 224px; }
  .teacher-workspace-theme .topbar { padding: 16px 28px; height: 80px; }
  .teacher-workspace-theme main { padding: 20px 28px 32px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  #view-dashboard[data-home-design] .dashboard-layout { gap: 16px; grid-template-columns: minmax(0,1fr) 280px; }
  #view-dashboard[data-home-design] .home-now { padding: 22px; }
  #view-dashboard[data-home-design] .now-holiday-group { flex-basis: 180px; gap: 10px; padding-left: 16px; }
  .teacher-workspace-theme .topbar-client-download > span:not(.icon) { display: none; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  #view-dashboard[data-home-design] .dashboard-layout { grid-template-columns: minmax(0,1fr); }
  #view-dashboard[data-home-design] .dashboard-aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .teacher-workspace-theme main { padding: calc(92px + env(safe-area-inset-top,0px)) 16px calc(110px + env(safe-area-inset-bottom,0px)); }
  .teacher-workspace-theme .topbar { border-bottom: 1px solid #e0e7e3; background: #fff; padding-inline: 12px; }
  .teacher-workspace-theme .topbar .global-search { background: #fff; }
  .teacher-workspace-theme .sidebar { border-radius: 16px; border-right: 0; box-shadow: 8px 12px 40px #173c3226; }
  .teacher-workspace-theme .mobile-tabbar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom,0px)); height: 64px; min-height: 64px; padding: 6px; background: #214c40; border-radius: 20px; box-shadow: 0 6px 20px #173c3226; }
  .teacher-workspace-theme .mobile-tab { display: flex; flex-direction: column; gap: 2px; border-radius: 14px; font-size: 12px; }
  .teacher-workspace-theme .mobile-tab .icon { display: inline-flex; width: 20px; height: 20px; }
  .teacher-workspace-theme .mobile-tab.active { color: #3e3612; background: #f4d65c; }
  #view-dashboard[data-home-design] #dashboard-title { font-size: 25px; }
  #view-dashboard[data-home-design] .welcome-heading { margin-bottom: 18px; }
  #view-dashboard[data-home-design] .home-now { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 20px; margin-bottom: 18px; }
  #view-dashboard[data-home-design] .now-copy { gap: 8px; }
  #view-dashboard[data-home-design] .now-lesson > span { font-size: 13px; }
  #view-dashboard[data-home-design] .now-lesson > small { font-size: 21px; }
  #view-dashboard[data-home-design] .now-holiday-group { flex-basis: auto; padding: 14px 0 0; border-left: 0; border-top: 1px solid #527367; gap: 12px; }
  #view-dashboard[data-home-design] .now-holiday { font-size: 14px; }
  #view-dashboard[data-home-design] .now-circle { width: 52px; height: 52px; }
  #view-dashboard[data-home-design] .now-circle strong { font-size: 23px; }
  #view-dashboard[data-home-design] .now-circle small { font-size: 10px; }
  #view-dashboard[data-home-design] .dashboard-layout { display: flex; flex-direction: column; gap: 16px; }
  .dashboard-main, .dashboard-aside { display: contents; }
  #view-dashboard[data-home-design] :is(.card,.todo-board) { width: 100%; }
  #view-dashboard[data-home-design] .today-card { order: 2; }
  #view-dashboard[data-home-design] .todo-board { order: 1; }
  #view-dashboard[data-home-design] .dashboard-school-card { order: 3; }
  #view-dashboard[data-home-design] .focus-card { order: 4; }
  #home-classroom-status { order: 5; }
  #view-dashboard[data-home-design] .dashboard-calendar-card { order: 6; }
  #view-dashboard[data-home-design] .card-header { padding: 12px 16px 4px; }
  #view-dashboard[data-home-design] .today-agenda { padding: 0 16px 6px; }
  #view-dashboard[data-home-design] .agenda-row { grid-template-columns: 48px minmax(0,1fr) auto; gap: 8px; }
  #view-dashboard[data-home-design] .agenda-row > time b { font-size: 15px; }
  #view-dashboard[data-home-design] .agenda-copy strong { font-size: 13px; }
  #view-dashboard[data-home-design] .agenda-copy small { font-size: 11px; }
  #view-dashboard[data-home-design] .agenda-tag { padding: 0 6px; font-size: 10px; }
  #view-dashboard[data-home-design] .todo-board-heading { padding: 14px 16px 6px; }
  #view-dashboard[data-home-design] .todo-board-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 6px 16px 16px; }
  #view-dashboard[data-home-design] .todo-tile { min-height: 0; padding: 12px; grid-template-columns: minmax(0,1fr); gap: 8px; border: 0; border-radius: 10px; }
  #view-dashboard[data-home-design] .todo-tile.grade { grid-row: auto; background: #fff0e2; color: #82431a; }
  #view-dashboard[data-home-design] .todo-tile.review { background: #e5f4ed; }
  #view-dashboard[data-home-design] .todo-tile-top { align-items: flex-start; flex-direction: column; gap: 6px; }
  #view-dashboard[data-home-design] .todo-pill { padding: 0; font-size: 12px; font-weight: 650; }
  #view-dashboard[data-home-design] .todo-tile-title { font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
  #view-dashboard[data-home-design] .todo-num { grid-area: auto; }
  #view-dashboard[data-home-design] .todo-num b { font-size: 22px; }
  #view-dashboard[data-home-design] .todo-go { grid-area: auto; justify-self: start; }
  #view-dashboard[data-home-design] .todo-tile-note { grid-area: auto; font-size: 11px; }
  #view-dashboard[data-home-design] .todo-tile.screen { margin: 0; }
  #view-dashboard[data-home-design] .school-agenda { padding: 12px 16px; }
  #view-dashboard[data-home-design] .school-agenda-heading { flex-wrap: wrap; gap: 6px; }
  #view-dashboard[data-home-design] .school-agenda-filter select { width: 120px; }
  #view-dashboard[data-home-design] .task-status-tabs { padding-inline: 16px; flex-wrap: wrap; }
  #view-dashboard[data-home-design] .task-status-tab { min-height: 44px; }
  #view-dashboard[data-home-design] .dashboard-date { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  #view-dashboard[data-home-design] *, .teacher-workspace-theme .mobile-tabbar { animation: none; transition: none; }
}
/* 班级今天：沿用教师端工作面，颜色只表达需要处理的状态。 */
#view-class-work .class-today-content{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(260px,1fr);gap:36px;padding:24px;align-items:start}
.class-today-main,.class-today-summary{display:flex;flex-direction:column;gap:24px;min-width:0}
.class-today-section{min-width:0;border-top:1px solid #dfe7e2;padding-top:18px;color:#344b43}
.class-today-section header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.class-today-section h3{margin:0;font-size:17px;line-height:1.5;color:#2d4d43}
.class-today-scope{font-size:12px;font-weight:400;color:#687a72;margin-left:6px;white-space:nowrap}
.class-today-section .text-link{display:inline-flex;align-items:center;gap:5px;min-height:36px;font-size:13px}
.class-today-note,.class-today-empty{font-size:13px;line-height:1.7;color:#687a72;margin:10px 0 0}
.class-today-lead{display:flex;align-items:baseline;gap:10px;margin:16px 0 8px;font-size:13px}
.class-today-lead strong{font-size:26px;font-variant-numeric:tabular-nums;line-height:1.4;color:#2d4d43}
.class-today-summary-line,.class-today-review-summary{font-size:15px;line-height:1.6;margin:12px 0 0}
.class-today-review-summary strong{font-weight:700;margin-right:6px}
.class-today-collection{margin-top:24px}
.class-today-collection h4{font-size:14px;font-weight:600;line-height:1.6;margin:0;color:#344b43}
.class-today-collection-total{font-size:14px;line-height:1.6;margin:6px 0 0;font-variant-numeric:tabular-nums}
.class-today-routine progress{width:100%;height:6px;border:0;border-radius:3px;overflow:hidden;background:#edf1ee;accent-color:#55796b}
.class-today-routine progress::-webkit-progress-bar{background:#edf1ee}.class-today-routine progress::-webkit-progress-value{background:#55796b}
.class-today-items,.class-today-followups{list-style:none;margin:14px 0 0;padding:0}
.class-today-items li,.class-today-followups li{display:flex;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid #edf1ee;align-items:center;font-size:14px}
.class-today-items li>span:first-child,.class-today-followups li>span{min-width:0;overflow-wrap:anywhere}
.class-today-items strong,.class-today-followups strong{font-weight:600}
.class-today-items small,.class-today-followups small{display:block;font-size:12px;color:#687a72;line-height:1.7;margin-top:4px}
.class-today-items .class-today-item-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.class-today-item-state{text-align:right;flex-shrink:0;font-size:13px;font-variant-numeric:tabular-nums}
.class-today-attention,.class-today-attention strong{color:#805c28}
.class-today-screen-state{display:flex;gap:8px;align-items:center;margin:12px 0 0;font-size:14px;line-height:1.6}
.class-today-screen-state i{width:8px;height:8px;border-radius:50%;background:currentColor}
.class-today-screen-online header{justify-content:flex-start;gap:12px}
.class-today-screen-online .class-today-screen-state{margin:0;color:#2d4d43}
.class-today-screen-online .text-link{margin-left:auto}
#class-today-date{font-size:13px;color:#687a72;margin:6px 0 0}
#class-today-status{font-size:12px;color:#687a72}
[data-class-today-refresh]{min-height:44px}
.class-today-loading{padding:20px;font-size:14px;color:#687a72}
@media(max-width:760px){#view-class-work .class-today-content{display:flex;flex-direction:column;gap:24px;padding:18px}.class-today-main,.class-today-summary,.class-today-section{width:100%}.class-today-lead strong{font-size:24px}#view-class-work .class-home-card>.card-header{flex-direction:column;align-items:stretch;gap:12px}#view-class-work .class-home-card>.card-header .card-header-actions{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:8px}#class-today-status{font-size:11px}.class-today-items li{gap:10px}}
.library-data-details{margin:16px 0 24px;color:var(--text-secondary);font-size:14px}
.library-data-details>summary{width:fit-content;min-height:44px;display:list-item;align-content:center;cursor:pointer;text-decoration:underline;text-underline-offset:4px}
.library-data-details[open]>summary{margin-bottom:14px}
.library-data-details .library-local-notice{margin-block:12px}
#view-school-calendar .calendar-day,#view-school-calendar .calendar-day:nth-child(7n){border-color:var(--border)}
#view-school-calendar .calendar-day:not(.today){border-color:transparent}
#view-school-calendar .calendar-empty-state{border-color:var(--border)}
#detail-drawer .homework-form :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:#fff;border-color:var(--border);color:var(--text)}
#detail-drawer .homework-editor-summary article{background:var(--surface-soft);border-color:var(--border)}

/* 班级工作信息精简：只调整内容层级，沿用现有视觉与侧栏。 */
#view-class-work > .page-heading { align-items:center; gap:16px; margin-bottom:16px; }
.class-heading-identity { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.class-heading-identity h1 { margin:0; }
#class-heading-meta { margin:0; color:var(--text-secondary); font-size:14px; }
#class-work-selector { order:-1; max-width:100%; min-height:48px; padding:6px 36px 6px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--primary); font:inherit; font-size:24px; font-weight:700; }
.class-heading-actions { display:flex; flex-wrap:wrap; gap:8px; flex-shrink:0; }
#view-class-work #class-tabs { margin-top:0; }
#view-class-work #class-student-tabs:not([hidden]) { display:flex !important; width:fit-content; margin:0 0 16px; }
#view-class-work [data-routine-view-panel][hidden], #homework-subject-filters[hidden], #class-work-selector[hidden] { display:none !important; }
.routine-view-switch { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.routine-view-switch button.active { background:var(--primary); color:var(--surface); border-color:var(--primary); }
#view-class-work .routine-records-disclosure { margin-top:20px; }
.routine-records-disclosure > summary { padding:18px 24px; cursor:pointer; color:var(--primary); min-height:54px; }
.routine-records-disclosure > summary .record-count { margin-left:12px; }
.routine-records-actions { padding:12px 24px 20px; }
#view-class-work .class-student-card { min-height:90px; padding:16px; gap:12px; }
#view-class-work .class-student-card .class-student-copy { flex:1; }
#class-schedule-content { padding:0 24px 24px; overflow:auto; }
.class-today-task-row { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.class-today-task-row .class-today-lead { display:flex; flex-direction:column; gap:2px; }
.class-today-lead small { font-size:12px; color:var(--text-secondary); }
.class-today-homework > .class-today-review { margin-top:16px; padding-top:16px; }
.class-today-lessons { list-style:none; margin:12px 0 0; padding:0; }
.class-today-lessons li { display:flex; align-items:baseline; gap:20px; padding:12px 0; border-bottom:1px solid var(--border); font-size:14px; }
.class-today-lessons time { color:var(--text-secondary); font-variant-numeric:tabular-nums; min-width:60px; }
.gb-export-menu { position:relative; }
.gb-export-menu > summary { display:flex; align-items:center; gap:8px; min-height:40px; font-size:12px; cursor:pointer; list-style:none; }
.gb-export-menu > summary::-webkit-details-marker { display:none; }
.gb-export-menu > div { position:absolute; top:calc(100% + 6px); right:0; z-index:10; display:grid; gap:6px; width:190px; padding:10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); }
.gb-export-menu:not([open]) > div { display:none; }
#view-class-work .gb-bulk { gap:10px; padding:12px 16px; }
#view-class-work .gb-bulk-heading { gap:8px 12px; }
#view-class-work .gb-bulk-item { flex-basis:180px; }
#view-class-work .gb-bulk-footer p { font-size:12px; }
@media(max-width:760px) {
  #view-class-work > .page-heading { align-items:flex-start; flex-direction:column; gap:12px; }
  .class-heading-actions { width:100%; }
  .class-heading-actions button { min-height:44px; }
  #class-work-selector { font-size:20px; width:100%; }
  .class-heading-identity { width:100%; }
  #view-class-work #class-student-tabs:not([hidden]) { width:100%; }
  #class-schedule-content { padding:0 12px 16px; }
  .class-today-task-row { gap:10px; }
  .class-today-task-row .text-link { flex-shrink:0; }
  .routine-records-disclosure > summary { padding:16px 18px; }
  .gb-export-menu > div { left:0; right:auto; }
}

/* Approved today mockup: one task work surface, separate supporting cards. */
#view-class-work .class-home-card { background:transparent; border:0; box-shadow:none; overflow:visible; }
#view-class-work .class-home-card > .card-header { padding:4px 0 16px; border:0; align-items:center; }
#class-home-title { font-size:22px; }
#class-today-date { display:none; }
#view-class-work .class-today-content { padding:0; gap:20px; grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr); }
.class-today-main,.class-today-summary { gap:16px; }
.class-today-main > .class-today-section,.class-today-summary > .class-today-section { padding:24px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); }
.class-today-section h3,.class-today-collection h4 { font-size:20px; font-weight:700; line-height:1.4; color:var(--text); }
.class-today-tasks { display:grid; gap:12px; margin-top:20px; }
.class-today-task-row { display:flex; align-items:center; gap:14px; padding:16px; border:1px solid var(--border); border-radius:var(--radius-sm); }
.class-today-task-row .class-today-lead { flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:4px; margin:0; }
.class-today-task-row .class-today-lead strong,.class-today-task-row h3 { margin:0; font-size:18px; font-weight:700; line-height:1.4; color:var(--text); }
.class-today-task-row small { font-size:13px; line-height:1.6; color:var(--text-secondary); }
.class-today-task-row .primary-button { min-height:44px; padding:10px 16px; flex-shrink:0; white-space:nowrap; }
.class-today-task-count { font-size:14px; color:var(--text); font-variant-numeric:tabular-nums; white-space:nowrap; }
.class-today-row-icon { width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; border-radius:50%; color:var(--primary); }
.class-today-row-icon.yellow { background:#fff1c4; }
.class-today-row-icon.mint { background:#e0f4eb; }
.class-today-row-icon .icon { width:22px; height:22px; }
.class-today-collection { border-top:1px solid var(--border); margin-top:24px; padding-top:24px; }
.class-today-items { display:grid; gap:10px; margin:16px 0 0; }
.class-today-items li { display:block; padding:0; border:0; }
.class-today-work-row { display:flex; width:100%; gap:12px; align-items:center; padding:12px; min-height:64px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); text-align:left; color:var(--text); cursor:pointer; font:inherit; }
.class-today-work-row:hover { background:var(--surface-soft); }
.class-today-work-row .class-today-item-title { flex:1; min-width:0; font-size:15px; line-height:1.5; }
.class-today-work-row .class-today-item-state { margin:0; font-size:14px; color:var(--text-secondary); }
.class-today-work-row > .icon { width:16px; height:16px; flex-shrink:0; color:var(--text-secondary); }
.class-today-waiting { margin-top:12px; }
.class-today-lessons { margin-top:16px; }
.class-today-lessons li { min-height:52px; padding:12px 0; gap:24px; font-size:16px; }
.class-today-lessons li:last-child { border-bottom:0; }
.class-today-lessons time { min-width:72px; color:var(--text); }
.class-today-routine .class-today-note { margin-top:16px; font-size:14px; }
.class-today-screen-online header h3 { font-size:16px; }
.class-today-screen-online .class-today-screen-state i { background:#2baa79; }
.class-today-summary > .class-today-screen-online { padding-block:18px; }
@media (min-width:761px) and (max-width:1150px) {
  #view-class-work .class-today-content { grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr); gap:16px; }
  .class-today-main > .class-today-section,.class-today-summary > .class-today-section { padding:18px; }
  .class-today-task-row { flex-wrap:wrap; }
  .class-today-task-count { margin-left:54px; }
  .class-today-task-row .primary-button { margin-left:auto; }
}
@media (max-width:760px) {
  #view-class-work .class-home-card > .card-header { flex-direction:row; flex-wrap:wrap; gap:8px; }
  #class-home-title { font-size:20px; }
  #view-class-work .class-home-card > .card-header .card-header-actions { gap:8px; }
  #view-class-work .class-today-content { padding:0; gap:16px; }
  .class-today-main > .class-today-section,.class-today-summary > .class-today-section { padding:16px; }
  .class-today-task-row { gap:10px; padding:12px; flex-wrap:wrap; }
  .class-today-task-row .class-today-lead { flex-basis:calc(100% - 50px); }
  .class-today-task-row .primary-button { margin-left:auto; }
  .class-today-task-count { margin-left:50px; }
  .class-today-work-row { gap:8px; padding:10px; flex-wrap:wrap; }
  .class-today-work-row .class-today-item-title { flex-basis:calc(100% - 48px); }
  .class-today-work-row .class-today-item-state { margin-left:48px; }
  .class-today-work-row > .icon { margin-left:auto; }
}

/* Class work secondary pages: compact tasks within the existing shell. */
#view-class-work .homework-header { align-items:center; }
#view-class-work .homework-header .homework-save-state { color:var(--text-secondary); font-weight:400; font-size:12px; }
#view-class-work .homework-header .homework-save-state[data-state="error"] { color:var(--danger); }
#view-class-work .gb-head { gap:12px; margin-bottom:4px; }
#view-class-work .gb-heading-copy { flex:1 1 100%; min-width:0; }
#view-class-work .gb-head .gb-assignment-title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; margin:0; font-size:18px; line-height:1.5; }
#view-class-work .gb-assignment-info { margin-top:4px; font-size:12px; color:var(--text-secondary); }
#view-class-work .gb-assignment-info summary { width:fit-content; padding:8px 0; cursor:pointer; color:var(--primary); }
#view-class-work .gb-assignment-info[open] { padding-bottom:12px; }
#view-class-work .gb-assignment-info p { max-width:70ch; overflow-wrap:anywhere; }
#view-class-work .gb-actions { width:100%; justify-content:flex-end; }
#view-class-work .gb-filter { background:transparent; color:var(--text-secondary); border:1px solid var(--border); }
#view-class-work .gb-filter.active { background:var(--primary); color:var(--surface); border-color:var(--primary); }
#view-class-work .gb-filter:not(.active):hover { background:var(--primary-soft); color:var(--primary); }
#view-class-work .gb-filter-note { margin:0; font-size:12px; color:var(--text-secondary); }
#view-class-work .routine-date-toolbar { box-shadow:none; border:1px solid var(--border); border-radius:var(--radius-md); gap:8px; }
#view-class-work .routine-date-state:not(.history) { display:none; }
#view-class-work .routine-tools { margin-left:auto; }
.class-page-tools { position:relative; }
.class-page-tools > summary { display:flex; gap:8px; align-items:center; cursor:pointer; list-style:none; }
.class-page-tools > summary::-webkit-details-marker { display:none; }
.class-page-tools > div { position:absolute; right:0; top:calc(100% + 6px); z-index:15; width:180px; display:grid; padding:8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); }
.class-page-tools > div button { min-height:44px; justify-content:flex-start; padding:8px 12px; text-align:left; }
.class-page-tools:not([open]) > div { display:none; }
#view-class-work .routine-view-switch { margin:12px 0; }
#view-class-work .routine-roster-grid { grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:10px; }
#view-class-work .routine-student-tile { min-height:148px; padding:12px 8px; gap:4px; border-radius:var(--radius-sm); }
#view-class-work .routine-student-avatar { width:36px; height:36px; font-size:18px; }
#view-class-work .routine-student-tile strong { font-size:14px; }
#view-class-work .routine-student-score b { font-size:25px; }
#view-class-work .routine-student-tile.has-deduction { background:var(--surface-soft); }
#view-class-work .routine-student-tile.has-bonus { background:var(--surface-soft); }
#view-class-work .routine-student-tile:hover { background:var(--primary-soft); }
.student-list-toolbar { display:flex; align-items:center; gap:16px; padding:16px 20px 8px; }
.student-list-search { display:flex; align-items:center; gap:10px; width:320px; max-width:100%; padding:0 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); }
.student-list-search input { width:100%; min-width:0; min-height:44px; padding:0; border:0; background:transparent; color:var(--text); font:inherit; font-size:14px; }
.student-list-search:focus-within { outline:2px solid var(--primary); outline-offset:2px; }
.student-list-search input:focus { outline:0; }
#class-student-search-count { color:var(--text-secondary); font-size:13px; }
#view-class-work .class-student-overview-grid { gap:0 20px; padding-top:8px; }
#view-class-work .class-student-card { min-height:72px; padding:12px 4px; gap:10px; border:0; border-bottom:1px solid var(--border); border-radius:0; box-shadow:none; }
#view-class-work .class-student-avatar { width:36px; height:36px; font-size:16px; }
#view-class-work .class-student-card:focus-visible { outline:2px solid var(--primary); outline-offset:1px; box-shadow:none; }
@media(max-width:760px){
 #view-class-work .routine-roster-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 #view-class-work .routine-date-toolbar label { order:0; flex:1; }
 #view-class-work .routine-date-toolbar label > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 #view-class-work .routine-date-toolbar .routine-today-button { flex:0 1 auto; }
 #view-class-work .routine-date-state.history { width:auto; }
 #view-class-work .routine-tools { margin-left:0; }
 #view-class-work .routine-tools > div { left:0; right:auto; }
 #view-class-work .gb-actions { justify-content:flex-start; }
 .student-list-toolbar { align-items:flex-start; flex-direction:column; gap:8px; padding:12px 14px 0; }
 .student-list-search { width:100%; }
 #view-class-work .class-student-overview-grid { gap:0 12px; }
 #view-class-work .class-student-card { padding:12px 0; }
}
#view-class-work .routine-tools { flex:0 0 auto; }
#view-class-work .routine-tools > summary { white-space:nowrap; min-width:120px; }
#view-class-work .routine-student-tile { padding:10px 8px; gap:3px; }
#view-class-work .routine-student-score { min-height:44px; justify-content:flex-start; }
@media print {
 body.print-gradebook .gb-assignment-info { display:none !important; }
 body.print-gradebook #view-class-work .gb-head .gb-assignment-title { display:block; overflow:visible; -webkit-line-clamp:unset; }
}

/* Teacher workspace: task first, secondary tools on demand. Shell stays unchanged. */
:is(#view-schedule,#view-school-calendar,#view-teachers,#view-library,#view-me) .page-heading { margin-bottom:24px; align-items:center; gap:16px; }
:is(#view-schedule,#view-school-calendar,#view-teachers,#view-library,#view-me) .page-heading h1 { font-size:28px; line-height:1.35; }
:is(#view-schedule,#view-school-calendar,#view-teachers,#view-library,#view-me) .page-heading p { font-size:14px; margin:6px 0 0; color:var(--text-secondary); }
.workspace-details { min-width:0; color:var(--text-secondary); font-size:14px; }
.workspace-details > summary { cursor:pointer; min-height:44px; padding:12px 0; color:var(--primary); font-weight:600; }
.workspace-details > summary:focus-visible { outline:2px solid var(--primary); outline-offset:3px; border-radius:6px; }
.workspace-details p { line-height:1.7; }
.workspace-action-row { display:flex; gap:12px; flex-wrap:wrap; }
#view-schedule .schedule-toolbar { margin-bottom:16px; }
#view-schedule .schedule-board-card { border:1px solid var(--border); border-radius:20px; box-shadow:none; }
#view-schedule .schedule-help { margin-top:16px; }
#view-schedule .schedule-help .legend { justify-content:flex-start; flex-wrap:wrap; padding:8px 0; }
#view-schedule #personal-timetable-source { padding:0; background:transparent; border:0; margin-bottom:12px; }
#view-schedule #personal-timetable-source details > div { border:1px solid var(--border); border-radius:16px; background:var(--surface); padding:16px; }
#view-schedule #personal-schedule-history { margin-top:12px; }
#view-school-calendar .calendar-toolbar { align-items:flex-start; margin-bottom:16px; gap:16px; }
#view-school-calendar .calendar-filter-menu { flex:0 1 440px; text-align:right; }
#view-school-calendar .calendar-filter-menu > summary { display:inline-block; padding:12px 18px; border:1px solid var(--border); border-radius:24px; background:var(--surface); }
#view-school-calendar .calendar-filter-menu > summary::after { content:' ▾'; }
#view-school-calendar .calendar-filter-menu[open] > summary::after { content:' ▴'; }
#view-school-calendar .calendar-filters { margin-top:12px; padding:12px; border:1px solid var(--border); border-radius:16px; background:var(--surface); text-align:left; }
#view-school-calendar .school-calendar-card { border:1px solid var(--border); border-radius:20px; box-shadow:none; }
#view-school-calendar .calendar-options { margin-top:12px; }
#view-teachers .teacher-mode-switch { display:flex; gap:8px; margin-bottom:16px; }
#view-teachers .teacher-mode-switch button { min-height:44px; width:auto; padding:8px 18px; border-radius:24px; box-shadow:none; }
#view-teachers .teacher-mode-switch .icon { width:18px; height:18px; }
#view-teachers .teacher-search-panel { padding:0; border:0; background:transparent; box-shadow:none; margin:16px 0 20px; }
#view-teachers .large-search { min-height:52px; border-radius:14px; border:1px solid var(--border); background:var(--surface); }
#view-teachers .personal-reference-source-switch { margin-bottom:12px; }
#view-teachers .personal-reference-source-switch button { font-size:13px; min-height:44px; padding:8px 14px; }
#view-teachers .teacher-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#view-teachers .teacher-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 16px; align-items:center; padding:18px; border:1px solid var(--border); border-radius:16px; box-shadow:none; }
#view-teachers .teacher-card-head,#view-teachers .directory-card .teacher-card-head { grid-template-columns:40px minmax(0,1fr); gap:12px; }
#view-teachers .teacher-avatar { width:40px; height:40px; font-size:18px; }
#view-teachers .teacher-card-head strong { font-size:16px; }
#view-teachers .teacher-card-head small { font-size:13px; }
#view-teachers .teacher-card-actions { grid-column:2; grid-row:1 / span 2; margin:0; }
#view-teachers .teacher-card-actions button { font-size:13px; min-height:44px; padding:8px 12px; }
#view-teachers .directory-brief { grid-column:1; margin:0 0 0 52px; font-size:13px; color:var(--text-secondary); }
#view-teachers .teacher-facts,#view-teachers .directory-summary-row { grid-column:1 / -1; }
#view-library .library-import-hub { padding:0; margin:0 0 24px; border:0; border-radius:16px; background:none; box-shadow:none; }
#view-library .library-import-hub > summary { display:flex; align-items:center; gap:10px; width:fit-content; padding:12px 20px; border-radius:24px; color:var(--surface); background:var(--primary); }
#view-library .library-import-hub > summary::after { content:'＋'; margin-left:12px; }
#view-library .library-import-hub[open] > summary::after { content:'−'; }
#view-library .library-import-body { margin-top:16px; padding:20px; border:1px solid var(--border); border-radius:20px; background:var(--surface); }
#view-library .library-import-body h2 { font-size:18px; margin:0; }
#view-library .library-import-body > p { margin:6px 0 12px; font-size:13px; }
#view-library .library-import-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; }
#view-library .library-import-choice-grid > button { min-height:80px; padding:14px; border-radius:12px; }
#view-library .library-import-choice-grid small { font-size:12px; }
#view-library .library-shared-import { margin-top:12px; }
#view-library .library-import-assistant button { display:flex; gap:10px; align-items:center; padding:12px 0; border:0; background:none; color:var(--primary); text-align:left; cursor:pointer; }
#view-library .library-import-assistant small { display:block; margin-top:4px; color:var(--text-secondary); }
#view-library .library-simple-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
#view-library .library-sources { border:1px solid var(--border); border-radius:20px; box-shadow:none; }
#view-library .library-sources .card-header { min-height:0; padding:20px 20px 8px; border:0; }
#view-library .library-sources h2 { font-size:18px; }
#view-library .library-source-card { min-height:92px; padding:16px 20px; gap:12px; background:transparent; }
#view-library .library-source-card strong { font-size:15px; }
#view-library .library-source-card small { font-size:12px; }
#view-library .library-source-card button { font-size:13px; padding:8px 12px; }
#view-library .library-storage-details { margin-top:24px; border-top:1px solid var(--border); }
#view-library .library-storage-details > .card,#view-library .library-data-details { margin-top:16px; }
#view-library .library-storage-details .library-account-card { max-width:640px; }
#view-me .me-profile-card { margin-bottom:24px; border:1px solid var(--border); border-radius:20px; box-shadow:none; padding:24px; }
#view-me .me-profile-copy > small { display:none; }
#view-me .me-simple-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
#view-me .me-settings-group { padding:20px; border:1px solid var(--border); border-radius:20px; box-shadow:none; }
#view-me .me-settings-group h2 { margin:0 0 12px; font-size:18px; }
#view-me .me-link-grid { display:flex; flex-direction:column; gap:0; }
#view-me .me-link-card { min-height:88px; padding:16px 0; grid-template-columns:36px minmax(0,1fr) 20px; border:0; border-bottom:1px solid var(--border); border-radius:0; box-shadow:none; background:transparent; }
#view-me .me-link-card:last-child { border-bottom:0; }
#view-me .me-link-icon { width:36px; height:36px; padding:8px; border-radius:12px; }
#view-me .me-link-card strong { font-size:15px; }
#view-me .me-link-card small { font-size:12px; line-height:1.6; }
#view-me .me-privacy-details { margin-top:20px; }
#view-dashboard[data-home-design] .home-now { min-height:112px; padding:20px 24px; }
#view-dashboard[data-home-design] .now-lesson > span { font-size:18px; color:#fff; font-weight:600; }
#view-dashboard[data-home-design] .now-lesson > small,#view-dashboard[data-home-design] .now-lesson:is([data-state="free"],[data-state="done"]) > small { font-size:14px; color:#e6f0eb; }
#view-dashboard[data-home-design] .now-circle { width:56px; height:56px; }
#view-dashboard[data-home-design] .now-circle strong { font-size:24px; }
#view-dashboard[data-home-design] .now-holiday { font-size:14px; }
@media(max-width:1100px){
 #view-teachers .teacher-grid,#view-library .library-simple-layout,#view-me .me-simple-layout { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:760px){
 :is(#view-schedule,#view-school-calendar,#view-teachers,#view-library,#view-me) .page-heading { align-items:flex-start; gap:12px; flex-wrap:wrap; }
 :is(#view-schedule,#view-school-calendar,#view-teachers,#view-library,#view-me) .page-heading h1 { font-size:24px; }
 #view-schedule .heading-actions { width:auto; }
 #view-school-calendar .calendar-toolbar { flex-wrap:wrap; }
 #view-school-calendar .calendar-filter-menu { flex:1 1 100%; text-align:left; }
 #view-school-calendar .calendar-filters { flex-wrap:wrap; }
 #view-school-calendar .calendar-filters label { flex:1 1 120px; min-width:0; }
 #view-school-calendar .calendar-filters select { width:100%; min-width:0; }
 #view-library .library-import-choice-grid { grid-template-columns:minmax(0,1fr); }
 #view-library .library-source-card { padding:14px; grid-template-columns:32px minmax(0,1fr) auto; gap:10px; }
 #view-library .library-source-icon { width:32px; height:32px; padding:7px; }
 #view-library .library-import-body { padding:14px; }
 #view-me .me-profile-card { padding:18px; flex-wrap:wrap; }
 #view-me .me-settings-group { padding:16px; }
 #view-teachers .teacher-card { padding:14px; gap:8px; }
 #view-teachers .teacher-card-actions button { padding:8px; }
 #view-dashboard[data-home-design] .home-now { padding:18px; gap:12px; }
 #view-dashboard[data-home-design] .now-holiday-group { padding-top:12px; }
}
#view-schedule .workspace-empty { padding:40px 24px; text-align:center; border:1px solid var(--border); border-radius:20px; box-shadow:none; }
#view-schedule .workspace-empty h2 { font-size:20px; }
#view-schedule .workspace-empty p { color:var(--text-secondary); margin:8px 0 20px; }
#view-dashboard #task-status-tabs[hidden] { display:none; }
@media(max-width:760px){
 #view-library .library-source-card > .secondary-button { grid-column:3; grid-row:1; justify-self:end; }
 #view-library .library-source-card > span:nth-child(2) { grid-column:2; grid-row:1; }
 #view-library .library-source-card > .library-source-icon { grid-column:1; grid-row:1; }
}
@media(max-width:760px){
 #view-school-calendar .workspace-action-row > button { flex:1 1 200px; min-height:44px; white-space:nowrap; }
}

/* Homepage-only calendar: stable two-line cells, original workspace colors. */
#view-dashboard[data-home-design] .dashboard-date { min-height: 56px; grid-template-rows: 22px 18px; align-content: center; gap: 2px; padding: 5px 0 8px; }
#view-dashboard .date-lunar { max-width: 100%; min-width: 0; font-size: 11px; line-height: 18px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
#view-dashboard .date-lunar.is-festival { color: var(--primary); font-weight: 650; }
#view-dashboard .dashboard-date.outside { opacity: .55; }
#view-dashboard .dashboard-date.selected .date-lunar { color: #fff; }
#view-dashboard .dashboard-date[aria-current="date"]:not(.selected) { border-color: var(--primary); }
#view-dashboard .dashboard-lunar-detail { margin: 6px 0 12px; color: var(--primary); font-size: 13px; line-height: 1.6; }
#view-dashboard .dashboard-calendar-insights { grid-template-columns: minmax(0, 1fr); }

/* Assistant: one intake action, then one review action; scoped to this drawer. */
#detail-drawer .assistant-workflow { display: grid; gap: 16px; min-width: 0; }
#detail-drawer .assistant-workflow [hidden] { display: none; }
#detail-drawer .assistant-workflow summary { min-height: 44px; padding-block: 12px; color: var(--primary); cursor: pointer; overflow-wrap: anywhere; }
#detail-drawer .assistant-material > summary { display: none; }
#detail-drawer .assistant-workflow.has-result .assistant-material > summary { display: list-item; }
#detail-drawer .assistant-workflow .assistant-source { gap: 16px; padding: 0; }
#detail-drawer .assistant-workflow .assistant-intro { display: block; padding: 0; border: 0; background: none; }
#detail-drawer .assistant-workflow .assistant-intro strong { color: var(--primary); font-family: inherit; font-size: 20px; font-weight: 600; }
#detail-drawer .assistant-workflow .assistant-intro p { margin: 6px 0 4px; font-size: 14px; color: #5a6280; }
#detail-drawer .assistant-workflow #assistant-intake-text { min-height: 144px; padding: 14px; border-radius: 16px; }
#detail-drawer .assistant-workflow .assistant-upload { min-height: 84px; padding: 16px; border-width: 1px; border-radius: 16px; }
#detail-drawer .assistant-workflow .assistant-upload strong { font-size: 15px; }
#detail-drawer .assistant-workflow .assistant-upload small { margin-top: 3px; }
#detail-drawer .assistant-workflow .assistant-upload > .icon { width: 36px; height: 36px; padding: 8px; background: none; color: var(--primary); }
#detail-drawer .assistant-workflow .assistant-examples-disclosure { margin-top: -8px; }
#detail-drawer .assistant-workflow .assistant-examples { display: flex; flex-wrap: wrap; }
#detail-drawer .assistant-workflow .assistant-options { border-block: 1px solid var(--border); }
#detail-drawer .assistant-workflow .assistant-model-control { padding: 4px 0 16px; border: 0; border-radius: 0; background: none; }
#detail-drawer .assistant-workflow .assistant-local-mode { margin: 0; font-size: 14px; line-height: 1.6; color: #5a6280; }
#detail-drawer .assistant-workflow .assistant-save-note { margin: -6px 0 0; color: #5a6280; font-size: 13px; text-align: center; }
#detail-drawer .assistant-workflow .assistant-file-feedback { padding: 10px 0; background: none; border-radius: 0; }
#detail-drawer .assistant-workflow .assistant-result { display: grid; gap: 16px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
#detail-drawer .assistant-workflow .assistant-result-heading { display: block; }
#detail-drawer .assistant-workflow .assistant-result-heading strong { font-family: inherit; font-size: 24px; font-weight: 600; }
#detail-drawer .assistant-workflow .assistant-result-heading small { display: block; margin-top: 6px; font-size: 13px; color: #5a6280; }
#detail-drawer .assistant-workflow .assistant-result > p { margin: 0; line-height: 1.6; }
#detail-drawer .assistant-workflow .assistant-evidence { display: grid; margin-block: 8px; }
#detail-drawer .assistant-workflow .assistant-evidence > span { padding: 0; border-radius: 0; background: none; }
#detail-drawer .assistant-workflow .assistant-write-boundary { padding: 12px 0; background: none; }
#detail-drawer .assistant-workflow.has-result #assistant-analyze { color: var(--primary); border: 1px solid var(--border); background: #fff; }
#detail-drawer .assistant-workflow summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
#detail-drawer .assistant-workflow .assistant-result[hidden] { display: none; }
