:root {
  color-scheme: light;
  --ink: #16201f;
  --muted: #62706d;
  --line: #dce4df;
  --panel: #ffffff;
  --soft: #eef5f1;
  --blue: #1f6f9b;
  --red: #d63f3f;
  --green: #16805a;
  --yellow: #f2c84b;
  --shadow: 0 18px 45px rgba(22, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f0e8;
}

button {
  color: inherit;
  font: inherit;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #f2b84b;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  color: #123d50;
  font-weight: 850;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sidebar,
.phrase-panel {
  background: var(--panel);
  padding: 28px;
  border-color: var(--line);
}

.sidebar {
  border-right: 1px solid var(--line);
}

.phrase-panel {
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #0b3d66);
  color: white;
  font-weight: 850;
  box-shadow: inset 10px 0 0 white, inset 16px 0 0 var(--red);
}

h1,
h2,
p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.05;
}

.brand p,
.eyebrow,
.category,
.level-row,
.stats span,
.card-head,
.feedback,
.phrase small {
  color: var(--muted);
}

.progress-panel,
.study-card,
.mission-panel,
.review-panel,
.typing-card,
.dictation-card,
.word-bank,
.tip-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.progress-panel {
  padding: 18px;
}

.mission-panel {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 16px;
  background: #102b35;
  color: white;
}

.mission-panel > span,
.mission-panel small {
  color: #c7eee2;
  font-size: 12px;
  font-weight: 800;
}

.mission-panel strong {
  font-size: 16px;
  line-height: 1.3;
}

.mission-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

#missionFill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 220ms ease;
}

.review-panel {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 16px;
}

.review-panel > span,
.review-panel p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-panel strong {
  font-size: 34px;
  line-height: 1;
  color: var(--green);
}

.review-panel button {
  min-height: 38px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 850;
}

.review-panel button:disabled {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
  cursor: not-allowed;
}

.level-row,
.card-head,
.meaning-row,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  margin: 16px 0;
  border-radius: 999px;
  background: #e8ece9;
}

#progressFill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 220ms ease;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats div {
  display: grid;
  gap: 3px;
}

.stats strong {
  font-size: 22px;
}

.category-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.language-panel,
.speech-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.language-panel > span,
.speech-panel > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.speech-panel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.language-toggle,
.speech-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.language-option,
.speech-option {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 800;
}

.language-option.active,
.speech-option.active {
  border-color: var(--blue);
  background: #e6f2f8;
  color: #124d73;
}

