:root {
  color-scheme: light;
  --mint-bg: #bdf3df;
  --canvas: #fffdfb;
  --cream: #f2ebe5;
  --cream-2: #ebe3da;
  --ink: #07070b;
  --muted: #6f6b6a;
  --line: #e8e0da;
  --rose: #f2b9be;
  --rose-strong: #ec8d9a;
  --sand: #f8dfb8;
  --lavender: #cfc9ff;
  --mint: #b8eed8;
  --blue: #dcefff;
  --blue-strong: #bfe4ff;
  --white: #ffffff;
  --radius: 30px;
  --shadow: 0 28px 80px rgba(20, 49, 38, .18);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  overflow-x: hidden;
}
body.course-reading {
  height: 100vh;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none !important;
}
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.55; }

.app-shell {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  background: var(--canvas);
}
.app-shell.auth-mode { grid-template-columns: 1fr; }
.app-shell.auth-mode .rail { display: none; }
.app-shell.auth-mode {
  background:
    radial-gradient(circle at 88% 14%, rgba(184, 238, 216, .92), transparent 28%),
    linear-gradient(135deg, #fffdfb 0%, #fffdfb 54%, #d9f8eb 100%);
}
.app-shell.system-mode {
  background: linear-gradient(90deg, var(--mint-bg) 0, var(--mint-bg) 48px, var(--canvas) 48px);
}
.rail {
  margin: 28px 0 28px 28px;
  padding: 28px 18px;
  background: var(--cream);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.system-mode .rail {
  position: sticky;
  top: 28px;
  height: calc(100vh - 56px);
  align-self: start;
}
.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  background: var(--ink);
  color: var(--white);
}
.rail-btn, .icon-circle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 12px 28px rgba(32, 26, 22, .06);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.rail-btn:hover, .icon-circle:hover { transform: translateY(-2px); }
.rail-btn.active {
  background: var(--ink);
  color: var(--white);
}
.rail-btn svg, .icon-circle svg { width: 27px; height: 27px; stroke-width: 2.4; }
.rail-btn.bottom { margin-top: auto; }

.workspace { padding: 28px 32px 28px 56px; min-width: 0; }
.auth-mode .workspace {
  min-height: 100vh;
  padding: clamp(28px, 5vw, 80px);
  display: grid;
}
.auth-layout, .system-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 34px;
  height: 100%;
}
.auth-layout { align-items: center; }
.auth-hero h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(58px, 6vw, 92px);
  line-height: .98;
  letter-spacing: 0;
  font-weight: 500;
}
.hero-row h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(42px, 4.7vw, 72px);
  line-height: .98;
  letter-spacing: 0;
  font-weight: 650;
}
.soft-label {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}
.auth-copy {
  max-width: 690px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.7;
}
.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  max-width: 860px;
  margin-top: 36px;
}
.auth-proof span {
  min-height: 104px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(232, 224, 218, .9);
  box-shadow: 0 18px 45px rgba(33, 53, 45, .08);
  color: var(--muted);
  line-height: 1.45;
}
.auth-proof strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  margin-bottom: 8px;
}
.auth-card, .profile-card, .panel, .reader, .ai-output, .wide-card, .magic-card {
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.auth-card {
  padding: 28px;
  align-self: center;
  background: rgba(242, 235, 229, .9);
  box-shadow: 0 24px 70px rgba(23, 38, 32, .12);
}
.auth-card-head { margin-bottom: 18px; }
.auth-card-head h2 {
  font-size: 28px;
  line-height: 1.1;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.tab, .small-pill, .category-pill, .primary, .dark-pill {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(29, 24, 20, .06);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.tab.active, .category-pill.active, .dark-pill, .primary {
  background: var(--ink);
  color: var(--white);
}
.tab:hover, .small-pill:hover, .category-pill:hover, .primary:hover, .dark-pill:hover { transform: translateY(-2px); }
.category-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.auth-tags .category-pill {
  pointer-events: none;
  cursor: default;
  box-shadow: 0 10px 24px rgba(29, 24, 20, .04);
}
.auth-tags .category-pill:hover { transform: none; }
.category-pill svg, .small-pill svg { width: 22px; height: 22px; }

.form-stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, textarea, select, .search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  padding: 13px 14px;
}
textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.55;
}
.message { min-height: 22px; color: #1f7a5f; font-weight: 700; }

.system-layout {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 400px);
  align-items: stretch;
}
.admin-mode .system-layout,
.admin-workspace .system-layout {
  grid-template-columns: minmax(0, 1fr);
}
.admin-mode .profile-column,
.admin-mode #dashboardView,
.admin-mode #courseFilters,
.admin-mode #overviewStrip,
.admin-mode .hero-row .top-tools,
.admin-mode .wide-card {
  display: none !important;
}
.admin-mode .workspace {
  padding-right: 56px;
}
.admin-mode .content-column {
  padding-right: 0;
}
.admin-mode .hero-row {
  margin-bottom: 24px;
}
.admin-mode .hero-row h1 {
  font-size: clamp(44px, 5vw, 72px);
  max-width: 900px;
}
.reading-mode .system-layout { grid-template-columns: minmax(0, 1fr); }
.reading-mode .profile-column,
.reading-mode .hero-row,
.reading-mode #courseFilters,
.reading-mode #overviewStrip {
  display: none;
}
.reading-mode .workspace { padding-top: 28px; }
.course-reading .workspace {
  height: 100vh;
  overflow: hidden;
}
.reading-mode .content-column { padding-right: 0; }
.reading-mode .reader,
.reading-mode .panel,
.reading-mode .coach-panel {
  min-height: calc(100vh - 56px);
}
.reading-mode .markdown-body {
  min-height: calc(100vh - 190px);
  font-size: 18px;
}
.content-column { min-width: 0; padding-right: 10px; }
.hero-row, .section-title, .reader-toolbar, .button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top-tools { display: flex; gap: 16px; }
h2, h3 { margin: 0; letter-spacing: 0; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.section-title { margin: 18px 0; }
.section-title span {
  color: var(--muted);
  line-height: 1.45;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 14px;
  margin: 28px 0 22px;
}
.role-home {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}
.home-card {
  min-height: 132px;
  padding: 20px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(31, 48, 42, .06);
}
.home-card p {
  color: var(--muted);
  line-height: 1.55;
}
.home-card span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #effaf5;
  font-weight: 900;
}
.overview-card {
  min-height: 94px;
  padding: 16px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  box-shadow: 0 14px 36px rgba(31, 48, 42, .06);
}
.overview-card span {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #effaf5;
}
.overview-card svg { width: 24px; height: 24px; }
.overview-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}
.overview-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}
.overview-card em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
}
.course-grid.single-grid {
  grid-template-columns: minmax(320px, 640px);
}
.course-card {
  min-height: 220px;
  position: relative;
  padding: 86px 26px 24px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  border: 0;
  transition: transform .2s ease, filter .2s ease;
}
.course-card:hover { transform: translateY(-4px); }
.course-card.rose { background: linear-gradient(135deg, var(--rose), #f6cbd1); }
.course-card.sand { background: linear-gradient(135deg, var(--sand), #fdebc9); }
.course-card.lavender { background: linear-gradient(135deg, var(--lavender), #ddd9ff); }
.course-card.mint { background: linear-gradient(135deg, var(--mint), #cdf6e7); }
.course-card.locked { filter: saturate(.65); opacity: .72; }
.course-card p, .course-card span { margin: 0; font-weight: 700; }
.course-card h3 {
  max-width: 520px;
  font-size: clamp(25px, 2vw, 34px);
  line-height: 1.12;
  font-weight: 800;
  margin: 6px 0 0;
}
.course-icon, .rating {
  position: absolute;
  top: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--white);
  font-weight: 800;
}
.course-icon { left: 26px; width: 52px; height: 52px; }
.rating { right: 24px; min-height: 40px; padding: 0 14px; }
.course-card > p {
  position: absolute;
  top: 42px;
  left: 92px;
  right: 104px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.course-card button { justify-self: start; }

.wide-card {
  margin-top: 24px;
  padding: 22px;
  background: var(--white);
}
.abc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
}
.abc-grid.single-grid {
  grid-template-columns: minmax(320px, 680px);
}
.wide-card.single-energy {
  max-width: 820px;
}
.abc-card {
  border-radius: 22px;
  padding: 18px;
  background: #f7f2ee;
}
.readiness-card header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.readiness-card header strong {
  min-width: 66px;
  height: 66px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--white);
  font-size: 26px;
}
.readiness-card h3 {
  font-size: 24px;
  line-height: 1.1;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.readiness-card > p {
  margin: 16px 0;
  color: var(--muted);
  line-height: 1.55;
}
.formula-pill {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--white);
  color: #2a2623;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.signal {
  border-radius: 18px;
  background: var(--white);
  padding: 12px;
  display: grid;
  gap: 7px;
}
.signal span { font-weight: 900; }
.signal strong { font-size: 24px; }
.signal i {
  height: 7px;
  border-radius: 999px;
  background: var(--mint);
}
.risk-signal i { background: var(--rose-strong); }
.signal small {
  color: var(--muted);
  line-height: 1.35;
}
.evidence-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.evidence-line span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.readiness-card footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2a2623;
  font-weight: 800;
  line-height: 1.45;
}

.profile-column { min-width: 0; }
.profile-card {
  height: 100%;
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 24px;
  background: linear-gradient(180deg, #f4ece5, #f0e8df);
}
.avatar {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--lavender), var(--rose));
  font-weight: 900;
  font-size: 26px;
}
.profile-card h2, .profile-card > p { text-align: center; }
.friend-pill {
  min-height: 62px;
  border-radius: 999px;
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
}
.friend-pill svg { width: 32px; height: 32px; }
.activity-card {
  background: var(--white);
  border-radius: 24px;
  padding: 20px;
}
.big-number {
  display: block;
  font-size: 34px;
  margin: 8px 0;
}
.great-pill {
  display: inline-block;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 18px;
  background: #f2eee9;
  color: #2a2623;
  font-weight: 800;
  line-height: 1.35;
}
.mini-bars {
  margin-top: 24px;
  height: 126px;
  display: flex;
  align-items: end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.mini-bars span {
  width: 42px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  align-content: end;
  background: #e9e2ff;
}
.mini-bars b, .mini-bars i, .mini-bars em { display: block; height: 33%; }
.mini-bars b { background: var(--mint); }
.mini-bars i { background: var(--lavender); }
.mini-bars em { background: var(--sand); }
.mini-courses { display: grid; gap: 12px; margin-top: 14px; }
.mini-course {
  min-height: 112px;
  border: 0;
  border-radius: 24px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
}
.mini-course.rose { background: var(--rose-strong); }
.mini-course.mint { background: var(--mint); }
.mini-course span, .mini-course small { display: block; font-weight: 700; }
.mini-course strong { display: block; margin: 18px 0 8px; font-size: 20px; line-height: 1.2; }

.reader-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
}
.reading-mode .reader-layout {
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
}
.coach-closed.reading-mode .reader-layout {
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
}
.coach-closed .coach-panel {
  display: none;
}
.reopen-coach {
  display: none;
  position: fixed;
  right: 28px;
  top: 128px;
  z-index: 20;
  box-shadow: 0 18px 45px rgba(16, 17, 20, .12);
}
.coach-closed .reopen-coach {
  display: inline-flex;
}
.ai-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}
.panel, .reader, .ai-output, .coach-panel {
  padding: 22px;
  background: var(--white);
}
.reader-layout > .panel,
.reader-layout > .reader {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.reader-layout > .panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.reader-layout > .reader {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.session-list {
  display: grid;
  gap: 10px;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.session-item {
  border: 0;
  border-radius: 20px;
  background: #f6f0ec;
  padding: 14px;
  text-align: left;
  color: var(--ink);
}
.session-item.active {
  background: var(--ink);
  color: var(--white);
}
.session-item span { display: block; margin-top: 5px; color: inherit; opacity: .72; }
.reader-toolbar {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.reader-toolbar #slideMeta {
  flex: 1 1 280px;
  min-width: 220px;
  text-align: center;
  font-weight: 800;
  line-height: 1.35;
}
.jump-control {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.jump-control input {
  width: 74px;
  min-height: 42px;
  padding: 0 10px;
  text-align: center;
  border-radius: 999px;
}
.jump-control .small-pill {
  min-height: 42px;
  padding: 0 14px;
}
.markdown-body {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  line-height: 1.75;
  padding: 16px 4px;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 26px 0 12px; }
.markdown-body img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid var(--line);
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--line);
  padding: 10px;
}
.markdown-body pre {
  overflow: auto;
  border-radius: 20px;
  background: #101116;
  color: #fff;
  padding: 16px;
}
.course-quiz-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white) !important;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.quiz-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8fbff;
}
.quiz-question {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.quiz-question h4 {
  margin: 0 0 10px;
  line-height: 1.35;
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
}
.quiz-option input {
  width: auto;
  margin-top: 4px;
}
.slide-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.understanding-status {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #effaf5;
  color: #167052;
  font-size: 13px;
  font-weight: 900;
}
.ai-output {
  min-height: 120px;
  line-height: 1.65;
  overflow: auto;
  padding: 14px;
}
.ai-output p,
.ai-output ul,
.ai-output ol,
.ai-output h1,
.ai-output h2,
.ai-output h3 { margin-top: 0; }
.ai-output ul,
.ai-output ol { padding-left: 20px; }
.ai-output code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #f3f6f8;
}
.ai-output pre {
  white-space: pre-wrap;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  background: #f3f6f8;
}
.inline-helper {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #f8fbff;
}
.inline-helper textarea {
  min-height: 84px;
  margin-bottom: 10px;
}
.inline-helper .ai-output {
  margin-top: 12px;
  max-height: 360px;
  background: var(--white);
}
.coach-panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 10px;
  background: #f7f2ee;
  position: relative;
}
.close-coach {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
}
.coach-panel h3 { font-size: 22px; line-height: 1.15; }
.coach-panel > .muted { font-size: 14px; line-height: 1.45; max-width: 24ch; }
.ai-panel-box .button-row {
  grid-template-columns: 1fr 1fr;
}
.ai-panel-box .ai-output {
  max-height: 220px;
  min-height: 96px;
  padding: 12px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.5;
  background: var(--white);
}
.compact-account {
  padding: 0;
  border: 0;
  background: transparent;
}
.compact-account summary {
  cursor: pointer;
  font-weight: 900;
}
.study-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.study-switcher .small-pill {
  min-height: 42px;
  padding: 0 10px;
  font-size: 13px;
  box-shadow: none;
}
.study-switcher .small-pill.active {
  background: var(--ink);
  color: var(--white);
}
.learning-box {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
}
.learning-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.learning-box .task-prompt {
  color: var(--ink);
  font-weight: 750;
}
.learning-box textarea {
  min-height: 92px;
  border-radius: 16px;
  font-size: 15px;
}
.learning-box input, .learning-box select {
  border-radius: 16px;
  min-height: 46px;
  font-size: 14px;
}
.compact-confidence {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.box-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 900;
}
.result-line {
  min-height: 20px;
  margin: 0;
  color: #167052;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}
.review-list {
  display: grid;
  gap: 10px;
}
.review-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: var(--white);
}
.review-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.floating-ai-btn {
  position: fixed;
  right: 32px;
  bottom: 30px;
  z-index: 55;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--white);
  font-weight: 900;
  box-shadow: 0 20px 55px rgba(7, 7, 11, .22);
}
.floating-ai-btn svg { width: 22px; height: 22px; }
.float-card {
  position: fixed;
  right: 32px;
  top: 112px;
  z-index: 60;
  width: min(430px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 138px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(232, 224, 218, .9);
  border-radius: 28px;
  background: rgba(255, 253, 251, .92);
  backdrop-filter: blur(18px);
  box-shadow: 0 28px 80px rgba(18, 30, 26, .2);
}
.check-float {
  right: 482px;
  width: min(400px, calc(100vw - 36px));
}
.float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 12px;
  cursor: grab;
  border-bottom: 1px solid rgba(232, 224, 218, .8);
}
.float-head:active { cursor: grabbing; }
.float-head strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}
.float-actions { display: flex; gap: 8px; }
.icon-mini {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(29, 24, 20, .06);
}
.icon-mini svg { width: 18px; height: 18px; }
.float-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}
.ai-float textarea { min-height: 100px; }
.float-card .ai-output {
  min-height: 150px;
  max-height: 300px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 14px;
}
.compact-key {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .76);
  border: 1px solid var(--line);
}
.compact-key summary {
  cursor: pointer;
  font-weight: 900;
}
.compact-key[open] {
  display: grid;
  gap: 10px;
}
.compact-key[open] summary { margin-bottom: 4px; }
.ai-float.minimized {
  grid-template-rows: auto;
  width: min(320px, calc(100vw - 36px));
}
.ai-float.minimized .float-body { display: none; }
.check-float .visual-lab-link { width: 100%; }

