:root {
  --ink: #142221;
  --ink-soft: #3a4a48;
  --paper: #f3f6f4;
  --paper-2: #e7eeea;
  --teal: #0f3d3e;
  --teal-mid: #1a5c5e;
  --teal-light: #d7ebe8;
  --amber: #c9782c;
  --amber-soft: #f3e0cc;
  --danger: #a33b2b;
  --ok: #1f6b4f;
  --line: rgba(20, 34, 33, 0.12);
  --shadow: 0 18px 50px rgba(15, 61, 62, 0.12);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

.guest-account-card { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.guest-account-card details { margin-top: 12px; }
.student-account-dialog { width: min(620px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--paper, #fff); color: var(--ink); }
.student-account-dialog::backdrop { background: rgb(20 40 35 / 45%); }
.student-account-dialog fieldset { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.student-account-dialog .inline-batch-create { margin: 18px 0; padding: 14px; background: #f1f6f3; border-radius: 12px; }
.student-account-dialog summary { cursor: pointer; font-weight: 600; }
.student-account-dialog .actions { margin-top: 22px; flex-wrap: wrap; }
.lesson-batch-picker { display:grid; gap:10px; margin-bottom:24px; }
.lesson-batch-picker select { width:100%; max-width:420px; }
.lesson-material-dialog .field { margin:18px 0; }
.lesson-material-dialog input[type=file], .lesson-material-dialog textarea { width:100%; max-width:100%; }
.lesson-material-dialog .lesson-check { display:flex; align-items:flex-start; gap:10px; margin:18px 0; }
.lesson-check input { width:auto; flex-shrink:0; margin-top:4px; }
.guest-account-card label { display: grid; gap: 6px; }
.guest-notice { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--teal-light); line-height: 1.6; }

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(201, 120, 44, 0.14), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(26, 92, 94, 0.18), transparent 32%),
    linear-gradient(165deg, #edf3f0 0%, #f7faf8 42%, #e8f0ec 100%);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 64px;
}

.shell.shell--with-sidebar {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0 0 0 220px;
  min-height: 100vh;
}

.shell.shell--with-sidebar:has(.admin-layout) {
  padding-left: 200px;
}

.app-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 243, 240, 0.9)),
    #fff;
  z-index: 40;
  box-sizing: border-box;
  overflow-y: auto;
}

.shell.shell--with-sidebar:has(.admin-layout) .app-sidebar {
  width: 200px;
}

.app-sidebar .brand {
  padding: 0 8px 4px;
}

.app-sidebar .brand strong {
  font-size: 1.35rem;
}

.app-sidebar .brand span {
  font-size: 0.78rem;
  line-height: 1.35;
}

.shell-main {
  padding: 28px 28px 64px;
  max-width: 1180px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.shell.shell--with-sidebar:has(.admin-layout) .shell-main {
  max-width: 1400px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.sidebar-nav {
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
}

.nav-cluster {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.nav-icon {
  border: none;
  background: transparent;
  color: var(--teal);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  position: relative;
  overflow: hidden;
  font: inherit;
  font-weight: 700;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  white-space: nowrap;
  box-shadow: none;
  text-align: left;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-icon .icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.nav-icon .nav-label {
  display: inline-block;
  width: auto;
  max-width: none;
  opacity: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  transform: none;
  pointer-events: none;
  transition: color 0.2s ease;
}

.nav-icon:hover,
.nav-icon:focus-visible {
  background: rgba(26, 92, 94, 0.12);
  color: var(--teal);
  transform: translateX(2px);
  box-shadow: none;
  outline: none;
}

.nav-icon:hover .nav-label,
.nav-icon:focus-visible .nav-label {
  opacity: 1;
  transform: none;
}

.nav-icon.active {
  color: var(--amber);
  background: rgba(201, 120, 44, 0.14);
}

.nav-icon.active:hover,
.nav-icon.active:focus-visible {
  color: var(--amber);
  background: rgba(201, 120, 44, 0.2);
}

.nav-logout {
  border: none;
  background: transparent;
  color: var(--teal);
  border-radius: 10px;
  width: 100%;
  height: auto;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  flex: 0 0 auto;
  margin-left: 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  padding-top: 0.85rem;
  font: inherit;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-logout .icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.nav-logout .nav-label {
  font-size: 0.88rem;
}

.nav-logout:hover,
.nav-logout:focus-visible {
  background: rgba(201, 120, 44, 0.14);
  color: var(--amber);
  outline: none;
}

.nav button:not(.nav-icon):not(.nav-logout),
.btn {
  border: none;
  background: transparent;
  color: var(--teal);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  font-weight: 600;
  box-shadow: none;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav button:not(.nav-icon):not(.nav-logout)::after,
.btn::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.nav-icon::after,
.nav-logout::after {
  display: none;
}

.nav button.ghost:not(.nav-icon):not(.nav-logout),
.btn.ghost {
  background: transparent;
  color: var(--teal);
  box-shadow: none;
}

.nav button.active:not(.nav-icon):not(.nav-logout) {
  background: transparent;
  color: var(--amber);
}

.nav button:not(.nav-icon):not(.nav-logout):hover,
.btn:hover {
  background: rgba(26, 92, 94, 0.12);
  color: var(--teal);
  transform: translateY(-1px);
  box-shadow: none;
}

.nav button.ghost:not(.nav-icon):not(.nav-logout):hover,
.btn.ghost:hover {
  background: rgba(201, 120, 44, 0.14);
  color: var(--amber);
}

.nav button:not(.nav-icon):not(.nav-logout):hover::after,
.btn:hover::after,
.nav button.active:not(.nav-icon):not(.nav-logout)::after {
  transform: scaleX(1);
}

.btn.amber {
  background: transparent;
  color: var(--amber);
}

.btn.amber:hover {
  background: var(--amber);
  color: #1d140a;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hero-login {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background:
    linear-gradient(160deg, rgba(243, 246, 244, 0.96), rgba(231, 238, 234, 0.92)),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input {
  border: 1px solid rgba(15, 61, 62, 0.18);
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.hint {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--teal-light);
  color: var(--teal);
  font-size: 0.88rem;
  line-height: 1.45;
}

.error {
  color: var(--danger);
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.panel h2,
.section-title {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--ink-soft);
  line-height: 1.5;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .value {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.stat .label {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.row strong {
  display: block;
  margin-bottom: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.ok {
  background: #d8eee4;
  color: var(--ok);
}

.badge.warn {
  background: var(--amber-soft);
  color: #8a4d12;
}

.badge.danger {
  background: #f4ddd8;
  color: var(--danger);
}

.badge.neutral {
  background: var(--paper-2);
  color: var(--ink-soft);
}

.semester {
  margin-bottom: 22px;
}

.semester-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.topic {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.topic:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.topic .roman {
  font-family: var(--font-display);
  color: var(--amber);
  font-size: 0.95rem;
}

.topic h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

.topic.placeholder {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(15, 61, 62, 0.03),
      rgba(15, 61, 62, 0.03) 8px,
      rgba(255, 255, 255, 0.7) 8px,
      rgba(255, 255, 255, 0.7) 16px
    );
}

.quiz-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 18px;
}

.quiz-layout--docked {
  display: block;
  padding-bottom: 96px;
}

.quiz-questions {
  max-width: 860px;
}

.q-figure {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f8f6;
  border: 1px solid rgba(15, 61, 62, 0.1);
  text-align: center;
}

.q-figure img {
  display: block;
  max-width: min(100%, 520px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.q-figure figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.q-figure--fallback .q-figure-fallback-body {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 10px 8px;
  text-align: center;
}

.q-figure-pdf {
  margin-top: 4px;
}

.quiz-dock {
  position: fixed;
  left: calc(220px + 24px);
  right: 24px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 61, 62, 0.14);
  box-shadow: 0 12px 40px rgba(15, 61, 62, 0.16);
  backdrop-filter: blur(10px);
}

.quiz-dock-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.quiz-dock-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.quiz-dock-meter {
  width: 88px;
  height: 8px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.quiz-dock-meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-mid), var(--amber));
}

.quiz-dock-count {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.quiz-dock-label {
  font-size: 0.85rem;
}

.quiz-dock-status {
  margin: 0;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.quiz-dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.quiz-dock-actions .btn {
  white-space: nowrap;
}

.question {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.q-figures {
  margin: 4px 0 12px;
}

.question h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.45;
}

.question .q-figures + .options,
.question h3 + .options {
  margin-top: 0;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #fbfdfc;
}

.option:hover {
  border-color: rgba(26, 92, 94, 0.35);
}

.option.selected {
  border-color: var(--teal-mid);
  background: var(--teal-light);
}

.option.correct {
  border-color: var(--ok);
  background: #d8eee4;
}

.option.incorrect {
  border-color: var(--danger);
  background: #f4ddd8;
}

.key-box {
  margin-top: 14px;
  padding: 0;
  border-radius: 14px;
  background: #f4f8f6;
  border: 1px solid rgba(15, 61, 62, 0.12);
  overflow: hidden;
}

.key-box.is-correct {
  border-color: rgba(31, 107, 79, 0.28);
}

.key-box.is-incorrect {
  border-color: rgba(180, 70, 60, 0.22);
}

.key-verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(15, 61, 62, 0.1);
}

.key-verdict-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.key-verdict-item strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.45;
}

.key-verdict-badge {
  align-self: center;
}

.ok-text {
  color: #1f6b3f;
}

.bad-text {
  color: #8a2f2b;
}

.key-body {
  padding: 12px 14px 14px;
}

.key-box .label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin-bottom: 8px;
}

.key-box .key-math {
  line-height: 1.7;
  color: var(--ink);
  overflow-x: auto;
  font-size: 0.98rem;
}

.key-box .key-math p {
  margin: 0 0 0.9rem;
}

.key-box .key-math p:last-child {
  margin-bottom: 0;
}

.key-box .key-math .key-label {
  font-weight: 700;
  color: var(--teal-mid);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.key-box .key-math .key-step,
.key-box .key-math .key-rebuttal {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 61, 62, 0.08);
  margin-bottom: 0.55rem;
}

.key-box .key-math .key-rebuttal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.key-opt {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  background: rgba(196, 78, 72, 0.14);
  color: #8a2f2b;
  font-weight: 700;
  font-size: 0.85rem;
}

.key-bullet {
  margin-right: 0.35rem;
  color: var(--teal-mid);
  font-weight: 700;
}

.key-box .katex {
  font-size: 1.08em;
}

.key-box .katex-display {
  margin: 0.55rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.result-question .options {
  margin-top: 10px;
}

.key-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.key-head-row .muted {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.results-stack .result-question {
  padding-bottom: 4px;
}

@media (max-width: 720px) {
  .key-verdict {
    grid-template-columns: 1fr;
  }
  .key-verdict-badge {
    justify-self: start;
  }
}

.question h3 .katex,
.option .katex {
  font-size: 1.02em;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--amber-soft);
  color: #7a4510;
  margin: 2px 4px 2px 0;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  flex: 1;
  border: 1px solid rgba(15, 61, 62, 0.18);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--teal);
  color: #f7fbfa;
  border-color: var(--teal);
}

button.linkish {
  border: none;
  background: none;
  color: var(--teal-mid);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.batch-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 61, 62, 0.16);
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
}

.batch-check:has(input:checked) {
  background: var(--teal-light);
  border-color: var(--teal-mid);
}

form.stack-batch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.option input {
  margin-top: 3px;
}

.side-card {
  position: sticky;
  top: 18px;
  align-self: start;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  margin: 10px 0 16px;
}

.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-mid), var(--amber));
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.page-head h1 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
}

.panel.stat.compact .value {
  font-size: 1.35rem;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.analytics-callouts {
  margin-top: 12px;
}

.matrix-wrap {
  max-width: 100%;
}

.matrix-table th,
.matrix-table td {
  text-align: center;
  white-space: nowrap;
}

.matrix-table th:first-child,
.matrix-table td:first-child,
.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.matrix-cell {
  font-variant-numeric: tabular-nums;
}

.matrix-footer td {
  background: #eef5f3;
  font-weight: 600;
}

.mark {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.mark.ok {
  background: #d8eee4;
  color: var(--ok);
}

.mark.bad {
  background: #f4ddd8;
  color: var(--danger);
}

.mark.blank,
.mark.miss {
  background: var(--paper-2);
  color: var(--ink-soft);
}

.pct-low {
  color: var(--danger);
  font-weight: 700;
}

.pct-mid {
  color: #8a4d12;
  font-weight: 700;
}

.pct-high {
  color: var(--ok);
  font-weight: 700;
}

select {
  border: 1px solid rgba(15, 61, 62, 0.18);
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}

/* Admin layout */
.shell:has(.admin-layout):not(.shell--with-sidebar) {
  max-width: 1320px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-mid);
  font-weight: 700;
}

.flash-ok {
  color: var(--ok);
  margin: 0 0 12px;
}

.nav-dropdown {
  position: relative;
}

.nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-drop-toggle .caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.8;
}

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.nav-dropdown.is-open .nav-drop-menu,
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
  display: grid;
  gap: 4px;
}

.nav-drop-menu button {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  border: 1px solid transparent;
}

.nav-drop-menu button:hover,
.nav-drop-menu button.active {
  background: var(--teal-light);
  color: var(--teal);
}

.drop-label {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-rail {
  position: sticky;
  top: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.admin-rail-label {
  margin: 0 8px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.admin-rail-nav {
  display: grid;
  gap: 4px;
}

.admin-rail-nav button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: start;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: none;
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  position: relative;
  overflow: hidden;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.admin-rail-nav button .rail-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-rail-nav button span {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.admin-rail-nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  background: var(--amber);
  transform: scaleY(0);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.admin-rail-nav button.active {
  background: transparent;
  color: var(--amber);
}

.admin-rail-nav button.active span {
  color: var(--ink-soft);
}

.admin-rail-nav button:hover {
  background: rgba(26, 92, 94, 0.1);
  transform: translateX(3px);
}

.admin-rail-nav button:hover::before,
.admin-rail-nav button.active::before {
  transform: scaleY(1);
}

.admin-main {
  min-width: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.panel.kpi {
  padding: 18px 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(231, 238, 234, 0.88)),
    #fff;
}

.panel.kpi .value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  color: var(--teal);
  line-height: 1.1;
}

.panel.kpi .label {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.visual-panel h2 {
  margin-bottom: 4px;
}

.bar-chart {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.pie-chart {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}

.pie-chart.is-donut {
  grid-template-columns: minmax(140px, 170px) minmax(0, 1fr);
}

.pie-donut-wrap {
  position: relative;
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1;
}

.pie-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pie-ring {
  stroke-linecap: butt;
  transition: stroke-dasharray 0.4s ease;
}

.pie-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.pie-center strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.pie-center span {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.pie-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pie-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.pie-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-top: 4px;
}

.pie-legend-row strong {
  display: block;
  font-size: 0.92rem;
}

.pie-legend-row .muted {
  font-size: 0.78rem;
}

.cohort-panel {
  grid-column: 1 / -1;
}

.cohort-panel h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.cohort-summary-kpis {
  margin-top: 14px;
}

.cohort-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 12px;
  align-items: start;
}

.cohort-donut,
.cohort-col {
  min-width: 0;
}

.bar-chart.compact {
  gap: 8px;
  margin-top: 0;
}

.bar-chart.compact .bar-row {
  grid-template-columns: minmax(0, 1fr) minmax(70px, 1.1fr) 42px;
  gap: 8px;
}

.bar-chart.compact .bar-meta strong {
  font-size: 0.86rem;
}

.bar-chart.compact .bar-meta .muted {
  font-size: 0.72rem;
}

.cohort-mini-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.cohort-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.cohort-chip .muted {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.cohort-chip strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

@media (max-width: 1100px) {
  .cohort-layout {
    grid-template-columns: 1fr 1fr;
  }

  .cohort-donut {
    grid-column: 1 / -1;
  }

  .cohort-mini-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .pie-chart,
  .pie-chart.is-donut {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .pie-legend {
    width: 100%;
  }

  .cohort-layout {
    grid-template-columns: 1fr;
  }

  .cohort-mini-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 1.4fr) 48px;
  gap: 10px;
  align-items: center;
}

.bar-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bar-meta strong {
  font-size: 0.95rem;
}

.bar-meta .muted {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 61, 62, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.bar-fill.high {
  background: linear-gradient(90deg, #1f6b4f, #2f9b74);
}

.bar-fill.mid {
  background: linear-gradient(90deg, #c9782c, #e0a35a);
}

.bar-fill.low {
  background: linear-gradient(90deg, #a33b2b, #d07060);
}

.bar-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--teal);
  font-size: 0.9rem;
}

.activity-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: rgba(243, 246, 244, 0.85);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  color: inherit;
  cursor: pointer;
}

.activity-row:hover {
  border-color: rgba(15, 61, 62, 0.16);
  background: #fff;
}

.activity-row > div:first-child {
  display: grid;
  gap: 2px;
}

.activity-meta {
  display: grid;
  gap: 2px;
  text-align: right;
  font-size: 0.86rem;
  flex-shrink: 0;
}

.attention-list,
.coming-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attention-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.attention-cat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: rgba(243, 246, 244, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.attention-cat:hover {
  background: #fff;
  border-color: rgba(15, 61, 62, 0.2);
}

.attention-cat-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.attention-cat-count {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--teal);
  line-height: 1;
}

.attention-cat.is-amber {
  border-color: rgba(201, 120, 44, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 120, 44, 0.12), transparent 55%),
    #fff;
}

.attention-cat.is-amber .attention-cat-count {
  color: var(--amber, #c9782c);
}

.attention-cat.is-danger {
  border-color: rgba(160, 50, 50, 0.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(160, 50, 50, 0.1), transparent 55%),
    #fff;
}

.attention-cat.is-danger .attention-cat-count {
  color: #a03232;
}

.attention-cat.is-ok .attention-cat-count {
  color: var(--ink-soft);
  opacity: 0.85;
}

.attention-row,
.coming-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: rgba(243, 246, 244, 0.85);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.attention-row:hover,
.coming-row:hover {
  border-color: rgba(15, 61, 62, 0.16);
  background: #fff;
}

.attention-row > div:first-child,
.coming-row > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.attention-row.is-amber {
  border-left: 3px solid rgba(201, 120, 44, 0.7);
}

.attention-row.is-danger {
  border-left: 3px solid rgba(160, 50, 50, 0.55);
}

.attention-go,
.coming-when {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
}

.coming-toolbar,
.batch-mix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 10px;
}

.batch-mix-toolbar .muted {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.batch-mix-select select {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem 0.55rem;
  max-width: 100%;
}

.coming-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.coming-board {
  display: grid;
  grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  min-height: 220px;
  max-height: 280px;
  align-items: stretch;
}

.coming-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.coming-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(243, 246, 244, 0.7);
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0.55rem 0.6rem;
  text-align: left;
  flex-shrink: 0;
}

.coming-tab:hover {
  background: #fff;
  border-color: rgba(15, 61, 62, 0.2);
}

.coming-tab.active {
  background: rgba(31, 107, 79, 0.1);
  border-color: rgba(31, 107, 79, 0.35);
  color: var(--teal);
}

.coming-tab-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.coming-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 1.1rem;
  text-align: right;
}

.coming-tab.active .coming-tab-count {
  color: var(--teal);
}

.coming-pane {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 8px;
}

.coming-pane .coming-list {
  margin-top: 0;
  gap: 0;
}

.batch-mix-visual {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.batch-mix-visual .pie-chart,
.batch-mix-visual .pie-chart.is-donut,
.batch-mix-visual .pie-chart.is-donut-only {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.batch-mix-visual .pie-donut-wrap {
  max-width: 150px;
}

.batch-mix-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 0;
  align-content: center;
}

.batch-mix-kpi {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  background: rgba(243, 246, 244, 0.7);
  min-width: 0;
}

.batch-mix-kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--teal);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-mix-kpi span {
  font-size: 0.64rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.batch-mix-table {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.batch-mix-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 0.7fr));
  gap: 6px;
  align-items: center;
  padding: 0.35rem 0.2rem;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(20, 40, 36, 0.06);
}

.batch-mix-row.is-head {
  color: var(--ink-soft);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-color: var(--line);
  padding-bottom: 0.45rem;
}

.batch-mix-row strong {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-mix-row > span {
  text-align: right;
  color: var(--ink-soft);
}

.coming-row.is-minimal {
  padding: 0.55rem 0.35rem;
  background: transparent;
  border-radius: 8px;
  border: 0;
  border-bottom: 1px solid rgba(20, 40, 36, 0.06);
}

.coming-row.is-minimal:hover {
  background: rgba(31, 107, 79, 0.06);
  border-color: transparent;
  border-bottom-color: rgba(20, 40, 36, 0.06);
}

.coming-row.is-minimal strong {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.jump-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.jump-icon {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0.65rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  min-width: 0;
}

.jump-icon:hover {
  border-color: rgba(15, 61, 62, 0.22);
  background: rgba(31, 107, 79, 0.06);
}

.jump-icon .icon {
  width: 18px;
  height: 18px;
}

.jump-icon span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jump-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.jump-card {
  display: grid;
  gap: 6px;
  text-align: left;
  background:
    radial-gradient(circle at 90% 0%, rgba(201, 120, 44, 0.12), transparent 42%),
    #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.jump-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 61, 62, 0.22);
  box-shadow: 0 12px 28px rgba(15, 61, 62, 0.1);
}

.jump-card strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.jump-card span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  align-items: end;
}

.batch-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
}

.chip.on {
  background: var(--teal);
  color: #f7fbfa;
  border-color: var(--teal);
}

.rank-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rank-card {
  display: grid;
  gap: 4px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(243, 246, 244, 0.9);
  border: 1px solid var(--line);
}

.rank-n {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.highlight-panel {
  border-color: rgba(201, 120, 44, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 120, 44, 0.12), transparent 40%),
    #fff;
}

.overview-top-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.kpi-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.kpi-grid-compact .kpi {
  padding: 0.7rem 0.85rem;
}

.kpi-grid-compact .kpi .value {
  font-size: 1.2rem;
}

.overview-pulse {
  padding: 12px 14px;
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.overview-pulse > .page-head {
  margin-bottom: 0;
}

.pulse-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pulse-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(231, 238, 234, 0.75)),
    #fff;
}

.pulse-stat .value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--teal);
  line-height: 1.1;
}

.pulse-stat .label {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.2;
}

.pulse-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 10px;
  min-width: 0;
}

.pulse-block h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ink-soft);
  font-family: var(--font-body);
}

.pulse-bars {
  display: grid;
  gap: 7px;
}

.pulse-bar-row {
  display: grid;
  gap: 3px;
}

.pulse-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
}

