:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #5d6875;
  --soft: #eef2f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #d8e0e2;
  --teal: #0f766e;
  --teal-soft: #d8f1ed;
  --amber: #b45309;
  --amber-soft: #fff2d7;
  --rose: #be123c;
  --rose-soft: #ffe4ea;
  --green: #166534;
  --green-soft: #dcfce7;
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 280px),
    #f4f6f5;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.brand h1,
.brand p,
.panel h2,
.workspace-header h2,
.topic-article h2,
.topic-article h3,
.empty-state h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1.1rem;
}

.brand p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.speech-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button,
.primary-button,
.secondary-button,
.link-button,
.tab-button,
.subject-button,
.topic-button,
.option-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ghost-button,
.secondary-button,
.tab-button {
  padding: 8px 12px;
}

.primary-button {
  padding: 10px 14px;
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
  font-weight: 700;
}

.link-button {
  min-height: 32px;
  padding: 4px 8px;
  color: var(--teal);
  background: transparent;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel,
.workspace,
.quiz-card,
.topic-article,
.empty-state,
.test-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 14px;
}

.student-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.11), rgba(180, 83, 9, 0.1)),
    var(--surface);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel p {
  color: var(--muted);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-heading h2 {
  font-size: 1rem;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

.subject-nav,
.topic-list,
.section-list {
  display: grid;
  gap: 8px;
}

.subject-button,
.topic-button,
.section-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.subject-button.active,
.topic-button.active,
.section-button.active,
.tab-button.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: #083d39;
  font-weight: 700;
}

.section-list {
  margin-bottom: 14px;
}

.section-button {
  min-height: 52px;
}

.section-button small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.section-button.active small {
  color: #0f514c;
}

.section-select-label {
  display: block;
  margin-top: 8px;
}

.topic-heading {
  margin-top: 14px;
}

.subject-button.locked {
  color: var(--muted);
  background: var(--surface-2);
}

.section-button.locked,
.topic-button.locked {
  color: var(--muted);
  background: #f1f5f4;
}

.status-pill,
.difficulty-pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ready {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.waiting {
  background: var(--soft);
  color: var(--muted);
}

.status-pill.locked {
  background: #f1f5f4;
  color: #6b7280;
}

.difficulty-pill {
  background: var(--amber-soft);
  color: var(--amber);
}

.score-pill {
  background: var(--teal-soft);
  color: var(--teal);
}

.danger-button {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}

.meter {
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #65a30d);
  transition: width 180ms ease;
}

.workspace {
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.workspace-header h2 {
  font-size: 1.35rem;
}

.view-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content-area {
  min-height: calc(100vh - 150px);
}

.learn-grid {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  min-height: calc(100vh - 150px);
}

.topic-rail {
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.topic-rail select {
  width: 100%;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.topic-main {
  padding: 18px;
}

.topic-article {
  padding: 20px;
}

.topic-article h2 {
  font-size: 1.5rem;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

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

.lesson-section {
  margin-top: 18px;
}

.lesson-section h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lesson-section ul,
.example-card ol {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.lesson-section li,
.example-card li {
  margin: 7px 0;
  line-height: 1.45;
}

.visual-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfc;
}

.visual-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.retake-panel {
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.retake-panel p {
  color: var(--muted);
}

.parent-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.parent-panel p,
.parent-panel h4 {
  margin-top: 0;
}

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

.progress-sync-grid textarea {
  width: 100%;
  min-height: 96px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
}

.number-line {
  position: relative;
  height: 74px;
  margin-top: 8px;
  border-bottom: 3px solid #1f2937;
}

.number-line span {
  position: absolute;
  bottom: -26px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.78rem;
}

.number-line i {
  position: absolute;
  bottom: -7px;
  width: 4px;
  height: 14px;
  transform: translateX(-50%);
  background: #1f2937;
}

.fraction-bars {
  display: grid;
  gap: 10px;
}

.fraction-bar {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  height: 28px;
  border: 1px solid #334155;
  border-radius: 6px;
}

.fraction-bar span {
  border-right: 1px solid rgba(51, 65, 85, 0.35);
}

.fraction-bar span:last-child {
  border-right: 0;
}

.fraction-bar .fill {
  background: var(--amber-soft);
}

.coordinate-grid,
.bar-chart-visual {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 260px;
  background-image:
    linear-gradient(#d5dde0 1px, transparent 1px),
    linear-gradient(90deg, #d5dde0 1px, transparent 1px);
  background-size: 20% 20%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.coordinate-grid {
  position: relative;
  place-items: center;
}

.coordinate-grid::before,
.coordinate-grid::after {
  content: "";
  position: absolute;
  background: #334155;
}

.coordinate-grid::before {
  width: 2px;
  height: 100%;
}

.coordinate-grid::after {
  width: 100%;
  height: 2px;
}

.coordinate-grid b {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--rose);
  transform: translate(-50%, -50%);
}

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

.shape-box {
  min-height: 82px;
  border: 2px solid var(--teal);
  background: var(--teal-soft);
  border-radius: 8px;
}

.shape-box.triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 0;
}

.bar-chart-visual {
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 10px;
  padding: 14px;
  aspect-ratio: 4 / 3;
  background-size: 100% 25%, 25% 100%;
}

.bar-chart-visual span {
  background: var(--teal);
  border-radius: 6px 6px 0 0;
}

.map-visual {
  position: relative;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.16) 1px, transparent 1px),
    linear-gradient(135deg, #ecfdf5, #dbeafe);
  background-size: 25% 25%, 25% 25%, 100% 100%;
}

.north {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--rose);
  font-weight: 800;
}

.map-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.18);
}

.map-dot.one {
  left: 24%;
  top: 32%;
}

.map-dot.two {
  left: 58%;
  top: 48%;
}

.map-dot.three {
  left: 39%;
  top: 72%;
}

.weather-visual {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 10px;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#dbeafe 1px, transparent 1px),
    #f8fafc;
  background-size: 100% 25%;
}

.weather-visual span {
  background: #2563eb;
  border-radius: 6px 6px 0 0;
}

.rocks-visual {
  display: grid;
  gap: 8px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f8fafc 0 24%, #e2e8f0 24% 45%, #fde68a 45% 66%, #fed7aa 66% 100%);
}

.rocks-visual span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 800;
}

.cell-visual {
  position: relative;
  min-height: 210px;
  border: 2px solid #16a34a;
  border-radius: 45% 55% 48% 52%;
  background:
    radial-gradient(circle at 68% 36%, rgba(22, 163, 74, 0.55) 0 12px, transparent 13px),
    radial-gradient(circle at 30% 72%, rgba(22, 163, 74, 0.5) 0 10px, transparent 11px),
    #ecfdf5;
}

.cell-nucleus,
.cell-label {
  position: absolute;
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
}

.cell-nucleus {
  left: 36%;
  top: 38%;
  background: var(--amber-soft);
  color: var(--amber);
}

.cell-label.wall {
  left: 8px;
  top: 10px;
}

.cell-label.vacuole {
  right: 14px;
  bottom: 22px;
}

.cell-label.chloroplast {
  right: 10px;
  top: 18px;
}

.force-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 170px;
}

.force-visual .object-block {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
}

.force-visual .arrow {
  position: relative;
  color: var(--teal);
  font-weight: 800;
  text-align: center;
}

.force-visual .arrow::after {
  content: "";
  display: block;
  height: 4px;
  margin-top: 8px;
  background: currentColor;
}

.force-visual .arrow.left::after {
  clip-path: polygon(0 50%, 18% 0, 18% 35%, 100% 35%, 100% 65%, 18% 65%, 18% 100%);
}

.force-visual .arrow.right::after {
  clip-path: polygon(0 35%, 82% 35%, 82% 0, 100% 50%, 82% 100%, 82% 65%, 0 65%);
}

.atom-visual {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, var(--rose) 0 18px, transparent 19px),
    linear-gradient(135deg, #eff6ff, #f8fafc);
}

.atom-visual::before,
.atom-visual::after {
  content: "";
  position: absolute;
  inset: 34px 20px;
  border: 2px solid #2563eb;
  border-radius: 50%;
}

.atom-visual::after {
  transform: rotate(65deg);
}

.atom-visual span {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #2563eb;
}

.atom-visual span:nth-child(1) {
  left: 22%;
  top: 42%;
}

.atom-visual span:nth-child(2) {
  right: 22%;
  top: 42%;
}

.atom-visual span:nth-child(3) {
  left: 47%;
  top: 15%;
}

.atom-visual span:nth-child(4) {
  left: 47%;
  bottom: 15%;
}

.project-visual {
  display: grid;
  gap: 8px;
}

.project-visual span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  text-align: center;
}

.tpe-visual {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(180, 83, 9, 0.12), rgba(15, 118, 110, 0.1)),
    #ffffff;
}