.category {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.category.active,
.category:hover {
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
}

.scenario-menu {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.scenario-menu > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.scenario-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.scenario-button.active,
.scenario-button:hover {
  border-color: var(--green);
  background: #e8f7f0;
  color: #0f5a41;
}

.study-area {
  min-width: 0;
  padding: 30px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2,
.panel-head h2 {
  font-size: 26px;
}

.icon-button,
.small-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.hero-strip {
  position: relative;
  display: flex;
  min-height: 190px;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #123b48 0%, #1f6f9b 48%, #f5d071 100%);
  box-shadow: var(--shadow);
}

.aurora {
  position: absolute;
  inset: -30% -10% auto;
  height: 180px;
  background: radial-gradient(ellipse at center, rgba(101, 218, 169, 0.8), rgba(101, 218, 169, 0) 62%);
  transform: rotate(-8deg);
}

.mountains {
  position: absolute;
  inset: auto 0 0;
  height: 110px;
}

.mountains span {
  position: absolute;
  bottom: -1px;
  width: 52%;
  height: 100px;
  background: #24302d;
  clip-path: polygon(0 100%, 48% 0, 100% 100%);
}

.mountains span:nth-child(1) {
  left: -8%;
}

.mountains span:nth-child(2) {
  left: 25%;
  height: 125px;
  background: #1c2725;
}

.mountains span:nth-child(3) {
  right: -10%;
  height: 92px;
  background: #36423c;
}

.hero-copy {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 22px;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.hero-copy strong {
  font-size: 42px;
  line-height: 1;
}

.learning-map-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(22, 32, 31, 0.07);
}

.comic-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  border: 2px solid #16201f;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12px 12px, rgba(22, 32, 31, 0.08) 1.6px, transparent 1.7px) 0 0 / 18px 18px,
    #fff3cf;
  box-shadow: 8px 8px 0 rgba(22, 32, 31, 0.12);
}

.comic-panel:not([open]) {
  gap: 0;
}

.learning-map-head {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
}

.comic-head {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.comic-head::-webkit-details-marker {
  display: none;
}

.comic-head::after {
  content: "+";
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #16201f;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 3px 3px 0 rgba(22, 32, 31, 0.16);
  color: #16201f;
  font-size: 24px;
  font-weight: 950;
}

.comic-panel[open] .comic-head::after {
  content: "-";
  padding-bottom: 3px;
}

.comic-head:focus-visible {
  outline: 3px solid rgba(31, 111, 155, 0.45);
  outline-offset: 6px;
}

.learning-map-head h2 {
  font-size: 28px;
}

.comic-head h2 {
  font-size: 28px;
}

.learning-map-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #102b35;
  color: white;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
}

.comic-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f2c84b;
  color: #2e2612;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
}

.roadmap-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.comic-strip {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.comic-panel:not([open]) .comic-strip {
  display: none;
}

.comic-story {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid #16201f;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 5px 5px 0 #f2c84b;
}

.comic-story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comic-story-head span {
  font-weight: 900;
}

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

.comic-frame {
  position: relative;
  display: grid;
  grid-template-rows: 162px minmax(152px, auto);
  overflow: hidden;
  border: 3px solid #16201f;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 4px 4px 0 rgba(22, 32, 31, 0.16);
}

.comic-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 2;
  pointer-events: none;
  border: 1px solid rgba(22, 32, 31, 0.14);
  border-radius: 4px;
}

.comic-frame::after {
  content: "!";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid #16201f;
  border-radius: 999px;
  background: #f2c84b;
  font-weight: 950;
}

.comic-scene {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 24%, rgba(255, 255, 255, 0.92) 0 12%, transparent 13%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #e9f4f6 0 54%, #f1dfb7 54% 100%);
}

.comic-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-radial-gradient(circle at 70% 25%, rgba(22, 32, 31, 0.13) 0 1px, transparent 1px 8px);
  opacity: 0.32;
}

.comic-scene::after {
  content: "";
  position: absolute;
  left: -24px;
  right: -24px;
  bottom: 45%;
  height: 24px;
  background: rgba(255, 255, 255, 0.46);
  transform: rotate(-4deg);
}

.comic-scene-school {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 0 8%, transparent 8% 100%),
    linear-gradient(180deg, #e8f3f8 0 54%, #dcebd3 54% 100%);
}

.comic-scene-shop {
  background:
    linear-gradient(90deg, rgba(22, 32, 31, 0.14) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #f8e0bd 0 54%, #f7edda 54% 100%);
}

.comic-action-mark {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 1;
  width: 48px;
  height: 32px;
  border-radius: 999px 999px 999px 4px;
  background: #ffffff;
  border: 2px solid #16201f;
  transform: rotate(-8deg);
}

.comic-action-mark::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: #d63f3f;
  box-shadow: 0 8px 0 #1f6f9b;
}

.comic-character {
  position: absolute;
  bottom: -4px;
  z-index: 3;
  width: 126px;
  height: 146px;
  filter: drop-shadow(5px 6px 0 rgba(22, 32, 31, 0.12));
}

.comic-character-left {
  left: 4px;
}

.comic-character-right {
  right: 2px;
  transform: scaleX(-1);
}

.comic-character-pose-1 {
  rotate: -2deg;
}

.comic-character-pose-2 {
  rotate: 4deg;
}

.comic-character-pose-3 {
  rotate: -5deg;
}

.comic-character-ozgur {
  width: 148px;
  height: 164px;
}

.sketch-character,
.traveler-character {
  overflow: visible;
}

.sketch-character path,
.sketch-character circle,
.sketch-character ellipse,
.traveler-character path,
.traveler-character circle,
.traveler-character ellipse {
  vector-effect: non-scaling-stroke;
}

