:root {
  --ink: #18232d;
  --muted: #60707b;
  --line: #dbe2e5;
  --surface: #ffffff;
  --soft: #f3f6f5;
  --green: #177245;
  --green-dark: #105b36;
  --red: #b84235;
  --amber: #9a6615;
  --focus: #166b8c;
  --shadow: 0 1px 3px rgba(24, 35, 45, 0.08);
  font-family: Inter, "Noto Sans", Arial, sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
}

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

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

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
}

.account-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.signout {
  min-height: 42px;
  padding: 8px 14px;
}

.workspace {
  max-width: 1280px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
}

.workspace.auth-mode {
  display: block;
}

.workspace.auth-mode .content {
  padding: 0;
}

.side-panel {
  padding: 34px 24px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.goal-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 30px;
  font-size: 26px;
  line-height: 1.2;
}

.progress-summary {
  margin-bottom: 30px;
}

.summary-number {
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
}

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

.wide {
  width: 100%;
}

.primary,
.secondary {
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
}

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

.primary:hover {
  background: var(--green-dark);
}

.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.secondary:hover {
  background: var(--soft);
}

.content {
  padding: 28px;
}

.auth-screen {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 440px);
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  color: #fff;
  background: #263b44 url("/assets/travel-banner.png") center / cover no-repeat;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(18, 30, 36, 0.85), rgba(18, 30, 36, 0.08));
}

.auth-visual-copy {
  position: relative;
  max-width: 470px;
}

.auth-visual h1 {
  margin: 10px 0 12px;
  font-size: 40px;
}

.auth-visual p {
  margin: 0;
  color: #e2e9e7;
  font-size: 18px;
  line-height: 1.45;
}