.tpe-visual span {
  padding: 10px;
  border: 1px solid rgba(120, 53, 15, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #7c2d12;
  font-weight: 800;
  text-align: center;
}

.pronunciation-grid {
  display: grid;
  gap: 10px;
}

.pronunciation-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.pronunciation-card strong {
  display: block;
  color: #991b1b;
  font-size: 1.05rem;
}

.pronunciation-card span,
.pronunciation-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.spanish-visual {
  display: grid;
  gap: 8px;
}

.spanish-visual span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
  text-align: center;
}

.latin-visual {
  display: grid;
  gap: 8px;
}

.latin-visual span {
  padding: 10px;
  border: 1px solid rgba(51, 65, 85, 0.16);
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  text-align: center;
}

.music-visual {
  display: grid;
  gap: 8px;
}

.music-visual span {
  padding: 10px;
  border: 1px solid rgba(124, 45, 18, 0.16);
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  text-align: center;
}

.art-visual {
  display: grid;
  gap: 8px;
}

.art-visual span {
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #ecfeff;
  color: #0f766e;
  font-weight: 800;
  text-align: center;
}

.art-project-visual {
  display: grid;
  gap: 8px;
}

.art-project-visual img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.drama-visual {
  display: grid;
  gap: 8px;
}

.drama-visual span {
  padding: 10px;
  border: 1px solid rgba(190, 18, 60, 0.16);
  border-radius: 8px;
  background: #fff1f2;
  color: #be123c;
  font-weight: 800;
  text-align: center;
}