.comic-character-ozgur text {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.traveler-character {
  filter: drop-shadow(6px 7px 0 rgba(16, 23, 22, 0.16));
}

.traveler-character .traveler-beanie,
.traveler-character .traveler-map {
  filter: drop-shadow(0 3px 0 rgba(16, 23, 22, 0.16));
}

.traveler-character .traveler-backpack,
.traveler-character .traveler-parka,
.traveler-character .traveler-beanie,
.traveler-character .traveler-map,
.traveler-character .traveler-badge {
  paint-order: stroke fill;
}

.traveler-character .traveler-backpack {
  opacity: 0.96;
}

.comic-character .sketch-speed {
  opacity: 0.85;
}

.comic-character .sketch-ground {
  opacity: 0.75;
}

.comic-prop {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  width: 52px;
  height: 26px;
  border: 3px solid #16201f;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(22, 32, 31, 0.2);
}

.comic-prop-school {
  width: 48px;
  height: 40px;
  border-radius: 10px 10px 5px 5px;
  background: #f2c84b;
}

.comic-prop-school::before {
  content: "";
  position: absolute;
  left: 11px;
  top: -9px;
  width: 26px;
  height: 12px;
  border: 3px solid #16201f;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.comic-prop-shop {
  width: 58px;
  height: 42px;
  border: 3px solid #2f6f82;
  border-radius: 8px;
  background: #ffffff;
}

.comic-prop-shop::before {
  content: "kr";
  position: absolute;
  left: 8px;
  top: 8px;
  color: #2f6f82;
  font-size: 16px;
  font-weight: 950;
}

.comic-bubble {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  margin: 12px;
  padding: 14px;
  border: 3px solid #16201f;
  border-radius: 18px 18px 18px 4px;
  background: #ffffff;
  box-shadow: 3px 3px 0 #f2c84b;
}

.comic-bubble::before {
  content: "";
  position: absolute;
  left: 20px;
  top: -13px;
  width: 22px;
  height: 22px;
  border-left: 3px solid #16201f;
  border-top: 3px solid #16201f;
  background: #ffffff;
  transform: rotate(45deg);
}

.comic-bubble small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.comic-bubble strong {
  font-size: 17px;
  line-height: 1.25;
}

.comic-bubble em {
  color: #586360;
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.roadmap-card {
  display: grid;
  min-height: 190px;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.roadmap-card.locked {
  opacity: 0.62;
}

.roadmap-card.passed {
  border-color: #7fcaa8;
  background: #f0faf5;
}

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

.roadmap-card-head span {
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #e6f2f8;
  color: #124d73;
  font-size: 12px;
  font-weight: 900;
}

.roadmap-card strong {
  line-height: 1.2;
}

.roadmap-card p,
.roadmap-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.roadmap-scenario-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roadmap-scenario-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5f8f6;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.roadmap-scenario-link span {
  font-size: 10px;
  font-weight: 950;
}

.roadmap-scenario-link.completed {
  border-color: #8bcdb0;
  background: #eff9f4;
  color: #116a4c;
}

.roadmap-scenario-link:disabled,
.roadmap-card button:disabled {
  border-color: var(--line);
  background: #eef1ef;
  color: #89918e;
  cursor: not-allowed;
}

.roadmap-scenario-link:hover,
.roadmap-scenario-link.active {
  border-color: var(--green);
  background: #e9f6ef;
  color: #116a4c;
}

.roadmap-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece9;
}

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

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

.roadmap-card button {
  min-height: 34px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.roadmap-card .unit-test-button {
  min-height: 40px;
  border-color: #124d73;
  background: #102b35;
}

.roadmap-card .unit-test-button.passed {
  border-color: #7fcaa8;
  background: #dff3e8;
  color: #116a4c;
}

.unit-test-panel {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: 20px;
  border: 2px solid #124d73;
  border-radius: 10px;
  background: #f4f9fc;
  box-shadow: 5px 5px 0 rgba(18, 77, 115, 0.14);
}

.unit-test-panel[hidden] {
  display: none;
}

.unit-test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.unit-test-head > div {
  display: grid;
  gap: 4px;
}

.unit-test-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.unit-test-head button,
.unit-test-next,
.unit-test-result button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #102b35;
  color: white;
  cursor: pointer;
  font-weight: 850;
  padding: 0 14px;
}

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

.unit-test-options button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 9px 12px;
}

.unit-test-options button.correct {
  border-color: #55aa82;
  background: #e6f6ed;
  color: #116a4c;
}

.unit-test-options button.wrong {
  border-color: #d88484;
  background: #fff0f0;
  color: #9b3131;
}

.unit-test-feedback {
  min-height: 22px;
  color: #9b3131;
  font-weight: 850;
}

.unit-test-feedback.success {
  color: #116a4c;
}

.unit-test-next {
  justify-self: start;
}

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

.unit-test-result strong {
  font-size: 22px;
}

.unit-test-result p {
  color: var(--muted);
  line-height: 1.55;
}

.unit-test-insights {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 8px;
  background: white;
}

.unit-test-insights span {
  color: var(--muted);
  line-height: 1.45;
}

.lesson-production {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border-bottom: 2px solid #cfe2db;
  background: #f7fbfd;
}

.lesson-can-do {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(31, 91, 84, 0.24);
  border-radius: 16px;
  background: #eef7f4;
}

.lesson-can-do span,
.lesson-self-check span {
  color: #1f5b54;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialogue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mini-dialogue-lines.meanings-hidden .dialogue-meaning {
  display: none;
}

.lesson-self-check {
  display: grid;
  gap: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(20, 39, 36, 0.12);
}

.lesson-self-check > div:first-child {
  display: grid;
  gap: 0.25rem;
}

.self-check-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.self-check-options button {
  min-height: 44px;
  padding: 0.65rem;
  border: 1px solid rgba(31, 91, 84, 0.25);
  border-radius: 12px;
  background: #fff;
  color: #183a36;
  font-weight: 700;
}

.self-check-options button.selected {
  border-color: #1f5b54;
  background: #1f5b54;
  color: #fff;
}

.lesson-self-check em {
  min-height: 1.2em;
  color: #1f5b54;
  font-size: 0.82rem;
  font-style: normal;
}

@media (max-width: 640px) {
  .self-check-options {
    grid-template-columns: 1fr;
  }
}

.mini-dialogue,
.production-task {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
}

.mini-dialogue {
  border-right: 1px solid var(--line);
}

.lesson-production-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-production-head > div {
  display: grid;
  gap: 7px;
}

.lesson-production-head span,
.production-task > span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.lesson-production-head small,
.production-task small,
.mini-dialogue-lines small {
  color: var(--muted);
}

.lesson-production-head button,
.production-task button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #124d73;
  color: white;
  cursor: pointer;
  font-weight: 850;
  padding: 0 14px;
}

