:root {
  --navy: #0f172a;
  --gold: #d4af37;
  --cream: #fff7e6;
  --offwhite: #fafaf8;
  --text: #111827;
  --ready-green: #1f8a5b;
  --brand-strong: var(--navy);
  --bg: var(--offwhite);
  --surface: var(--offwhite);
  --surface-2: var(--cream);
  --line: #eadfbe;
  --line-strong: #d9bd5b;
  --muted: #6b6254;
  --blue: var(--navy);
  --blue-2: var(--cream);
  --green: var(--gold);
  --green-2: var(--cream);
  --amber: var(--gold);
  --amber-2: var(--cream);
  --coral: #cf5b48;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  --radius: 8px;
  --sidebar: 244px;
  --heading-font: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--body-font);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 247, 230, 0.9), rgba(250, 250, 248, 0) 380px),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
}

.sprite {
  display: none;
}

.hidden,
.hidden-input {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 14px;
}

.auth-card img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
}

.auth-card h1 {
  font-size: 30px;
}

.auth-card p,
.auth-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.google-demo-btn {
  min-height: 44px;
}

.auth-card .ghost-btn {
  width: 100%;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
  font-family: var(--heading-font);
  color: var(--navy);
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.main-tabs {
  display: grid;
  gap: 8px;
}

.main-tab {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--navy);
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  font-family: var(--heading-font);
  font-weight: 850;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.main-tab.active {
  background: var(--cream);
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--navy);
  box-shadow: inset 4px 0 0 var(--gold);
}

.profile-menu-wrap {
  position: relative;
}

.profile-avatar,
.profile-large-avatar {
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: var(--cream);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-family: var(--heading-font);
  font-weight: 900;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 20;
  display: grid;
  gap: 6px;
}

.profile-menu .ghost-btn {
  width: 100%;
}

.nav-badge,
.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.card-badge {
  margin-left: 6px;
  vertical-align: middle;
}

.section-back-btn {
  min-width: 132px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item,
.ghost-btn,
.primary-btn,
.secondary-btn,
.icon-btn,
.segment {
  border: 0;
  border-radius: var(--radius);
  min-height: 40px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: transparent;
  color: var(--navy);
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}

.step-nav .nav-item span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.step-nav .nav-item.active span,
.step-nav .nav-item.done span {
  background: var(--gold);
  color: var(--navy);
}

.step-nav .nav-item.done {
  color: var(--navy);
}

.nav-item:hover,
.nav-item.active {
  background: var(--cream);
  color: var(--navy);
}

.privacy-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 650;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2,
h3,
h4,
.label,
button,
.type-pill,
.status-chip,
.score-ring {
  font-family: var(--heading-font);
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.topbar p,
.panel-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 5px;
}

.top-actions,
.button-pair,
.answer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wizard-workspace {
  max-width: 1180px;
  width: 100%;
}

.progress-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #f1ead6;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 16.666%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.2s ease;
}

.progress-strip > span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.wizard-screen {
  display: none;
}

.wizard-screen.active {
  display: grid;
  gap: 18px;
}

