:root {
  --bg: #edf3f6;
  --bg-grad: linear-gradient(180deg, #f7fafc 0%, #edf3f6 100%);
  --bg-elev: #f5f8fa;
  --bg-card: #ffffff;
  --bg-hover: #eaf2f7;
  --border: #d9e4eb;
  --border-strong: #bfd0dc;
  --text: #17324a;
  --text-dim: #46647b;
  --text-faint: #7b91a2;
  --accent: #4f8fbb;
  --accent-2: #3f7fab;
  --accent-soft: rgba(79, 143, 187, .13);
  --accent-glow: rgba(79, 143, 187, .2);
  --red: #cf5e69;
  --yellow: #b78324;
  --blue: #4f91bd;
  --green: #2d9b6c;
  --purple: #7477bd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 28px rgba(38, 72, 96, .12);
  --shadow-glow: 0 5px 16px var(--accent-glow);
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* ---------- sidebar ---------- */
#sidebar {
  width: 296px;
  min-width: 296px;
  background: rgba(12, 13, 18, .72);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 15px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px; cursor: pointer; }
/* The brand lockup is injected by brand.js; it brings its own inner markup. */
.brand .brand-lockup { display: flex; align-items: center; gap: 11px; }
/* The injected SVG carries its own rounded background, so the legacy gradient
   chip must not apply inside the lockup. */
.brand .brand-lockup .brand-mark {
  width: auto; height: auto; border-radius: 0; background: none; box-shadow: none;
  display: flex; align-items: center; justify-content: center; font-size: 0;
}
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand .brand-text strong { font-size: 15.5px; font-weight: 660; letter-spacing: -.02em; color: var(--text); }
.brand .brand-text span { font-size: 11px; color: var(--text-faint); letter-spacing: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.brand-text h1 { font-size: 16.5px; font-weight: 680; letter-spacing: -.02em; }
.brand-text span { font-size: 11px; color: var(--text-faint); letter-spacing: 0; }

.student-search {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(0, 0, 0, .25); color: var(--text);
  font-size: 13.5px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.student-search::placeholder { color: var(--text-faint); }
.student-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.student-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }

.student-tab {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 11px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--text);
  cursor: pointer; text-align: left; transition: background .14s, border-color .14s;
}
.student-tab:hover { background: var(--bg-hover); }
.student-tab.active { background: var(--accent-soft); border-color: var(--border-strong); }

.avatar {
  width: 36px; height: 36px; min-width: 36px; border-radius: 10px;
  background: var(--bg-hover); display: grid; place-items: center;
  font-weight: 680; font-size: 13px; color: var(--accent);
  border: 1px solid var(--border);
}
.student-tab.active .avatar { background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 4px 14px var(--accent-glow); }
.student-meta { flex: 1; min-width: 0; }
.student-meta .nm { font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-meta .lv { font-size: 11.5px; color: var(--text-faint); }
.tab-pill {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 650;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.add-student-btn {
  padding: 11px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong);
  background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px; font-weight: 550;
  transition: all .14s;
}
.add-student-btn:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.sidebar-foot { font-size: 11.5px; color: var(--text-faint); display: flex; align-items: center; gap: 7px; padding: 2px 6px; }
.sidebar-user { display: flex; align-items: center; gap: 7px; width: 100%; font-size: 11.5px; color: var(--text-faint); }
.sidebar-user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout {
  background: none; border: 1px solid var(--border); color: var(--text-faint);
  font-size: 11px; padding: 3px 9px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit;
}
.sidebar-logout:hover { border-color: var(--red); color: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.home-nav { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-dim); font: inherit; font-size: 13.5px; font-weight: 560; cursor: pointer; text-align: left; transition: background .14s, color .14s, border-color .14s; }
.home-nav span { font-size: 17px; color: var(--text-faint); }
.home-nav:hover { background: var(--bg-hover); color: var(--text); }
.home-nav.active { background: var(--accent-soft); border-color: var(--border-strong); color: var(--text); }
.brand[role="button"] { cursor: pointer; }
.brand[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }

/* ---------- main ---------- */
#main { flex: 1; overflow-y: auto; position: relative; }

/* ---------- home dashboard ---------- */
.home-shell { max-width: 1240px; margin: 0 auto; padding: 46px 42px 72px; }
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; padding: 6px 0 30px; }
.home-head h2 { font-size: 25px; line-height: 1.2; letter-spacing: -.025em; font-weight: 620; color: var(--text); margin: 0; }
.home-work { font-size: 14.5px; color: var(--text-dim); margin-top: 7px; }
.home-work.has-work { color: var(--accent-2); font-weight: 560; }
.home-head > .btn { white-space: nowrap; flex-shrink: 0; }
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 18px 0 38px; }
.home-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 11px; font-weight: 560; letter-spacing: .075em; text-transform: uppercase; margin-bottom: 18px; }
.home-hero h2 { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.04; letter-spacing: -.048em; font-weight: 560; color: #f7f8f8; }
.home-hero h2 span { color: #7f8490; }
.home-hero p { color: var(--text-faint); max-width: 610px; font-size: 14.5px; line-height: 1.65; margin-top: 18px; }
.home-hero > .btn { margin-bottom: 4px; white-space: nowrap; }

.home-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.018); margin-bottom: 40px; }
.home-stat { padding: 19px 21px; min-width: 0; border-right: 1px solid var(--border); position: relative; }
.home-stat:last-child { border-right: 0; }
.home-stat.alert::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--yellow); }
.home-stat-label { color: var(--text-faint); font-size: 11px; font-weight: 560; letter-spacing: .045em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.home-stat-value { color: var(--text); font-size: 25px; line-height: 1.1; letter-spacing: -.035em; font-weight: 560; margin-top: 10px; }
.home-stat-sub { color: var(--text-faint); font-size: 11.5px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-live { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }

.home-section { margin-bottom: 36px; }
.home-section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; color: var(--text-faint); font-size: 12px; }
.home-section-head h3 { color: var(--text); font-size: 18px; font-weight: 560; letter-spacing: -.025em; margin-top: 5px; }
.section-kicker { color: var(--text-faint); font-size: 10px; font-weight: 590; letter-spacing: .12em; }
.home-student-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.home-student-card { display: block; width: 100%; min-height: 190px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.018); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: background .16s, border-color .16s, transform .16s; }
.home-student-card:hover { background: rgba(255,255,255,.038); border-color: var(--border-strong); transform: translateY(-2px); }
.home-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.home-card-head .avatar { background: rgba(113,112,255,.12); border-color: rgba(113,112,255,.25); }
.home-open { color: var(--text-faint); font-size: 16px; transition: color .14s, transform .14s; }
.home-student-card:hover .home-open { color: var(--text); transform: translate(2px,-2px); }
.home-card-name { font-size: 16px; font-weight: 560; letter-spacing: -.02em; }
.home-card-level { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.home-card-divider { height: 1px; background: var(--border); margin: 20px 0 13px; }
.home-card-metrics { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-faint); font-size: 11.5px; }
.home-card-metrics strong { color: var(--text-dim); font-weight: 560; }
.needs-review { color: var(--yellow); }
.up-to-date { color: var(--green); }

