@import url("css/tokens.css");
@import url("css/components.css");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}

.ai-mode-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1200;
  padding: 7px 11px;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  color: #24324a;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  pointer-events: none;
}

.ai-mode-cached { color: #7c3aed; }
.ai-mode-live { color: #b42318; border-color: rgba(180, 35, 24, .3); }

.speech-input-control,
.listen-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 10px 0;
}

.speech-input-control button,
.listen-control button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #d8d4e5;
  border-radius: 9px;
  color: #423b70;
  background: #f8f6ff;
  font: 700 12px/1 "DM Sans", sans-serif;
  cursor: pointer;
}

.speech-input-control button:hover,
.listen-control button:hover:not(:disabled) {
  border-color: var(--purple);
  background: #f0edff;
}

.speech-input-control button:focus-visible,
.listen-control button:focus-visible,
.listen-control select:focus-visible {
  outline: 3px solid rgba(112, 92, 214, .28);
  outline-offset: 2px;
}

.speech-input-control button:disabled,
.listen-control button:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.speech-input-control.is-recording {
  padding: 8px;
  border: 1px solid rgba(190, 37, 52, .35);
  border-radius: 11px;
  background: #fff5f5;
}

.speech-input-control.is-recording .speech-stop-button {
  color: #a51d2d;
  border-color: #e4a7ae;
  background: #fff;
  animation: recording-pulse 1.4s ease-in-out infinite;
}

.listen-control label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #606778;
  font-size: 11px;
  font-weight: 700;
}

.listen-control select {
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid #d8d4e5;
  border-radius: 8px;
  background: #fff;
}

.speech-status {
  flex-basis: 100%;
  min-height: 16px;
  color: #5f6674;
  font-size: 11px;
  line-height: 1.4;
}

.compact-listen-control {
  margin: 8px 0 0;
}

.compact-listen-control button:not([data-speech-play]),
.compact-listen-control select {
  display: none;
}

.compact-listen-control.is-playing button,
.compact-listen-control.is-paused button,
.compact-listen-control.is-playing select,
.compact-listen-control.is-paused select {
  display: inline-flex;
}

@keyframes recording-pulse {
  50% { box-shadow: 0 0 0 5px rgba(190, 37, 52, .12); }
}

@media (prefers-reduced-motion: reduce) {
  .speech-input-control.is-recording .speech-stop-button { animation: none; }
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 340px;
  height: 340px;
  left: -140px;
  top: 110px;
  background: #d7d2ff80;
}

.ambient-two {
  width: 420px;
  height: 420px;
  right: -190px;
  bottom: -140px;
  background: #ffd8c180;
}

.nav {
  height: 86px;
  max-width: 1180px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}

.nav-left {
  display: flex;
  align-items: center;
}

.settings-button {
  position: fixed;
  left: 225px;
  top: 26px;
  z-index: 10;
  border: 1px solid #ded9cf;
  background: #ffffffee;
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 11px;
  font: 600 12px "DM Sans";
  cursor: pointer;
}

.settings-button:hover {
  color: var(--ink);
  border-color: #bdb6aa;
}

.brand {
  font: 800 24px "Manrope";
  color: var(--ink);
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 21px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  filter: drop-shadow(0 5px 10px rgba(16, 46, 40, .18));
}

.nav-note {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-note i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55bd8c;
  box-shadow: 0 0 0 5px #55bd8c22;
}

.hero {
  max-width: 830px;
  margin: 65px auto 0;
  text-align: center;
  padding: 0 24px 70px;
  position: relative;
  z-index: 1;
}

.eyebrow,
.card-kicker,
.side-label {
  color: var(--orange);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .16em;
}

.hero h1 {
  font: 800 clamp(43px, 7vw, 76px)/1.02 "Manrope";
  letter-spacing: -.05em;
  margin: 20px auto 24px;
  max-width: 800px;
}

.hero h1 em {
  color: var(--orange);
  font-style: normal;
  position: relative;
}

.hero h1 em:after {
  content: "";
  position: absolute;
  left: 4%;
  right: 0;
  bottom: -7px;
  height: 9px;
  border-top: 3px solid var(--orange);
  border-radius: 50%;
  transform: rotate(-1deg);
}

.hero-copy {
  max-width: 650px;
  margin: 0 auto 35px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.upload-card {
  background: #fff;
  border: 1px solid #ece8df;
  border-radius: 25px;
  padding: 13px;
  box-shadow: 0 20px 60px #534d3e16;
}

.drop-zone {
  min-height: 210px;
  border: 1.5px dashed #cfc8ba;
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s;
  background: #fcfbf8;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--orange);
  background: #fff8f4;
}

.drop-zone input {
  display: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f1eeff;
  color: var(--purple);
  font-size: 27px;
  margin-bottom: 13px;
}

.drop-zone strong {
  font: 700 17px "Manrope";
}

.drop-zone small {
  color: var(--muted);
  margin-top: 7px;
}

.previews {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.previews img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 9px;
  border: 2px solid white;
  box-shadow: 0 2px 8px #0002;
}

.primary-button {
  border: 0;
  background: var(--ink);
  color: white;
  border-radius: 14px;
  padding: 16px 20px;
  font: 700 15px "DM Sans";
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: .2s;
}

.upload-card>.primary-button {
  width: 100%;
  margin-top: 12px;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #253354;
}

.primary-button:disabled {
  opacity: .55;
  cursor: wait;
}

.primary-button b {
  color: var(--coral);
  font-size: 20px;
}

.privacy {
  color: #9b9b98;
  font-size: 12px;
  margin: 11px 0 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  text-align: left;
  margin-top: 50px;
}

.steps div {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 10px;
}

.steps span {
  grid-row: 1/3;
  color: #bbb4a9;
  font: 700 13px "Manrope";
}

.steps strong {
  font: 700 14px "Manrope";
}

.steps small {
  color: var(--muted);
  margin-top: 3px;
}

.study-home {
  max-width: 980px;
  margin-top: 42px;
}

.study-card {
  padding: 24px;
  border: 1px solid #e8e3d9;
  border-radius: 24px;
  text-align: left;
  background: white;
  box-shadow: 0 22px 65px #3c352415;
}

.subject-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.subject-picker legend,
.goal-field>span {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font: 700 13px "Manrope";
}

.subject-picker legend {
  grid-column: 1 / -1;
}

.subject-picker label {
  cursor: pointer;
}

.subject-picker input {
  position: absolute;
  opacity: 0;
}

.subject-picker label>span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 11px 12px;
  border: 1px solid #ded9d0;
  border-radius: 12px;
  color: #555f75;
  background: #fdfcf9;
  font-size: 17px;
  transition: .18s;
}

.subject-picker label b {
  font-size: 12px;
}

.subject-picker input:checked+span {
  border-color: var(--purple);
  color: #5548ad;
  background: #f3f0ff;
  box-shadow: 0 0 0 3px #7565e812;
}

.goal-field {
  display: block;
  margin-top: 20px;
}

.goal-field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #d8d3c9;
  border-radius: 14px;
  padding: 16px;
  color: var(--ink);
  background: #fbfaf7;
  font: 15px/1.55 "DM Sans";
  outline: none;
}

.goal-field textarea:focus {
  border-color: var(--purple);
  background: white;
  box-shadow: 0 0 0 3px #7565e814;
}

.study-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
}

.study-actions small {
  color: var(--muted);
  font-size: 11px;
}

.attachment-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8d3c9;
  border-radius: 10px;
  padding: 9px 12px;
  color: #59637a;
  background: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.attachment-button input {
  display: none;
}

.attachment-button>span:first-of-type {
  color: var(--purple);
  font-size: 18px;
}

.study-card .previews {
  justify-content: flex-start;
}

.begin-button {
  width: 100%;
  margin-top: 16px;
}

.study-card .privacy {
  text-align: center;
}

.prompt-ideas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 19px;
  color: var(--muted);
  font-size: 11px;
}

.prompt-ideas button {
  border: 1px solid #ded9d0;
  border-radius: 20px;
  padding: 7px 10px;
  color: #5c6478;
  background: #ffffffaa;
  font: 11px "DM Sans";
  cursor: pointer;
}

.prompt-ideas button:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.hidden {
  display: none !important;
}

.lesson {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
  z-index: 3;
  background: #f9f8f4;
}

.lesson-sidebar {
  position: fixed;
  width: 280px;
  height: 100vh;
  background: var(--ink);
  color: white;
  padding: 32px 27px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  color: white;
  margin-bottom: 65px;
}