.pulse-bar-label strong {
  font-size: 0.74rem;
}

.pulse-bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(20, 40, 36, 0.08);
  overflow: hidden;
}

.pulse-bar-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), rgba(31, 107, 79, 0.65));
  min-width: 0;
}

.pulse-activity {
  display: grid;
  gap: 2px;
}

.pulse-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.pulse-activity-row:hover {
  background: rgba(31, 107, 79, 0.06);
}

.pulse-activity-main {
  min-width: 0;
  display: grid;
  gap: 0;
}

.pulse-activity-main strong,
.pulse-activity-main .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-activity-main strong {
  font-size: 0.8rem;
}

.pulse-activity-main .muted {
  font-size: 0.7rem;
}

.pulse-activity-meta {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
}

.pulse-foot {
  font-size: 0.72rem;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.attendance-desk.is-compact {
  padding: 12px 14px;
  max-width: 360px;
  width: 100%;
  justify-self: start;
}

.attendance-desk-head {
  margin-bottom: 8px;
  align-items: center;
}

.attendance-desk-head h2 {
  margin: 0;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.att-window-stage {
  display: grid;
  gap: 8px;
}

.att-window-rail {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}

.att-window-rail::-webkit-scrollbar {
  display: none;
}

.att-window-track {
  display: flex;
  gap: 0;
  min-width: 100%;
}

.att-window-tile {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  aspect-ratio: auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  box-sizing: border-box;
}

.att-window-tile-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.att-window-tile-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.att-window-tile-title strong {
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-window-tile-desc {
  font-size: 0.72rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.att-window-meta {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(20, 40, 36, 0.035);
  border: 1px solid rgba(20, 40, 36, 0.06);
}

.att-window-meta-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  font-size: 0.74rem;
  line-height: 1.25;
  min-width: 0;
}

.att-window-meta-row > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-window-meta-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ink-soft);
}

.att-window-tile-detail {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

.att-window-tile-action {
  margin-top: 2px;
}

.att-window-cta {
  width: 100%;
  justify-content: center;
  gap: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

.att-window-cta .icon {
  width: 14px;
  height: 14px;
}

.att-window-pager {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}

.att-window-nav {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.att-window-nav:hover:not(:disabled) {
  background: var(--teal-light, rgba(31, 107, 79, 0.08));
}

.att-window-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.att-window-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-height: 28px;
}

.att-window-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(20, 40, 36, 0.18);
  cursor: pointer;
}

.att-window-dot.active {
  background: var(--teal);
  width: 16px;
}

.att-window-tile.is-ready {
  border-color: rgba(201, 120, 44, 0.45);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 120, 44, 0.14), transparent 50%),
    #fff;
}

