:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #647085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --blue: #2f6fed;
  --green: #0e9f6e;
  --amber: #b7791f;
  --red: #d33f49;
  --teal: #087f8c;
  --shadow: 0 18px 45px rgba(39, 52, 78, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef3f8;
  color: var(--ink);
  position: fixed;
  inset: 0;
  -webkit-overflow-scrolling: auto;
  touch-action: pan-y;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  background: #172033;
  color: #f9fbff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f4c95d;
  color: #172033;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  color: #b8c3d7;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #cdd6e7;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button.active,
.nav button:hover {
  background: #26344f;
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  color: #c5d0e2;
  font-size: 13px;
  line-height: 1.45;
}

.main {
  padding: 26px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 21px;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

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

.section-kicker,
.step-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.section-head h2 {
  margin-bottom: 0;
}

.focus-card h2 {
  font-size: 25px;
  line-height: 1.18;
}

.section-stack {
  align-items: start;
}

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

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

.weak-drill-item {
  border: 1px solid #f2c6cb;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #fff7f8;
}

.weak-drill-item span {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.weak-drill-item strong {
  color: #172033;
  font-size: 14px;
  line-height: 1.25;
}

.weak-drill-item small {
  color: #81515a;
  font-size: 12px;
  font-weight: 800;
}

.proof-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: #2d3a50;
  font-weight: 700;
  line-height: 1.35;
}

.install-card {
  display: grid;
  gap: 14px;
  background: #f9fbff;
}

.install-steps {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  color: #40506a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.path-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  background: #f9fbff;
}

.path-hero h2 {
  margin-bottom: 8px;
}

.path-score {
  width: 118px;
  min-height: 96px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: #172033;
  color: #ffffff;
}

.path-score strong {
  font-size: 28px;
  line-height: 1;
}

.path-score span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 850;
}

.lesson-map {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.unit-block {
  display: grid;
  gap: 10px;
}

.unit-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  background: #172033;
  color: #ffffff;
}

.unit-head span {
  grid-row: span 2;
  min-width: 54px;
  min-height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 950;
}

.unit-head strong {
  font-size: 16px;
  line-height: 1.2;
}

.unit-head small {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.unit-levels {
  display: grid;
  gap: 10px;
}

.lesson-node {
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(39, 52, 78, 0.08);
}

.lesson-node:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.lesson-node.done {
  border-color: #badfca;
  background: #f7fbf9;
}

.lesson-node.practice {
  border-color: #c9d8ff;
}

.lesson-dot {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #edf3ff;
  color: var(--blue);
  font-weight: 950;
}

.lesson-node.done .lesson-dot {
  background: #dff7ea;
  color: var(--green);
}

.lesson-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lesson-copy strong {
  font-size: 16px;
  line-height: 1.2;
}

.lesson-copy small,
.lesson-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.lesson-meta {
  min-width: 58px;
  text-align: right;
}

.lesson-shell {
  display: grid;
  gap: 14px;
}

.lesson-progress {
  height: 8px;
  border-radius: 999px;
  background: #dfe7f2;
  overflow: hidden;
}

.lesson-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.exercise-card {
  display: grid;
  gap: 16px;
}

.exercise-card h2 {
  margin-bottom: 0;
}

.exercise-prompt {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
  color: #263245;
  font-size: 21px;
  font-weight: 850;
  line-height: 1.25;
}

.exercise-options,
.word-bank {
  display: grid;
  gap: 10px;
}

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

.match-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.match-item {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: #223047;
  text-align: left;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.match-item.active {
  border-color: var(--blue);
  background: #edf3ff;
  color: #184db5;
}

.match-item.matched {
  border-color: #9bd6b4;
  background: #ecfdf3;
  color: #057348;
}

.exercise-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 850;
}

.exercise-option,
.word-tile {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: #223047;
  text-align: left;
  font-weight: 800;
  line-height: 1.3;
}

.exercise-option.correct,
.built-answer.correct {
  border-color: #9bd6b4;
  background: #ecfdf3;
  color: #057348;
}

.exercise-option.wrong,
.built-answer.wrong {
  border-color: #f1a6ad;
  background: #fff1f2;
  color: var(--red);
}

.exercise-option.muted-option {
  opacity: 0.55;
}

.built-answer {
  min-height: 62px;
  border: 1px dashed #b9c5d6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 14px;
  background: #f8fafc;
  color: #526074;
  font-weight: 850;
  line-height: 1.35;
}

.word-bank {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.word-tile {
  text-align: center;
}

.word-tile:disabled {
  opacity: 0.35;
}

.speak-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.speak-card strong {
  color: #172033;
  font-size: 24px;
  line-height: 1.22;
}

.speak-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.dialog-exercise {
  gap: 12px;
}

.dialog-thread {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
}

.dialog-bubble {
  max-width: 88%;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.dialog-bubble.interviewer {
  justify-self: start;
  background: #ffffff;
  color: #263245;
}

.dialog-bubble.user {
  justify-self: end;
  background: #edf3ff;
  color: #184db5;
}

.dialog-bubble small {
  color: inherit;
  font-size: 12px;
  font-weight: 750;
  opacity: 0.78;
}

.dialog-options {
  display: grid;
  gap: 10px;
}

.dialog-option {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: #223047;
  text-align: left;
  font-weight: 850;
  line-height: 1.35;
}

.exercise-feedback {
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.exercise-feedback.correct {
  background: #ecfdf3;
  color: #057348;
}

.exercise-feedback.wrong {
  background: #fff1f2;
  color: var(--red);
}

.exercise-feedback span {
  font-weight: 750;
  line-height: 1.35;
}

.lesson-complete {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.link-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  background: #edf3ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-strip button {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  background: #eef2f8;
  color: #40506a;
  font-size: 13px;
  font-weight: 850;
}

.category-strip button.active {
  background: var(--blue);
  color: #fff;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.card {
  padding: 16px;
}

.library-card {
  width: 100%;
  color: inherit;
  text-align: left;
}

.library-card:hover {
  border-color: var(--blue);
}

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

.library-section-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.library-section-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.library-section-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.library-section-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.library-card-list {
  display: grid;
  gap: 12px;
}

.library-data-card {
  box-shadow: none;
}

.library-data-card h3 {
  margin: 10px 0 8px;
  font-size: 18px;
}

.library-data-card p {
  margin-bottom: 0;
  color: #2c384e;
  font-weight: 750;
  line-height: 1.4;
}

.metric {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e8edf5;
  color: var(--ink);
  font-weight: 750;
}

.btn {
  justify-content: center;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.danger {
  background: #fde8ea;
  color: var(--red);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn.listening {
  background: #fde8ea;
  color: var(--red);
}

.voice-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.voice-status {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.phrase-bank {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.phrase-bank-title {
  margin-bottom: 10px;
  color: #344057;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.phrase-chip {
  min-height: 34px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid #cbd6e5;
  color: #25324a;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.phrase-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #edf3ff;
  color: #2759b8;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 750;
}

.tag.green {
  background: #e8f7f0;
  color: var(--green);
}

.tag.amber {
  background: #fff6df;
  color: var(--amber);
}

.tag.red {
  background: #fdebed;
  color: var(--red);
}

.question {
  font-size: 30px;
  line-height: 1.18;
  margin: 14px 0 18px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: #344057;
  font-size: 13px;
  font-weight: 750;
}

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

.progress-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  min-height: 34px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f1;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
}

.feedback {
  display: grid;
  gap: 14px;
}

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

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

.phrase-group-card {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  display: grid;
  align-content: space-between;
  gap: 8px;
  text-align: left;
  box-shadow: var(--shadow);
}

.phrase-group-card.active {
  border-color: var(--blue);
  background: #edf3ff;
}

.phrase-group-card h3 {
  margin: 0;
  color: #344057;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.phrase-group-card strong {
  font-size: 26px;
  line-height: 1;
}

.phrase-group-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.phrase-group-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.group-complete {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  background: #f7fbf9;
  border-color: #c7e5d4;
}

.group-progress {
  height: 8px;
  border-radius: 999px;
  background: #dfe7f2;
  overflow: hidden;
}

.group-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.anki-session {
  display: grid;
  gap: 14px;
}

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

.swipe-hints span {
  min-height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2f8;
  color: #526074;
  font-size: 12px;
  font-weight: 850;
}

.anki-stage {
  perspective: 1200px;
}

.anki-card {
  --swipe-x: 0px;
  --swipe-y: 0px;
  --swipe-rotate: 0deg;
  width: 100%;
  min-height: 390px;
  position: relative;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  display: block;
  text-align: left;
  transform: translate(var(--swipe-x), var(--swipe-y)) rotate(var(--swipe-rotate));
  transform-style: preserve-3d;
  transition: transform 220ms ease, filter 220ms ease;
  touch-action: none;
}

.anki-card.flipped {
  transform: translate(var(--swipe-x), var(--swipe-y)) rotate(var(--swipe-rotate)) rotateY(180deg);
}

.anki-face {
  position: absolute;
  inset: 0;
  min-height: 390px;
  border: 1px solid #c9d4e3;
  border-radius: 18px;
  padding: 24px;
  background: #fbfcff;
  display: grid;
  align-content: center;
  gap: 16px;
  backface-visibility: hidden;
  box-shadow: 0 22px 48px rgba(39, 52, 78, 0.16);
}

.anki-front {
  background:
    linear-gradient(135deg, rgba(244, 201, 93, 0.16), transparent 38%),
    #fbfcff;
}

.anki-back {
  background:
    linear-gradient(135deg, rgba(14, 159, 110, 0.13), transparent 40%),
    #f6fbf8;
  border-color: #b8dec8;
  transform: rotateY(180deg);
}

.anki-card strong {
  display: block;
  font-size: 29px;
  line-height: 1.18;
}

.anki-card span {
  color: #3a465b;
  font-size: 17px;
  line-height: 1.45;
}

.anki-helper,
.anki-meta {
  color: var(--muted) !important;
  font-size: 14px !important;
}

.anki-side-label {
  color: var(--teal) !important;
  font-size: 12px !important;
  font-weight: 900;
  text-transform: uppercase;
}

body.training-active {
  background: #f6f8fb;
  touch-action: none;
}

body.training-active .app-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  display: block;
  overflow: hidden;
}

body.training-active .sidebar {
  display: none;
}

body.training-active .main {
  width: 100vw;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.practice-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  background: #f6f8fb;
  overscroll-behavior: none;
}

.practice-header {
  flex: 0 0 auto;
  min-height: 56px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.practice-header div {
  min-width: 0;
  text-align: center;
}

.practice-header span,
.practice-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.practice-header strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-icon-btn,
.practice-count {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 8px 18px rgba(39, 52, 78, 0.08);
}

.practice-icon-btn {
  font-size: 24px;
  line-height: 1;
}

.practice-count {
  font-size: 12px !important;
  font-weight: 900;
}

.practice-card-area {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px 0 14px;
}

.practice-card-area .anki-stage {
  width: min(100%, 430px);
  height: min(68dvh, 540px);
  min-height: 360px;
  max-height: 100%;
}

.practice-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.practice-card .anki-face {
  min-height: 0;
  height: 100%;
  padding: 26px 22px;
  border-color: #d8e0eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 22px 54px rgba(39, 52, 78, 0.14);
  overflow: hidden;
}

.practice-card .anki-front,
.practice-card .anki-back {
  background: #ffffff;
}

.practice-card .anki-back {
  border-color: #c9dece;
}

.practice-card strong {
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.12;
}

.practice-card span {
  font-size: clamp(15px, 4vw, 18px);
}

.practice-card .anki-helper,
.practice-card .anki-meta {
  font-size: 13px !important;
}

.practice-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 0 12px;
}

.practice-action {
  min-height: 54px;
  border-radius: 16px;
  background: #ffffff;
  color: #253044;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(39, 52, 78, 0.09);
}

.practice-action.again {
  color: var(--red);
}

.practice-action.hard {
  color: #8a5a12;
}

.practice-action.know,
.practice-action.primary {
  background: #172033;
  color: #ffffff;
}

.practice-action.secondary {
  color: #475569;
}

.completed-screen .practice-actions {
  grid-template-columns: 1fr 1fr;
}

.practice-swipe-guide {
  flex: 0 0 auto;
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 8px 0 14px;
}

.practice-swipe-guide span {
  min-height: 36px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.session-complete-card {
  width: min(100%, 390px);
  border: 1px solid #d8e0eb;
  border-radius: 24px;
  padding: 28px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 22px 54px rgba(39, 52, 78, 0.12);
}

.session-complete-card h1 {
  margin: 8px 0;
  font-size: clamp(32px, 10vw, 46px);
}

.session-complete-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.score {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #e7edf5 0);
  font-size: 24px;
  font-weight: 900;
}

.score::before {
  content: "";
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.score span {
  position: relative;
}

.onboarding {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.onboarding .panel {
  width: min(860px, 100%);
}

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

.choice {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 70px;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.choice.active {
  border-color: var(--blue);
  background: #edf3ff;
}

.empty-state {
  min-height: 210px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #b8c4d4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 880px) {
  body {
    background: #f4f7fb;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 10;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    color: var(--ink);
    box-shadow: 0 -10px 30px rgba(39, 52, 78, 0.12);
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .nav button {
    justify-content: center;
    min-height: 44px;
    padding: 0 4px;
    border-radius: 8px;
    background: transparent;
    color: #526074;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
  }

  .nav button.active,
  .nav button:hover {
    background: #e9f0ff;
    color: var(--blue);
  }

  .main {
    padding: 16px 14px 92px;
  }

  .eyebrow {
    display: none;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .library-section-grid,
  .form-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar .actions {
    width: 100%;
  }

  .topbar .actions .btn,
  .actions .btn {
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    white-space: normal;
  }

  .focus-card h2 {
    font-size: 22px;
  }

  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .compact-metrics .metric {
    min-height: 86px;
  }

  .path-hero {
    grid-template-columns: 1fr;
  }

  .path-score {
    width: 100%;
    min-height: 78px;
  }

  .lesson-node {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 88px;
  }

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

  .lesson-meta {
    grid-column: 2;
    text-align: left;
  }

  .exercise-prompt {
    font-size: 18px;
  }

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

  .match-board {
    gap: 8px;
  }

  .match-item {
    min-height: 58px;
    padding: 10px;
    font-size: 12px;
  }

  .speak-card strong {
    font-size: 20px;
  }

  .dialog-bubble {
    max-width: 94%;
  }

  .section-head {
    align-items: center;
  }

  .link-button {
    flex: 0 0 auto;
  }

  .category-strip {
    margin: -4px;
    padding: 4px 4px 8px;
  }

  .phrase-groups {
    display: flex;
    gap: 10px;
    margin: 0 -14px 14px;
    overflow-x: auto;
    padding: 0 14px 4px;
    scrollbar-width: none;
  }

  .phrase-groups::-webkit-scrollbar {
    display: none;
  }

  .phrase-group-card {
    flex: 0 0 154px;
    min-height: 108px;
    box-shadow: none;
  }

  .phrase-group-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .phrase-group-grid .phrase-group-card {
    min-height: 118px;
  }

  .question {
    font-size: 23px;
    line-height: 1.22;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 19px;
  }

  .panel {
    padding: 16px;
  }

  .card {
    padding: 14px;
  }

  .metric {
    min-height: 92px;
  }

  .metric strong {
    font-size: 26px;
  }

  textarea {
    min-height: 180px;
  }

  .voice-tools {
    grid-template-columns: 1fr;
  }

  .anki-card {
    min-height: 330px;
  }

  .anki-face {
    min-height: 330px;
    padding: 18px;
  }

  .anki-card strong {
    font-size: 22px;
  }

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