.mini-dialogue-lines {
  display: grid;
  gap: 8px;
}

.mini-dialogue-lines button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.mini-dialogue-lines button > b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
}

.mini-dialogue-lines button span {
  display: grid;
  gap: 3px;
}

.production-task p {
  margin: 0;
  line-height: 1.5;
}

.production-task textarea {
  width: 100%;
  resize: vertical;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.production-task > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.production-task em {
  color: var(--green);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.daily-flow {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.daily-plan-list span {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.daily-plan-list strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.scenario-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(22, 32, 31, 0.07);
  overflow: hidden;
}

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

.scenario-head h2 {
  font-size: 28px;
}

.scenario-head p:last-child {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.scenario-head a {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 38px;
  align-items: center;
  padding: 0 13px;
  border-radius: 8px;
  background: #102b35;
  color: white;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

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

.scenario-visual {
  grid-column: 1 / -1;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(232, 246, 255, 0.92), rgba(246, 255, 248, 0.92));
}

.clock-lesson,
.routine-lesson,
.clock-practice {
  display: grid;
  gap: 18px;
}

.clock-lesson-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.clock-lesson-head p {
  margin: 0 0 5px;
  color: #10201f;
  font-size: 22px;
  font-weight: 900;
}

.clock-lesson-head span {
  color: #566763;
  font-weight: 750;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.clock-card,
.routine-step,
.clock-rule-card,
.clock-drill-card {
  border: 1px solid #d3dfda;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #10201f;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(16, 43, 53, 0.08);
}

.clock-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 12px;
  text-align: center;
}

.clock-card strong {
  font-size: 18px;
}

.clock-card span {
  font-weight: 900;
}

.clock-card small,
.routine-step small,
.clock-rule-card small,
.clock-drill-card small {
  color: #5d6d69;
  font-weight: 750;
  line-height: 1.35;
}

.clock-face {
  width: 112px;
  height: 112px;
}

.clock-ring {
  fill: #e9f6fb;
  stroke: #102b35;
  stroke-width: 3;
}

.clock-inner {
  fill: #fff;
  stroke: #a9c1cc;
  stroke-width: 1.5;
}

.clock-ticks line {
  stroke: #102b35;
  stroke-width: 2;
  stroke-linecap: round;
}

.clock-hand line {
  stroke: #102b35;
  stroke-linecap: round;
}

.hour-hand line {
  stroke-width: 5;
}

.minute-hand line {
  stroke-width: 3;
}

.clock-pin {
  fill: #0d8a5b;
  stroke: #102b35;
  stroke-width: 1;
}

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

.routine-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
  padding: 14px;
  text-align: left;
}

.routine-step b {
  color: #16805a;
  font-size: 18px;
}

.routine-icon {
  justify-self: end;
  border-radius: 999px;
  background: #102b35;
  color: white;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.routine-step strong {
  grid-column: 1 / -1;
  font-size: 15px;
  line-height: 1.3;
}

.routine-step small {
  grid-column: 1 / -1;
}

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

.clock-rule-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
}

.clock-rule-card b {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: #102b35;
  color: #fff;
  font-size: 13px;
}

.clock-rule-card strong {
  font-size: 16px;
}

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

.clock-drill-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 14px 12px;
  text-align: center;
}

.clock-drill-card .clock-face {
  width: 88px;
  height: 88px;
}

.clock-drill-card span {
  color: #16704a;
  font-size: 17px;
  font-weight: 950;
}

.scenario-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.scenario-card.learned {
  background: #f3faf6;
}

.scenario-card:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.scenario-card div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.scenario-card strong {
  font-size: 21px;
  line-height: 1.15;
}

.scenario-card span {
  color: var(--ink);
  font-weight: 750;
}

.scenario-card small {
  color: var(--muted);
  font-size: 13px;
}

.scenario-card button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  padding: 0 12px;
}

.scenario-card button[data-action="known"] {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.scenario-completion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-top: 2px solid #cfe2db;
  background: #f2faf6;
}

.scenario-completion > div {
  display: grid;
  gap: 4px;
}

.scenario-completion span {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.scenario-completion small {
  color: var(--muted);
}

.scenario-completion button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 900;
  padding: 0 16px;
}

.scenario-completion button:disabled {
  background: #dfe7e3;
  color: #77817d;
  cursor: not-allowed;
}

.study-card {
  padding: 20px;
  min-height: 330px;
}

.trainer-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.typing-card,
.dictation-card,
.word-bank,
.dictionary-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dictionary-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(22, 32, 31, 0.07);
}