.att-window-tile.is-open {
  border-color: rgba(31, 107, 79, 0.4);
  background:
    radial-gradient(circle at 100% 0%, rgba(31, 107, 79, 0.12), transparent 50%),
    #fff;
}

.att-window-tile-icon {
  display: grid;
  place-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(31, 107, 79, 0.08);
  color: var(--teal);
  line-height: 0;
  flex-shrink: 0;
}

.att-window-tile-icon .icon {
  width: 16px;
  height: 16px;
}

.att-window-tile.is-ready .att-window-tile-icon {
  color: var(--amber, #c9782c);
  background: rgba(201, 120, 44, 0.12);
}

.att-window-tile.is-open .att-window-tile-icon {
  color: var(--ok, #1f6b4f);
  background: rgba(31, 107, 79, 0.12);
}

.att-window-tile.is-upcoming .att-window-tile-icon {
  color: var(--teal);
  background: rgba(31, 107, 79, 0.08);
}

.att-window-tile .badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  align-self: start;
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.icon-btn .icon {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.icon-btn.is-amber:hover,
.icon-btn.is-amber {
  border-color: rgba(201, 120, 44, 0.45);
  color: #c9782c;
}

.icon-btn.is-ok:hover,
.icon-btn.is-ok {
  border-color: rgba(31, 107, 79, 0.4);
  color: #1f6b4f;
}

.icon-btn.is-danger:hover,
.icon-btn.is-danger {
  border-color: rgba(160, 50, 50, 0.4);
  color: #a03232;
}

.compact-empty {
  font-size: 0.8rem;
  margin: 0;
  grid-column: 1 / -1;
}

.attendance-pending-strip {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.attendance-pending-strip h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ink-soft);
  font-family: var(--font-body);
}

.attendance-pending-list {
  display: grid;
  gap: 4px;
  max-height: 148px;
  overflow: auto;
}

.att-pending-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  min-width: 0;
}

.att-pending-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0;
}

