:root {
  color-scheme: light;
  --ink: #17201a;
  --muted: #627064;
  --line: #d9e2d7;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b4f49;
  --gold: #b7791f;
  --danger: #b42318;
  --soft: #eef6ef;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-height: 42px;
  padding: 0 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.app-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 18px;
}

.topbar,
.progress-strip,
.layout {
  display: grid;
  gap: 16px;
}

.topbar {
  align-items: center;
  grid-template-columns: 1fr auto;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

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

h1 {
  font-size: 30px;
  line-height: 1.15;
}

.mode-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  overflow: hidden;
}

.mode-toggle button {
  border: 0;
  border-radius: 0;
}

.mode-toggle button.active {
  background: var(--accent);
  color: white;
}

.progress-strip {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: auto 1fr;
  padding: 12px;
}

.progress-strip span {
  display: block;
  font-weight: 800;
}

.progress-strip small {
  color: var(--muted);
}

.progress-bar {
  background: #edf2e9;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-bar span {
  background: var(--accent);
  display: block;
  height: 100%;
  width: 0;
}

.layout {
  align-items: start;
  grid-template-columns: 320px 1fr;
  margin-top: 16px;
}

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

.map-panel {
  max-height: calc(100vh - 155px);
  overflow: auto;
  padding: 14px;
  position: sticky;
  top: 16px;
}

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

.panel-heading h2 {
  font-size: 18px;
}

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

.card-map {
  display: grid;
  gap: 8px;
}

.map-card {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px 1fr auto;
  min-height: 54px;
  text-align: left;
  width: 100%;
}

.map-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .12);
}

.map-card.locked {
  color: var(--muted);
}

.node {
  align-items: center;
  background: var(--soft);
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.done .node {
  background: var(--accent);
  color: white;
}

.practice-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.card-status,
.card-actions,
.controls,
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-status span,
.feature-tags span {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
}

.card-title {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.sentence-block h2 {
  font-size: clamp(26px, 5vw, 46px);
  line-height: 1.08;
}

.coach-note {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 12px;
}

.translation {
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
  margin-top: 12px;
}

.usage {
  background: #fffaf0;
  border-left: 4px solid var(--gold);
  color: #6f4e18;
  line-height: 1.7;
  margin-top: 10px;
  padding: 10px 12px;
}

.sound-map {
  background: #f5f8f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.section-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ipa {
  font-size: 22px;
  line-height: 1.45;
}

.shadowing {
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.sound-plain {
  color: var(--muted);
  line-height: 1.7;
}

.learning-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.learning-panel strong {
  color: var(--gold);
  font-size: 24px;
}

.learning-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.mini-chips,
.explain-list {
  display: grid;
  gap: 8px;
}

.mini-chips {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.mini-chips span {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 8px 10px;
}

.explain-list article {
  background: #fbfcf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.explain-list strong {
  color: var(--accent-strong);
  font-size: 16px;
}

.explain-list span {
  color: var(--gold);
  font-weight: 800;
}

.explain-list p {
  color: var(--muted);
  line-height: 1.6;
}

.controls button:first-child,
.card-actions button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.status-line {
  color: var(--muted);
  min-height: 24px;
}

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

.feedback-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.feedback-grid span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.feedback-grid strong {
  display: block;
  font-size: 28px;
  margin-top: 4px;
}

.notes h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.notes ul {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
  padding-left: 20px;
}

.two-column-notes {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

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

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

  .map-panel {
    max-height: none;
    position: static;
  }

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

  .map-card {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 54px;
    padding: 6px;
  }

  .map-card .map-title,
  .map-card .map-state {
    display: none;
  }

  .practice-card {
    padding: 16px;
  }

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

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