.magic-card {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 210px minmax(180px, 1fr) 90px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  background: var(--white);
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px;
  gap: 12px;
  margin: 0 0 18px;
}
.admin-toolbar select,
.admin-toolbar input {
  min-height: 48px;
  border-radius: 18px;
}
.admin-tabs .tab {
  min-height: 42px;
  padding: 0 15px;
  box-shadow: none;
  border: 1px solid var(--line);
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}
.admin-section.people.people-list {
  display: contents;
}
.admin-summary-card {
  min-height: 104px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #f7f2ee;
}
.admin-summary-card strong {
  display: block;
  font-size: 34px;
}
.admin-summary-card span {
  color: var(--muted);
  font-weight: 800;
}
#adminPanel .admin-section.section-hidden {
  display: none;
}
.pager-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}
.small-pill:disabled,
.primary:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
}
.roster-card {
  grid-column: 1 / -1;
}
.roster-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr);
  gap: 12px;
}
.table-wrap {
  overflow: auto;
}
.roster-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.roster-table th,
.roster-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.roster-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.roster-table small,
.user-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}
.user-card, .ops-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
}
.user-card p { margin: 4px 0 0; color: var(--muted); }
.user-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}
.status-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1ede8;
  font-weight: 900;
  font-size: 12px;
}
.status-chip.active { background: #e8f8ef; color: #176944; }
.status-chip.pending { background: #fff3cf; color: #80610d; }
.status-chip.suspended { background: #ffe2e2; color: #8a2525; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.course-checks {
  display: grid;
  gap: 8px;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check-line input { width: auto; }
.mastery-review {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.mastery-review textarea {
  min-height: 90px;
}
.ops-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.ops-line span { color: var(--muted); }
.qr-box {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: #f7f2ee;
  border: 1px solid var(--line);
}
.qr-box img {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  background: var(--white);
}
.qr-box p {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.join-request {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.course-request {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.course-request span {
  color: var(--muted);
  font-weight: 800;
}
.course-request p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.join-request span {
  color: var(--muted);
  line-height: 1.4;
}
.ops-card textarea[data-correction-body] {
  min-height: 120px;
}
.simple-magic-card {
  grid-template-columns: 1fr 110px;
}
.simple-magic-card h3,
.simple-magic-card p,
.simple-magic-card [data-magic-result] {
  grid-column: 1 / -1;
}
.account-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
}
.account-card summary {
  cursor: pointer;
  font-weight: 900;
}
.account-card[open] {
  display: grid;
}
.account-card[open] summary {
  margin-bottom: 10px;
}
.batch-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

@media (max-width: 1180px) {
  .auth-layout, .system-layout { grid-template-columns: 1fr; }
  .profile-card { min-height: auto; }
  .course-grid, .abc-grid, .overview-strip { grid-template-columns: 1fr; }
  .role-home { grid-template-columns: 1fr; }
  .auth-proof, .signal-grid { grid-template-columns: 1fr; }
  .reader-layout, .ai-layout { grid-template-columns: 1fr; }
  .magic-card { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.system-mode { background: var(--canvas); }
  .rail {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0;
    border-radius: 0;
    flex-direction: row;
    justify-content: center;
    overflow-x: auto;
  }
  .rail-btn { width: 52px; height: 52px; flex: 0 0 auto; }
  .logo-mark { display: none; }
  .workspace { padding: 22px; }
  .auth-mode .workspace { padding: 28px 22px; }
  .auth-hero h1, .hero-row h1 { font-size: clamp(40px, 11vw, 58px); }
  .hero-row, .section-title { align-items: flex-start; flex-direction: column; }
  .reader-layout, .ai-layout { grid-template-columns: 1fr; }
  .magic-card { grid-template-columns: 1fr; }
  .profile-card { padding: 20px; }
}