.att-pending-meta strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-pending-meta .muted {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-pending-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .overview-top-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pulse-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .kpi-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-mix-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .batch-mix-visual {
    grid-template-columns: minmax(110px, 130px) minmax(0, 1fr);
  }

  .batch-mix-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .coming-board {
    grid-template-columns: minmax(88px, 100px) minmax(0, 1fr);
    max-height: 260px;
  }
}

.calendar-list .badge {
  margin-right: 4px;
}

textarea {
  border: 1px solid rgba(15, 61, 62, 0.18);
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  width: 100%;
  font: inherit;
  resize: vertical;
  min-height: 8rem;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .jump-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-pct {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .grid-3,
  .grid-2,
  .quiz-layout,
  .admin-layout,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .quiz-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .quiz-dock-main {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .quiz-dock-status {
    white-space: normal;
  }

  .quiz-dock-actions {
    width: 100%;
  }

  .quiz-dock-actions .btn {
    flex: 1;
  }

  .quiz-layout--docked {
    padding-bottom: 140px;
  }

  .admin-rail {
    position: static;
  }

  .admin-rail-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid,
  .jump-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .shell.shell--with-sidebar {
    padding-left: 0;
  }

  .shell.shell--with-sidebar:has(.admin-layout) {
    padding-left: 0;
  }

  .app-sidebar,
  .shell.shell--with-sidebar:has(.admin-layout) .app-sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 14px 10px;
    overflow: visible;
  }

  .sidebar-nav {
    flex-direction: column;
    gap: 8px;
  }

  .nav-cluster {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .shell-main {
    padding: 20px 16px 56px;
  }

  .side-card {
    position: static;
  }

  .nav-drop-menu {
    left: 0;
    right: auto;
  }
}

/* Visual month calendar */
.calendar-board {
  overflow: hidden;
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cal-month-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-cell {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 250, 248, 0.9);
  padding: 8px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.cal-cell.empty {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
  min-height: 0;
}

.cal-cell:hover {
  border-color: rgba(15, 61, 62, 0.28);
  transform: translateY(-1px);
}

.cal-cell.today {
  box-shadow: inset 0 0 0 2px rgba(201, 120, 44, 0.45);
}

.cal-cell.selected {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 10px 24px rgba(15, 61, 62, 0.1);
}

.cal-cell.has-events {
  background: linear-gradient(165deg, #fff, rgba(215, 235, 232, 0.55));
}

.cal-daynum {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.cal-dot,
.cal-legend .cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: var(--teal-mid);
}

.cal-dot.deadline {
  background: var(--amber);
}

.cal-dot.appointment {
  background: var(--teal);
}

.cal-dot.class {
  background: #2f6f9b;
}

.cal-dot.other {
  background: #6b7280;
}

.cal-more {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.cal-mini {
  display: none;
  flex-direction: column;
  gap: 3px;
}

.cal-chip {
  display: block;
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(15, 61, 62, 0.08);
}

.cal-chip.deadline {
  background: var(--amber-soft);
  color: #8a4d12;
}

.cal-chip.appointment,
.cal-chip.class {
  background: var(--teal-light);
  color: var(--teal);
}

.cal-day-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cal-day-detail h3 {
  margin: 0;
  font-family: var(--font-display);
}

@media (min-width: 900px) {
  .cal-cell {
    min-height: 108px;
  }

  .cal-mini {
    display: flex;
  }

  .cal-dots {
    display: none;
  }
}

@media (max-width: 700px) {
  .cal-cell {
    min-height: 64px;
    padding: 6px;
  }

  .cal-legend {
    width: 100%;
  }
}

/* Student dashboard � compact session + visual summary tiles + upcoming */
.student-dash .page-head.compact {
  margin-bottom: 10px;
}

.student-dash .page-head.compact h1 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin-bottom: 2px;
}

.student-dash .page-head.compact .muted {
  font-size: 0.88rem;
  margin: 0;
}

.student-dash .shell,
.shell:has(.student-dash) {
  padding-bottom: 40px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1.2fr) minmax(0, 1.15fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
  max-width: none;
}

.session-square,
.summary-square,
.notif-panel {
  aspect-ratio: auto;
  height: 168px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 10px;
}

.session-square {
  width: 100%;
  border-color: rgba(201, 120, 44, 0.28);
  background:
    radial-gradient(circle at 12% 18%, rgba(201, 120, 44, 0.14), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(26, 92, 94, 0.1), transparent 40%),
    #fff;
}

.session-square.is-open {
  border-color: rgba(31, 107, 79, 0.4);
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 107, 79, 0.12), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(201, 120, 44, 0.08), transparent 40%),
    #fff;
}

.session-square.is-empty {
  opacity: 0.92;
}

.session-square-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.session-square-top .eyebrow {
  margin: 0;
  font-size: 0.72rem;
}

.session-square-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 0;
}

.session-square .session-date {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.session-square h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.session-square .session-topic {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.session-square .session-time {
  margin: 3px 0 0;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.session-square-cta {
  margin-top: auto;
  padding-top: 4px;
}

.session-square-cta .btn {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
}

.summary-square {
  background:
    linear-gradient(160deg, rgba(215, 235, 232, 0.45), transparent 55%),
    rgba(255, 255, 255, 0.86);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  height: 100%;
  min-height: 0;
}

.summary-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 0;
  overflow: hidden;
}

.summary-tile.tone-ok {
  border-color: rgba(31, 107, 79, 0.28);
  background: linear-gradient(135deg, rgba(31, 107, 79, 0.1), rgba(255, 255, 255, 0.95));
}

.summary-tile.tone-teal {
  border-color: rgba(26, 92, 94, 0.24);
  background: linear-gradient(135deg, rgba(215, 235, 232, 0.55), rgba(255, 255, 255, 0.95));
}

.summary-tile.tone-warn {
  border-color: rgba(201, 120, 44, 0.35);
  background: linear-gradient(135deg, rgba(201, 120, 44, 0.12), rgba(255, 255, 255, 0.95));
}

.summary-tile.tone-danger {
  border-color: rgba(163, 59, 43, 0.4);
  background: linear-gradient(135deg, rgba(163, 59, 43, 0.12), rgba(255, 255, 255, 0.95));
  animation: pulse-alert 1.8s ease-in-out infinite;
}

.summary-tile.tone-neutral {
  background: rgba(255, 255, 255, 0.94);
}

@keyframes pulse-alert {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(163, 59, 43, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(163, 59, 43, 0.12);
  }
}

.tile-visual {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.tile-visual.mood-only {
  display: grid;
  place-items: center;
}

.dash-ring {
  width: 32px;
  height: 32px;
  transform: rotate(-90deg);
}

.dash-ring-track,
.dash-ring-value {
  fill: none;
  stroke-width: 3.5;
}

.dash-ring-track {
  stroke: rgba(20, 34, 33, 0.1);
}

.dash-ring-value {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}

.dash-ring.tone-ok .dash-ring-value {
  stroke: var(--ok);
}

.dash-ring.tone-teal .dash-ring-value,
.dash-ring.tone-neutral .dash-ring-value {
  stroke: var(--teal-mid);
}

.dash-ring.tone-warn .dash-ring-value {
  stroke: var(--amber);
}

.dash-ring.tone-danger .dash-ring-value {
  stroke: var(--danger);
}

.mood-face {
  width: 28px;
  height: 28px;
  color: var(--ink-soft);
}

.tile-visual:not(.mood-only) .mood-face {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
}

.mood-face circle {
  fill: rgba(255, 255, 255, 0.85);
  stroke: currentColor;
  stroke-width: 2;
}

.mood-face.happy {
  color: var(--ok);
}

.mood-face.calm {
  color: var(--teal-mid);
}

.mood-face.worried {
  color: var(--amber);
}

.mood-face.panic {
  color: var(--danger);
}

.summary-tile.tone-danger .mood-face.panic {
  animation: shake-face 0.7s ease-in-out infinite;
}

@keyframes shake-face {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(8deg);
  }
}

.tile-copy {
  min-width: 0;
}

.summary-tile .value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.summary-tile .label {
  color: var(--ink-soft);
  font-size: 0.65rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.summary-tile .blurb {
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-dash .notif-panel {
  padding: 8px 10px;
  margin-bottom: 0;
  background:
    linear-gradient(160deg, rgba(243, 224, 204, 0.3), transparent 50%),
    rgba(255, 255, 255, 0.86);
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.notif-head h2 {
  margin: 0;
  font-size: 0.95rem;
}

.notif-count {
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--amber);
  color: #fff;
  flex-shrink: 0;
}

.notif-count.is-clear {
  background: var(--paper-2);
  color: var(--ink-soft);
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y proximity;
  padding-right: 2px;
}

.notif-card {
  position: relative;
  flex: 0 0 auto;
  min-height: 2.75rem;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
}

.notif-card.tone-ok {
  border-color: rgba(31, 107, 79, 0.28);
  background: linear-gradient(160deg, rgba(31, 107, 79, 0.07), #fff 60%);
}

.notif-card.tone-warn {
  border-color: rgba(201, 120, 44, 0.3);
  background: linear-gradient(160deg, rgba(201, 120, 44, 0.08), #fff 60%);
}

.notif-card.tone-danger {
  border-color: rgba(163, 59, 43, 0.3);
  background: linear-gradient(160deg, rgba(163, 59, 43, 0.08), #fff 60%);
}

.notif-card.tone-teal {
  border-color: rgba(26, 92, 94, 0.22);
  background: linear-gradient(160deg, rgba(215, 235, 232, 0.45), #fff 60%);
}

.notif-card.is-empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  color: var(--ink-soft);
  flex: 1;
  height: auto;
}

.notif-card.is-empty h3 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}

.notif-card.is-empty p {
  margin: 0;
  font-size: 0.78rem;
}

.notif-main {
  flex: 1;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 26px 8px 10px;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 0;
  width: 100%;
}

.notif-main h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.notif-main p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-dismiss {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.12rem 0.28rem;
  border-radius: 5px;
}

.notif-dismiss:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.student-dash .upcoming-board {
  overflow: hidden;
  padding: 14px;
  margin-bottom: 0;
}

.student-dash .upcoming-head {
  gap: 8px;
  margin-bottom: 8px;
}

.student-dash .upcoming-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.student-dash .upcoming-head .muted {
  font-size: 0.82rem;
  margin: 2px 0 0;
}

.student-dash .upcoming-tab {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

.student-dash .upcoming-card {
  padding: 10px 12px;
  min-height: 0;
  border-radius: 12px;
}

.student-dash .upcoming-card-label {
  margin-bottom: 8px;
}

.student-dash .upcoming-card-label strong {
  font-size: 1rem;
}

.student-dash .upcoming-items {
  gap: 6px;
}

.student-dash .upcoming-item {
  padding: 8px 10px;
  border-radius: 10px;
  gap: 8px;
}

.student-dash .upcoming-item h3 {
  font-size: 0.95rem;
}

.student-dash .upcoming-item .kind {
  font-size: 0.68rem;
}

.student-dash .upcoming-item p.muted {
  margin: 2px 0 0;
  font-size: 0.78rem;
}

.student-dash .upcoming-item .btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.student-dash .upcoming-nav {
  width: 34px;
  border-radius: 10px;
  font-size: 1.3rem;
}

.student-dash .upcoming-dots {
  margin-top: 8px;
}

.student-dash .dash-secondary {
  margin-top: 12px;
  gap: 12px;
}

.student-dash-main {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: start;
  margin-top: 2px;
}

.student-dash-upcoming {
  min-width: 0;
}

.student-dash-upcoming .upcoming-board {
  margin: 0;
  height: 100%;
}

.student-dash-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.student-dash .upcoming-head {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.student-dash .upcoming-tabs {
  flex-wrap: wrap;
  max-width: 100%;
}

.student-dash .upcoming-stage {
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 6px;
}

.student-dash .upcoming-nav {
  width: 28px;
  font-size: 1.15rem;
  border-radius: 8px;
}

.student-dash .upcoming-card {
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
}

.student-dash .upcoming-item {
  flex-direction: column;
  align-items: stretch;
}

.student-dash .upcoming-item .actions {
  justify-content: flex-start;
}

.account-page {
  max-width: 920px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.account-meta {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.account-meta > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(20, 40, 36, 0.08);
}

.account-meta dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ink-soft);
}

.account-meta dd {
  margin: 0;
  font-weight: 600;
}

.account-password-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-width: 420px;
}

.student-dash .compact-panel {
  padding: 12px 14px;
}

.student-dash .compact-panel h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.student-dash .list.tight {
  gap: 6px;
  margin-top: 0;
}

.student-dash .compact-row {
  padding: 8px 10px;
  border-radius: 10px;
  gap: 8px;
}

.student-dash .compact-row strong {
  font-size: 0.92rem;
}

.student-dash .compact-row .muted {
  font-size: 0.78rem;
}

.student-dash .compact-row .btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

.student-dash .tight-table {
  margin-top: 0;
}

.student-dash .tight-table th,
.student-dash .tight-table td {
  padding: 6px 8px;
  font-size: 0.84rem;
}

.upcoming-board {
  overflow: hidden;
}

.upcoming-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.upcoming-head h2 {
  margin: 0 0 4px;
}

.upcoming-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.upcoming-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.upcoming-tab span {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--paper-2);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  color: var(--ink);
}

.upcoming-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.upcoming-tab.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.upcoming-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  touch-action: pan-y;
}

.upcoming-nav {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  width: 42px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--teal);
  align-self: center;
}

.upcoming-nav:hover {
  background: var(--teal-light);
}

.upcoming-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(215, 235, 232, 0.45), transparent 48%),
    #fff;
  padding: 16px;
  min-height: 220px;
}

.upcoming-card-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.upcoming-card-label strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.upcoming-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-left: 4px solid var(--teal-mid);
}

.upcoming-item.tone-amber {
  border-left-color: var(--amber);
}

.upcoming-item.tone-danger {
  border-left-color: var(--danger);
}

.upcoming-item.tone-ok {
  border-left-color: var(--ok);
}

.upcoming-item .kind {
  margin: 0 0 2px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.upcoming-item h3 {
  margin: 0;
  font-size: 1.05rem;
}

.upcoming-item .actions {
  flex-shrink: 0;
}

.upcoming-item p.muted {
  margin: 4px 0 0;
}

.upcoming-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.upcoming-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper-2);
}