.sidebar-brand span {
  background: white;
  color: var(--ink);
}

.side-label {
  color: #9ba5bf;
  margin-bottom: 12px;
}

.lesson-sidebar h2 {
  font: 700 21px/1.3 "Manrope";
  margin: 0 0 28px;
}

.concept-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.concept {
  padding: 11px 12px;
  border: 1px solid #ffffff18;
  border-radius: 10px;
  color: #c8cee0;
  font-size: 13px;
  display: flex;
  gap: 9px;
}

.concept:before {
  content: "✓";
  color: #7ed2aa;
}

.score-card {
  margin-top: auto;
  padding: 18px;
  background: #ffffff0c;
  border: 1px solid #ffffff14;
  border-radius: 14px;
}

.score-card small {
  color: #9ba5bf;
  font-size: 10px;
  letter-spacing: .14em;
}

.score-card strong {
  display: block;
  font: 800 36px "Manrope";
  margin: 6px 0;
}

.score-card strong i {
  font-size: 14px;
  color: #8993ad;
  font-style: normal;
}

.score-card p {
  color: #9ba5bf;
  font-size: 11px;
  margin: 0;
}

.text-button {
  background: none;
  border: 0;
  color: #b7bfd2;
  text-align: left;
  padding: 20px 0 0;
  cursor: pointer;
}

.lesson-main {
  grid-column: 2;
  padding: 55px clamp(30px, 7vw, 100px) 100px;
  max-width: 1050px;
  width: 100%;
}

.lesson-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 35px;
}

.lesson-top h1 {
  font: 800 clamp(34px, 5vw, 55px)/1.06 "Manrope";
  letter-spacing: -.04em;
  margin: 11px 0 0;
}

.level-badge {
  padding: 8px 12px;
  border-radius: 30px;
  background: #eeeafd;
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mastery-label {
  margin-top: 28px;
  margin-bottom: 10px;
}

.mastery-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mastery-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  font-size: 11px;
  color: #c8cee0;
}

.mastery-item b {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mastery-item span {
  color: #8f99b2;
}

.mastery-bar {
  grid-column: 1/3;
  height: 5px;
  background: #ffffff13;
  border-radius: 5px;
  overflow: hidden;
}

.mastery-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: #7ed2aa;
  transition: width .4s;
}

.mastery-item.weak .mastery-bar i {
  background: var(--coral);
}

.content-card {
  background: white;
  border: 1px solid #ebe8e0;
  border-radius: 20px;
  padding: 30px;
  display: grid;
  grid-template-columns: 55px 1fr;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px #46402d0a;
}

.card-number {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f2efff;
  color: var(--purple);
  display: grid;
  place-items: center;
  font: 800 12px "Manrope";
}

.content-card h2 {
  font: 700 23px/1.35 "Manrope";
  margin: 7px 0 15px;
}

.prose {
  color: #4d5871;
  line-height: 1.75;
  white-space: pre-line;
}

.wide {
  min-width: 0;
}

.example-card ol {
  padding-left: 22px;
  color: #4d5871;
  line-height: 1.7;
}

.example-card li {
  padding: 4px 0 4px 8px;
}

.example-answer {
  background: #f1fbf7;
  color: #237a5a;
  padding: 13px 15px;
  border-radius: 10px;
  font-weight: 700;
  margin-top: 14px;
}

.teacher-notes-card {
  border-top: 4px solid var(--purple);
}

.start-test-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin: 28px 0;
  padding: 27px 30px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(130deg, var(--ink), #35436b);
  box-shadow: 0 18px 45px #18233f2c;
}

.start-test-card .card-kicker {
  color: #aeb8d5;
}

.start-test-card h2 {
  margin: 7px 0 5px;
  font: 700 24px "Manrope";
}

.start-test-card p {
  margin: 0;
  color: #c8cee0;
  font-size: 13px;
}

.start-test-card .primary-button {
  min-width: 160px;
  background: var(--orange);
}

.test-progress {
  position: sticky;
  top: 14px;
  z-index: 7;
  margin-bottom: 22px;
  padding: 15px 18px;
  border: 1px solid #e4e0d8;
  border-radius: 15px;
  background: #fffffff2;
  box-shadow: 0 10px 30px #18233f16;
  backdrop-filter: blur(10px);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.progress-copy span {
  color: var(--muted);
}

.progress-track {
  height: 7px;
  margin: 9px 0 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #ebe8e1;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--purple), #9a8fff);
  transition: width .35s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-steps span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #979ca8;
  background: #f0eee9;
  font-size: 11px;
  font-weight: 700;
}

.progress-steps .current {
  color: white;
  background: var(--purple);
  box-shadow: 0 0 0 4px #7565e820;
}

.progress-steps .correct {
  color: white;
  background: var(--green);
}

.progress-steps .wrong {
  color: white;
  background: #d95e47;
}

.teacher-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.teacher-notes-grid section {
  border-radius: 13px;
  padding: 16px;
}

.teacher-notes-grid h3 {
  font: 700 14px "Manrope";
  margin: 0 0 10px;
}

.teacher-notes-grid ul {
  margin: 0;
  padding-left: 19px;
  color: #4d5871;
  font-size: 13px;
  line-height: 1.6;
}

.tips-box {
  background: #f4f1ff;
}

.tips-box h3 {
  color: #594bb5;
}

.exceptions-box {
  background: #fff4ec;
}

.exceptions-box h3 {
  color: #a65332;
}

.question-card {
  border-top: 4px solid var(--orange);
  transition: border-color .25s, box-shadow .25s;
}

.question-card.result-correct {
  border-color: var(--green);
  box-shadow: 0 10px 35px #2d9b7320;
}

.question-card.result-wrong {
  border-color: #d95e47;
  box-shadow: 0 10px 35px #d95e4720;
}

.answer-control {
  margin: 17px 0 12px;
}

.answer-control>p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.answer-option {
  position: relative;
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}

.answer-option input {
  position: absolute;
  opacity: 0;
}

.answer-option span {
  display: block;
  padding: 13px 14px 13px 44px;
  border: 1px solid #dedad1;
  border-radius: 11px;
  color: #3f4a64;
  background: #fdfcf9;
}

.answer-option span:before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #bbb6ad;
  border-radius: 50%;
  transform: translateY(-50%);
}

.answer-option input[type="checkbox"]+span:before {
  border-radius: 4px;
}

.answer-option input:checked+span {
  border-color: var(--purple);
  color: #5144a7;
  background: #f4f1ff;
}

.answer-option input:checked+span:before {
  border: 5px solid var(--purple);
  background: white;
}

.answer-control select,
.answer-control textarea {
  width: 100%;
  border: 1px solid #dcd8cf;
  border-radius: 12px;
  padding: 14px;
  color: var(--ink);
  background: white;
  font: 15px "DM Sans";
  outline: none;
}

.answer-control textarea {
  resize: vertical;
}

.response-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  border: 0;
}

.response-confidence legend {
  margin-bottom: 8px;
  color: #566078;
  font-size: 13px;
  font-weight: 800;
}

.response-confidence label { cursor: pointer; }
.response-confidence input { position: absolute; opacity: 0; pointer-events: none; }
.response-confidence span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid #dedfe7;
  border-radius: 999px;
  background: #fff;
  color: #566078;
  font-size: 13px;
  font-weight: 800;
  transition: border-color .16s, background .16s, color .16s;
}

.response-confidence input:checked + span {
  border-color: rgba(117, 101, 232, .45);
  background: #f0effc;
  color: #5146ba;
}

.response-confidence input:focus-visible + span {
  outline: 3px solid rgba(117, 101, 232, .2);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .response-confidence { flex-wrap: wrap; }
  .response-confidence legend { width: 100%; }
}

.symbol-keyboard {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid #e3dfd7;
  border-radius: 12px;
  background: #f8f6f1;
}

.symbol-keyboard small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.symbol-keyboard>div {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.symbol-keyboard button {
  flex: 0 0 42px;
  min-height: 40px;
  border: 1px solid #d9d4ca;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font: 700 17px "DM Sans";
  cursor: pointer;
}

.symbol-keyboard button:hover,
.symbol-keyboard button:focus-visible {
  border-color: var(--purple);
  color: var(--purple);
  outline: none;
}

.feedback-steps {
  margin-top: 10px;
  white-space: pre-wrap;
  line-height: 1.7;
}

.ordering-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ordering-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dcd8cf;
  border-radius: 11px;
  background: white;
  cursor: grab;
}