.dictionary-head {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
}

.dictionary-head h2 {
  font-size: 28px;
}

.dictionary-head strong {
  display: grid;
  min-width: 74px;
  min-height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green);
  font-size: 13px;
}

.dictionary-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.dictionary-search input {
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  font: inherit;
  padding: 0 13px;
}

.dictionary-search button,
.dictionary-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 850;
  padding: 0 12px;
}

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

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

.dictionary-card.known {
  border-color: #bde8d3;
  background: #f0faf5;
}

.dictionary-card div:first-child {
  display: grid;
  gap: 4px;
}

.dictionary-card span {
  width: max-content;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.dictionary-card strong {
  font-size: 21px;
  line-height: 1.15;
}

.dictionary-card small,
.dictionary-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.dictionary-card p {
  color: var(--ink);
  font-weight: 800;
}

.dictionary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.dictionary-actions button[data-action="known"] {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.dictionary-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.typing-card h2 {
  font-size: 30px;
}

.typing-card p:not(.eyebrow),
.dictation-card p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
}

.typing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.typing-row input {
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  font: inherit;
  padding: 0 13px;
}

.typing-row button,
.listen-wide-button {
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 850;
  padding: 0 14px;
}

.dictation-card h2 {
  font-size: 30px;
}

.listen-wide-button {
  width: 100%;
  background: #102b35;
}

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

.bank-word {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  padding: 9px 10px;
}

.bank-word.known {
  border-color: #bde8d3;
  background: #f0faf5;
}

.bank-word strong {
  font-size: 15px;
}

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

.word-card {
  display: grid;
  width: 100%;
  min-height: 170px;
  margin: 18px 0;
  place-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: #102b35;
  color: white;
  cursor: pointer;
}

.word-card span {
  font-size: 52px;
  font-weight: 850;
  text-align: center;
}

.word-card small {
  font-size: 18px;
  color: #c7eee2;
}

.small-button,
.primary-button {
  min-height: 38px;
  padding: 0 14px;
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: white;
  font-weight: 750;
}

.translation-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.translation-stack span {
  font-size: 24px;
  font-weight: 800;
}

.translation-stack small {
  color: var(--muted);
  font-size: 14px;
}

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

#quizQuestion {
  font-size: 22px;
  font-weight: 780;
  line-height: 1.25;
}

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