.upcoming-dots span.on {
  background: var(--teal);
  width: 18px;
  border-radius: 999px;
}

.empty.soft {
  margin: 28px 0;
  text-align: center;
}

/* Student attendance � session cards */
.session-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-card.is-open {
  border-color: rgba(31, 107, 79, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(31, 107, 79, 0.1), transparent 40%),
    #fff;
}

.session-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.session-card-top strong {
  display: block;
  font-size: 1.05rem;
}

.session-card-top .muted {
  display: block;
  margin-top: 2px;
}

.session-date-sm {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.session-time {
  margin: 0;
  font-size: 0.92rem;
}

.session-card-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

@media (max-width: 900px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .student-dash-main {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .session-square,
  .summary-square,
  .notif-panel {
    height: auto;
    min-height: 150px;
  }

  .session-square {
    min-height: 160px;
  }

  .notif-panel {
    min-height: 180px;
  }

  .notif-list {
    max-height: 148px;
  }

  .session-card-grid {
    grid-template-columns: 1fr;
  }

  .upcoming-stage,
  .student-dash .upcoming-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .upcoming-nav {
    display: none;
  }

  .upcoming-item {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Icons */
.icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.15em;
}

.icon.lg {
  width: 1.35rem;
  height: 1.35rem;
}

.nav button .icon,
.btn .icon {
  width: 1rem;
  height: 1rem;
}

.admin-rail-nav .icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 2px;
  grid-row: 1 / span 2;
}

/* Page motion — only when shell--enter is set on a real page/section change */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.shell.shell--enter > *:not(.app-sidebar) {
  animation: rise-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.shell.shell--enter .dashboard-hero > * {
  animation: rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.shell.shell--enter .dashboard-hero > *:nth-child(1) { animation-delay: 0.04s; }
.shell.shell--enter .dashboard-hero > *:nth-child(2) { animation-delay: 0.1s; }
.shell.shell--enter .dashboard-hero > *:nth-child(3) { animation-delay: 0.16s; }

.panel {
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.session-square,
.summary-square,
.notif-panel,
.session-card,
.summary-tile,
.notif-card,
.upcoming-item {
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.session-square:hover,
.summary-square:hover,
.notif-panel:hover,
.session-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 61, 62, 0.1);
}

.summary-tile:hover,
.notif-card:hover,
.upcoming-item:hover,
.compact-row:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 92, 94, 0.28);
}

.notif-main .icon {
  float: left;
  margin: 1px 6px 0 0;
}

/* Interactive tour */
.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.tour-dim {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 24, 0.55);
  backdrop-filter: blur(1.5px);
  -webkit-mask-image: radial-gradient(
    circle var(--spot-r, 0px) at var(--spot-x, 50%) var(--spot-y, 50%),
    transparent 0,
    transparent 99%,
    #000 100%
  );
  mask-image: radial-gradient(
    circle var(--spot-r, 0px) at var(--spot-x, 50%) var(--spot-y, 50%),
    transparent 0,
    transparent 99%,
    #000 100%
  );
  transition: mask-image 0.25s ease, -webkit-mask-image 0.25s ease;
}

.tour-spot {
  position: fixed;
  border-radius: 12px;
  border: 2px solid var(--amber);
  box-shadow:
    0 0 0 4px rgba(201, 120, 44, 0.22),
    0 12px 30px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  animation: tour-pulse 1.6s ease-in-out infinite;
  z-index: 101;
}

@keyframes tour-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(201, 120, 44, 0.2),
      0 12px 30px rgba(0, 0, 0, 0.16);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(201, 120, 44, 0.12),
      0 14px 34px rgba(0, 0, 0, 0.18);
  }
}