.auth-panel {
  padding: 50px 38px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel h2 {
  margin: 0 0 22px;
  font-size: 27px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: var(--surface);
  color: var(--muted);
}

.auth-tab.active {
  background: #eaf3ef;
  color: var(--green-dark);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.field input:focus {
  border-color: var(--focus);
  outline: 2px solid rgba(22, 107, 140, 0.15);
}

.auth-note {
  margin: 19px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 14px;
}

.auth-error {
  margin: 0;
}

.banner {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 28px;
  background: #263b44 url("/assets/travel-banner.png") right center / cover no-repeat;
}

.banner-copy {
  position: absolute;
  inset: 0;
  max-width: 460px;
  padding: 28px 30px;
  color: #fff;
  background: linear-gradient(90deg, rgba(18, 30, 36, 0.92) 0%, rgba(18, 30, 36, 0.78) 60%, transparent 100%);
}

.banner h2 {
  margin: 5px 0 10px;
  font-size: 28px;
  line-height: 1.2;
}

.banner p {
  margin: 0;
  max-width: 300px;
  color: #e2e9e7;
}

.course-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
  padding: 20px 23px;
  border: 1px solid #cfe0d7;
  border-radius: 8px;
  background: var(--surface);
}

.course-now-copy {
  flex: 1;
}

.course-now h2 {
  margin: 7px 0 5px;
  font-size: 20px;
}

.course-now p {
  margin: 0 0 14px;
  color: var(--muted);
}

.course-progress {
  max-width: 430px;
  height: 7px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: #e3e9e7;
}

.course-progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.course-actions {
  display: flex;
  gap: 9px;
}

.review-panel {
  min-height: 88px;
  margin-bottom: 27px;
  padding: 17px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.review-panel.has-errors {
  border-color: #e2cca4;
  background: #fffaf2;
}

.review-panel h2 {
  margin: 6px 0 4px;
  font-size: 18px;
}

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

.review-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.profile-head h2 {
  margin: 8px 0 5px;
  font-size: 29px;
}

.profile-head p {
  margin: 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 11px;
  margin-bottom: 19px;
}

.profile-stats article {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-stats span,
.profile-stats small {
  display: block;
  color: var(--muted);
}

.profile-stats strong {
  display: block;
  margin: 12px 0 7px;
  font-size: 27px;
}

.vocabulary-panel {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 340px;
  gap: 14px;
  margin-bottom: 16px;
}

.vocabulary-target,
.profile-phrases,
.known-words {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.vocabulary-target p {
  line-height: 1.5;
}

.vocabulary-meter {
  height: 9px;
  margin: 20px 0 9px;
  border-radius: 10px;
  overflow: hidden;
  background: #e3e9e7;
}

.vocabulary-meter span {
  display: block;
  height: 100%;
  min-width: 0;
  background: var(--green);
}

.profile-phrases h3,
.known-words h2 {
  margin: 0 0 15px;
  font-size: 19px;
}

.profile-phrases ul {
  max-height: 210px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.profile-phrases li {
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0f1;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.word-chip {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 10px;
  border-radius: 5px;
  background: #eef3f1;
  color: var(--green-dark);
}

.eyebrow {
  color: #83d1aa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 15px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
}

.modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.module {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.module h3 {
  font-size: 17px;
  margin: 0 0 7px;
}

.module p {
  min-height: 42px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.4;
}

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  display: inline-flex;
  height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 14px;
  background: #eef3f1;
  color: var(--muted);
  font-size: 13px;
}

.history {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

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

.program-head h2 {
  margin: 8px 0;
  font-size: 27px;
}

.program-head p {
  margin: 0;
  color: var(--muted);
}

.program-layout {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

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

.week {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.week header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.week h3,
.year-map h3 {
  margin: 6px 0 0;
  font-size: 18px;
}

.week p {
  margin: 9px 0 16px;
}

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

.lesson-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.lesson-row:hover {
  border-color: var(--focus);
}

.lesson-status {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef3f1;
  font-weight: 700;
  color: var(--muted);
}

.lesson-status.done {
  color: #fff;
  background: var(--green);
}

.lesson-copy {
  flex: 1;
  min-width: 0;
}

.lesson-copy strong,
.lesson-copy small {
  display: block;
}

.lesson-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.control-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #eaf3ef;
  color: var(--green-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  vertical-align: middle;
}

.lesson-score {
  color: var(--green-dark);
  font-weight: 700;
}

.year-map {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.year-map h3 {
  margin: 0 0 15px;
}

.month {
  min-height: 53px;
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f1;
}

.month:last-child {
  border-bottom: 0;
}

.month-number {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  background: #eaf3ef;
  color: var(--green-dark);
  font-weight: 700;
}

.month strong,
.month small {
  display: block;
}

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

.month small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.3;
}

.month.locked {
  opacity: 0.58;
}

.lesson-panel {
  max-width: 820px;
  margin: 12px auto 0;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lesson-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.lesson-head h2 {
  margin: 8px 0 7px;
  font-size: 27px;
}

.lesson-head p {
  margin: 0;
  color: var(--muted);
}

.lesson-material {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
  border-radius: 7px;
  background: var(--soft);
}

.lesson-material h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.lesson-material ul {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.phrases li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speak-phrase {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--green-dark);
}

.stat {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
}

.test-panel,
.result-panel {
  max-width: 760px;
  margin: 16px auto 0;
}

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

.meter {
  flex: 1;
  max-width: 280px;
  height: 7px;
  margin-left: 18px;
  background: #e3e9e7;
  border-radius: 10px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.question {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.question h2 {
  font-size: 23px;
  line-height: 1.35;
  margin: 19px 0 8px;
}

.translation {
  margin: 0 0 22px;
  color: var(--muted);
}

.listen {
  min-width: 46px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  font-size: 20px;
}

.answers {
  display: grid;
  gap: 10px;
}

.choice {
  padding: 13px 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.choice:hover:not(:disabled) {
  border-color: var(--focus);
}

.choice.selected {
  border-color: var(--focus);
  background: #e9f2f5;
}

.text-answer {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.feedback {
  padding: 15px;
  margin-top: 20px;
  border-radius: 6px;
  line-height: 1.45;
}

.feedback.correct {
  background: #e7f5ed;
  color: #155d39;
}

.feedback.wrong {
  background: #fcebe8;
  color: #87332c;
}

.feedback strong {
  display: block;
  margin-bottom: 4px;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 20px 0 24px;
}

.score strong {
  font-size: 64px;
  color: var(--green);
}

.level {
  padding: 18px;
  background: #eaf3ef;
  border-left: 4px solid var(--green);
  margin-bottom: 20px;
}

.level h2 {
  margin: 0 0 8px;
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 16px;
  }

  .workspace {
    display: block;
  }

  .auth-screen {
    display: block;
  }

  .auth-visual {
    min-height: 230px;
    padding: 22px 20px;
  }

  .auth-visual h1 {
    margin: 7px 0 8px;
    font-size: 28px;
  }

  .auth-visual p {
    font-size: 15px;
  }

  .auth-panel {
    padding: 27px 20px 34px;
  }

  .account-controls {
    gap: 6px;
  }

  .user-name {
    display: none;
  }

  .side-panel {
    padding: 18px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-panel h1 {
    margin: 7px 0 14px;
    font-size: 22px;
  }

  .progress-summary {
    display: inline-block;
    vertical-align: middle;
    margin: 0 16px 0 0;
  }

  .summary-number {
    font-size: 30px;
  }

  .side-panel .primary {
    width: auto;
    vertical-align: middle;
  }

  .content {
    padding: 16px;
  }

  .banner {
    min-height: 170px;
  }

  .banner-copy {
    padding: 20px;
  }

  .banner h2 {
    font-size: 23px;
  }

  .modules,
  .history {
    grid-template-columns: 1fr;
  }

  .course-now {
    display: block;
  }

  .course-actions {
    margin-top: 17px;
  }

  .review-panel {
    display: block;
  }

  .review-panel button {
    margin-top: 15px;
  }

  .profile-head {
    display: block;
  }

  .profile-head button {
    margin-top: 16px;
  }

  .profile-stats,
  .vocabulary-panel {
    grid-template-columns: 1fr;
  }

  .program-head {
    display: block;
  }

  .program-head .secondary {
    margin-top: 16px;
  }

  .program-layout {
    display: flex;
    flex-direction: column;
  }

  .weeks,
  .year-map {
    width: 100%;
  }

  .lesson-panel {
    padding: 18px;
  }

  .lesson-head {
    display: block;
  }

  .lesson-head .pill {
    margin-top: 14px;
  }

  .lesson-material {
    grid-template-columns: 1fr;
  }

  .question {
    padding: 18px;
  }

  .question h2 {
    font-size: 20px;
  }
}