.home-value-strip { display: flex; align-items: center; gap: 15px; padding: 17px 18px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(90deg, rgba(113,112,255,.07), rgba(255,255,255,.014)); }
.value-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 21px; border: 1px solid rgba(113,112,255,.2); }
.home-value-strip > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.home-value-strip strong { font-size: 13.5px; font-weight: 560; }
.home-value-strip span { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-value-strip .btn { margin-left: auto; white-space: nowrap; }
.home-empty { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.home-empty h2 { font-size: 27px; font-weight: 560; letter-spacing: -.035em; }
.home-empty p { max-width: 440px; color: var(--text-faint); font-size: 14px; line-height: 1.65; margin-bottom: 8px; }

@media (max-width: 1000px) {
  .home-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .home-stat:nth-child(2) { border-right: 0; }
  .home-stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .home-student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .home-shell { padding: 70px 18px 52px; }
  .home-hero { align-items: flex-start; flex-direction: column; }
  .home-hero h2 { font-size: 36px; }
  .home-student-grid { grid-template-columns: 1fr; }
  .home-value-strip { align-items: flex-start; flex-wrap: wrap; }
  .home-value-strip .btn { margin-left: 53px; }
}

.empty-state {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px; gap: 14px;
}
.empty-icon { font-size: 64px; animation: float 3.5s ease-in-out infinite; filter: drop-shadow(0 8px 30px var(--accent-glow)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.empty-state h2 { font-size: 30px; font-weight: 720; letter-spacing: -.03em; background: linear-gradient(120deg, #fff, #b9b3d6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.empty-state p { color: var(--text-dim); max-width: 460px; line-height: 1.65; font-size: 15px; }
.empty-hint { color: var(--text-faint) !important; font-size: 13px !important; }

/* ---------- student view ---------- */
.sv-head { padding: 30px 38px 0; }
.sv-title { display: flex; align-items: center; gap: 16px; }
.sv-title .avatar { width: 56px; height: 56px; min-width: 56px; border-radius: 15px; font-size: 20px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 20px var(--accent-glow); }
.sv-title h2 { font-size: 25px; font-weight: 720; letter-spacing: -.03em; }
.sv-title .sub { color: var(--text-dim); font-size: 13.5px; margin-top: 3px; }
.sv-actions { margin-left: auto; display: flex; gap: 8px; }

.tabs { display: flex; gap: 2px; margin-top: 26px; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 11px 16px; background: transparent; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 13.5px; font-weight: 560; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .14s; display: flex; align-items: center;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.sv-body { padding: 26px 38px 70px; }

/* ---------- workspaces ---------- */
.workspace-backbar { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.workspace-backbar > button { border: 1px solid var(--border); border-radius: 7px; background: rgba(255,255,255,.02); color: var(--text-dim); padding: 7px 10px; cursor: pointer; font: inherit; font-size: 11.5px; }
.workspace-backbar > button:hover { color: var(--text); border-color: var(--border-strong); }
.workspace-backbar h3 { color: var(--text); font-size: 16px; font-weight: 560; letter-spacing: -.02em; margin-top: 3px; }
.workspace-subnav { width: fit-content; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,.18); margin-bottom: 18px; }
.workspace-subnav button { border: 0; border-radius: 6px; background: transparent; color: var(--text-faint); padding: 7px 13px; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 510; }
.workspace-subnav button.active { color: var(--text); background: var(--bg-hover); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.history-workspace-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.history-workspace-head h3 { color: var(--text); font-size: 20px; font-weight: 560; letter-spacing: -.03em; margin-top: 5px; }
.history-workspace-head .workspace-subnav { margin-bottom: 0; }
.compact-history-section { margin-top: 0; }
.report-accordion .lesson-summary-icon { color: var(--green); background: rgba(70,224,160,.08); border-color: rgba(70,224,160,.15); }
@media (max-width: 720px) {
  .history-workspace-head { align-items: flex-start; flex-direction: column; }
  .history-workspace-head .workspace-subnav { width: 100%; }
  .history-workspace-head .workspace-subnav button { flex: 1; }
}

/* ---------- evidence timeline ---------- */
.evidence-timeline { position: relative; padding-left: 6px; }
.evidence-timeline::before { content: ""; position: absolute; left: 21px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.evidence-event { position: relative; display: flex; gap: 16px; padding: 0 0 22px; }
.evidence-event:last-child { padding-bottom: 0; }
.evidence-dot { position: relative; z-index: 1; width: 42px; height: 42px; min-width: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--border); font-size: 17px; box-shadow: 0 2px 6px rgba(48,81,104,.06); }
.evidence-class .evidence-dot { border-color: rgba(79,143,187,.35); }
.evidence-lesson .evidence-dot { border-color: rgba(119,120,189,.35); }
.evidence-report .evidence-dot { border-color: rgba(45,155,108,.35); }
.evidence-attention .evidence-dot { border-color: rgba(183,131,36,.4); }
.evidence-attention.severity-critical .evidence-dot { border-color: rgba(207,94,105,.5); background: rgba(207,94,105,.06); }
.evidence-body { flex: 1; min-width: 0; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 3px 10px rgba(48,81,104,.045); }
.evidence-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.evidence-top strong { color: var(--text); font-size: 13.5px; font-weight: 600; }
.evidence-top time { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.evidence-body p { color: var(--text-dim); font-size: 12.5px; line-height: 1.55; margin-top: 5px; }
.evidence-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.evidence-link { color: var(--accent); font-size: 11.5px; text-decoration: none; }
.evidence-link:hover { text-decoration: underline; }
.evidence-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--bg-hover); color: var(--text-faint); font-size: 10.5px; }
.evidence-tag.severity-critical { color: var(--red); background: rgba(207,94,105,.11); }
.evidence-tag.severity-warning { color: var(--yellow); background: rgba(183,131,36,.11); }
.evidence-attention.severity-critical .evidence-body { border-color: rgba(207,94,105,.3); }

/* ---------- class calendar ---------- */
.calendar-card { border: 1px solid var(--border); border-radius: 11px; background: #fff; padding: 16px 18px 18px; box-shadow: 0 4px 14px rgba(48,81,104,.05); }
.calendar-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.calendar-toolbar strong { color: var(--text); font-size: 15px; font-weight: 620; min-width: 150px; }
.calendar-nav { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; }
.calendar-nav:hover { border-color: var(--accent); color: var(--accent); }
.calendar-today { margin-left: auto; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.calendar-weekdays { margin-bottom: 6px; }
.calendar-weekdays > div { color: var(--text-faint); font-size: 10.5px; font-weight: 650; text-align: center; letter-spacing: .04em; }
.calendar-day { min-height: 78px; padding: 6px 6px 7px; border: 1px solid var(--border); border-radius: 8px; background: #fbfdfe; display: flex; flex-direction: column; gap: 3px; }
.calendar-day.outside { background: transparent; border-color: transparent; opacity: .45; }
.calendar-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.calendar-day.has-classes { background: #fff; }
.calendar-day-num { color: var(--text-faint); font-size: 11px; font-weight: 600; }
.calendar-day.today .calendar-day-num { color: var(--accent); }
.calendar-class-pill { display: block; width: 100%; border: 0; border-radius: 5px; background: var(--accent-soft); color: var(--accent); text-align: left; cursor: pointer; font-size: 10px; line-height: 1.3; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-class-pill:hover { background: rgba(79,143,187,.22); }
.calendar-more { color: var(--text-faint); font-size: 9.5px; padding-left: 5px; }
@media (max-width: 720px) {
  .calendar-day { min-height: 56px; }
  .calendar-class-pill { font-size: 9px; }
}

/* ---------- simple teacher summary ---------- */
.simple-summary-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.simple-summary-head h3 { color: var(--text); font-size: 24px; font-weight: 620; letter-spacing: -.025em; margin-top: 5px; }
.simple-summary-head p { color: var(--text-faint); font-size: 13.5px; margin-top: 5px; }
.simple-primary-actions { display: flex; gap: 9px; }
.simple-primary-actions .btn { min-height: 42px; font-size: 13.5px; }
.simple-approval-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; margin-bottom: 16px; border: 1px solid rgba(79,143,187,.28); border-radius: 10px; background: #f4f9fc; }
.simple-approval-banner > div { display: flex; align-items: center; gap: 11px; }
.simple-approval-banner > div:first-child > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-size: 16px; }
.simple-approval-banner p { display: flex; flex-direction: column; gap: 2px; }
.simple-approval-banner strong { color: var(--text); font-size: 13.5px; }
.simple-approval-banner small { color: var(--text-faint); font-size: 12px; }
.simple-approval-banner > div:last-child { gap: 12px; }
.simple-insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.simple-insight-card { min-height: 300px; padding: 18px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 5px 16px rgba(48,81,104,.06); }
.insight-errors { border-top: 4px solid var(--red); }
.insight-strengths { border-top: 4px solid var(--green); }
.insight-improve { border-top: 4px solid var(--yellow); }
.insight-attention { border-top: 4px solid var(--purple); }
.insight-heading { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.insight-icon { width: 34px; height: 34px; min-width: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 16px; font-weight: 700; }
.insight-errors .insight-icon { color: var(--red); background: rgba(207,94,105,.11); }
.insight-strengths .insight-icon { color: var(--green); background: rgba(45,155,108,.11); }
.insight-improve .insight-icon { color: var(--yellow); background: rgba(183,131,36,.12); }
.insight-attention .insight-icon { color: var(--purple); background: rgba(119,120,189,.12); }
.insight-heading h4 { color: var(--text); font-size: 16px; font-weight: 620; }
.insight-heading p { color: var(--text-faint); font-size: 11.5px; line-height: 1.4; margin-top: 3px; }
.attention-add { margin-left: auto; width: 26px; height: 26px; min-width: 26px; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--text-faint); cursor: pointer; font-size: 15px; line-height: 1; }
.attention-add:hover { color: var(--accent); border-color: var(--accent); }
.attention-item { align-items: center; }
.attention-item button { border: 0; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 13px; padding: 2px 6px; }
.attention-item button:hover { color: var(--green); }
.attention-item.severity-critical span { color: var(--red); font-weight: 550; }
.attention-item.severity-warning span { color: var(--text-dim); }
.attention-item.severity-info span { color: var(--text-faint); }
.tag-attention { color: var(--purple); background: rgba(119,120,189,.12); }
.tag-attention.severity-critical { color: var(--red); background: rgba(207,94,105,.12); }

.simple-insight-list { display: flex; flex-direction: column; gap: 0; margin-top: 5px; }
.simple-insight-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 2px; border-bottom: 1px solid #e9eff3; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.simple-insight-item:last-child { border-bottom: 0; }
.simple-insight-item > span { min-width: 0; }
.simple-insight-item b { min-width: 30px; padding: 2px 7px; border-radius: 999px; text-align: center; font-size: 10px; font-weight: 650; }
.insight-errors .simple-insight-item b { color: var(--red); background: rgba(207,94,105,.1); }
.insight-improve .simple-insight-item b { color: var(--yellow); background: rgba(183,131,36,.11); }
.simple-insight-empty { padding: 30px 6px; color: var(--text-faint); font-size: 13px; line-height: 1.5; text-align: center; }
.simple-lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 13px; }
.simple-info-card { min-height: 130px; padding: 17px 18px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 4px 14px rgba(48,81,104,.045); }
.simple-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.simple-card-top > span { color: var(--text-faint); font-size: 10px; font-weight: 650; letter-spacing: .1em; }
.simple-info-card > strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--text); font-size: 14px; line-height: 1.5; font-weight: 580; }
.simple-info-card > small { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 8px; }
.simple-info-card > p { color: var(--text-faint); font-size: 13px; margin-bottom: 7px; }
.simple-profile-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 17px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.simple-profile-line > div { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.simple-profile-line strong { color: var(--text-faint); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.simple-profile-line span { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.second-brain-entry { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 16px; padding: 15px 17px; margin-top: 13px; border: 1px solid rgba(79,143,187,.24); border-radius: 10px; background: linear-gradient(90deg, rgba(79,143,187,.1), #fff 62%); }
.second-brain-mini { position: relative; width: 76px; height: 58px; border-radius: 9px; background: rgba(79,143,187,.08); overflow: hidden; }
.second-brain-mini::before, .second-brain-mini::after { content: ""; position: absolute; width: 52px; height: 1px; left: 12px; top: 29px; background: rgba(79,143,187,.24); transform: rotate(25deg); }
.second-brain-mini::after { transform: rotate(-25deg); }
.mini-core, .mini-node { position: absolute; display: block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(79,143,187,.12); }
.mini-core { width: 13px; height: 13px; left: 32px; top: 23px; z-index: 2; }
.mini-node { width: 7px; height: 7px; z-index: 2; }
.mini-node.n1 { left: 11px; top: 11px; background: var(--red); }
.mini-node.n2 { right: 11px; top: 10px; background: var(--green); }
.mini-node.n3 { left: 12px; bottom: 9px; background: var(--yellow); }
.mini-node.n4 { right: 12px; bottom: 10px; background: var(--purple); }
.second-brain-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.second-brain-copy strong { color: var(--text); font-size: 13.5px; }
.second-brain-copy p { color: var(--text-faint); font-size: 11.5px; line-height: 1.45; }
.second-brain-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.second-brain-action > span { color: var(--text-faint); font-size: 10.5px; }
.second-brain-action .btn { white-space: nowrap; }
@media (max-width: 720px) { .second-brain-entry { grid-template-columns: 66px 1fr; } .second-brain-mini { width: 60px; } .second-brain-action { grid-column: 2; align-items: flex-start; } }
.simple-review-list { max-height: 360px; overflow-y: auto; }
.simple-review-actions { align-items: center; }
@media (max-width: 1040px) {
  .simple-insight-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .simple-insight-card { min-height: 0; }
}
@media (max-width: 620px) {
  .simple-insight-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .simple-summary-head { align-items: flex-start; flex-direction: column; }
  .simple-primary-actions { width: 100%; }
  .simple-primary-actions .btn { flex: 1; justify-content: center; }
  .simple-lower-grid { grid-template-columns: 1fr; }
  .simple-approval-banner { align-items: flex-start; flex-direction: column; }
  .simple-profile-line > div { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* ---------- student overview ---------- */
.student-quickbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 19px; }
.student-quickbar h3 { color: var(--text); font-size: 18px; font-weight: 560; letter-spacing: -.025em; margin-top: 5px; }
.quick-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.today-command-center { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 10px; margin-bottom: 14px; }
.next-action-card, .prepared-lesson-card { min-width: 0; border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; font: inherit; text-align: left; transition: border-color .14s, background .14s, transform .14s; }
.next-action-card:hover, .prepared-lesson-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.next-action-card { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 16px 17px; background: linear-gradient(110deg, rgba(139,123,255,.16), rgba(176,108,255,.05)); border-color: rgba(139,123,255,.3); }
.next-action-card.next-action-review { background: linear-gradient(110deg, rgba(255,207,92,.11), rgba(255,255,255,.015)); border-color: rgba(255,207,92,.25); }
.next-action-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.next-action-review .next-action-icon { color: var(--yellow); background: rgba(255,207,92,.1); }
.next-action-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.next-action-copy small, .prepared-lesson-top small { color: var(--text-faint); font-size: 9.5px; font-weight: 590; letter-spacing: .1em; }
.next-action-copy strong { font-size: 14px; font-weight: 590; }
.next-action-copy > span { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-action-card > b { color: var(--accent); font-size: 11px; font-weight: 560; white-space: nowrap; }
.next-action-review > b { color: var(--yellow); }
.prepared-lesson-card { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; background: rgba(255,255,255,.017); }
.prepared-lesson-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prepared-lesson-top time { color: var(--text-faint); font-size: 10.5px; white-space: nowrap; }
.prepared-lesson-card > strong { font-size: 12.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prepared-lesson-card > span:not(.prepared-lesson-top) { color: var(--text-faint); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prepared-lesson-card > b { color: var(--text-dim); font-size: 10.5px; font-weight: 560; margin-top: 3px; }
.student-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.015); margin-bottom: 16px; }
.student-metric { padding: 15px 18px; border-right: 1px solid var(--border); position: relative; }
.student-metric:last-child { border-right: 0; }
.student-metric > span { display: block; color: var(--text-faint); font-size: 10.5px; font-weight: 560; letter-spacing: .06em; text-transform: uppercase; }
.student-metric strong { display: block; color: var(--text); font-size: 22px; font-weight: 560; line-height: 1.15; letter-spacing: -.035em; margin-top: 7px; }
.student-metric small { display: block; color: var(--text-faint); font-size: 11px; margin-top: 3px; }
.student-metric.metric-alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--red); }
.pending-banner { width: 100%; display: flex; align-items: center; gap: 13px; padding: 13px 16px; margin-bottom: 16px; border: 1px solid rgba(255,207,92,.2); border-radius: 9px; background: rgba(255,207,92,.055); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.pending-banner > span { color: var(--yellow); font-size: 19px; }
.pending-banner > div { display: flex; flex-direction: column; gap: 2px; }
.pending-banner strong { font-size: 12.5px; font-weight: 560; }
.pending-banner small { color: var(--text-faint); font-size: 11.5px; }
.pending-banner b { margin-left: auto; color: var(--yellow); font-size: 11.5px; font-weight: 560; white-space: nowrap; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(300px, .68fr); gap: 13px; align-items: start; }
.overview-main, .overview-side { display: flex; flex-direction: column; gap: 13px; }
.overview-panel { padding: 18px 19px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.017); }
.overview-panel:hover { border-color: var(--border-strong); }
.panel-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-label { color: var(--text-faint); font-size: 10px; font-weight: 590; letter-spacing: .11em; }
.panel-date { color: var(--text-faint); font-size: 11.5px; }
.text-action { border: 0; background: transparent; color: var(--text-faint); padding: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 510; transition: color .13s; }
.text-action:hover { color: var(--accent); }
.focus-panel { position: relative; overflow: hidden; background: linear-gradient(120deg, rgba(255,106,125,.055), rgba(255,255,255,.012) 55%); }
.focus-panel::after { content: ""; position: absolute; width: 170px; height: 170px; right: -85px; top: -85px; border-radius: 50%; border: 1px solid rgba(255,106,125,.12); box-shadow: 0 0 0 26px rgba(255,106,125,.025), 0 0 0 52px rgba(255,106,125,.018); pointer-events: none; }
.focus-panel h3, .overview-panel > h3 { position: relative; z-index: 1; color: var(--text); font-size: 16px; font-weight: 560; line-height: 1.45; letter-spacing: -.018em; margin-bottom: 8px; }
.focus-panel p { position: relative; z-index: 1; color: var(--text-faint); font-size: 12.5px; line-height: 1.6; max-width: 84%; margin-bottom: 14px; }
.focus-count { color: var(--red); background: rgba(255,106,125,.1); border: 1px solid rgba(255,106,125,.17); border-radius: 999px; padding: 3px 8px; font-size: 10.5px; }
.latest-class-meta { display: flex; align-items: center; justify-content: space-between; color: var(--text-faint); font-size: 11.5px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.overview-panel:not(.focus-panel) > h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.panel-empty { color: var(--text-faint); font-size: 12.5px; line-height: 1.6; padding: 8px 0; }
.ai-mark { color: var(--accent); font-size: 10.5px; font-weight: 590; letter-spacing: .05em; }
.briefing-intro { color: var(--text-faint); font-size: 12.5px; line-height: 1.6; margin-bottom: 14px; }

.brain-breakdown { display: flex; flex-direction: column; gap: 13px; }
.breakdown-row { display: flex; flex-direction: column; gap: 6px; }
.breakdown-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-dim); font-size: 11.5px; }
.breakdown-head span { display: flex; align-items: center; gap: 7px; }
.breakdown-head i { width: 7px; height: 7px; border-radius: 50%; }
.breakdown-head b { color: var(--text-faint); font-weight: 560; }
.breakdown-track { height: 3px; background: rgba(255,255,255,.04); border-radius: 3px; overflow: hidden; }
.breakdown-track span { display: block; height: 100%; min-width: 2px; border-radius: 3px; opacity: .75; }
.profile-panel .profile-row { display: block; margin-bottom: 13px; }
.profile-panel .profile-row:last-child { margin-bottom: 0; }
.profile-panel .profile-row .k { display: block; min-width: 0; color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.profile-panel .profile-row .v { display: block; color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }
.progress-signal { display: flex; align-items: flex-start; gap: 10px; }
.progress-signal > span { color: var(--green); width: 26px; height: 26px; min-width: 26px; display: grid; place-items: center; border-radius: 7px; background: rgba(70,224,160,.08); border: 1px solid rgba(70,224,160,.14); }
.progress-signal p { color: var(--text-dim); font-size: 12.5px; line-height: 1.55; }

@media (max-width: 1040px) {
  .overview-layout { grid-template-columns: 1fr; }
  .student-quickbar { align-items: flex-start; flex-direction: column; }
  .quick-actions { justify-content: flex-start; }
  .today-command-center { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .student-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .student-metric:nth-child(2) { border-right: 0; }
  .student-metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .quick-actions { width: 100%; }
  .quick-actions .btn { flex: 1; justify-content: center; }
  .pending-banner { align-items: flex-start; }
  .pending-banner b { display: none; }
  .next-action-card { grid-template-columns: 38px minmax(0,1fr); }
  .next-action-card > b { grid-column: 2; }
}

/* ---------- lesson builder ---------- */
.lesson-builder-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.lesson-builder-head h3 { color: var(--text); font-size: 23px; font-weight: 560; letter-spacing: -.035em; margin: 5px 0 5px; }
.lesson-builder-head p { color: var(--text-faint); font-size: 12.5px; }
.duration-fixed { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: 9px; background: rgba(255,255,255,.025); }
.duration-fixed > span { color: var(--accent); font-size: 20px; }
.duration-fixed > div { display: flex; flex-direction: column; }
.duration-fixed strong { color: var(--text); font-size: 13px; font-weight: 560; }
.duration-fixed small { color: var(--text-faint); font-size: 10.5px; }
.lesson-builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 13px; align-items: start; }
.lesson-config-panel { display: flex; flex-direction: column; gap: 11px; }
.config-section { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.016); }
.config-number { color: var(--text-faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; padding-top: 2px; }
.config-content { min-width: 0; }
.config-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.config-title h4 { color: var(--text); font-size: 14px; font-weight: 560; letter-spacing: -.015em; }
.config-title p { color: var(--text-faint); font-size: 11.5px; margin-top: 3px; }
.objective-input { font-size: 14px !important; padding: 12px 13px !important; }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lesson-option { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.012); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: border-color .14s, background .14s; }
.lesson-option:hover { background: rgba(255,255,255,.035); border-color: var(--border-strong); }
.lesson-option.active { background: rgba(113,112,255,.09); border-color: rgba(113,112,255,.45); box-shadow: inset 0 0 0 1px rgba(113,112,255,.08); }
.lesson-option > span { width: 25px; height: 25px; min-width: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--text-dim); background: rgba(255,255,255,.04); font-size: 14px; }
.lesson-option.active > span { color: var(--accent); background: rgba(113,112,255,.13); }
.lesson-option > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson-option strong { color: var(--text-dim); font-size: 11.5px; font-weight: 560; }
.lesson-option.active strong { color: var(--text); }
.lesson-option small { color: var(--text-faint); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.style-option { padding: 10px 11px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.012); color: var(--text); text-align: left; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px; transition: border-color .14s, background .14s; }
.style-option:hover { background: rgba(255,255,255,.035); border-color: var(--border-strong); }
.style-option.active { background: rgba(113,112,255,.09); border-color: rgba(113,112,255,.45); }
.style-option strong { font-size: 11.5px; font-weight: 560; color: var(--text-dim); }
.style-option.active strong { color: var(--text); }
.style-option small { font-size: 9.8px; color: var(--text-faint); }
.advanced-config { border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.012); overflow: hidden; }
.advanced-config summary { padding: 14px 17px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; color: var(--text-dim); font-size: 12.5px; }
.advanced-config summary::-webkit-details-marker { display: none; }
.advanced-config summary small { color: var(--text-faint); font-size: 10.5px; }
.advanced-config[open] summary { border-bottom: 1px solid var(--border); }
.advanced-body { padding: 4px 17px 17px; }
.advanced-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.advanced-row > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.advanced-row strong { color: var(--text-dim); font-size: 11.5px; font-weight: 560; }
.advanced-row small { color: var(--text-faint); font-size: 10px; }
.segment-control { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: rgba(0,0,0,.18); }
.segment-control button { border: 0; border-radius: 5px; background: transparent; color: var(--text-faint); padding: 6px 9px; cursor: pointer; font: inherit; font-size: 10.5px; white-space: nowrap; }
.segment-control button.active { color: var(--text); background: var(--bg-hover); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.toggle-list { display: flex; gap: 14px; }
.toggle-option { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 11px; cursor: pointer; }
.toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-option > span { width: 27px; height: 16px; border-radius: 99px; background: var(--bg-hover); border: 1px solid var(--border-strong); position: relative; transition: background .15s; }
.toggle-option > span::after { content: ""; position: absolute; width: 10px; height: 10px; left: 2px; top: 2px; border-radius: 50%; background: var(--text-faint); transition: transform .15s, background .15s; }
.toggle-option input:checked + span { background: var(--accent); border-color: var(--accent); }
.toggle-option input:checked + span::after { transform: translateX(11px); background: #fff; }
.advanced-instruction { margin: 14px 0 0 !important; }
.advanced-instruction textarea { min-height: 70px; }
.generate-main-btn { min-height: 46px; justify-content: center; font-size: 13.5px; }

.lesson-context-panel { position: sticky; top: 20px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.016); overflow: hidden; }
.context-head { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.context-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.context-head > div { display: flex; flex-direction: column; gap: 2px; }
.context-head strong { color: var(--text); font-size: 12px; font-weight: 560; }
.context-head small { color: var(--text-faint); font-size: 10px; }
.context-block { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.context-label { display: block; color: var(--text-faint); font-size: 9px; font-weight: 590; letter-spacing: .11em; margin-bottom: 7px; }
.context-block p { color: var(--text-dim); font-size: 11.5px; line-height: 1.55; }
.context-block button { width: 100%; display: grid; grid-template-columns: 7px 1fr auto; gap: 8px; align-items: start; border: 0; background: transparent; color: var(--text-dim); text-align: left; cursor: pointer; padding: 6px 0; font: inherit; font-size: 10.5px; line-height: 1.4; }
.context-block button i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-top: 4px; }
.context-block button b { color: var(--red); font-size: 9.5px; font-weight: 560; }
.context-block button:hover span { color: var(--text); }
.context-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 13px 8px; }
.context-summary > div { display: flex; flex-direction: column; align-items: center; gap: 2px; border-right: 1px solid var(--border); }
.context-summary > div:last-child { border-right: 0; }
.context-summary strong { color: var(--text); font-size: 14px; font-weight: 560; }
.context-summary span { color: var(--text-faint); font-size: 8.5px; text-transform: uppercase; letter-spacing: .06em; }
.generation-output { margin-top: 18px; }
.generation-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.lesson-history { margin-top: 34px; }
.lesson-accordion { border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.012); margin-bottom: 7px; overflow: hidden; transition: border-color .14s, background .14s; }
.lesson-accordion:hover, .lesson-accordion[open] { border-color: var(--border-strong); background: rgba(255,255,255,.022); }
.lesson-accordion > summary { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 13px 15px; cursor: pointer; list-style: none; }
.lesson-accordion > summary::-webkit-details-marker { display: none; }
.lesson-summary-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(113,112,255,.18); }
.lesson-summary-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson-summary-main > strong { color: var(--text-dim); font-size: 12.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-summary-meta { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 9.5px; }
.lesson-tags { display: flex; gap: 5px; min-height: 16px; }
.lesson-tags span { color: var(--text-faint); background: rgba(255,255,255,.035); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 9px; }
.accordion-chevron { color: var(--text-faint); font-size: 16px; transition: transform .16s; }
.lesson-accordion[open] > summary .accordion-chevron, .history-accordion[open] > summary .accordion-chevron { transform: rotate(180deg); }
.lesson-detail { max-height: 580px; overflow-y: auto; padding: 19px 22px 20px 60px; border-top: 1px solid var(--border); background: rgba(0,0,0,.12); }
.lesson-detail-actions { position: sticky; bottom: -20px; display: flex; gap: 7px; justify-content: flex-end; padding: 13px 0 0; margin-top: 18px; border-top: 1px solid var(--border); background: linear-gradient(transparent, var(--bg-elev) 24%); }

/* class history timeline */
.class-log-card { max-width: 820px; }
.history-section { margin-top: 36px; }
.history-timeline { position: relative; padding-left: 24px; }
.history-timeline::before { content: ""; position: absolute; left: 6px; top: 13px; bottom: 13px; width: 1px; background: var(--border); }
.history-accordion { position: relative; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.012); margin-bottom: 8px; transition: border-color .14s, background .14s; }
.history-accordion:hover, .history-accordion[open] { border-color: var(--border-strong); background: rgba(255,255,255,.022); }
.history-accordion > summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; padding: 13px 15px; cursor: pointer; list-style: none; }
.history-accordion > summary::-webkit-details-marker { display: none; }
.timeline-dot { position: absolute; width: 9px; height: 9px; left: -23px; top: 19px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-faint); box-shadow: 0 0 0 4px var(--bg); }
.history-accordion[open] .timeline-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 8px var(--accent-glow); }
.history-summary-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.history-summary-top { display: flex; align-items: center; gap: 8px; }
.history-summary-main > strong { color: var(--text-dim); font-size: 12px; font-weight: 510; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memory-extracted { color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 7px; font-size: 9px; }
.history-detail { padding: 17px 18px; border-top: 1px solid var(--border); background: rgba(0,0,0,.11); }
.history-detail-label { color: var(--text-faint); font-size: 9px; font-weight: 590; letter-spacing: .1em; margin-bottom: 8px; }
.history-detail-text { color: var(--text-dim); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; }
.history-detail-actions { display: flex; justify-content: flex-end; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--border); }
.transcript-detail { margin-top: 14px; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.transcript-detail > summary { padding: 9px 11px; color: var(--text-faint); cursor: pointer; font-size: 11px; list-style: none; }
.transcript-detail > div { max-height: 300px; overflow-y: auto; padding: 12px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 11px; line-height: 1.55; white-space: pre-wrap; }

@media (max-width: 1040px) {
  .lesson-builder-layout { grid-template-columns: 1fr; }
  .lesson-context-panel { position: static; }
}
@media (max-width: 720px) {
  .lesson-builder-head { align-items: flex-start; flex-direction: column; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .style-grid { grid-template-columns: 1fr; }
  .advanced-row { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .segment-control { width: 100%; }
  .segment-control button { flex: 1; }
  .config-section { grid-template-columns: 1fr; }
  .config-number { display: none; }
  .config-title { flex-direction: column; }
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent), var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 16px;
}
.card h3 { font-size: 15.5px; font-weight: 660; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; letter-spacing: -.02em; }
.card .card-sub { font-size: 12.5px; color: var(--text-faint); margin-bottom: 15px; line-height: 1.55; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.profile-row { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.55; }
.profile-row .k { color: var(--text-faint); min-width: 92px; font-weight: 500; }
.profile-row .v { color: var(--text); flex: 1; }

/* ---------- buttons ---------- */
.btn {
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-hover); color: var(--text); cursor: pointer; font-size: 13px;
  font-weight: 560; transition: all .14s; display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { background: #222635; border-color: var(--text-faint); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(140deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 6px 22px var(--accent-glow); filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: rgba(255, 106, 125, .1); border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- memories ---------- */
.mem-group { margin-bottom: 22px; }
.mem-group-title { font-size: 12px; font-weight: 660; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.mem-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px;
  background: rgba(255, 255, 255, .02); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 7px; font-size: 13.5px; line-height: 1.55; transition: border-color .14s, background .14s;
}
.mem-item:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, .035); }
.mem-item .mem-dot { font-size: 8px; margin-top: 6px; }
.mem-item .mem-text { flex: 1; }
.mem-item .mem-actions { display: flex; gap: 5px; opacity: 0; transition: opacity .14s; }
.mem-item:hover .mem-actions { opacity: 1; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--text-dim); cursor: pointer; font-size: 12px;
  display: grid; place-items: center; transition: all .13s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-faint); background: var(--bg-hover); }
.count-badge { font-size: 10.5px; padding: 1px 8px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-weight: 650; border: 1px solid var(--border); }
.mem-resolved .mem-text { text-decoration: line-through; opacity: .5; }

/* proposed review zone */
.review-zone {
  background: linear-gradient(140deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.review-zone h3 { color: var(--text); }
.review-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.review-item .mem-text { flex: 1; font-size: 13.5px; }
.type-tag { font-size: 10px; padding: 3px 9px; border-radius: 7px; font-weight: 680; text-transform: uppercase; letter-spacing: .04em; }
.tag-mistake { background: rgba(255, 106, 125, .14); color: var(--red); }
.tag-vocab { background: rgba(255, 207, 92, .14); color: var(--yellow); }
.tag-fact { background: rgba(86, 176, 255, .14); color: var(--blue); }
.tag-progress { background: rgba(70, 224, 160, .14); color: var(--green); }
.tag-strategy { background: rgba(207, 139, 255, .14); color: var(--purple); }
.tag-note { background: rgba(232, 235, 242, .12); color: #e8ebf2; }

/* ---------- brain graph ---------- */
.brain-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brain-toolbar h3 { margin: 0; }
.view-toggle { margin-left: auto; display: flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.view-toggle button { padding: 7px 14px; border: none; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 12.5px; font-weight: 560; border-radius: 7px; transition: all .14s; display: flex; align-items: center; gap: 6px; }
.view-toggle button.active { background: var(--bg-hover); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

.graph-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.graph-search { min-width: 210px; flex: 1 1 230px; display: flex; align-items: center; gap: 8px; padding: 0 11px; min-height: 38px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; color: var(--text-faint); }
.graph-search:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 123, 255, .12); }
.graph-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; }
.graph-search input::placeholder { color: var(--text-faint); }
.graph-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.graph-filters label { cursor: pointer; }
.graph-filters input { position: absolute; opacity: 0; pointer-events: none; }
.graph-filters span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-faint); font-size: 11.5px; font-weight: 600; transition: border-color .14s, background .14s, color .14s; }
.graph-filters input:checked + span { border-color: rgba(139, 123, 255, .45); background: rgba(139, 123, 255, .11); color: var(--text); }
.graph-filters input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
.graph-result-count { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.graph-reset { margin-left: auto; white-space: nowrap; }

.graph-wrap {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(700px 500px at 50% 40%, rgba(139, 123, 255, .06), transparent 70%), #0a0b11;
  height: 560px;
}
#brainGraph { display: block; width: 100%; height: 100%; cursor: grab; }
#brainGraph:active { cursor: grabbing; }
.graph-legend {
  position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 6px;
  background: rgba(10, 11, 17, .78); backdrop-filter: blur(10px); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 13px; pointer-events: none;
}
.graph-legend .lg { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-dim); }
.graph-legend .lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.graph-hint { position: absolute; bottom: 14px; left: 14px; font-size: 11px; color: var(--text-faint); pointer-events: none; }
.graph-tooltip {
  position: absolute; pointer-events: none; background: rgba(10, 11, 17, .95); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; max-width: 260px; color: var(--text);
  box-shadow: var(--shadow); opacity: 0; transition: opacity .12s; z-index: 5; transform: translate(-50%, -100%);
}
.graph-tooltip .tt-type { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 680; margin-bottom: 3px; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 15px; }
label.field .lbl { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 7px; font-weight: 560; }
input.inp, textarea.inp, select.inp {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25); color: var(--text); font-size: 13.5px; outline: none;
  font-family: inherit; transition: border-color .16s, box-shadow .16s;
}
input.inp:focus, textarea.inp:focus, select.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.inp { resize: vertical; min-height: 96px; line-height: 1.6; }
.class-notes-field { margin-bottom: 9px !important; }
.note-template-group { margin-bottom: 15px; }
.note-template-label { display: block; margin-bottom: 7px; color: var(--text-faint); font-size: 11.5px; }
.note-template-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.note-template-chip {
  min-height: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255,255,255,.025); color: var(--text-dim); font: inherit; font-size: 11.5px;
  cursor: pointer; transition: border-color .14s, background .14s, color .14s;
}
.note-template-chip:hover { border-color: var(--border-strong); background: var(--accent-soft); color: var(--text); }
.note-template-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.duration-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.dur-chip {
  padding: 9px 17px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(0, 0, 0, .2); color: var(--text-dim); cursor: pointer; font-size: 13px; transition: all .14s; font-weight: 540;
}
.dur-chip:hover { border-color: var(--border-strong); color: var(--text); }
.dur-chip.active { background: linear-gradient(140deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }

details.collapse { margin-bottom: 15px; }
details.collapse summary { cursor: pointer; font-size: 12.5px; color: var(--text-dim); padding: 7px 0; user-select: none; }
details.collapse summary:hover { color: var(--text); }

/* ---------- briefing ---------- */
.briefing-grid { display: flex; flex-direction: column; gap: 14px; }
.brief-block .brief-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 5px; font-weight: 680; }
.brief-block .brief-val { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg-hover); border: 1px solid var(--border); padding: 5px 12px; border-radius: 20px; font-size: 12.5px; }

.connected-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 680; margin-bottom: 8px; }
.connected-note-list { display: flex; flex-direction: column; gap: 7px; }
.connected-note-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: rgba(232, 235, 242, .04); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-align: left; cursor: pointer; font: inherit; font-size: 13px; line-height: 1.45; transition: border-color .14s, background .14s; }
.connected-note-card:hover { border-color: rgba(232, 235, 242, .35); background: rgba(232, 235, 242, .07); }
.connected-dot { width: 8px; height: 8px; min-width: 8px; border-radius: 50%; background: #e8ebf2; box-shadow: 0 0 8px rgba(232, 235, 242, .5); }
.connected-edit { margin-left: auto; color: var(--text-faint); white-space: nowrap; font-size: 11.5px; }
.connected-empty { padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-faint); font-size: 12.5px; text-align: center; }

/* ---------- markdown output ---------- */
.md-out { font-size: 14px; line-height: 1.7; color: var(--text-dim); }
.md-out h1 { font-size: 21px; margin: 4px 0 14px; letter-spacing: -.02em; color: var(--text); }
.md-out h2 { font-size: 16.5px; margin: 22px 0 10px; color: var(--accent); letter-spacing: -.01em; }
.md-out h3 { font-size: 14.5px; margin: 16px 0 8px; color: var(--text); }
.md-out p { margin: 9px 0; }
.md-out ul, .md-out ol { margin: 9px 0 9px 24px; }
.md-out li { margin: 5px 0; }
.md-out strong { color: var(--text); font-weight: 660; }
.md-out hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.md-out code { background: var(--bg-elev); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; color: var(--accent); }

.stream-box { min-height: 60px; }
.cursor-blink::after { content: "▋"; color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hist-item { padding: 14px 16px; background: rgba(255, 255, 255, .02); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 9px; transition: border-color .14s; }
.hist-item:hover { border-color: var(--border-strong); }
.hist-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.hist-date { font-size: 12.5px; color: var(--text-faint); }
.hist-head .btn { margin-left: auto; }
.hist-notes { font-size: 13px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .68); backdrop-filter: blur(5px);
  display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .16s;
}
@keyframes fade { from { opacity: 0; } }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 28px; width: 100%; max-width: 580px; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow); animation: pop .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pop { from { transform: scale(.95) translateY(10px); opacity: .4; } }
.modal-box h3 { font-size: 19px; margin-bottom: 5px; letter-spacing: -.02em; }
.modal-box .modal-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; line-height: 1.55; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 22px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text);
  padding: 13px 22px; border-radius: var(--radius-sm); font-size: 13.5px; z-index: 200;
  box-shadow: var(--shadow); animation: toastUp .26s cubic-bezier(.2, .8, .2, 1);
}
.toast.err { border-color: var(--red); color: #ffc4cc; }
.toast.ok { border-color: var(--green); color: #b6f2d8; }
@keyframes toastUp { from { transform: translate(-50%, 16px); opacity: 0; } }

.spinner { width: 17px; height: 17px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-mini { text-align: center; padding: 34px; color: var(--text-faint); font-size: 13.5px; }
.empty-mini .em { font-size: 34px; display: block; margin-bottom: 10px; opacity: .85; }

/* ---------- mobile ---------- */
.mobile-menu-btn, .sidebar-backdrop { display: none; }
@media (max-width: 760px) {
  .mobile-menu-btn { display: grid; place-items: center; position: fixed; top: 12px; left: 12px; z-index: 90; width: 42px; height: 42px; border-radius: 11px; background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text); font-size: 18px; cursor: pointer; }
  #sidebar { position: fixed; inset: 0 auto 0 0; z-index: 95; transform: translateX(-100%); transition: transform .22s; }
  #sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 94; }
  .sv-head, .sv-body { padding-left: 18px; padding-right: 18px; }
  .sv-head { padding-top: 64px; }
  .graph-controls { align-items: stretch; }
  .graph-search { flex-basis: 100%; }
  .graph-filters { width: 100%; }
  .graph-filters label { flex: 1 1 auto; }
  .graph-filters span { justify-content: center; }
  .graph-reset { margin-left: 0; }
  .graph-wrap { height: 440px; }
}

/* ---------- LQuest light identity ---------- */
#sidebar {
  background: #ffffff;
  backdrop-filter: none;
  box-shadow: 3px 0 18px rgba(49, 82, 106, .07);
}
.brand-mark, .student-tab.active .avatar, .sv-title .avatar, .tab-pill, .btn-primary, .dur-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.student-search, input.inp, textarea.inp, select.inp {
  background: #f7fafc;
}
.home-hero h2 { color: var(--text); }
.home-hero h2 span { color: #68859a; }
.empty-state h2 {
  background: none;
  color: var(--text);
  -webkit-text-fill-color: currentColor;
}
.sv-head {
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 14px rgba(45, 77, 99, .04);
}
.home-stat-grid, .home-student-card, .home-value-strip,
.student-metric-grid, .overview-panel, .card, .config-section,
.advanced-config, .lesson-context-panel, .lesson-accordion,
.history-accordion, .prepared-lesson-card, .workspace-backbar,
.connected-note-card, .review-item, .graph-search, .hist-item {
  background: var(--bg-card);
  box-shadow: 0 4px 14px rgba(48, 81, 104, .045);
}
.home-student-card:hover, .overview-panel:hover, .lesson-accordion:hover,
.lesson-accordion[open], .history-accordion:hover, .history-accordion[open] {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(48, 81, 104, .09);
}
.home-card-head .avatar {
  background: var(--accent-soft);
  border-color: rgba(79,143,187,.24);
}
.home-value-strip {
  background: linear-gradient(90deg, rgba(79,143,187,.1), #ffffff 72%);
}
.next-action-card {
  background: linear-gradient(110deg, rgba(79,143,187,.16), rgba(255,255,255,.92));
  border-color: rgba(79,143,187,.34);
  box-shadow: 0 6px 18px rgba(48,81,104,.07);
}
.next-action-card.next-action-review {
  background: linear-gradient(110deg, rgba(183,131,36,.12), #ffffff);
  border-color: rgba(183,131,36,.28);
}
.focus-panel {
  background: linear-gradient(120deg, rgba(207,94,105,.08), #ffffff 58%);
}
.lesson-option, .style-option, .advanced-config, .workspace-subnav,
.segment-control, .note-template-chip {
  background: #f8fafc;
}
.lesson-option:hover, .style-option:hover, .note-template-chip:hover {
  background: var(--bg-hover);
}
.lesson-option.active, .style-option.active {
  background: var(--accent-soft);
  border-color: rgba(79,143,187,.48);
  box-shadow: inset 0 0 0 1px rgba(79,143,187,.06);
}
.lesson-option.active > span {
  background: rgba(79,143,187,.16);
}
.segment-control button.active, .workspace-subnav button.active, .view-toggle button.active {
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(48,81,104,.13);
}
.btn { background: #f4f8fa; }
.btn:hover { background: #e6f0f5; border-color: var(--accent); }
.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 6px 18px var(--accent-glow); }
.mem-item { background: #fbfcfd; }
.mem-item:hover { background: #f4f8fa; }
.review-zone { background: linear-gradient(135deg, rgba(79,143,187,.12), #ffffff 72%); box-shadow: none; }
.tag-note { background: #e9f0f5; color: #496a82; }
.graph-wrap {
  background: radial-gradient(700px 500px at 50% 40%, rgba(79,143,187,.09), transparent 72%), #f8fbfd;
  box-shadow: inset 0 0 28px rgba(70,105,130,.045);
}
.graph-legend {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 16px rgba(48,81,104,.09);
}
.graph-tooltip {
  background: rgba(255,255,255,.98);
  color: var(--text);
  box-shadow: var(--shadow);
}
.graph-filters input:checked + span {
  border-color: rgba(79,143,187,.48);
  background: var(--accent-soft);
  color: var(--text);
}
.graph-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lesson-detail, .history-detail { background: #f8fafb; }
.lesson-detail-actions { background: linear-gradient(transparent, #f8fafb 24%); }
.timeline-dot { background: var(--bg-card); box-shadow: 0 0 0 4px var(--bg); }
.history-accordion[open] .timeline-dot { box-shadow: 0 0 0 4px var(--bg), 0 0 8px var(--accent-glow); }
.transcript-detail > div { background: #ffffff; }
.modal-overlay { background: rgba(24,50,70,.35); }
.modal-box { border-radius: 14px; }
.toast.err { color: var(--red); background: #fff7f8; }
.toast.ok { color: var(--green); background: #f3fbf7; }
.connected-dot { background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.connected-note-card:hover { border-color: var(--accent); background: #f6fafc; }

/* Students with items waiting for review get a visible marker, so the teacher
   sees where the work is without reading every card. */
.home-student-card.needs-attention { border-color: rgba(183, 131, 36, .42); }
.home-student-card.needs-attention::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--yellow); border-radius: 12px 12px 0 0;
}
.home-student-card { position: relative; }

/* ---------- coordination view ---------- */
.coord-loading { padding: 40px 4px; color: var(--text-faint); font-size: 14px; }
.coord-table-wrap {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-card);
}
.coord-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.coord-table th {
  text-align: left; font-size: 11px; font-weight: 640; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--bg-elev);
}
.coord-table th.num, .coord-table td.num { text-align: right; }
.coord-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.coord-table tbody tr:last-child td { border-bottom: 0; }
.coord-table tbody tr:hover { background: var(--bg-hover); }
.coord-teacher { display: flex; align-items: center; gap: 11px; }
.coord-teacher > div { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.coord-teacher strong { font-size: 14px; font-weight: 600; }
.coord-teacher span { font-size: 12px; color: var(--text-faint); }
.coord-none { color: var(--text-faint); font-size: 13px; }
.coord-note {
  margin-top: 22px; font-size: 12.5px; color: var(--text-faint); line-height: 1.55; max-width: 640px;
}

/* ---------- boas-vindas (conta sem nenhum aluno) ---------- */
.welcome { max-width: 620px; margin: 0 auto; padding: 56px 0 40px; }
.welcome h2 {
  font-size: 28px; font-weight: 640; letter-spacing: -.025em;
  color: var(--text); margin: 0 0 8px;
}
.welcome-sub { font-size: 15px; color: var(--text-dim); margin: 0 0 34px; line-height: 1.55; }
.welcome-steps { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 20px; }
.welcome-steps li { display: flex; gap: 15px; align-items: flex-start; }
.welcome-num {
  flex-shrink: 0; width: 27px; height: 27px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 13px; font-weight: 650;
  display: flex; align-items: center; justify-content: center;
}
.welcome-steps strong { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.welcome-steps span { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }
.btn-welcome { padding: 12px 22px; font-size: 14.5px; }

/* Ação secundária indisponível: visível, mas claramente não é o caminho agora. */
.simple-primary-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Gerador bloqueado por falta de histórico: explica, não culpa. */
.builder-gate {
  max-width: 540px; margin: 60px auto; padding: 34px 32px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.builder-gate h3 { font-size: 19px; font-weight: 620; margin: 0 0 12px; color: var(--text); }
.builder-gate p { font-size: 14.5px; line-height: 1.6; color: var(--text-dim); margin: 0 0 24px; }