.tour-target {
  z-index: 92 !important;
  pointer-events: auto !important;
}

.tour-target--static {
  position: relative;
}

.tour-tip {
  position: fixed;
  z-index: 102;
  width: min(360px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  pointer-events: auto;
  animation: rise-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tour-tip .eyebrow {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-tip h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.tour-tip p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.tutorial-progress {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.tutorial-progress span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--paper-2);
}

.tutorial-progress span.on {
  background: var(--teal);
}

.tutorial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

body.tutorial-active {
  overflow: hidden;
}

/* Guide lives in the sidebar — no floating FAB */
.guide-fab-wrap,
.guide-fab,
.guide-fab-menu {
  display: none !important;
}

.guide-steps {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.guide-step:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 92, 94, 0.28);
}

.guide-step .step-num {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 700;
  font-size: 0.85rem;
}

.guide-step h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.guide-step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* Grades manager + Quiz Center */
.summary-tile-link {
  cursor: pointer;
}
.summary-tile-link:focus-visible {
  outline: 2px solid rgba(26, 92, 94, 0.55);
  outline-offset: 2px;
}

.grades-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.grades-kpi .value {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
}

.grades-kpi .label {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.grades-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.grades-side {
  display: grid;
  gap: 16px;
}

.trend-bars {
  display: grid;
  gap: 8px;
}

.trend-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.trend-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 61, 62, 0.08);
  overflow: hidden;
}