.hero-panel,
.centered-card {
  max-width: 900px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.exam-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.option-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.choice-card {
  min-height: 146px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 10px;
}

.choice-card svg {
  color: var(--gold);
}

.choice-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.choice-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.choice-card:hover,
.choice-card.selected {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.option-grid.compact .choice-card {
  min-height: 112px;
}

.home-action-grid .choice-card {
  min-height: 118px;
  align-content: center;
}

.home-action-grid .choice-card strong {
  font-size: 17px;
}

.repository-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.repository-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.repository-empty.small-empty {
  padding: 10px;
  font-size: 12px;
}

.duplicate-lesson-panel {
  margin-top: 12px;
  border: 1px solid #f1d994;
  border-radius: var(--radius);
  background: var(--amber-2);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.duplicate-lesson-panel > strong {
  color: #7b560e;
  font-size: 13px;
}

.duplicate-lesson-panel p {
  color: #6f5a25;
  font-size: 12px;
  line-height: 1.4;
}

.duplicate-lesson-list,
.exam-lesson-list,
.exam-draft-subjects,
.exam-subject-list,
.exam-assessment-list {
  display: grid;
  gap: 8px;
}

.duplicate-lesson-row,
.exam-subject-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.duplicate-lesson-row strong,
.exam-subject-row strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.duplicate-lesson-row span,
.exam-subject-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.help-launch-btn {
  width: 100%;
}

.repository-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
}

.repository-page,
.friends-page,
.profile-page,
.exam-page {
  display: grid;
  gap: 18px;
}

.exam-section-shell {
  gap: 14px;
}

.exam-section-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.exam-section-tab {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  font-weight: 850;
  cursor: pointer;
}

.exam-section-tab.active {
  background: var(--cream);
  border-color: rgba(212, 175, 55, 0.6);
  color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.exam-section {
  display: grid;
  gap: 18px;
}

.exam-lesson-picker {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.exam-picker-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy);
  font-size: 13px;
}

.exam-picker-header span {
  color: var(--muted);
  font-size: 12px;
}

.exam-lesson-option {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.exam-lesson-option input {
  width: auto;
  margin-top: 3px;
}

.exam-lesson-option span,
.exam-lesson-option strong,
.exam-lesson-option small {
  display: block;
}

.exam-lesson-option small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.exam-readiness-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.small-ring {
  width: 140px;
  height: 140px;
}

.small-ring strong {
  font-size: 26px;
}

.exam-assessment {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.exam-assessment summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}

.exam-assessment ol {
  margin: 10px 0 0 20px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.45;
}

.exam-assessment li span {
  color: var(--muted);
  font-size: 12px;
}

.exam-score-entry {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 150px) auto;
  gap: 8px;
  align-items: end;
}

.exam-list-section {
  display: grid;
  gap: 12px;
}

.exam-list-heading,
.exam-detail-main,
.exam-evaluation-summary,
.exam-readiness-overview {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.exam-list-heading h3,
.exam-detail-main h3,
.exam-readiness-overview h3 {
  margin: 0;
}

.exam-list-heading span,
.exam-detail-main p,
.exam-evaluation-summary span,
.exam-readiness-overview p {
  color: var(--muted);
  margin: 4px 0 0;
}

.exam-detail-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.exam-detail-row.selected {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.exam-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 8px;
  min-width: 320px;
}

.exam-metric-grid span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 2px;
}

.exam-metric-grid strong {
  color: var(--brand-strong);
  font-size: 18px;
}

.exam-metric-grid small,
.exam-subject-meter small {
  color: var(--muted);
  font-size: 12px;
}

.exam-mini-readiness {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.exam-mini-readiness summary,
.exam-old-list summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-weight: 850;
}

.exam-old-list {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.exam-old-list .exam-list-section {
  margin-top: 12px;
}

.exam-subject-meter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.exam-subject-meter {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.exam-subject-meter strong {
  color: var(--brand-strong);
  font-size: 22px;
}

.exam-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-evaluation-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.exam-evaluation-summary,
.exam-readiness-overview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  margin-top: 14px;
}

.exam-assessment-meta,
.exam-offline-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.exam-assessment-meta span,
.exam-offline-note span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
}

.exam-online-answer-sheet {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.exam-question-input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.exam-question-input legend,
.exam-question-input span {
  color: var(--text);
  font-weight: 850;
}

.exam-question-input label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--navy);
}

.exam-question-input input[type="radio"] {
  width: auto;
}

.exam-question-input textarea {
  resize: vertical;
}

.exam-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.exam-insight-grid section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.exam-insight-grid h3 {
  margin: 0 0 8px;
}

.exam-insight-grid p,
.exam-insight-grid li {
  color: var(--navy);
  line-height: 1.5;
}

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

.lesson-list-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lesson-list-row:hover {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.repository-open.static-row {
  cursor: default;
}

.compact-filter {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-filter select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.repository-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.repository-row:hover {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.repository-open {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.repository-delete {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff0ee;
  color: #a33b2b;
  font-size: 12px;
  font-weight: 850;
}

.repository-share {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: var(--cream);
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.repository-share:hover {
  background: #f7ebcd;
}

.repository-delete:hover {
  background: #ffe2dd;
}

.repository-row strong,
.repository-row span {
  display: block;
}

.repository-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.friends-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.friends-list {
  display: grid;
  gap: 8px;
}

.friend-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.friend-row.active,
.friend-row:hover {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.request-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.friend-row strong {
  color: var(--text);
  font-size: 13px;
}

.friend-row span {
  color: var(--muted);
  font-size: 12px;
}

.request-section {
  display: grid;
  gap: 8px;
}

.request-section + .request-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.request-section h3 {
  margin: 0;
  color: var(--navy);
  font-size: 13px;
}

.friend-thumb-grid,
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.friend-thumb,
.user-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  padding: 12px;
  text-align: left;
}

.friend-thumb {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.friend-thumb.active,
.friend-thumb:hover,
.user-card:hover {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.friend-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
}

.friend-thumb strong,
.user-card strong {
  color: var(--text);
  font-size: 13px;
}

.friend-thumb small,
.friend-thumb em,
.user-card small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.add-friends-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.existing-users-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.discover-controls {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.discover-controls label {
  display: grid;
  gap: 7px;
}

.user-card {
  display: grid;
  gap: 10px;
}

.user-card-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-card dl,
.friend-detail-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.user-card dl div,
.friend-detail-card dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.user-card dt,
.friend-detail-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.user-card dd,
.friend-detail-card dd {
  margin: 0;
  color: var(--navy);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.friend-detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.friend-shared-list {
  margin-top: 12px;
}

.lesson-bottom-actions {
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.invite-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invite-row input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.profile-large-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 24px;
  flex: 0 0 auto;
}

.profile-summary strong,
.profile-summary span {
  display: block;
}

.profile-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-required-alert {
  margin-top: 14px;
  border: 1px solid #f0d894;
  border-radius: var(--radius);
  background: var(--amber-2);
  color: #70500f;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

input[readonly],
input:disabled,
select:disabled {
  color: #6b6254;
  background: var(--cream);
  cursor: not-allowed;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.profile-stats div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 4px;
}

.profile-stats span {
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
}

.profile-stats strong {
  color: var(--muted);
  font-size: 12px;
}

.material-choice {
  margin-top: 14px;
}

.screen-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.screen-actions.end {
  justify-content: flex-end;
}

.screen-actions .secondary-btn {
  width: auto;
}

.howto-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.42);
  padding: 22px;
  overflow: auto;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.42);
  padding: 22px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.howto-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  padding: 18px;
}

.share-panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  padding: 18px;
}

.share-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.share-choice-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.share-choice-card h3 {
  margin: 0;
  font-size: 14px;
}

.share-choice-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.howto-header,
.howto-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.howto-header {
  margin-bottom: 16px;
}

.howto-header h2 {
  margin-top: 4px;
  font-size: 24px;
}

.howto-header p,
.howto-footer p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.howto-layout {
  display: grid;
  gap: 16px;
}

.howto-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.howto-overview-grid article,
.faq-section details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.howto-overview-grid strong,
.howto-shot-card strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
}

.howto-overview-grid p,
.howto-shot-card p,
.faq-section p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.howto-shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.howto-shot-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  min-height: 210px;
}

.howto-shot-card img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
  object-position: top left;
  border-right: 1px solid var(--line);
  background: var(--cream);
}

.howto-shot-card div {
  padding: 16px;
  align-self: center;
}

.howto-shot-card span {
  display: block;
  margin-bottom: 8px;
  color: #7b5f12;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.faq-section {
  display: grid;
  gap: 10px;
}

.faq-section h3 {
  margin: 0;
  color: var(--navy);
}

.faq-section summary {
  color: var(--navy);
  cursor: pointer;
  font-family: var(--heading-font);
  font-weight: 850;
}

.howto-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  min-height: 180px;
}

.howto-preview {
  width: 100%;
  height: 100%;
  min-height: 180px;
  border-right: 1px solid var(--line);
  background: linear-gradient(135deg, var(--cream), var(--surface));
  padding: 18px;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.howto-preview::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.howto-preview > * {
  position: relative;
  z-index: 1;
}

.preview-home {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
}

.preview-home span,
.preview-sections span {
  min-height: 58px;
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.preview-home span:first-child,
.preview-sections span:first-child {
  background: var(--green-2);
}

.preview-material {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
}

.preview-material span {
  height: 34px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.preview-material strong {
  grid-column: 1 / -1;
  height: 58px;
  border: 1.5px dashed rgba(212, 175, 55, 0.65);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.preview-material em {
  grid-column: 1 / -1;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
}

.preview-map {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: center;
}

.preview-map span,
.preview-sections span {
  height: 42px;
}

.preview-map strong {
  grid-column: 1 / -1;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.preview-sections {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
}

.preview-assessment {
  align-content: center;
}

.preview-assessment span {
  height: 28px;
  border-radius: 999px;
  background: var(--gold);
}

.preview-assessment strong,
.preview-assessment em,
.preview-assessment i {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.preview-readiness {
  grid-template-columns: 88px minmax(0, 1fr);
  align-content: center;
}

.preview-readiness span {
  grid-row: span 3;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 12px solid var(--gold);
  background: var(--surface);
  place-self: center;
}

.preview-readiness strong,
.preview-readiness em,
.preview-readiness i {
  height: 20px;
  border-radius: 999px;
  background: var(--cream);
}

.howto-preview::before {
  display: none;
}

.howto-preview {
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.howto-preview b,
.howto-preview small,
.howto-preview button,
.howto-preview label,
.howto-preview strong,
.howto-preview span,
.howto-preview em {
  position: relative;
  z-index: 1;
}

.howto-preview b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.howto-preview small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.howto-preview button,
.howto-preview label,
.howto-preview span,
.howto-preview strong,
.howto-preview em {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--navy);
  padding: 7px 9px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.05);
}

.howto-preview label {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.howto-preview label strong {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 11px;
}

.preview-home,
.preview-sections {
  grid-template-columns: 1fr;
}

.preview-home button:first-of-type,
.preview-sections button:first-of-type,
.preview-assessment em,
.preview-readiness b {
  background: var(--cream);
  border-color: rgba(212, 175, 55, 0.65);
  color: var(--navy);
}

.preview-material,
.preview-assessment {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-material b,
.preview-material small,
.preview-material em,
.preview-assessment b,
.preview-assessment small,
.preview-assessment em {
  grid-column: 1 / -1;
}

.preview-map {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-map b,
.preview-map small,
.preview-map strong {
  grid-column: 1 / -1;
}

.preview-readiness {
  grid-template-columns: 78px minmax(0, 1fr);
}

.preview-readiness b {
  grid-row: span 3;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-self: center;
  font-size: 18px;
}

.preview-readiness span,
.preview-readiness em {
  grid-row: auto;
  height: auto;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  place-self: stretch;
}

.howto-step > div:not(.howto-preview) {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.howto-step > div:not(.howto-preview) span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.howto-step > div:not(.howto-preview) strong {
  font-size: 15px;
  line-height: 1.3;
}

.howto-step > div:not(.howto-preview) p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.howto-footer {
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-toolbar p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lesson-action-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.lesson-detail-hub {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lesson-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.lesson-detail-hub .lesson-action {
  min-height: 86px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 5px;
  text-align: left;
}

.lesson-detail-hub .lesson-action strong {
  color: var(--text);
  font-size: 14px;
}

.lesson-detail-hub .lesson-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.lesson-action.active {
  background: var(--cream);
  border-color: rgba(212, 175, 55, 0.65);
  color: var(--navy);
}

.map-view {
  display: none;
}

.map-view.active {
  display: grid;
  gap: 14px;
}

.map-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.map-detail h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.map-detail p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.map-detail ul,
.map-detail ol {
  margin-top: 8px;
}

.subtopic-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.subtopic-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.subtopic-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 13px;
}

.subtopic-item p {
  margin: 0;
}

.subtopic-item ul {
  margin-bottom: 0;
}

.question-bank-sections {
  display: grid;
  gap: 12px;
}

.question-bank-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.question-bank-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.question-bank-question {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.question-bank-options,
.question-bank-statements {
  margin: 8px 0 10px;
}

.question-bank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.question-bank-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.matching-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.matching-preview span,
.matching-preview strong {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: var(--surface);
}

.shared-with-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.shared-with-panel summary {
  cursor: pointer;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.shared-with-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.shared-with-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.shared-with-row span {
  color: var(--muted);
  font-size: 12px;
}

.custom-assessment-bar,
.answer-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.compact-segmented {
  min-width: 360px;
  margin-top: 8px;
}

.answer-mode-actions {
  margin-top: 8px;
}

.assessment-mode-actions {
  margin-top: 8px;
}

.offline-actions {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--amber-2);
  color: #684607;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.offline-actions div {
  display: grid;
  gap: 3px;
}

.offline-actions strong {
  font-size: 14px;
}

.offline-actions span,
.offline-upload-note {
  font-size: 13px;
  line-height: 1.45;
}

.offline-upload-note {
  border: 1px solid #f0d894;
  border-radius: var(--radius);
  background: var(--amber-2);
  color: #70500f;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.assessment-timer {
  min-height: 48px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--navy);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.assessment-timer span,
.assessment-timer small {
  color: inherit;
  font-size: 12px;
  font-weight: 850;
}

.assessment-timer strong {
  font-size: 22px;
  line-height: 1;
}

.assessment-timer.over-time {
  border-color: #efb2aa;
  background: #fff0ee;
  color: #a33b2b;
}

.compact-rail {
  grid-template-columns: repeat(auto-fit, minmax(110px, 150px));
  margin-bottom: 0;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.ai-chip.ready {
  color: var(--ready-green);
  background: var(--green-2);
  border-color: rgba(212, 175, 55, 0.42);
}

.ai-chip.demo {
  color: #8c5c12;
  background: var(--amber-2);
  border-color: #f1d994;
}

.ai-chip.error {
  color: #a33b2b;
  background: #fff0ee;
  border-color: #f0beb6;
}

.primary-btn,
.ghost-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.primary-btn {
  color: var(--navy);
  background: var(--gold);
  box-shadow: 0 10px 22px rgba(212, 175, 55, 0.2);
}

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

.ghost-btn {
  color: var(--navy);
  background: var(--cream);
}

.ghost-btn:hover {
  background: #f7ebcd;
}

.secondary-btn {
  width: 100%;
  color: var(--navy);
  background: var(--cream);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.secondary-btn:hover {
  background: #f7ebcd;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  background: var(--cream);
  flex: 0 0 auto;
}

.icon-btn:hover {
  background: #f7ebcd;
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.step {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: #7b5f12;
  font-weight: 800;
  font-size: 12px;
}

.step strong {
  font-size: 13px;
}

.step.active {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
  color: var(--navy);
}

.step.active span {
  background: var(--gold);
  color: var(--navy);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.main-column {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
}

.assessment-panel,
.answers-panel {
  grid-column: 1 / -1;
}

.right-column {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-icon {
  color: var(--blue);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: var(--amber-2);
  color: #8c5c12;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label,
.label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 11px;
  margin-top: 7px;
}

select[multiple] {
  height: auto;
  min-height: 132px;
  padding: 8px;
}

select[multiple] option {
  padding: 7px;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
  margin-top: 8px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-top: 14px;
  background: var(--cream);
  border-radius: var(--radius);
}

.segment {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.segment.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.upload-zone {
  min-height: 140px;
  border: 1.5px dashed rgba(212, 175, 55, 0.72);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--navy);
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.82), rgba(255, 255, 255, 0.88));
}

.upload-zone.dragging {
  border-color: var(--gold);
  background: var(--cream);
}

.upload-zone input {
  display: none;
}

.upload-zone svg {
  width: 26px;
  height: 26px;
}

.upload-zone strong {
  font-size: 14px;
}

.upload-zone span {
  color: var(--muted);
  font-size: 12px;
}

.generation-status {
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--navy);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.generation-status div {
  display: grid;
  gap: 3px;
}

.generation-status strong {
  font-size: 14px;
}

.generation-status span {
  font-size: 13px;
  line-height: 1.45;
}

.generation-status.error {
  border-color: #f0beb6;
  background: #fff0ee;
  color: #a33b2b;
}

.generation-status.done {
  border-color: rgba(212, 175, 55, 0.45);
  background: var(--cream);
  color: var(--navy);
}

.generation-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(212, 175, 55, 0.28);
  border-top-color: var(--gold);
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 2px;
  animation: spin 0.9s linear infinite;
}

.generation-status.error .generation-spinner,
.generation-status.done .generation-spinner {
  animation: none;
  border-color: currentColor;
}

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

.file-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.file-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 92px;
  padding: 9px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.file-thumb {
  height: 54px;
  border-radius: 6px;
  background: var(--blue-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--blue);
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-card strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.file-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.notes-label {
  display: block;
}

.chapter-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.map-item {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--surface);
}

.map-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.map-item strong {
  font-size: 13px;
  line-height: 1.35;
}

.question-list,
.answer-sheet {
  display: grid;
  gap: 10px;
}

.question-row,
.answer-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.question-top strong {
  font-size: 14px;
  line-height: 1.38;
}

.type-pill {
  border-radius: 999px;
  background: var(--blue-2);
  color: #7b5f12;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 10px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
}

.key {
  border-left: 3px solid var(--green);
  padding: 8px 10px;
  background: var(--green-2);
  color: var(--navy);
  font-size: 13px;
  display: none;
}

.show-keys .key {
  display: block;
}

.answer-row label {
  display: grid;
  gap: 8px;
}

.answer-row textarea,
.answer-row input[type="text"] {
  min-height: 78px;
  margin-top: 0;
}

.answer-row input[type="text"] {
  min-height: 40px;
}

.answer-prompt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.answer-prompt strong {
  font-size: 14px;
  line-height: 1.38;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.answer-option {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.answer-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
}

.answer-option:has(input:checked) {
  border-color: rgba(212, 175, 55, 0.72);
  background: var(--green-2);
  color: var(--navy);
}

.answer-freeform,
.typed-voice-fallback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.answer-freeform.single {
  grid-template-columns: minmax(0, 1fr);
}

.typed-voice-fallback textarea {
  min-height: 48px;
}

.answer-voice-btn {
  min-width: 78px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.answer-voice-btn.recording {
  background: #fff0ee;
  color: #a33b2b;
}

.matching-answer-grid,
.tf-statement-list {
  display: grid;
  gap: 8px;
}

.matching-row,
.tf-statement {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.matching-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
}

.matching-row span,
.tf-statement strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.matching-row select {
  margin-top: 0;
}

.tf-statement {
  display: grid;
  gap: 8px;
}

.tf-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tf-options label {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
}

.tf-options input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green);
}

.answers-panel.offline .answer-sheet {
  display: none;
}

.answer-score {
  display: none;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--green-2);
  color: var(--navy);
  font-size: 13px;
}

.answer-score.warn {
  background: var(--amber-2);
  color: #7b540e;
}

.answer-score.bad {
  background: #fff0ee;
  color: #a33b2b;
}

.score-ring {
  width: 172px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 12px auto 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--score) * 1%), #efe4c2 0);
}

.score-ring span {
  font-size: 42px;
  line-height: 1;
  font-weight: 850;
}

.score-ring small {
  margin-top: -38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.script-scorebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.script-scorebar strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

.corrected-script-list {
  display: grid;
  gap: 10px;
}

.script-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.script-row.good {
  border-color: rgba(31, 138, 91, 0.42);
}

.script-row.warn {
  border-color: #e8c874;
}

.script-row.bad {
  border-color: #e7aaa0;
}

.script-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.script-row-top strong {
  font-size: 14px;
  line-height: 1.38;
}

.script-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.script-grid > div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.script-grid p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.readiness-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.test-history-list {
  display: grid;
  gap: 8px;
}

.test-history-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.test-history-row.active,
.test-history-row:hover {
  border-color: rgba(212, 175, 55, 0.65);
  background: var(--cream);
}

.test-history-row strong,
.test-history-row span {
  display: block;
}

.test-history-row span:not(.type-pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.type-pill.submitted {
  color: var(--ready-green);
  background: var(--green-2);
}

.type-pill.pending {
  color: #8c5c12;
  background: var(--amber-2);
}

.test-detail-panel {
  margin-top: 14px;
}

.test-detail-card,
.test-detail-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.test-detail-card {
  display: grid;
  gap: 10px;
}

.test-detail-card strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.test-detail-card p,
.test-detail-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.insight-list {
  display: grid;
  gap: 16px;
}

ul,
ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.repo-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  margin-bottom: 12px;
}

.repo-item strong {
  font-size: 14px;
}

.repo-item span {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 750;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    overflow-x: auto;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .privacy-note {
    margin-top: 0;
    margin-left: auto;
    min-width: max-content;
  }

  .help-launch-btn {
    width: auto;
    min-width: max-content;
  }

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

  .right-column {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .workspace {
    padding: 16px;
  }

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

  .top-actions {
    justify-content: flex-start;
  }

  .howto-modal {
    padding: 12px;
  }

  .howto-header,
  .howto-footer {
    flex-direction: column;
    align-items: stretch;
  }

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

  .howto-step {
    grid-template-columns: 1fr;
  }

  .howto-preview {
    height: auto;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .progress-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-strip > span {
    align-self: flex-start;
  }

  .step-strip,
  .main-column,
  .chapter-map,
  .right-column,
  .lesson-detail-hub,
  .readiness-layout,
  .script-scorebar,
  .script-grid,
  .option-grid,
  .option-grid.compact,
  .profile-fields,
  .share-choice-grid,
  .two-col,
  .custom-assessment-bar,
  .answer-options,
  .answer-freeform,
  .typed-voice-fallback,
  .matching-row,
  .matching-preview,
  .answer-tools,
  .friend-thumb-grid,
  .discover-grid,
  .discover-controls,
  .friend-detail-card,
  .lesson-list-row,
  .duplicate-lesson-row,
  .exam-subject-row,
  .exam-readiness-grid,
  .exam-score-entry,
  .howto-overview-grid,
  .howto-shot-grid {
    grid-template-columns: 1fr;
  }

  .howto-shot-card {
    grid-template-columns: 1fr;
  }

  .howto-shot-card img {
    height: 210px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .offline-actions,
  .answer-prompt,
  .test-history-row,
  .shared-with-row {
    grid-template-columns: 1fr;
  }

  .offline-actions,
  .answer-prompt,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-segmented {
    min-width: 0;
  }

  .repository-row {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .options {
    grid-template-columns: 1fr;
  }

  .exam-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    overflow-x: hidden;
  }

  .brand {
    min-width: 0;
  }

  .brand > div {
    min-width: 0;
  }

  .main-tabs {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .main-tab {
    min-width: 0;
    text-align: center;
    padding: 0 8px;
  }

  .help-launch-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .nav-list {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .nav-item {
    justify-content: flex-start;
    min-width: 0;
    padding: 0 8px;
  }

  .privacy-note {
    display: none;
  }

  .exam-section-tabs,
  .exam-evaluation-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exam-evaluation-toolbar .primary-btn {
    grid-column: 1 / -1;
  }

  .exam-detail-main,
  .exam-evaluation-summary,
  .exam-readiness-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-metric-grid {
    min-width: 0;
    width: 100%;
  }

  .exam-insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 247, 230, 0.9), rgba(250, 250, 248, 0) 260px),
      var(--bg);
  }

  .auth-shell {
    min-height: 100svh;
    padding: 16px;
    align-items: stretch;
  }

  .auth-card {
    align-self: center;
    padding: 18px;
    gap: 12px;
  }

  .auth-card img {
    width: 52px;
    height: 52px;
  }

  .exam-section-tabs,
  .exam-evaluation-toolbar,
  .exam-metric-grid {
    grid-template-columns: 1fr;
  }

  .exam-section-tab {
    min-height: 44px;
  }

  .auth-card h1 {
    font-size: 26px;
    line-height: 1.08;
  }

  .app-shell {
    display: block;
    min-height: 100svh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  }

  .brand {
    min-height: 40px;
  }

  .brand img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .help-launch-btn {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .nav-list {
    grid-column: 1 / -1;
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 2px 4px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 118px;
    min-height: 38px;
    scroll-snap-align: start;
    padding: 0 10px;
    font-size: 12px;
    gap: 8px;
    background: var(--surface);
  }

  .step-nav .nav-item span {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .workspace {
    padding: 12px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  h1 {
    font-size: 25px;
    line-height: 1.08;
  }

  .topbar p,
  .panel-header p {
    font-size: 12px;
  }

  .top-actions {
    display: flex;
    justify-content: flex-end;
    width: auto;
    gap: 8px;
  }

  .top-actions > * {
    min-width: 0;
  }

  .ai-chip {
    justify-content: center;
    padding: 0 8px;
    min-height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .profile-menu-wrap {
    justify-self: end;
  }

  .progress-strip {
    gap: 8px;
    margin-bottom: 12px;
  }

  .progress-track {
    height: 7px;
  }

  .wizard-screen.active {
    gap: 12px;
  }

  .panel {
    padding: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  }

  .panel-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .status-chip {
    align-self: flex-start;
  }

  .option-grid,
  .option-grid.compact {
    gap: 10px;
  }

  .exam-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-card,
  .option-grid.compact .choice-card {
    min-height: auto;
    padding: 13px;
    gap: 8px;
  }

  .choice-card strong {
    font-size: 14px;
  }

  .repository-row,
  .repository-open {
    grid-template-columns: 1fr;
  }

  .repository-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .repository-share,
  .repository-delete {
    width: 100%;
  }

  .screen-actions,
  .screen-actions.end {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 8px;
  }

  .screen-actions .primary-btn,
  .screen-actions .ghost-btn,
  .screen-actions .secondary-btn,
  .button-pair .primary-btn,
  .button-pair .ghost-btn {
    width: 100%;
  }

  .button-pair,
  .answer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .primary-btn,
  .ghost-btn,
  .secondary-btn,
  .segment {
    min-height: 44px;
    padding: 0 12px;
    white-space: normal;
    text-align: center;
    line-height: 1.18;
  }

  .icon-btn {
    min-width: 44px;
    width: 44px;
    height: 44px;
  }

  .form-grid {
    gap: 10px;
  }

  input,
  select {
    height: 44px;
    font-size: 16px;
  }

  textarea {
    min-height: 130px;
    font-size: 16px;
  }

  .upload-zone {
    min-height: 120px;
    padding: 16px;
    text-align: center;
  }

  .file-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-detail-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lesson-detail-hub .lesson-action {
    min-height: 76px;
    padding: 10px;
  }

  .lesson-detail-hub .lesson-action strong {
    font-size: 13px;
  }

  .lesson-detail-hub .lesson-action span {
    font-size: 11px;
  }

  .map-detail,
  .map-item,
  .question-row,
  .answer-row,
  .script-row,
  .test-detail-card,
  .test-detail-empty {
    padding: 11px;
  }

  .question-top,
  .answer-prompt,
  .script-row-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .type-pill {
    align-self: flex-start;
    white-space: normal;
    line-height: 1.2;
  }

  .custom-assessment-bar,
  .answer-tools {
    gap: 12px;
  }

  .compact-segmented {
    width: 100%;
  }

  .segmented {
    gap: 5px;
    padding: 4px;
  }

  .segment {
    min-height: 40px;
    padding: 0 6px;
    font-size: 11px;
  }

  .offline-actions,
  .generation-status,
  .assessment-timer {
    align-items: stretch;
  }

  .assessment-timer {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .assessment-timer small {
    grid-column: 1 / -1;
  }

  .answer-options {
    gap: 7px;
  }

  .answer-option {
    min-height: 46px;
    align-items: flex-start;
  }

  .answer-freeform,
  .typed-voice-fallback {
    gap: 8px;
  }

  .answer-voice-btn {
    min-width: 0;
  }

  .matching-row {
    gap: 8px;
  }

  .tf-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-options label {
    justify-content: center;
  }

  .score-ring {
    width: 140px;
    margin: 10px auto 16px;
  }

  .score-ring span {
    font-size: 34px;
  }

  .score-ring small {
    margin-top: -30px;
  }

  .script-scorebar {
    gap: 10px;
  }

  .script-scorebar strong {
    font-size: 20px;
  }

  .test-history-row {
    gap: 8px;
  }

  .main-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .main-tab {
    min-width: 0;
    text-align: center;
  }

  .profile-menu {
    right: 0;
  }

  .lesson-list-row,
  .invite-row,
  .friend-row,
  .request-row {
    grid-template-columns: 1fr;
  }

  .repository-actions,
  .request-row .button-pair,
  .invite-row .button-pair {
    justify-content: stretch;
  }

  .repository-actions button,
  .invite-row button,
  .request-row button {
    width: 100%;
  }

  .compact-filter {
    min-width: 0;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .howto-panel {
    padding: 12px;
  }

  .howto-header h2 {
    font-size: 21px;
  }

  .howto-preview {
    max-height: 190px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: translateY(18px);
    text-align: center;
  }

  .toast.show {
    transform: translateY(0);
  }
}

@media (max-width: 420px) {
  .brand span {
    max-width: 138px;
  }

  .top-actions {
    display: flex;
    justify-content: flex-end;
  }

  .top-actions .ai-chip {
    max-width: 132px;
  }

  .button-pair,
  .answer-actions,
  .repository-actions,
  .exam-action-grid,
  .lesson-detail-hub,
  .tf-options,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .file-rail {
    grid-template-columns: 1fr;
  }

  .chapter-map {
    gap: 8px;
  }

  .map-item {
    min-height: auto;
  }

  .nav-item {
    min-width: 108px;
  }

  .help-launch-btn {
    max-width: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