.ordering-item.dragging {
  opacity: .45;
  border-color: var(--purple);
}

.drag-handle {
  color: #a7a2b3;
  font-size: 18px;
}

.ordering-item b {
  font-size: 13px;
  font-weight: 600;
}

.order-buttons {
  display: flex;
  gap: 4px;
}

.order-buttons button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: var(--purple);
  background: #f1eeff;
  cursor: pointer;
}

.feedback-note {
  margin-top: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #ffffff99;
}

.feedback-note.exception {
  border-left: 3px solid var(--orange);
}

.test-summary {
  padding: 5px 0 40px;
}

.summary-hero {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 27px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(135deg, var(--ink), #34446f);
}

.summary-hero>span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: white;
  background: var(--green);
  font-size: 25px;
}

.summary-hero h2 {
  margin: 5px 0;
  font: 700 25px "Manrope";
}

.summary-hero p {
  margin: 0;
  color: #c5ccdf;
  font-size: 13px;
}

.summary-hero>strong {
  font: 800 43px "Manrope";
}

.summary-hero>strong small {
  color: #aeb7cf;
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 15px;
  margin: 16px 0;
}

.summary-card {
  padding: 22px;
  border: 1px solid #e7e3da;
  border-radius: 16px;
  background: white;
}

.summary-card h3 {
  margin: 0 0 15px;
  font: 700 15px "Manrope";
}

.summary-card h3:not(:first-child) {
  margin-top: 21px;
}

.summary-card ul {
  padding-left: 20px;
  color: #4d5871;
  font-size: 13px;
  line-height: 1.6;
}

.chart-row {
  margin-bottom: 15px;
}

.chart-row>div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.chart-track {
  height: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: #ece9e2;
}

.chart-track i {
  display: block;
  height: 100%;
  border-radius: 10px;
}

.chart-track .strong {
  background: var(--green);
}

.chart-track .developing {
  background: #e4a33c;
}

.chart-track .weak {
  background: #d95e47;
}

.question-meta {
  display: flex;
  justify-content: space-between;
}

.question-meta>span:last-child {
  color: #9b7b6c;
  font-size: 12px;
  background: #fff1e9;
  padding: 6px 10px;
  border-radius: 20px;
}

.hint-button {
  border: 0;
  background: none;
  color: var(--purple);
  font-weight: 700;
  padding: 2px 0 13px;
  cursor: pointer;
}

.hint {
  background: #f5f2ff;
  padding: 12px 14px;
  border-radius: 10px;
  color: #5548aa;
}

.question-card textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #dcd8cf;
  border-radius: 12px;
  padding: 14px;
  font: 15px "DM Sans";
  outline: none;
  margin: 5px 0 10px;
}

.question-card textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px #7565e815;
}

.question-card .primary-button {
  width: 100%;
}

.feedback {
  margin-top: 16px;
  border-radius: 12px;
  padding: 17px;
  line-height: 1.55;
}

.feedback.correct {
  background: #edfaf5;
  color: #216e53;
}

.feedback.incorrect {
  background: #fff1ec;
  color: #9a492c;
}

.feedback strong {
  display: block;
  font: 700 17px "Manrope";
  margin-bottom: 5px;
}

.next-button {
  margin-top: 12px;
  border: 0;
  background: white;
  border-radius: 9px;
  padding: 9px 12px;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}