.trend-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(26, 92, 94, 0.75), rgba(31, 107, 79, 0.9));
}

.trend-avg {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  margin-left: -1px;
  background: rgba(201, 120, 44, 0.95);
}

.trend-pct {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
}

.weak-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.weak-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.weak-report {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(196, 120, 44, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(255, 244, 230, 0.55), rgba(255, 255, 255, 0.92) 45%),
    #fff;
}

.weak-report.empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.7);
}

.weak-summary {
  margin: 0 0 12px;
  font-size: 1.02rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
}

.weak-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.weak-kpi {
  padding: 10px 10px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
}

.weak-kpi strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.weak-kpi span {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.weak-diff-strip {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  min-height: 34px;
}

.weak-diff-seg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  min-width: 0;
}

.weak-diff-seg em {
  font-style: normal;
  opacity: 0.85;
}

.weak-diff-seg.easy {
  background: #4f9f72;
}

.weak-diff-seg.medium {
  background: #d5953d;
}

.weak-diff-seg.hard {
  background: #c14e48;
}

.weak-topic-cards {
  display: grid;
  gap: 10px;
}

.weak-topic-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.weak-topic-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.weak-topic-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.weak-topic-card header .muted {
  margin: 4px 0 0;
  font-size: 0.8rem;
}

.weak-topic-stat {
  text-align: right;
  flex-shrink: 0;
}

.weak-topic-stat strong {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
}

.weak-topic-stat span {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.weak-share-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 40, 48, 0.08);
  margin: 10px 0 8px;
  overflow: hidden;
}

.weak-share-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d5953d, #c14e48);
}

.weak-mini-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-pill {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(26, 92, 94, 0.1);
  color: var(--teal);
}

.weak-topic-samples {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.weak-topic-samples li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.86rem;
  line-height: 1.35;
}

.weak-sample-prompt {
  min-width: 0;
}

.weak-hw-row {
  margin-top: 14px;
}

.weak-hw-row h3,
.weak-build-heading {
  margin: 0 0 8px;
  font-size: 1rem;
}

.weak-build-heading {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.weak-hw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.weak-hw-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
}

.weak-miss-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.weak-miss-details summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.weak-miss-details summary::-webkit-details-marker {
  display: none;
}

.weak-miss-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.weak-miss-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.weak-miss-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.weak-miss-prompt {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.weak-miss-answers {
  display: grid;
  gap: 4px;
  font-size: 0.86rem;
}

.weak-miss-answers em {
  font-style: normal;
  color: var(--ink-soft);
  margin-right: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.you-picked {
  color: #8a2f2b;
}

.correct-was {
  color: #1f6b3f;
}

.weak-miss-explain {
  margin: 8px 0 0;
  font-size: 0.84rem;
}

@media (max-width: 720px) {
  .weak-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .weak-hw-list li {
    grid-template-columns: 1fr auto;
  }
  .weak-hw-list li .muted {
    grid-column: 1 / -1;
  }
}

.quiz-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.quiz-mode-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}

.quiz-mode-tab.active {
  border-color: rgba(26, 92, 94, 0.45);
  background: linear-gradient(135deg, rgba(215, 235, 232, 0.85), rgba(255, 255, 255, 0.95));
  font-weight: 600;
}

.quiz-center-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.quiz-center-layout.single {
  grid-template-columns: minmax(0, 720px);
}

.quiz-gateways {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-gateway {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 8px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.94);
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.quiz-gateway .icon {
  grid-row: 1 / span 2;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 2px;
}

.quiz-gateway-copy {
  display: grid;
  gap: 4px;
}

.quiz-gateway-copy strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.quiz-gateway-copy span {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.quiz-gateway-meta {
  grid-column: 2;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--teal);
}

.quiz-gateway:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 61, 62, 0.1);
}

.quiz-gateway.analyze {
  background: linear-gradient(145deg, rgba(26, 92, 94, 0.1), rgba(255, 255, 255, 0.96) 55%);
  border-color: rgba(26, 92, 94, 0.22);
}

.quiz-gateway.build {
  background: linear-gradient(145deg, rgba(232, 168, 74, 0.18), rgba(255, 255, 255, 0.96) 55%);
  border-color: rgba(201, 120, 44, 0.3);
}

.quiz-gateway:focus-visible {
  outline: 2px solid rgba(26, 92, 94, 0.55);
  outline-offset: 2px;
}

.weak-summary-card {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(196, 120, 44, 0.2);
  background:
    linear-gradient(160deg, rgba(255, 244, 230, 0.5), rgba(255, 255, 255, 0.94) 50%),
    #fff;
}

.weak-review-line {
  margin: -4px 0 12px;
  font-size: 0.9rem;
  color: var(--teal);
  font-weight: 650;
}

.weak-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 12px;
  margin-top: 14px;
}

.weak-chart-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  min-width: 0;
}

.weak-chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.weak-chart-head h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.weak-chart-head .muted {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 36ch;
}

.weak-chart-footnote {
  margin: 10px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.weak-metric-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.weak-metric-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.weak-metric-btn.active {
  background: rgba(26, 92, 94, 0.12);
  color: var(--teal);
  font-weight: 650;
}

.weak-topic-bars {
  margin-top: 8px;
  gap: 8px;
}

.weak-bar-row {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 6px 4px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.weak-bar-row:hover {
  background: rgba(26, 92, 94, 0.05);
}

.weak-bar-row.active {
  border-color: rgba(201, 120, 44, 0.4);
  background: rgba(232, 168, 74, 0.12);
}

.weak-bar-rank {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(201, 120, 44, 0.18);
  color: #8a5a12;
  vertical-align: middle;
}

.weak-expand-topics {
  margin-top: 8px;
  width: 100%;
}

.weak-topic-detail-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(26, 92, 94, 0.22);
  background: rgba(255, 255, 255, 0.7);
}

.weak-topic-detail-donut .pie-chart {
  margin-top: 4px;
}

.weak-depth-callout .eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 650;
}

.weak-depth-callout strong {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.1;
}

@media (max-width: 900px) {
  .weak-visual-grid,
  .weak-topic-detail-charts {
    grid-template-columns: 1fr;
  }
}

.weak-browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.weak-groupby {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.weak-groupby-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.weak-groupby-btn.active {
  background: rgba(26, 92, 94, 0.12);
  color: var(--teal);
  font-weight: 650;
}

.weak-group-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.weak-group-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.weak-group-chip em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 650;
}

.weak-group-chip.active {
  border-color: rgba(26, 92, 94, 0.45);
  background: rgba(26, 92, 94, 0.1);
  box-shadow: inset 0 0 0 1px rgba(26, 92, 94, 0.15);
  font-weight: 650;
}

.weak-group-chip.diff-easy.active {
  border-color: rgba(72, 160, 110, 0.45);
  background: rgba(72, 160, 110, 0.12);
}

.weak-group-chip.diff-medium.active {
  border-color: rgba(200, 130, 40, 0.45);
  background: rgba(232, 168, 74, 0.14);
}

.weak-group-chip.diff-hard.active {
  border-color: rgba(196, 78, 72, 0.4);
  background: rgba(196, 78, 72, 0.12);
}