.quiz-options button {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.quiz-options button:hover {
  border-color: var(--blue);
}

.quiz-options button.correct {
  border-color: var(--green);
  background: #e8f7f0;
}

.quiz-options button.wrong {
  border-color: var(--red);
  background: #fdecec;
}

.feedback {
  min-height: 24px;
  font-weight: 700;
}

.panel-head {
  margin-bottom: 18px;
}

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

.phrase {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.phrase strong {
  font-size: 18px;
}

.phrase em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.tip-box {
  margin-top: 24px;
  padding: 16px;
  background: var(--soft);
}

.tip-box p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.pronunciation-lab {
  margin-top: 24px;
}

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

.pronunciation-drill {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
  text-align: left;
}

.pronunciation-drill:hover {
  border-color: var(--blue);
}

.pronunciation-drill strong {
  font-size: 18px;
}

.pronunciation-drill span,
.pronunciation-drill small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.worklife-lesson {
  background: linear-gradient(135deg, rgba(250, 252, 248, 0.98), rgba(232, 244, 241, 0.98));
  border-color: rgba(26, 92, 74, 0.22);
}

.worklife-hero {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.worklife-hero p {
  margin: 0;
  color: #1b7b5d;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.worklife-hero h3 {
  margin: 0;
  font-size: 28px;
  color: var(--text);
}

.worklife-hero span {
  color: var(--muted);
  max-width: 860px;
  line-height: 1.55;
}

.worklife-flow,
.worklife-panel,
.worklife-diary-book,
.worklife-grammar-card,
.worklife-letter-paper {
  display: grid;
  gap: 14px;
}

.worklife-flow {
  gap: 18px;
}

.worklife-panel {
  padding: 18px;
  border: 1px solid rgba(25, 87, 70, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.worklife-panel-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  font-size: 19px;
}

.worklife-panel-title span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border-radius: 14px;
  background: #dff1ed;
  color: #124d40;
  font-size: 13px;
  font-weight: 900;
}

.worklife-job-grid,
.worklife-opinion-grid,
.worklife-grammar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

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

.worklife-job-card,
.worklife-opinion,
.worklife-time-card,
.worklife-day,
.worklife-grammar-example,
.worklife-letter-line {
  border: 1px solid rgba(21, 79, 65, 0.18);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.worklife-job-card:hover,
.worklife-opinion:hover,
.worklife-time-card:hover,
.worklife-day:hover,
.worklife-grammar-example:hover,
.worklife-letter-line:hover {
  transform: translateY(-2px);
  border-color: rgba(27, 123, 93, 0.45);
  box-shadow: 0 14px 28px rgba(21, 79, 65, 0.12);
}

.worklife-job-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.worklife-icon {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #173b35;
  color: #f5f0d8;
  font-size: 12px;
  font-weight: 900;
}

.worklife-job-card b,
.worklife-time-card b {
  color: #1b7b5d;
}

.worklife-job-card strong,
.worklife-opinion strong,
.worklife-time-card strong,
.worklife-grammar-example strong {
  font-size: 17px;
}

.worklife-job-card em,
.worklife-job-card small,
.worklife-opinion small,
.worklife-time-card small {
  color: var(--muted);
  font-style: normal;
}

.worklife-opinion-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.worklife-opinion,
.worklife-time-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.worklife-timeline {
  display: grid;
  gap: 10px;
}

.worklife-time-card {
  border-left: 6px solid #1b7b5d;
}

.worklife-diary-book {
  align-content: start;
  padding: 16px;
  border-radius: 16px;
  background: #f7f2df;
  border: 1px solid rgba(124, 98, 44, 0.18);
}

.worklife-diary-book h4,
.worklife-grammar-card h4 {
  margin: 0;
}

.worklife-day {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  font-family: inherit;
}

.worklife-day span {
  color: #765d1f;
  font-weight: 900;
  font-size: 12px;
}

.worklife-day strong {
  font-family: Georgia, serif;
  font-style: italic;
}

.worklife-grammar-card {
  padding: 16px;
  border-radius: 16px;
  background: #f9fbfb;
  border: 1px solid rgba(31, 68, 76, 0.16);
}

.worklife-grammar-card p {
  margin: 0;
  color: var(--muted);
}

.worklife-grammar-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(31, 68, 76, 0.1);
}

.worklife-grammar-row span {
  color: var(--muted);
}

.worklife-grammar-example {
  padding: 12px;
  background: #eaf5f2;
  color: #123f36;
}

.worklife-letter-paper {
  padding: 18px;
  border-radius: 16px;
  background: #fffdf5;
  border: 1px solid rgba(126, 108, 63, 0.2);
}

.worklife-letter-line {
  padding: 9px 12px;
  font-family: Georgia, serif;
  font-style: italic;
}

[data-theme="dark"] .worklife-lesson {
  background: linear-gradient(135deg, rgba(18, 25, 27, 0.98), rgba(27, 44, 42, 0.98));
  border-color: rgba(139, 184, 232, 0.22);
}

[data-theme="dark"] .worklife-panel,
[data-theme="dark"] .worklife-job-card,
[data-theme="dark"] .worklife-opinion,
[data-theme="dark"] .worklife-time-card,
[data-theme="dark"] .worklife-grammar-card,
[data-theme="dark"] .worklife-letter-line {
  background: rgba(30, 34, 41, 0.92);
  border-color: rgba(139, 184, 232, 0.18);
  color: var(--text);
}

[data-theme="dark"] .worklife-diary-book,
[data-theme="dark"] .worklife-letter-paper {
  background: rgba(39, 37, 30, 0.9);
  border-color: rgba(230, 199, 114, 0.18);
}

[data-theme="dark"] .worklife-panel-title span,
[data-theme="dark"] .worklife-grammar-example {
  background: rgba(139, 184, 232, 0.14);
  color: #d8eaff;
}

[data-theme="dark"] .worklife-hero p,
[data-theme="dark"] .worklife-job-card b,
[data-theme="dark"] .worklife-time-card b {
  color: #8bb8e8;
}

@media (max-width: 1100px) {
  .worklife-job-grid,
  .worklife-grammar-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .lesson-production {
    grid-template-columns: 1fr;
  }

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

  .worklife-job-grid,
  .worklife-opinion-grid,
  .worklife-grammar-grid,
  .worklife-two-col,
  .worklife-diary {
    grid-template-columns: 1fr;
  }

  .worklife-day {
    grid-template-columns: 1fr;
  }

  .worklife-panel {
    padding: 14px;
  }

  .worklife-hero h3 {
    font-size: 23px;
  }
}

/* Four-part course shell */
[hidden] {
  display: none !important;
}

.course-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 240, 232, 0.94);
  backdrop-filter: blur(16px);
}

.course-language-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.course-language-option {
  min-width: 38px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.course-language-option.active {
  background: var(--ink);
  color: white;
}

.course-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.course-brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #0b3d66);
  color: white;
  font-weight: 900;
  box-shadow: inset 8px 0 0 white, inset 13px 0 0 var(--red);
}

.course-header nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.course-header nav button,
.header-continue,
.course-primary,
.course-secondary,
.course-back-button,
.mobile-course-nav button {
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.course-header nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
}

.course-header nav button:hover,
.course-header nav button.active {
  background: var(--soft);
  color: var(--ink);
}

.header-continue,
.course-primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  padding: 0 18px;
}