.loading {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.loading span {
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid #e3dff4;
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #b64832;
  color: white;
  padding: 14px 18px;
  border-radius: 11px;
  z-index: 20;
  box-shadow: 0 8px 30px #0003;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: #11182b55;
  backdrop-filter: blur(3px);
  z-index: 29;
}

.settings-panel {
  position: fixed;
  left: 18px;
  top: 18px;
  width: min(360px, calc(100vw - 36px));
  background: white;
  border-radius: 20px;
  padding: 23px;
  box-shadow: 0 24px 80px #151b3055;
  z-index: 30;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.settings-head small {
  color: var(--orange);
  font-weight: 800;
  letter-spacing: .15em;
  font-size: 9px;
}

.settings-head h2 {
  margin: 4px 0 0;
  font: 800 25px "Manrope";
}

.settings-head button {
  border: 0;
  background: #f2f0ea;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
}

.setting-group {
  padding-top: 20px;
}

.setting-group label {
  display: block;
  font: 700 14px "Manrope";
}

.setting-group p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 5px 0 12px;
}

.setting-group select {
  width: 100%;
  border: 1px solid #d8d3c9;
  border-radius: 11px;
  padding: 12px;
  background: white;
  font: 600 14px "DM Sans";
  color: var(--ink);
  outline: none;
}

.chat-toggle {
  position: fixed;
  right: 25px;
  bottom: 24px;
  border: 0;
  background: var(--purple);
  color: white;
  border-radius: 30px;
  padding: 13px 18px;
  font: 700 14px "DM Sans";
  box-shadow: 0 12px 35px #5d51bd55;
  cursor: pointer;
  z-index: 8;
}

.chat-toggle span {
  margin-right: 7px;
}

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(380px, calc(100vw - 30px));
  height: min(610px, calc(100vh - 48px));
  background: white;
  border: 1px solid #e3dfd6;
  border-radius: 20px;
  box-shadow: 0 20px 70px #1b234044;
  z-index: 12;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 17px 18px;
  border-bottom: 1px solid #ece9e2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header>div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-header strong,
.chat-header small {
  display: block;
}

.chat-header strong {
  font: 700 14px "Manrope";
}

.chat-header small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.chat-header>button {
  border: 0;
  background: none;
  font-size: 25px;
  color: #8e94a3;
  cursor: pointer;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #eeeaff;
  color: var(--purple);
  border-radius: 11px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfaf7;
}

.message {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-line;
}

.tutor-message {
  align-self: flex-start;
  background: white;
  border: 1px solid #e9e5dc;
  border-bottom-left-radius: 4px;
}

.student-message {
  align-self: flex-end;
  background: var(--ink);
  color: white;
  border-bottom-right-radius: 4px;
}

.typing-message {
  color: #8a90a0;
  font-style: italic;
}

.chat-suggestions {
  padding: 10px 13px 3px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.chat-suggestions button {
  border: 1px solid #ded9ef;
  background: #f8f6ff;
  color: #5d50ae;
  border-radius: 20px;
  padding: 7px 10px;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.chat-form {
  padding: 10px 12px 13px;
  display: grid;
  grid-template-columns: 1fr 39px;
  gap: 7px;
}

.chat-form textarea {
  resize: none;
  border: 1px solid #ddd9d0;
  border-radius: 11px;
  padding: 10px 11px;
  font: 13px "DM Sans";
  outline: none;
}

.chat-form textarea:focus {
  border-color: var(--purple);
}

.chat-form button {
  border: 0;
  border-radius: 11px;
  background: var(--purple);
  color: white;
  cursor: pointer;
  font-size: 15px;
}

@media(max-width:760px) {
  .nav {
    height: 70px
  }

  .hero {
    margin-top: 35px
  }

  .steps {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 35px auto 0
  }

  .subject-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .study-card {
    padding: 16px;
  }

  .lesson {
    display: block
  }

  .lesson-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 18px 22px
  }

  .sidebar-brand {
    margin: 0
  }

  .side-label,
  .lesson-sidebar h2,
  .concept-list,
  .mastery-list,
  .score-card {
    display: none
  }

  .text-button {
    position: absolute;
    right: 22px;
    top: 18px;
    padding: 8px
  }

  .lesson-main {
    padding: 35px 18px 90px
  }

  .content-card {
    grid-template-columns: 1fr;
    padding: 22px
  }

  .teacher-notes-grid {
    grid-template-columns: 1fr;
  }

  .start-test-card {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-hero {
    grid-template-columns: 45px 1fr;
  }

  .summary-hero>span {
    width: 45px;
    height: 45px;
  }

  .summary-hero>strong {
    grid-column: 1 / 3;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .card-number {
    display: none
  }

  .lesson-top {
    display: block
  }

  .level-badge {
    display: inline-block;
    margin-top: 13px
  }

  .hero h1 {
    font-size: 45px
  }

  .chat-toggle {
    right: 15px;
    bottom: 15px
  }

  .chat-panel {
    right: 15px;
    bottom: 15px;
    height: calc(100vh - 30px)
  }
}

/* Voice controls are progressive enhancements and must keep their compact
   control styling inside form-specific button systems. */
.recall-card .speech-input-control button,
.recall-card .listen-control button,
.chat-form .speech-input-control button,
.exam-question .speech-input-control button,
.exam-question .listen-control button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #d8d4e5;
  border-radius: 9px;
  color: #423b70;
  background: #f8f6ff;
  font: 700 12px/1 "DM Sans", sans-serif;
}

.chat-form {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto 39px;
}

.chat-form .speech-input-control {
  flex-wrap: nowrap;
  margin: 0;
}

.chat-form .speech-input-control button {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.chat-form .speech-input-control button span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chat-form .speech-status {
  position: absolute;
  right: 12px;
  bottom: 100%;
  max-width: 280px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,.96);
}

@media (max-width: 520px) {
  .listen-control { align-items: flex-start; }
  .listen-control label { flex-basis: 100%; }
  .speech-input-control button span:last-child,
  .listen-control button span:last-child { display: none; }
}

.nav-note {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-note a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.nav-note form {
  margin: 0;
}

.nav-logout {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.account-page,
.dashboard-page {
  min-height: 100vh;
  background: #f7f5ef;
  color: #20231f;
}

.account-shell {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.account-card,
.dashboard-card {
  background: #fff;
  border: 1px solid #deddd5;
  border-radius: 24px;
  box-shadow: 0 14px 45px rgba(32, 35, 31, .07);
}

.account-card {
  margin-top: 36px;
  padding: 36px;
}

.account-card h1,
.dashboard-heading h1 {
  margin: 8px 0;
  font-family: Manrope, sans-serif;
}

.account-card form {
  display: grid;
  gap: 18px;
  margin: 28px 0 18px;
}

.account-card label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.account-card input {
  border: 1px solid #c9c9c1;
  border-radius: 12px;
  font: inherit;
  padding: 13px;
}

.account-card .remember {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  font-weight: 500;
}

.form-alert {
  margin: 18px 0;
  padding: 12px 15px;
  border-radius: 10px;
  background: #fff0e8;
  color: #8b321d;
}

.dashboard-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 120px 0 60px;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 30px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.dashboard-card {
  padding: 26px;
}

.dashboard-card h2 {
  margin-top: 0;
}

.mistakes-card {
  grid-column: 1/-1;
}

.sessions-card {
  grid-column: 1/-1;
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 18px;
}

.language-switch a {
  border: 1px solid #d7d6ce;
  border-radius: 999px;
  color: #55584f;
  padding: 8px 13px;
  text-decoration: none;
}

.language-switch a.active {
  background: #20231f;
  border-color: #20231f;
  color: #fff;
}

.mobile-nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--navy, #17233f);
  font-size: 1.5rem;
  cursor: pointer;
}

.settings-shell {
  min-height: calc(100vh - 90px);
}

.settings-shell select {
  width: 100%;
  margin: .5rem 0 1.25rem;
  padding: .85rem 1rem;
  border: 1px solid #d8dbea;
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

@media (max-width: 860px) {
  .global-nav { position: relative; }
  .mobile-nav-toggle { display: inline-flex; margin-left: auto; }
  .global-nav-links {
    display: none;
    position: absolute;
    z-index: 100;
    top: calc(100% - .35rem);
    left: 1rem;
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    padding: .75rem;
    border: 1px solid #e6e2da;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(20, 30, 55, .14);
  }
  .global-nav-links.open { display: flex; }
  .global-nav-links a, .global-nav-links form, .global-nav-links button { width: 100%; }
}

.lesson-history-list {
  display: grid;
  gap: 2px;
}

.saved-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #ecebe5;
}

.saved-lesson>div:first-child {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.saved-lesson span,
.saved-lesson small {
  color: #777970;
}

.saved-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.saved-actions form {
  margin: 0;
}

.saved-actions a,
.saved-actions button {
  border: 0;
  background: transparent;
  color: #365a49;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.history-shell .dashboard-card {
  min-width: 0;
}

.history-message {
  border-radius: 15px;
  margin: 12px 0;
  padding: 14px 16px;
}

.history-message.student {
  background: #edf5ef;
  margin-left: 40px;
}

.history-message.tutor {
  background: #f3f1eb;
  margin-right: 40px;
}

.history-message p {
  line-height: 1.55;
  margin: 7px 0;
  white-space: pre-wrap;
}

.history-message small {
  color: #777970;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #ecebe5;
}

.metric-row span,
.mistake div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-row small,
.mistake small,
.mistake span {
  color: #777970;
}

.mistake {
  padding: 18px 0;
  border-bottom: 1px solid #ecebe5;
}

.mistake p {
  margin: 10px 0;
}

.mistake small {
  display: block;
  margin-top: 5px;
}

.notebook-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notebook-heading h2 {
  margin: 4px 0 0;
}

.notebook-heading>span {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f1eeff;
  color: #594bb5;
  font-weight: 800;
}

.notebook-filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px;
  margin: 22px 0 6px;
  padding: 16px;
  border-radius: 15px;
  background: #f7f5ef;
}

.notebook-filters label {
  display: grid;
  gap: 7px;
  color: #5f625b;
  font-size: 12px;
  font-weight: 700;
}

.notebook-filters select {
  min-width: 0;
  border: 1px solid #d7d6ce;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #20231f;
  font: inherit;
}

.notebook-filters button,
.mistake-actions button {
  border: 1px solid #d7d6ce;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  color: #365a49;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.mistake-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.mistake-list .mistake {
  padding: 20px;
  border: 1px solid #e4e2da;
  border-radius: 17px;
  background: #fdfcf9;
}

.mistake-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mistake-head>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-badge {
  flex: none;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
}

.status-needs_practice {
  background: #fff0ea;
  color: #a2482d !important;
}

.status-developing {
  background: #fff6dc;
  color: #866014 !important;
}

.status-weak {
  background: #fff0ea;
  color: #a2482d !important;
}

.status-learning {
  background: #fff6dc;
  color: #866014 !important;
}

.status-strong {
  background: #e9f7f1;
  color: #287356 !important;
}

.status-mastered {
  background: #e9f7f1;
  color: #287356 !important;
}

.status-understood {
  background: #eeecfb;
  color: #594bb5 !important;
}

.mistake-details {
  display: flex;
  gap: 24px;
  margin: 16px 0;
}

.mistake-details div {
  display: block;
}

.mistake-details dt {
  color: #777970;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mistake-details dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.mistake-copy {
  display: block !important;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  line-height: 1.55;
}

.mistake-copy p {
  color: #5f625b;
}

.mistake-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 9px !important;
  margin-top: 15px;
}

.mistake-actions form {
  margin: 0;
}

.mistake-actions .notebook-primary {
  border-color: #365a49;
  background: #365a49;
  color: #fff;
}

.learning-overview {
  display: grid;
  grid-template-columns: 140px 1fr 1.2fr auto;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 22px;
}

.learning-overview>div,
.continue-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78px;
  padding: 15px 18px;
  border: 1px solid #deddd5;
  border-radius: 16px;
  background: #fff;
  text-decoration: none;
}

.learning-overview span {
  color: #777970;
  font-size: 11px;
  font-weight: 700;
}

.learning-overview strong {
  margin-top: 5px;
  color: #20231f;
  font: 800 22px Manrope, sans-serif;
}

.continue-button {
  align-items: center;
  border-color: #365a49;
  background: #365a49;
  color: #fff;
  font-weight: 800;
}

.trend-bars {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 36px;
  margin-top: 6px;
}

.trend-bars i {
  flex: 1;
  min-width: 4px;
  max-width: 15px;
  border-radius: 4px 4px 2px 2px;
  background: #7565e8;
}

.today-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 6px 0 26px;
}

.today-heading h1 {
  margin: 0;
  font: 800 38px Manrope, sans-serif;
}

.today-heading p {
  max-width: 700px;
  margin: 8px 0 0;
  color: #666b63;
  line-height: 1.55;
}

.today-estimate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.today-estimate div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid #deddd5;
  border-radius: 17px;
  background: #fff;
}

.today-estimate strong {
  font: 800 28px Manrope, sans-serif;
}

.today-estimate span {
  color: #777970;
  font-size: 12px;
}

.recent-failures {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recent-failures>span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f5ef;
}

.recent-failures small {
  color: #777970;
}

@media(max-width:760px) {
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mistakes-card,
  .sessions-card {
    grid-column: auto;
  }

  .saved-lesson {
    align-items: flex-start;
    flex-direction: column;
  }

  .saved-actions {
    flex-wrap: wrap;
  }
}

@media(max-width:760px) {
  .dashboard-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 96px;
  }

  .dashboard-card {
    padding: 18px;
    border-radius: 18px;
  }

  .notebook-filters {
    grid-template-columns: 1fr;
  }

  .notebook-filters button,
  .mistake-actions form,
  .mistake-actions button {
    width: 100%;
  }

  .mistake-list .mistake {
    padding: 16px;
  }

  .mistake-head {
    align-items: flex-start;
    flex-direction: column !important;
  }

  .mistake-details {
    justify-content: space-between;
    gap: 12px;
  }

  .learning-overview {
    grid-template-columns: 1fr 1fr;
  }

  .trend-overview,
  .continue-button {
    grid-column: 1/-1;
  }

  .today-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .today-heading form,
  .today-heading button {
    width: 100%;
  }

  .today-estimate {
    grid-template-columns: 1fr;
  }
}