.weak-group-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.weak-group-meta h3 {
  margin: 0;
  font-size: 1.15rem;
}

.weak-question-browser {
  margin-top: 4px;
}

.weak-q-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.weak-q-dot {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  color: var(--ink-soft);
}

.weak-q-dot.active {
  border-color: rgba(201, 120, 44, 0.55);
  background: rgba(232, 168, 74, 0.2);
  color: #8a5a12;
}

.weak-miss-card.focused {
  border-color: rgba(26, 92, 94, 0.22);
  box-shadow: 0 8px 20px rgba(15, 61, 62, 0.06);
}

.weak-browse-stage {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: stretch;
  touch-action: pan-y;
}

.weak-browse-nav {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--teal);
}

.weak-browse-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.weak-browse-frame {
  min-width: 0;
}

.weak-browse-pos {
  margin: 0 0 8px;
  font-size: 0.8rem;
}

.weak-slide-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.weak-slide-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.weak-slide-head .eyebrow {
  margin: 0 0 2px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 650;
}

.weak-slide-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.weak-slide-sub {
  margin: 14px 0 8px;
  font-size: 0.92rem;
}

.weak-miss-list.compact {
  max-height: 420px;
  overflow: auto;
}

.weak-diff-strip .weak-diff-seg {
  border: 0;
  cursor: pointer;
  font: inherit;
}

@media (max-width: 720px) {
  .quiz-gateways {
    grid-template-columns: 1fr;
  }
  .weak-browse-stage {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
  }
}

.quiz-builder-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 14px;
}

.topic-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.topic-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-chip em {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.topic-chip.selected {
  border-color: rgba(26, 92, 94, 0.45);
  background: rgba(215, 235, 232, 0.65);
}

.quiz-future-note {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.85rem;
}

.stat-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 4px;
}

.stat-chip strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
}

.stat-chip span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .grades-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grades-layout,
  .quiz-center-layout {
    grid-template-columns: 1fr;
  }
}

.quiz-invite {
  background:
    linear-gradient(145deg, rgba(232, 168, 74, 0.16), rgba(255, 255, 255, 0.92) 55%),
    var(--panel, #fff);
  border-color: rgba(232, 168, 74, 0.35);
}

.quiz-invite h2 {
  margin-bottom: 4px;
}

.quiz-invite-btn {
  margin-top: 12px;
  width: 100%;
}

.dash-cta-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dash-cta {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.92);
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.dash-cta .icon {
  grid-row: 1 / span 2;
  width: 1.55rem;
  height: 1.55rem;
}

.dash-cta-label {
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dash-cta-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.dash-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 61, 62, 0.1);
}

.dash-cta:focus-visible {
  outline: 2px solid rgba(26, 92, 94, 0.55);
  outline-offset: 2px;
}

.dash-cta-grades {
  background: linear-gradient(145deg, rgba(26, 92, 94, 0.1), rgba(255, 255, 255, 0.95) 60%);
  border-color: rgba(26, 92, 94, 0.22);
  color: var(--teal);
}

.dash-cta-grades:hover {
  border-color: rgba(26, 92, 94, 0.4);
}

.dash-cta-quiz {
  background: linear-gradient(145deg, rgba(232, 168, 74, 0.22), rgba(255, 255, 255, 0.95) 58%);
  border-color: rgba(201, 120, 44, 0.35);
  color: #8a5a12;
}

.dash-cta-quiz:hover {
  border-color: rgba(201, 120, 44, 0.55);
  box-shadow: 0 12px 24px rgba(201, 120, 44, 0.16);
}

@media (max-width: 560px) {
  .dash-cta-pair {
    grid-template-columns: 1fr;
  }
}

.difficulty-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(26, 40, 48, 0.12);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
}

.diff-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.diff-chip em {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.diff-chip.selected {
  border-color: rgba(26, 92, 94, 0.45);
  box-shadow: inset 0 0 0 1px rgba(26, 92, 94, 0.2);
}

.diff-chip.diff-easy.selected {
  background: rgba(72, 160, 110, 0.12);
  border-color: rgba(72, 160, 110, 0.45);
}

.diff-chip.diff-medium.selected {
  background: rgba(232, 168, 74, 0.14);
  border-color: rgba(200, 130, 40, 0.45);
}

.diff-chip.diff-hard.selected {
  background: rgba(196, 78, 72, 0.12);
  border-color: rgba(196, 78, 72, 0.4);
}

.diff-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.diff-badge.diff-easy {
  background: rgba(72, 160, 110, 0.16);
  color: #1f6b3f;
}

.diff-badge.diff-medium {
  background: rgba(232, 168, 74, 0.2);
  color: #8a5a12;
}

.diff-badge.diff-hard {
  background: rgba(196, 78, 72, 0.16);
  color: #8a2f2b;
}

.diff-mix-field label {
  margin-bottom: 8px;
}

.diff-mix-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.diff-mix-label strong {
  font-variant-numeric: tabular-nums;
}

.diff-mix-label em {
  font-style: normal;
  color: var(--ink-soft);
  margin-left: 2px;
}

.diff-mix-label.easy {
  color: #1f6b3f;
}

.diff-mix-label.medium {
  color: #8a5a12;
}

.diff-mix-label.hard {
  color: #8a2f2b;
}

.diff-mix-track {
  position: relative;
  display: flex;
  height: 28px;
  border-radius: 999px;
  overflow: visible;
  border: 1px solid rgba(26, 40, 48, 0.12);
  background: rgba(255, 255, 255, 0.7);
  touch-action: none;
  user-select: none;
  cursor: pointer;
}

.diff-mix-seg {
  min-width: 0;
  height: 100%;
  transition: flex 0.05s linear;
}

.diff-mix-seg:first-child {
  border-radius: 999px 0 0 999px;
}

.diff-mix-seg:last-of-type {
  border-radius: 0 999px 999px 0;
}

.diff-mix-seg.easy {
  background: linear-gradient(180deg, #7dcaa0, #4f9f72);
}

.diff-mix-seg.medium {
  background: linear-gradient(180deg, #f0c27a, #d5953d);
}

.diff-mix-seg.hard {
  background: linear-gradient(180deg, #e08b86, #c14e48);
}

.diff-mix-knob {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1a3c3d;
  box-shadow: 0 4px 12px rgba(15, 61, 62, 0.28);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  z-index: 2;
}

.diff-mix-knob:focus-visible {
  outline: 2px solid rgba(26, 92, 94, 0.55);
  outline-offset: 2px;
}

.diff-mix-bank {
  margin-top: 8px;
  font-size: 0.8rem;
}

.lesson-bank-count { margin: 10px 0 0; color: var(--ink-soft); font-size: .86rem; }
.lesson-bank-tools { display: grid; gap: 16px; margin-bottom: 22px; }
.lesson-bank-tools .field { max-width: 520px; }
.lesson-bank-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.lesson-bank-tabs .btn span { opacity: .7; margin-left: 7px; }
.lesson-bank-list { display: grid; gap: 20px; }
.lesson-bank-question { min-width: 0; }
.lesson-bank-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.lesson-bank-title { margin: 16px 0; font-size: 1.15rem; }
.lesson-bank-options { list-style: none; padding: 0; display: grid; gap: 10px; margin: 18px 0; }
.lesson-bank-options li { display: flex; align-items: baseline; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; }
.lesson-bank-options li span { min-width: 0; overflow-wrap: anywhere; }
.lesson-bank-review { padding: 12px 16px; border-left: 3px solid #b47d32; background: #fcf5e9; border-radius: 4px; }
.lesson-bank-solution { margin-top: 16px; }
.lesson-bank-question .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
@media (max-width: 650px) {
  .lesson-bank-head { flex-direction: column; align-items: flex-start; }
  .lesson-bank-tabs .btn { padding: 8px 10px; font-size: .82rem; }
}