.cs-visual {
  display: grid;
  gap: 8px;
}

.cs-visual span {
  padding: 10px;
  border: 1px solid rgba(30, 64, 175, 0.16);
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  text-align: center;
}

.dt-food-visual {
  display: grid;
  gap: 8px;
}

.dt-food-visual span {
  padding: 10px;
  border: 1px solid rgba(22, 101, 52, 0.16);
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
  text-align: center;
}

.history-visual {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  border-left: 4px solid var(--amber);
}

.history-visual span {
  position: relative;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
}

.history-visual span::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 3px solid var(--amber);
  border-radius: 999px;
  background: #ffffff;
  transform: translateY(-50%);
}

.river-visual {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf5, #fefce8);
}

.river-visual::before {
  content: "";
  position: absolute;
  inset: -20px 38% -20px 28%;
  border-radius: 45%;
  background: #38bdf8;
  transform: rotate(22deg);
}

.river-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 26%, rgba(22, 101, 52, 0.3) 0 16px, transparent 17px),
    radial-gradient(circle at 66% 62%, rgba(22, 101, 52, 0.25) 0 22px, transparent 23px);
}

.ecosystem-visual,
.settlement-visual {
  display: grid;
  gap: 10px;
}

.ecosystem-visual span,
.settlement-visual span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
  text-align: center;
}

.settlement-visual span {
  background: var(--teal-soft);
  color: var(--teal);
}

.example-card,
.check-card,
.question-card {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.example-card h4,
.check-card h4,
.question-card h4 {
  margin: 0 0 8px;
}

.check-card label,
.question-card label {
  display: block;
  margin: 8px 0;
}

.answer-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.answer-row input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feedback {
  display: none;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  line-height: 1.4;
}

.feedback.correct {
  display: block;
  background: var(--green-soft);
  color: var(--green);
}

.feedback.incorrect {
  display: block;
  background: var(--rose-soft);
  color: var(--rose);
}

.action-row,
.test-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.guided-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.arrow-button {
  min-width: 130px;
}

.quiz-view,
.tests-view,
.scores-view {
  padding: 18px;
}

.quiz-toolbar,
.tests-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.quiz-toolbar select,
.tests-toolbar select {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.quiz-card,
.test-card {
  padding: 18px;
}

.question-card {
  background: #ffffff;
}

.question-card p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.option-button {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  text-align: left;
}

.option-button.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.option-button.correct-answer {
  border-color: var(--green);
  background: var(--green-soft);
}

.option-button.wrong-answer {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.score-banner {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--amber-soft);
}

.locked-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.locked-panel h3 {
  margin: 0 0 8px;
}

.locked-panel p {
  color: var(--muted);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.score-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.score-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.score-card p {
  margin: 4px 0;
  color: var(--muted);
}

.empty-state {
  margin: 18px;
  padding: 24px;
}

.empty-state p {
  color: var(--muted);
}

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

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

  .learn-grid,
  .lesson-layout,
  .progress-sync-grid {
    grid-template-columns: 1fr;
  }

  .topic-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar,
  .workspace-header,
  .quiz-toolbar,
  .tests-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .speech-controls,
  .view-tabs {
    justify-content: flex-start;
  }

  .app-shell {
    padding: 10px;
  }

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

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .ghost-button,
  .primary-button,
  .secondary-button,
  .tab-button {
    flex: 1 1 120px;
  }

  .topic-main,
  .quiz-view,
  .tests-view,
  .scores-view {
    padding: 12px;
  }

  .topic-article,
  .quiz-card,
  .test-card {
    padding: 14px;
  }
}