.course-secondary,
.course-back-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0 16px;
}

.course-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.course-home,
.grammar-library {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 90px;
}

.course-hero,
.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 32px;
  align-items: center;
  padding: 42px;
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(10, 46, 58, 0.98), rgba(31, 111, 155, 0.88)),
    #102b35;
  color: white;
  box-shadow: var(--shadow);
}

.course-hero h1,
.library-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.course-hero > div > p:last-of-type,
.library-hero > div > p:last-of-type {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.6;
}

.course-eyebrow {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.course-hero .course-primary,
.library-hero .course-primary {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #2c280f;
}

.course-hero .course-secondary {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.course-summary {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.course-summary span,
.course-summary small {
  color: rgba(255, 255, 255, 0.78);
}

.course-summary strong {
  font-size: 30px;
}

.course-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.course-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
}

.course-section,
.grammar-section {
  padding-top: 54px;
}

.course-section-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 20px;
}

.course-section-head h2 {
  margin-top: 6px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
}

.course-section-head > p {
  max-width: 480px;
  color: var(--muted);
  line-height: 1.55;
}

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

.course-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 16px;
  min-height: 410px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(22, 32, 31, 0.07);
}

.course-card-current {
  border-color: rgba(22, 128, 90, 0.52);
  box-shadow: 0 16px 38px rgba(22, 128, 90, 0.13);
}

.course-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.course-number {
  color: var(--blue);
  font-weight: 950;
}

.course-status {
  border-radius: 999px;
  background: #e1f3eb;
  color: #106545;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.course-status-planned {
  background: var(--soft);
  color: var(--muted);
}