@media(max-width:760px) {
  .settings-button {
    left: 210px;
    top: 18px
  }

  .settings-button span {
    display: none
  }
}

/* Uploaded-material study projects and source-grounded exam mode */
.project-page { min-height: 100vh; background: #f7f5ef; color: var(--ink); }
.dashboard-projects { margin-bottom: 18px; padding: 22px; border: 1px solid #dedbd3; border-radius: 18px; background: #fff; }
.dashboard-projects .notebook-heading { margin-bottom: 14px; }
.dashboard-project-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.dashboard-project-list a { display: grid; gap: 4px; padding: 13px; border-radius: 11px; color: inherit; background: #f7f5ef; text-decoration: none; }
.dashboard-project-list span { color: var(--orange); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.dashboard-project-list small { color: #777d88; }
.project-shell, .learning-shell, .exam-setup-shell, .exam-results-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 112px 0 70px; }
.project-hero { display: grid; grid-template-columns: 1fr minmax(380px, .82fr); gap: 60px; align-items: center; min-height: 560px; }
.project-hero h1, .project-title-row h1, .learning-heading h1, .exam-setup-heading h1 { margin: 10px 0 14px; font: 800 clamp(38px, 5vw, 66px)/1.05 Manrope, sans-serif; letter-spacing: -.045em; }
.project-hero>div>p, .project-title-row p, .learning-heading p, .exam-setup-heading p { color: #646b78; line-height: 1.7; max-width: 690px; }
.project-create-card, .material-card, .sections-card, .exam-config-card { padding: 28px; border: 1px solid #e4e0d8; border-radius: 22px; background: #fff; box-shadow: 0 15px 45px #18233f0e; }
.project-create-card h2, .section-heading h2, .preparation-card h2, .exam-config-card h2 { margin: 3px 0 20px; font: 750 24px Manrope, sans-serif; }
.project-create-card label, .exam-config-card label { display: grid; gap: 7px; margin-bottom: 15px; color: #424b60; font-size: 13px; font-weight: 700; }
.project-create-card input, .exam-config-card input, #mergeForm input, .section-edit input { min-width: 0; border: 1px solid #d9d5cc; border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fff; font: inherit; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.project-drop { padding: 20px; border: 1px dashed #a89ce9; border-radius: 14px; background: #f8f6ff; text-align: center; cursor: pointer; }
.project-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.project-drop span { color: var(--purple); font-weight: 800; }
.project-drop small, .project-create-card .privacy { color: #7d8290; font-weight: 500; }
.project-create-card .primary-button { width: 100%; }
.section-heading, .project-title-row, .learning-heading, .exam-start-bar, .section-test-callout, .result-actions { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.project-list-section { padding: 35px 0; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-tile { padding: 23px; border: 1px solid #e1ded6; border-radius: 18px; color: inherit; background: #fff; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.project-tile:hover { transform: translateY(-3px); box-shadow: 0 15px 30px #18233f12; }
.project-tile h3 { margin: 10px 0 6px; font: 750 20px Manrope, sans-serif; }
.project-tile p, .section-help { color: #727780; font-size: 13px; line-height: 1.55; }
.project-tile>div { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.project-subject { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.empty-project { padding: 45px; border: 1px dashed #d4d0c7; border-radius: 18px; text-align: center; color: #737982; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border: 1px solid #cbc6bc; border-radius: 11px; color: var(--ink); background: #fff; font-weight: 800; text-decoration: none; cursor: pointer; }
.project-title-row { align-items: flex-end; margin-bottom: 26px; }
.project-main-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.readiness-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.readiness-grid article { display: flex; flex-direction: column; gap: 7px; padding: 20px; border: 1px solid #e2dfd7; border-radius: 16px; background: #fff; }
.readiness-grid span, .readiness-grid small { color: #777d88; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.readiness-grid strong { font: 800 28px Manrope, sans-serif; }
.readiness-score strong { color: var(--purple); }
.readiness-track { height: 7px; overflow: hidden; border-radius: 10px; background: #ebe8e1; }
.readiness-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), #49b889); }
.preparation-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 18px 0; padding: 22px 26px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #18233f, #34456c); }
.preparation-card .eyebrow { color: #aeb8d5; }
.preparation-card h2 { margin-bottom: 0; }
.preparation-card p { max-width: 630px; color: #d4d9e6; line-height: 1.6; }
.material-card, .sections-card { margin-top: 18px; }
.source-page-list, .learning-section-list { display: grid; gap: 9px; margin-top: 18px; }
.source-page { display: grid; grid-template-columns: 25px 1fr auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid #e4e0d7; border-radius: 13px; background: #fcfbf8; }
.source-page.dragging, .learning-section-row.dragging { opacity: .45; }
.drag-grip { color: #aaa5b1; cursor: grab; font-size: 20px; }
.source-page div { display: grid; gap: 3px; }
.source-page small { color: #777d88; }
.source-page p { margin: 7px 0 0; color: #5c6474; font-size: 12px; line-height: 1.5; white-space: pre-line; }
.source-page em { color: #a34f36; font-size: 12px; }
.source-page button, .section-edit button, .section-row-actions button, #mergeForm button { border: 0; color: var(--purple); background: transparent; font-weight: 800; cursor: pointer; }
.save-status { min-height: 18px; color: #657267; font-size: 12px; }
#mergeForm { display: flex; gap: 8px; }
.learning-section-row { display: grid; grid-template-columns: 24px 20px 46px 1fr auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid #e2ded6; border-radius: 14px; background: #fff; }
.section-excluded { opacity: .55; background: #f3f1ec; }
.section-position { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: var(--purple); background: #f0edff; font-weight: 800; text-decoration: none; }
.section-edit { display: flex; gap: 8px; align-items: center; }
.section-edit>input { flex: 1; padding: 7px 9px; font-weight: 800; }
.section-edit label { display: flex; gap: 4px; align-items: center; color: #757a85; font-size: 11px; }
.section-edit label input { min-width: auto; }
.section-copy p { margin: 5px 0; color: #6b7280; font-size: 12px; }
.section-meta { display: flex; flex-wrap: wrap; gap: 7px; color: #747a85; font-size: 11px; }
.section-meta>span { padding-right: 7px; border-right: 1px solid #dedad2; }
.section-row-actions { display: flex; gap: 9px; align-items: center; }
.section-row-actions a { color: var(--purple); font-weight: 800; text-decoration: none; }
.exam-history { display: grid; gap: 8px; }
.exam-history a { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 13px; border-radius: 11px; color: inherit; background: #f7f5ef; text-decoration: none; }

.learning-shell { max-width: 1120px; }
.learning-breadcrumb { display: flex; gap: 8px; margin-bottom: 22px; color: #777d88; font-size: 13px; }
.learning-breadcrumb a { color: var(--purple); text-decoration: none; }
.learning-heading { align-items: flex-end; }
.mastery-dial { display: grid; place-items: center; width: 110px; height: 110px; border: 9px solid #e8e4dc; border-top-color: var(--purple); border-radius: 50%; background: #fff; }
.mastery-dial strong { font: 800 25px Manrope; }
.mastery-dial span { color: #777; font-size: 10px; text-transform: uppercase; }
.explanation-levels { display: flex; gap: 6px; align-items: center; margin: 25px 0; padding: 8px; border: 1px solid #e2dfd7; border-radius: 13px; background: #fff; }
.explanation-levels>span { margin: 0 8px; color: #777d88; font-size: 12px; }
.explanation-levels a { padding: 8px 13px; border-radius: 8px; color: #596173; font-size: 12px; font-weight: 800; text-decoration: none; }
.explanation-levels a.active { color: #fff; background: var(--purple); }
.learning-content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.learning-main-column { display: grid; gap: 15px; }
.learning-block { display: grid; grid-template-columns: 48px 1fr; gap: 15px; padding: 26px; border: 1px solid #e3dfd7; border-radius: 18px; background: #fff; }
.learning-block h2 { margin: 6px 0 16px; font: 750 23px Manrope; }
.block-number { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--purple); background: #f0edff; font-weight: 800; }
.structured-prose { white-space: pre-wrap; line-height: 1.85; overflow-wrap: anywhere; }
.study-list { display: grid; gap: 10px; margin: 0; padding-left: 20px; line-height: 1.65; }
.formula-block { border-top: 4px solid var(--orange); }
.formula-list { display: grid; gap: 9px; }
.formula-list div { padding: 13px 15px; border-radius: 10px; color: #27334f; background: #f5f2eb; font: 650 16px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.learning-side-column { display: grid; gap: 12px; position: sticky; top: 90px; }
.side-study-card { padding: 19px; border: 1px solid #e1ded6; border-radius: 15px; background: #fff; }
.side-study-card h3 { margin: 0 0 11px; font: 750 16px Manrope; }
.side-study-card ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; color: #5f6674; font-size: 13px; line-height: 1.5; }
.source-note { color: #57616d; background: #edf8f3; }
.recall-section { margin-top: 38px; }
.recall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.recall-card { padding: 20px; border: 1px solid #e1ddd5; border-radius: 16px; background: #fff; }
.recall-card>span { color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.recall-card h3 { min-height: 48px; font: 700 16px/1.45 Manrope; }
.recall-card input { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #d9d5cc; border-radius: 9px; }
.recall-card button { margin-top: 9px; padding: 10px 13px; border: 0; border-radius: 8px; color: #fff; background: var(--ink); font-weight: 800; cursor: pointer; }
.recall-result { margin-top: 10px; white-space: pre-wrap; line-height: 1.55; font-size: 12px; }
.recall-result.correct { color: #237a5a; }.recall-result.incorrect { color: #a34f36; }
.section-test-callout { margin-top: 35px; padding: 28px; border-radius: 20px; color: #fff; background: linear-gradient(125deg, #18233f, #35436b); }
.section-test-callout h2 { margin: 6px 0; font: 750 27px Manrope; }.section-test-callout p { color: #cbd2e0; }

.exam-setup-shell { max-width: 900px; }.exam-setup-heading { text-align: center; }.exam-setup-heading p { margin-inline: auto; }
.readiness-warning { display: flex; gap: 9px; flex-direction: column; margin: 25px 0; padding: 17px 20px; border-left: 4px solid var(--orange); border-radius: 10px; background: #fff2e9; }
.exam-setup-form { display: grid; gap: 16px; }.exam-config-card fieldset { border: 0; padding: 0; }.exam-config-card legend { margin-bottom: 10px; font-weight: 800; }
.choice-pills { display: flex; flex-wrap: wrap; gap: 8px; }.choice-pills label { margin: 0; }.choice-pills input { position: absolute; opacity: 0; }.choice-pills span { display: block; padding: 10px 13px; border: 1px solid #d9d5cc; border-radius: 10px; cursor: pointer; }.choice-pills input:checked+span { border-color: var(--purple); color: var(--purple); background: #f1eeff; }
.exam-check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.exam-check-list label { grid-template-columns: auto 1fr; align-items: center; margin: 0; padding: 12px; border: 1px solid #e0ddd5; border-radius: 10px; }.exam-check-list input { min-width: auto; }.exam-check-list span { display: grid; gap: 3px; }.exam-check-list small { color: #777d88; font-weight: 500; }
.exam-start-bar { position: sticky; bottom: 15px; z-index: 5; padding: 18px 20px; border-radius: 16px; color: #fff; background: #18233ff2; box-shadow: 0 12px 35px #18233f38; }.exam-start-bar div { display: grid; gap: 3px; }.exam-start-bar span { color: #c8cee0; font-size: 12px; }

.exam-page { margin: 0; color: var(--ink); background: #f4f3ef; }.exam-header { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; min-height: 68px; padding: 0 28px; border-bottom: 1px solid #dedbd3; background: #fff; }.exam-header>div { display: flex; align-items: center; gap: 10px; }.exam-header span { display: grid; }.exam-header small { color: #777d88; }.exam-clock { display: grid !important; place-items: center; gap: 1px !important; }.exam-clock span { color: #777; font-size: 10px; text-transform: uppercase; }.exam-clock strong { font: 800 23px ui-monospace, monospace; }.autosave-status { color: #5e7467; font-size: 12px; }
.exam-shell { display: grid; grid-template-columns: 210px minmax(0, 760px); gap: 30px; justify-content: center; width: min(1080px, calc(100% - 30px)); margin: 0 auto; padding: 30px 0 70px; }.exam-sidebar { position: sticky; top: 95px; align-self: start; }.exam-sidebar nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 20px; }.exam-sidebar nav a { display: grid; place-items: center; padding: 8px 3px; border: 1px solid #dcd9d1; border-radius: 8px; color: inherit; background: #fff; text-decoration: none; }.exam-sidebar nav span { color: #777; font-size: 8px; text-transform: uppercase; }.exam-rules { padding: 15px; border-radius: 12px; color: #d4d9e6; background: #18233f; }.exam-rules p { margin-bottom: 0; font-size: 11px; line-height: 1.5; }
.exam-question-list { display: grid; gap: 15px; }.exam-intro { display: flex; gap: 9px; }.exam-intro span { padding: 7px 10px; border-radius: 8px; color: #667080; background: #fff; font-size: 11px; }.exam-question { padding: 28px; border: 1px solid #dedbd3; border-radius: 18px; background: #fff; scroll-margin-top: 85px; }.exam-question-meta { display: flex; justify-content: space-between; gap: 10px; color: #777d88; font-size: 11px; text-transform: uppercase; }.exam-question h2 { margin: 16px 0 20px; font: 700 21px/1.45 Manrope; }.exam-options { display: grid; gap: 8px; }.exam-options label { position: relative; }.exam-options input { position: absolute; opacity: 0; }.exam-options span { display: block; padding: 13px 14px; border: 1px solid #ddd9d0; border-radius: 10px; cursor: pointer; }.exam-options input:checked+span { border-color: var(--purple); color: var(--purple); background: #f1eeff; }.exam-written-answer { width: 100%; box-sizing: border-box; padding: 14px; border: 1px solid #d8d4ca; border-radius: 11px; font: 15px/1.6 DM Sans; resize: vertical; }.exam-symbols { display: flex; gap: 5px; overflow-x: auto; margin-top: 8px; padding-bottom: 3px; }.exam-symbols button { flex: 0 0 38px; min-height: 36px; border: 1px solid #d9d5cc; border-radius: 8px; background: #f8f6f1; font-weight: 800; cursor: pointer; }.question-save-state { min-height: 16px; margin: 8px 0 0; color: #637269; font-size: 11px; }.exam-submit-card { display: flex; justify-content: space-between; gap: 25px; align-items: center; padding: 25px; border-radius: 18px; color: #fff; background: #18233f; }.exam-submit-card h2 { margin: 0; }.exam-submit-card p { color: #c8cee0; font-size: 12px; }

.exam-results-shell { max-width: 1000px; }.result-hero { display: flex; justify-content: space-between; align-items: end; padding: 30px; border-radius: 22px; color: #fff; background: linear-gradient(125deg, #18233f, #34466f); }.result-hero h1 { margin: 8px 0; font: 800 35px Manrope; }.result-hero p { color: #cbd2e0; }.result-hero>strong { font: 800 70px Manrope; }.result-hero>strong small { font-size: 20px; }.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }.result-metrics article { display: grid; gap: 5px; padding: 16px; border: 1px solid #e1ddd5; border-radius: 13px; background: #fff; }.result-metrics span { color: #777d88; font-size: 11px; text-transform: uppercase; }.result-metrics strong { font: 800 26px Manrope; }.result-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.result-breakdown article { padding: 20px; border: 1px solid #e1ddd5; border-radius: 15px; background: #fff; }.result-breakdown h2 { font: 750 18px Manrope; }.result-bar { display: grid; grid-template-columns: 130px 1fr 45px; gap: 9px; align-items: center; margin-top: 10px; font-size: 12px; }.result-bar>div { height: 7px; overflow: hidden; border-radius: 8px; background: #ebe8e1; }.result-bar i { display: block; height: 100%; border-radius: inherit; background: var(--purple); }.review-heading { margin: 38px 0 15px; }.review-heading h2 { margin: 6px 0; font: 750 26px Manrope; }.review-heading p { color: #727883; }.exam-review-list { display: grid; gap: 12px; }.exam-review { padding: 24px; border: 1px solid #e1ddd5; border-left: 4px solid #d15f49; border-radius: 15px; background: #fff; }.exam-review.review-correct { border-left-color: #3c9c76; }.exam-review h3 { font: 700 18px/1.5 Manrope; }.exam-review dl { display: grid; gap: 12px; }.exam-review dl div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }.exam-review dt { color: #777d88; font-size: 11px; font-weight: 800; text-transform: uppercase; }.exam-review dd { margin: 0; }.exam-review footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px solid #e6e2da; color: #747a85; font-size: 11px; }.result-actions { margin-top: 25px; justify-content: flex-end; }

@media(max-width: 800px) {
  .project-shell, .learning-shell, .exam-setup-shell, .exam-results-shell { width: min(100% - 24px, 1180px); padding-top: 92px; }
  .project-hero, .learning-content-grid, .result-breakdown { grid-template-columns: 1fr; gap: 20px; }
  .dashboard-project-list { grid-template-columns: 1fr; }
  .project-hero { padding: 35px 0; }.project-grid { grid-template-columns: 1fr; }.form-pair, .exam-check-list { grid-template-columns: 1fr; }
  .project-title-row, .learning-heading, .section-test-callout, .preparation-card, .exam-start-bar, .exam-submit-card, .result-hero { align-items: stretch; flex-direction: column; }
  .project-main-actions, .project-main-actions a, .section-test-callout form, .section-test-callout button { width: 100%; }.readiness-grid { grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }.section-heading form { width: 100%; }.section-heading button { width: 100%; }#mergeForm { flex-wrap: wrap; }
  .learning-section-row { grid-template-columns: 20px 20px 42px 1fr; }.section-row-actions { grid-column: 4; }.section-edit { align-items: stretch; flex-direction: column; }.source-page { grid-template-columns: 22px 1fr; }.source-page>form { grid-column: 2; }
  .learning-side-column { position: static; }.recall-grid { grid-template-columns: 1fr; }.exam-shell { grid-template-columns: 1fr; }.exam-sidebar { position: static; }.exam-sidebar nav { grid-template-columns: repeat(8, 1fr); overflow-x: auto; }.exam-header { padding: 0 12px; }.exam-header>div:first-child small, .autosave-status { display: none; }
  .result-metrics { grid-template-columns: 1fr 1fr; }.result-hero>strong { font-size: 54px; }.exam-review dl div { grid-template-columns: 1fr; }.exam-review footer { flex-direction: column; }.result-actions a { flex: 1; }.exam-history a { grid-template-columns: 1fr; }.exam-config-card { padding: 20px; }
}

/* Camera capture and recognition review */
.document-hero { align-items: start; padding-top: 45px; }
.document-flow { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: flow; }
.document-flow li { display: flex; gap: 10px; align-items: center; color: #4d586b; font-weight: 700; }
.document-flow li:before { counter-increment: flow; content: counter(flow); display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: var(--purple); background: #eeeaff; font-size: 11px; }
.document-input-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 13px; padding: 0; border: 0; }
.document-input-options legend { grid-column: 1/-1; margin-bottom: 2px; color: #424b60; font-size: 13px; font-weight: 800; }
.document-input-option { display: flex !important; flex-direction: column; align-items: center; gap: 5px !important; min-height: 105px; box-sizing: border-box; margin: 0 !important; padding: 13px 8px; border: 1px solid #dcd8cf; border-radius: 12px; color: var(--ink); background: #fbfaf7; text-align: center; cursor: pointer; }
button.document-input-option { font: inherit; }
.document-input-option:hover, .document-input-option:focus-within { border-color: var(--purple); background: #f5f2ff; outline: 0; }
.document-input-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.document-input-option small { color: #777d88; font-size: 10px; font-weight: 500; }
.input-icon { display: grid; place-items: center; min-width: 37px; height: 30px; padding: 0 4px; border-radius: 8px; color: var(--purple); background: #ece8ff; font-size: 10px; font-weight: 900; }
.selected-material { min-height: 21px; margin-bottom: 10px; color: #616a78; font-size: 12px; line-height: 1.5; }
.upload-progress { display: flex; gap: 9px; align-items: center; margin-top: 11px; color: #576474; font-size: 12px; }
.upload-progress i { width: 16px; height: 16px; border: 2px solid #d8d2fb; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }

.scanner-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: #0d1323e8; }
.scanner-panel { width: min(980px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 22px; background: #f7f5ef; box-shadow: 0 30px 100px #0008; }
.scanner-panel>header { position: sticky; top: 0; z-index: 4; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px 22px; border-bottom: 1px solid #e1ddd5; background: #fff; }
.scanner-panel>header h2 { margin: 3px 0 0; font: 750 22px Manrope; }
.scanner-panel>header button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eeeae2; font-size: 24px; cursor: pointer; }
.scanner-live, .capture-review { padding: 20px; }
.camera-stage { position: relative; max-width: 680px; margin: 0 auto; overflow: hidden; border-radius: 16px; background: #090d16; aspect-ratio: 4/3; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; }
.document-frame { position: absolute; inset: 7% 12%; display: grid; place-items: end center; border: 3px solid #fff; border-radius: 8px; box-shadow: 0 0 0 2000px #0005; pointer-events: none; }
.document-frame:before, .document-frame:after { content: ""; position: absolute; inset: -4px; border: 4px solid transparent; border-top-color: var(--orange); border-bottom-color: var(--orange); border-radius: 10px; }
.document-frame span { margin-bottom: 12px; padding: 6px 9px; border-radius: 7px; color: #fff; background: #111a2dbf; font-size: 11px; }
.capture-guidance { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin: 13px 0; }
.capture-guidance span { padding: 7px 9px; border-radius: 20px; color: #566172; background: #fff; font-size: 10px; }
.scanner-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; max-width: 650px; margin: 0 auto; }
.scanner-controls>button:not(.capture-button), #finishScanning { justify-self: end; border: 0; color: var(--purple); background: transparent; font-weight: 800; cursor: pointer; }
.scanner-controls>span { color: #656e7e; font-size: 12px; }
.capture-button { display: grid; place-items: center; width: 72px; height: 72px; border: 4px solid #fff; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--orange); cursor: pointer; }
.capture-button i { width: 48px; height: 48px; border: 2px solid #fff; border-radius: 50%; }
.flash-guidance { text-align: center; color: #777d88; font-size: 11px; }
.camera-fallback { margin: 25px; padding: 25px; border-left: 4px solid var(--orange); border-radius: 12px; background: #fff1e7; }
.capture-review { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
.capture-preview-wrap { position: relative; display: grid; place-items: center; min-height: 440px; overflow: hidden; border-radius: 14px; background: #151b29; }
.capture-preview-wrap img { max-width: 90%; max-height: 550px; transition: transform .2s; }
.crop-frame { position: absolute; inset: 8%; border: 2px dashed #fff; pointer-events: none; }
.crop-controls { padding: 18px; border-radius: 14px; background: #fff; }
.crop-controls h3 { margin-top: 0; }.crop-controls p { color: #707785; font-size: 11px; line-height: 1.5; }
.crop-controls label { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; }
.review-capture-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 8px; }
.review-capture-actions button:not(.primary-button) { padding: 10px 13px; border: 1px solid #d5d0c7; border-radius: 9px; background: #fff; font-weight: 800; cursor: pointer; }
.accepted-scans { padding: 0 20px 22px; }.accepted-scans>div:first-child { display: flex; justify-content: space-between; align-items: center; }
.scan-thumbnails { display: flex; gap: 9px; overflow-x: auto; min-height: 90px; padding-bottom: 5px; }
.scan-thumbnails article { flex: 0 0 112px; padding: 7px; border: 1px solid #ddd9d1; border-radius: 10px; background: #fff; }
.scan-thumbnails img { width: 100%; height: 72px; border-radius: 6px; object-fit: cover; }.scan-thumbnails b { display: block; margin: 4px 0; font-size: 10px; }.scan-thumbnails button { border: 0; color: var(--purple); background: transparent; font-size: 10px; cursor: pointer; }

.review-shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 110px 0 110px; }
.review-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 22px; }
.review-heading h1 { margin: 7px 0; font: 800 clamp(36px, 5vw, 57px)/1.05 Manrope; letter-spacing: -.04em; }.review-heading p { max-width: 780px; color: #656e7c; line-height: 1.65; }
.review-summary { display: grid; min-width: 150px; padding: 18px; border-radius: 16px; color: #fff; background: #18233f; }.review-summary strong { font: 800 34px Manrope; }.review-summary span, .review-summary small { color: #cbd2e0; }
.recognition-start-card { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 18px; padding: 23px; border-radius: 18px; color: #fff; background: linear-gradient(125deg, #18233f, #3c4b72); }.recognition-start-card h2 { margin: 0 0 6px; }.recognition-start-card p { color: #cbd2df; }.recognition-start-card ol { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }.recognition-start-card li { padding: 6px 8px; border-radius: 8px; background: #ffffff14; color: #dce1eb; font-size: 10px; }
.review-page-list { display: grid; gap: 18px; }.recognition-page-card { overflow: hidden; border: 1px solid #dfdbd3; border-radius: 19px; background: #fff; }.recognition-page-card.dragging { opacity: .45; }.recognition-page-card>header { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 18px 21px; border-bottom: 1px solid #e4e0d8; }.recognition-page-card>header h2 { margin: 4px 0 0; font: 750 18px Manrope; }.review-drag { color: #aaa4b1; font-size: 22px; cursor: grab; }
.confidence-pill { padding: 7px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; }.confidence-high { color: #267758; background: #e8f8f1; }.confidence-review { color: #906022; background: #fff3d7; }.confidence-unclear { color: #a54539; background: #fee9e5; }.page-failed { border-color: #df9a8e; }.recognition-warning { padding: 11px 20px; color: #8d463a; background: #fff0ec; font-size: 12px; }
.page-review-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; padding: 20px; }.image-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }.image-comparison>div { min-width: 0; }.image-comparison h3, .recognized-editor h3 { margin: 0 0 7px; color: #69717e; font-size: 11px; text-transform: uppercase; }.image-comparison img, .image-comparison iframe { width: 100%; height: 430px; box-sizing: border-box; border: 1px solid #dfdbd3; border-radius: 10px; background: #ece9e1; object-fit: contain; }
.recognized-editor { min-width: 0; }.detected-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #717886; font-size: 10px; }.recognized-editor>label { display: grid; gap: 6px; font-size: 11px; font-weight: 800; }.recognized-editor textarea, .uncertain-blocks textarea, .detected-content textarea, .recognized-formulas input { width: 100%; box-sizing: border-box; border: 1px solid #d9d5cc; border-radius: 9px; padding: 11px; color: var(--ink); background: #fff; font: 13px/1.65 DM Sans; resize: vertical; }.review-flags { display: grid; gap: 7px; margin-top: 10px; }.review-flags label { font-size: 11px; }
.uncertain-blocks, .detected-content { margin: 0 20px 18px; padding: 18px; border-radius: 14px; background: #f7f5ef; }.uncertain-blocks>h3, .detected-content>h3 { margin: 0 0 5px; font: 750 17px Manrope; }.uncertain-blocks>p, .detected-content>p { color: #6e7582; font-size: 11px; }.uncertain-blocks>div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.uncertain-blocks article { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px; border: 1px solid #e0dcd4; border-radius: 11px; background: #fff; }.uncertain-blocks img { width: 150px; height: 100px; border-radius: 7px; object-fit: contain; background: #eeeae2; }.uncertain-blocks article>label { display: grid; gap: 4px; }.uncertain-blocks article>label span { color: #8b5b29; font-size: 10px; font-weight: 800; text-transform: uppercase; }.uncertain-blocks article>div { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 10px; color: #6e7582; font-size: 10px; }.uncertain-blocks article>div b { color: #a54539; }
.recognized-formulas { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }.recognized-formulas label { display: grid; gap: 5px; }.recognized-formulas span, .recognized-formulas small { color: #69717f; font-size: 10px; }.recognized-formulas input { font: 650 15px ui-monospace, monospace; }.diagram-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.diagram-blocks article { display: grid; grid-template-columns: 180px 1fr; gap: 10px; }.diagram-blocks img { width: 180px; height: 120px; object-fit: contain; background: #fff; }
.page-review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding: 14px 20px; border-top: 1px solid #e5e1d9; }.page-review-actions>button, .rescan-control button { padding: 9px 11px; border: 1px solid #d9d4cb; border-radius: 8px; color: #5d6371; background: #fff; font-weight: 800; cursor: pointer; }.rescan-control { display: flex; gap: 6px; align-items: center; padding-left: 8px; border-left: 1px solid #ddd8d0; font-size: 10px; }.rescan-control input { max-width: 190px; font-size: 10px; }
.review-confirm-bar { position: sticky; bottom: 12px; z-index: 8; display: flex; align-items: center; gap: 9px; margin-top: 20px; padding: 16px 18px; border-radius: 16px; color: #fff; background: #18233ff2; box-shadow: 0 15px 40px #18233f45; }.review-confirm-bar>div { display: grid; flex: 1; gap: 3px; }.review-confirm-bar span { color: #c9d0dd; font-size: 11px; }.review-confirm-bar>button:not(.primary-button) { padding: 10px 11px; border: 1px solid #ffffff36; border-radius: 9px; color: #fff; background: transparent; cursor: pointer; }
.processing-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; place-items: center; padding: 20px; color: #fff; background: #111a2eef; text-align: center; }.processing-overlay .spinner { border-color: #ffffff30; border-top-color: var(--orange); }.processing-overlay h2 { margin: 18px 0 4px; }.processing-overlay p, .processing-overlay small { color: #c8cee0; }

@media(max-width: 800px) {
  .document-input-options { grid-template-columns: 1fr; }.document-input-option { min-height: 76px; }.scanner-modal { padding: 0; }.scanner-panel { max-height: 100vh; min-height: 100vh; border-radius: 0; }.capture-review { grid-template-columns: 1fr; }.capture-preview-wrap { min-height: 300px; }.crop-controls { grid-row: 2; }.scanner-controls { grid-template-columns: 1fr auto 1fr; gap: 8px; }.scanner-controls>button:not(.capture-button) { justify-self: start; font-size: 10px; }.capture-button { width: 62px; height: 62px; }.capture-button i { width: 40px; height: 40px; }
  .review-shell { width: min(100% - 20px, 1240px); padding-top: 92px; }.review-heading, .recognition-start-card { align-items: stretch; flex-direction: column; }.review-summary { min-width: 0; }.recognition-start-card form, .recognition-start-card button { width: 100%; }.recognition-page-card>header { grid-template-columns: 25px 1fr; }.confidence-pill { grid-column: 2; justify-self: start; }.page-review-grid, .image-comparison { grid-template-columns: 1fr; }.image-comparison img, .image-comparison iframe { height: 340px; }.uncertain-blocks>div, .recognized-formulas, .diagram-blocks { grid-template-columns: 1fr; }.uncertain-blocks article { grid-template-columns: 100px 1fr; }.uncertain-blocks img { width: 100px; }.diagram-blocks article { grid-template-columns: 110px 1fr; }.diagram-blocks img { width: 110px; }.review-confirm-bar { align-items: stretch; flex-direction: column; }.review-confirm-bar button { width: 100%; }.rescan-control { width: 100%; flex-wrap: wrap; }.page-review-actions>button { flex: 1; }
}

.recall-card .speech-input-control button,
.recall-card .listen-control button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #d8d4e5;
  border-radius: 9px;
  color: #423b70;
  background: #f8f6ff;
  font: 700 12px/1 "DM Sans", sans-serif;
}

/* Lesson media: video search links and Wikimedia images */
.media-card .lesson-videos { display: flex; flex-direction: column; gap: .6rem; margin: .5rem 0 1rem; }
.media-video { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem .8rem; background: #f8f6ff; border-radius: 12px; }
.media-video-text { display: flex; flex-direction: column; gap: .15rem; }
.media-video-text small { opacity: .7; font-size: .8rem; line-height: 1.35; }
.media-links a { margin-left: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.lesson-images { display: flex; flex-wrap: wrap; gap: 1rem; }
.media-image { margin: 0; max-width: 320px; }
.media-image img { max-width: 100%; height: auto; border-radius: 12px; display: block; }
.media-image figcaption { font-size: .8rem; opacity: .75; margin-top: .4rem; line-height: 1.35; }
.media-image figcaption a { font-weight: 600; text-decoration: none; }