.course-card h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.08;
}

.course-card p,
.course-card li {
  color: var(--muted);
  line-height: 1.5;
}

.course-card ul {
  display: grid;
  align-content: start;
  gap: 7px;
  margin: 0;
  padding-left: 19px;
}

.unit-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0 0 10px;
  overflow-x: auto;
  list-style: none;
}

.unit-list li {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.unit-list li span {
  color: var(--green);
  font-weight: 950;
}

.unit-list li strong {
  font-size: 19px;
  line-height: 1.15;
}

.unit-list li small {
  color: var(--muted);
  line-height: 1.45;
}

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

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

.grammar-grid details {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.grammar-grid summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.grammar-grid summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.grammar-grid details p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.grammar-grid details p strong {
  color: var(--ink);
}

.course-source-note {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #cfe2db;
  border-radius: 10px;
  background: #f4faf7;
}

.course-source-note h3 {
  margin: 0;
  color: var(--green);
  font-size: 18px;
}

.course-source-note p {
  max-width: 920px;
  color: var(--muted);
  line-height: 1.6;
}

.course-source-note div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-source-note a {
  border-radius: 999px;
  background: white;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  padding: 7px 11px;
  text-decoration: none;
}

.course-source-note a:hover {
  text-decoration: underline;
}

.course-back-button {
  margin-left: auto;
}

.mobile-course-nav {
  display: none;
}

@media (max-width: 1100px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 72px;
  }

  .course-header {
    grid-template-columns: 1fr auto;
    min-height: 62px;
    padding: 0 16px;
  }

  .course-header nav,
  .header-continue {
    display: none;
  }

  .course-language-option {
    min-width: 40px;
    min-height: 40px;
  }

  .course-home,
  .grammar-library {
    width: calc(100% - 32px);
    padding: 20px 0 70px;
  }

  .course-hero,
  .library-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 26px 22px;
  }

  .course-hero h1,
  .library-hero h1 {
    font-size: 44px;
  }

  .course-hero > div > p:last-of-type,
  .library-hero > div > p:last-of-type {
    font-size: 16px;
  }

  .course-hero-actions,
  .course-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .course-hero-actions button,
  .course-section-head button {
    width: 100%;
  }

  .course-grid,
  .grammar-grid {
    grid-template-columns: 1fr;
  }

  .course-card {
    min-height: 0;
  }

  .unit-test-options {
    grid-template-columns: 1fr;
  }

  .unit-test-head,
  .scenario-completion {
    align-items: stretch;
    flex-direction: column;
  }

  .scenario-completion button {
    width: 100%;
  }

  .unit-list {
    grid-template-columns: repeat(7, 82vw);
    scroll-snap-type: x mandatory;
  }

  .unit-list li {
    scroll-snap-align: start;
  }

  .course-back-button {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .mobile-course-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 30px rgba(22, 32, 31, 0.1);
    backdrop-filter: blur(16px);
  }

  .mobile-course-nav button {
    display: grid;
    min-height: 52px;
    place-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 4px;
    font-size: 11px;
  }

  .mobile-course-nav button span {
    color: var(--ink);
    font-size: 17px;
    line-height: 1;
  }

  .mobile-course-nav button small {
    font: inherit;
  }

  .mobile-course-nav button.active {
    border-radius: 8px;
    background: var(--soft);
    color: var(--green);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .phrase-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

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

  .trainer-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .card-grid,
  .trainer-panel,
  .phrase-list,
  .comic-frames,
  .scenario-list,
  .daily-plan-list {
    grid-template-columns: 1fr;
  }

  .learning-map-head,
  .comic-head {
    display: grid;
    align-items: start;
  }

  .scenario-card:nth-child(odd) {
    border-right: 0;
  }

  .scenario-head {
    display: grid;
    align-items: start;
  }

  .scenario-visual {
    padding: 16px;
  }

  .clock-lesson-head {
    display: grid;
  }

  .clock-lesson-head p {
    font-size: 19px;
  }

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

  .typing-row,
  .word-bank-list,
  .dictionary-search,
  .dictionary-results {
    grid-template-columns: 1fr;
  }

  .dictionary-head {
    display: grid;
    align-items: start;
  }

  .sidebar,
  .phrase-panel,
  .study-area {
    padding: 20px;
  }

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

  .word-card span {
    font-size: 40px;
  }

  .hero-copy strong {
    font-size: 34px;
  }
}
