:root {
  color-scheme: light;
  --ink: #171814;
  --ink-soft: #44463e;
  --paper: #eee8da;
  --paper-raised: #f8f4ea;
  --paper-deep: #ded5c3;
  --paper-dark: #cbc0ad;
  --line: rgba(23, 24, 20, 0.22);
  --line-soft: rgba(23, 24, 20, 0.1);
  --line-strong: rgba(23, 24, 20, 0.72);
  --signal: #e2b714;
  --signal-soft: #f5df70;
  --teal: #1f776d;
  --coral: #b95d45;
  --blue: #496b9b;
  --danger: #a3473d;
  --shadow: 0 24px 70px rgba(44, 38, 26, 0.13);
  --shadow-tight: 0 12px 34px rgba(44, 38, 26, 0.11);
  --radius: 3px;
  --font-ui: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(23, 24, 20, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 20, 0.032) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
  mix-blend-mode: multiply;
}

::selection {
  background: var(--signal-soft);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

img,
canvas {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 72px;
  border-bottom: 1px solid rgba(248, 244, 234, 0.15);
  background: rgba(23, 24, 20, 0.96);
  padding: 10px clamp(18px, 3.5vw, 54px);
  color: var(--paper-raised);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(248, 244, 234, 0.28);
  border-radius: 50%;
  background: var(--paper-raised);
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
}

.brand > span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.06em;
}

.brand small {
  color: rgba(248, 244, 234, 0.48);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

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

.nav {
  justify-content: flex-end;
}

.nav-link {
  position: relative;
  padding: 8px 6px;
  color: rgba(248, 244, 234, 0.7);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.nav-link::after {
  position: absolute;
  right: 6px;
  bottom: 2px;
  left: 6px;
  height: 1px;
  background: var(--signal);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.progress-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border-left: 1px solid rgba(248, 244, 234, 0.2);
  margin-left: 4px;
  padding: 5px 4px 5px 14px;
  color: rgba(248, 244, 234, 0.56);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.progress-chip b {
  color: var(--signal);
  font-family: var(--font-display);
  font-size: 19px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.nav-link:focus-visible,
.text-link:focus-visible,
.text-button:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.button-ink {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-raised);
}

.button-ink:hover {
  background: #292b24;
}

.button-signal {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--ink);
}

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

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: inherit;
}

.button-ghost:hover {
  border-color: var(--line-strong);
  background: rgba(248, 244, 234, 0.5);
}

.button-compact {
  min-height: 38px;
  padding: 8px 13px;
}

.button-wide {
  width: 100%;
}

.text-link,
.text-button {
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  padding: 3px 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.map-coordinate {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.page,
.atlas-page {
  width: min(1540px, calc(100% - clamp(28px, 5vw, 80px)));
  margin: 0 auto;
}

.page {
  padding: clamp(28px, 5vw, 72px) 0 96px;
}

.atlas-page {
  padding-bottom: 80px;
}

.atlas-page--map-only {
  padding-top: clamp(18px, 3vw, 36px);
  padding-bottom: clamp(18px, 3vw, 36px);
}

.account-page {
  min-height: calc(100vh - 86px);
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.7fr);
  gap: clamp(32px, 7vw, 110px);
  align-items: center;
  min-height: 620px;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  padding: clamp(32px, 7vw, 96px);
  box-shadow: var(--shadow);
}

.account-hero h1 {
  max-width: 820px;
  margin: 16px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 1;
}

.account-hero > div > p,
.account-form > p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.account-form {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(248, 244, 234, 0.18);
  background: var(--ink);
  padding: clamp(24px, 4vw, 44px);
  color: var(--paper-raised);
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(248, 244, 234, 0.22);
}

.auth-mode-switch button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: rgba(248, 244, 234, 0.58);
  font-weight: 750;
}

.auth-mode-switch button + button {
  border-left: 1px solid rgba(248, 244, 234, 0.22);
}

.auth-mode-switch button.is-active {
  background: var(--signal);
  color: var(--ink);
}

.account-warning {
  display: grid;
  gap: 5px;
  max-width: 680px;
  border-left: 4px solid var(--signal);
  margin-top: 28px;
  padding: 12px 16px;
  background: rgba(226, 183, 20, 0.1);
  color: var(--ink-soft);
  line-height: 1.6;
}

.account-warning b {
  color: var(--ink);
}

.dashboard-page {
  display: grid;
  gap: 28px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  padding: clamp(32px, 6vw, 78px);
  color: var(--paper-raised);
  box-shadow: var(--shadow);
}

.dashboard-hero h1 {
  margin: 14px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 94px);
  font-weight: 520;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.dashboard-hero p {
  color: rgba(248, 244, 234, 0.62);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  border: 1px solid rgba(248, 244, 234, 0.18);
}

.dashboard-kpis div {
  display: grid;
  gap: 8px;
  padding: 24px;
}

.dashboard-kpis div + div {
  border-left: 1px solid rgba(248, 244, 234, 0.18);
}

.dashboard-kpis dt {
  color: rgba(248, 244, 234, 0.48);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.dashboard-kpis dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 42px;
}

.dashboard-section {
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  padding: clamp(24px, 4vw, 48px);
}

.dashboard-section > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.dashboard-section h2,
.purchase-history h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 520;
}

.dashboard-section > header p {
  max-width: 560px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

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

.owned-course-card {
  display: grid;
  gap: 16px;
  min-height: 360px;
  border: 1px solid var(--line-strong);
  padding: clamp(22px, 3vw, 36px);
  transition: transform 180ms ease, filter 180ms ease;
}

.owned-course-card.is-owned {
  border-top: 8px solid var(--course-accent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--course-accent) 15%, var(--paper-raised)), var(--paper-raised) 48%);
}

.owned-course-card.is-unowned {
  border-top: 8px solid #9b9b92;
  background: #e1dfd7;
  filter: grayscale(1);
  color: #77776f;
}

.owned-course-card:hover {
  transform: translateY(-3px);
}

.owned-course-card header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.owned-course-card h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
}

.owned-course-card p {
  margin: 0;
  color: inherit;
  line-height: 1.65;
}

.course-progress-line {
  position: relative;
  height: 5px;
  background: rgba(23, 24, 20, 0.13);
}

.course-progress-line i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: var(--course-accent);
}

.owned-course-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: auto 0 0;
}

.owned-course-card dl div {
  display: grid;
  gap: 4px;
}

.owned-course-card dt {
  font-size: 10px;
  color: var(--ink-soft);
}

.owned-course-card dd {
  margin: 0;
  font-weight: 800;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.purchase-history {
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  padding: clamp(24px, 4vw, 44px);
}

.purchase-history > div {
  display: grid;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.purchase-history section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.purchase-history span,
.purchase-history small {
  display: block;
}

.purchase-history small,
.purchase-history time,
.dashboard-empty {
  color: var(--ink-soft);
}

.account-form h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
}

.account-form label {
  display: grid;
  gap: 8px;
  color: rgba(248, 244, 234, 0.65);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.account-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(248, 244, 234, 0.28);
  background: rgba(248, 244, 234, 0.06);
  padding: 12px 14px;
  color: var(--paper-raised);
  font-size: 16px;
}

.device-list {
  display: grid;
  gap: 1px;
  background: rgba(248, 244, 234, 0.16);
}

.device-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--ink);
  padding: 14px 0;
}

.device-list span,
.device-list small {
  display: block;
}

.reader-body[data-account-watermark] {
  position: relative;
}

.account-watermark-grid {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  grid-auto-rows: 240px;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.account-watermark-grid span {
  color: rgba(23, 24, 20, 0.075);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  transform: rotate(-24deg);
  white-space: nowrap;
}

.reader-body > :not(.account-watermark-grid) {
  position: relative;
  z-index: 2;
}

@media (max-width: 780px) {
  .account-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 20px;
  }

  .dashboard-hero,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpis,
  .owned-course-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpis div + div {
    border-top: 1px solid rgba(248, 244, 234, 0.18);
    border-left: 0;
  }

  .dashboard-section > header {
    display: grid;
  }
}

.atlas-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(30px, 7vw, 110px);
  align-items: end;
  min-height: 520px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: clamp(48px, 7vw, 104px) clamp(24px, 6vw, 92px) clamp(42px, 6vw, 84px);
}

.atlas-title-block {
  max-width: 920px;
}

.atlas-title-block h1 {
  margin: 20px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(52px, 7.4vw, 112px);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.94;
}

.atlas-title-block h1 em {
  color: var(--signal);
  font-weight: 600;
  font-style: normal;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.08em;
}

.atlas-title-block > p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: clamp(17px, 1.7vw, 25px);
  line-height: 1.72;
}

.atlas-actions {
  margin-top: 34px;
}

.atlas-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.atlas-proof > div {
  min-height: 135px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 21px;
}

.atlas-proof b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 62px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.atlas-proof span {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.route-dock {
  padding: clamp(52px, 6vw, 88px) 0;
}

.route-dock > header,
.map-list > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.route-dock h2,
.map-list h2,
.conversion-band h2,
.course-hero h1,
.redeem-hero h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 550;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.route-dock > header p,
.map-list > header p {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.route-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  min-height: 235px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 244, 234, 0.48);
  padding: 20px;
  color: var(--ink);
  text-align: left;
  transition: background 180ms ease, transform 180ms ease;
}

.route-card::before {
  position: absolute;
  top: -1px;
  right: -1px;
  left: -1px;
  height: 4px;
  background: var(--signal);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.route-card:hover,
.route-card.is-active {
  z-index: 1;
  background: var(--paper-raised);
  box-shadow: var(--shadow-tight);
  transform: translateY(-5px);
}

.route-card:hover::before,
.route-card.is-active::before {
  transform: scaleX(1);
}

.route-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
}

.route-card-top small,
.route-card-top b,
.route-card > small {
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.route-card > strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.route-card > span:not(.route-card-top):not(.route-progress) {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.route-progress,
.reader-route i {
  position: relative;
  display: block;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.route-progress i,
.reader-route i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: var(--signal);
  content: "";
}

.atlas-shell {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(440px, 1fr) 330px;
  min-height: min(790px, calc(100vh - 86px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.map-controls {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(248, 244, 234, 0.14);
  background: var(--ink);
  padding: 24px 20px;
  color: var(--paper-raised);
}

.map-controls .map-coordinate {
  color: rgba(248, 244, 234, 0.45);
}

.control-heading h2 {
  margin: 8px 0 24px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(248, 244, 234, 0.25);
}

.mode-switch button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: rgba(248, 244, 234, 0.55);
  font-size: 11px;
  font-weight: 700;
}

.mode-switch button + button {
  border-left: 1px solid rgba(248, 244, 234, 0.25);
}

.mode-switch button.is-active {
  background: var(--signal);
  color: var(--ink);
}

.map-search,
.layer-switches {
  display: grid;
  gap: 9px;
  border: 0;
  border-top: 1px solid rgba(248, 244, 234, 0.16);
  margin: 22px 0 0;
  padding: 20px 0 0;
}

.map-search > span,
.layer-switches legend {
  color: rgba(248, 244, 234, 0.48);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.map-search input,
.sidebar-search input,
.redeem-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(248, 244, 234, 0.22);
  border-radius: 0;
  background: rgba(248, 244, 234, 0.06);
  padding: 11px 12px;
  color: inherit;
  font-size: 12px;
}

.map-search input::placeholder {
  color: rgba(248, 244, 234, 0.35);
}

.layer-switches label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: rgba(248, 244, 234, 0.75);
  font-size: 11px;
}

.layer-switches input {
  position: absolute;
  opacity: 0;
}

.layer-switches label span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(248, 244, 234, 0.4);
}

.layer-switches input:checked + span {
  border-color: var(--signal);
  background: var(--signal);
  box-shadow: inset 0 0 0 3px var(--ink);
}

.map-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 8px;
  border-top: 1px solid rgba(248, 244, 234, 0.16);
  margin-top: 20px;
  padding-top: 20px;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(248, 244, 234, 0.58);
  font-size: 9px;
}

.legend-dot {
  display: inline-grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border: 1px solid rgba(248, 244, 234, 0.55);
  border-radius: 50%;
  color: var(--ink);
  font-size: 8px;
  font-style: normal;
}

.legend-dot.is-current { border: 3px double var(--signal); }
.legend-dot.is-mastered { background: var(--signal); }
.legend-dot.is-review { background: var(--coral); color: white; }
.legend-dot.is-locked { border-style: dashed; opacity: 0.55; }

.control-note {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(248, 244, 234, 0.16);
  margin-top: auto;
  padding-top: 20px;
  color: rgba(248, 244, 234, 0.44);
  font-size: 9px;
  line-height: 1.7;
}

.control-note b {
  color: rgba(248, 244, 234, 0.7);
  letter-spacing: 0.12em;
}

.map-controls .text-button {
  align-self: flex-start;
  margin-top: 18px;
  color: rgba(248, 244, 234, 0.68);
}

.map-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.64), transparent 58%),
    var(--paper);
}

.map-stage-head {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(238, 232, 218, 0.9);
  padding: 13px 18px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
  backdrop-filter: blur(8px);
}

.map-stage-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-signal {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 5px rgba(226, 183, 20, 0.15);
  animation: signal 2.4s ease-in-out infinite;
}

.map-viewport {
  width: 100%;
  height: 100%;
  min-height: 760px;
  touch-action: none;
}

.knowledge-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  cursor: grab;
  user-select: none;
}

.knowledge-map-svg.is-panning {
  cursor: grabbing;
}

.map-world {
  transform-origin: 0 0;
}

.map-paper {
  fill: transparent;
}

.map-contour {
  fill: none;
  stroke: rgba(23, 24, 20, 0.065);
  stroke-width: 1;
}

.map-equator {
  stroke: rgba(23, 24, 20, 0.16);
  stroke-dasharray: 4 8;
  stroke-width: 1;
}

.map-continent-label {
  fill: rgba(23, 24, 20, 0.36);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.map-area {
  --area-color: #777;
}

.map-area-shape {
  fill: var(--area-color);
  fill-opacity: 0.08;
  stroke: var(--area-color);
  stroke-dasharray: 2 8;
  stroke-opacity: 0.35;
  stroke-width: 1;
}

.map-area-index {
  fill: var(--area-color);
  fill-opacity: 0.5;
  font-family: var(--font-display);
  font-size: 17px;
}

.map-area-label {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.map-edge {
  fill: none;
  stroke: rgba(23, 24, 20, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-edge-semantic {
  stroke: rgba(73, 107, 155, 0.36);
  stroke-dasharray: 3 6;
}

.map-edge.is-route-context {
  stroke-opacity: 0.14;
}

.map-route-halo,
.map-route-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.map-route-halo {
  stroke: rgba(226, 183, 20, 0.2);
  stroke-width: 9;
}

.map-route-line {
  stroke: var(--signal);
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-width: 2.5;
  animation: draw-route 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.map-node {
  --node-color: #777;
  cursor: pointer;
  opacity: 1;
  transition: opacity 180ms ease;
}

.map-node-focus {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1;
}

.map-node-dot {
  fill: var(--paper-raised);
  stroke: var(--node-color);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transition: fill 160ms ease, stroke-width 160ms ease;
}

.map-node-code {
  fill: rgba(23, 24, 20, 0.68);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.map-node-mark,
.map-node-lock {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.map-node-symbol {
  fill: white;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
}

.map-node.status-mastered .map-node-dot {
  fill: var(--signal);
  stroke: var(--ink);
}

.map-node.status-review .map-node-dot {
  fill: var(--coral);
  stroke: var(--coral);
}

.map-node.status-learning .map-node-dot {
  fill: var(--node-color);
  fill-opacity: 0.32;
}

.map-node.is-locked .map-node-dot {
  fill: var(--paper);
  stroke-dasharray: 2 2;
  opacity: 0.75;
}

.map-node.is-on-route .map-node-focus,
.map-node.is-selected .map-node-focus,
.map-node:focus .map-node-focus {
  stroke: var(--signal);
  stroke-opacity: 0.9;
  stroke-width: 2;
}

.map-node.is-selected .map-node-dot,
.map-node:hover .map-node-dot,
.map-node:focus .map-node-dot {
  fill: var(--ink);
  stroke: var(--signal);
  stroke-width: 3;
}

.map-node.is-selected .map-node-code,
.map-node:hover .map-node-code,
.map-node:focus .map-node-code {
  fill: var(--ink);
  font-weight: 900;
}

.map-node.is-route-dimmed,
.map-node.is-search-dimmed {
  opacity: 0.14;
}

.map-node.is-search-match .map-node-focus {
  fill: rgba(226, 183, 20, 0.22);
  stroke: var(--signal);
}

.map-inspector {
  position: relative;
  z-index: 3;
  min-width: 0;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--paper-raised);
  padding: 28px 24px;
}

.inspector-empty {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
}

.inspector-empty h2,
.inspector-node h2 {
  margin: 16px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(29px, 2.5vw, 42px);
  font-weight: 550;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.inspector-empty p,
.inspector-lead,
.unlock-note {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.inspector-node {
  --node-accent: var(--signal);
}

.inspector-node::before {
  display: block;
  width: 56px;
  height: 5px;
  margin-bottom: 22px;
  background: var(--node-accent);
  content: "";
}

.inspector-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.access-tag {
  border: 1px solid var(--line);
  padding: 4px 7px;
  color: var(--teal);
}

.access-tag.is-locked {
  color: var(--danger);
}

.node-facts {
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.node-facts > div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 0;
}

.node-facts dt {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.node-facts dd {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  margin-right: 7px;
}

.status-dot.status-mastered { border-color: var(--signal); background: var(--signal); }
.status-dot.status-learning { border-color: var(--teal); background: var(--teal); }
.status-dot.status-review { border-color: var(--coral); background: var(--coral); }

.inspector-section {
  border-left: 2px solid var(--node-accent);
  margin: 24px 0;
  padding-left: 14px;
}

.inspector-section small {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.inspector-section ul,
.locked-value ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 17px;
  font-size: 11px;
  line-height: 1.55;
}

.route-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0;
}

.route-badges span {
  border: 1px solid var(--line);
  padding: 5px 7px;
  color: var(--ink-soft);
  font-size: 8px;
}

.inspector-node .text-link {
  display: table;
  margin: 18px auto 0;
}

.map-list {
  display: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: clamp(34px, 5vw, 70px);
}

.map-list.is-open {
  display: block;
}

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

.map-list-group {
  --area-color: #777;
  border-top: 2px solid var(--area-color);
}

.map-list-group > header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.map-list-group h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
}

.map-list-group header span,
.map-list-group header small {
  color: var(--ink-soft);
  font-size: 9px;
}

.map-list-group > div {
  display: grid;
}

.map-list-group button {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 9px 0;
  color: var(--ink);
  text-align: left;
}

.map-list-group button:hover {
  background: rgba(248, 244, 234, 0.8);
}

.map-list-group button span,
.map-list-group button small {
  color: var(--ink-soft);
  font-size: 9px;
}

.map-list-group button strong {
  font-size: 11px;
}

.conversion-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin: clamp(58px, 8vw, 110px) 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: clamp(34px, 5vw, 70px) clamp(18px, 4vw, 54px);
}

.conversion-band h2 {
  max-width: 850px;
}

.conversion-band p {
  max-width: 760px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.course-hero,
.redeem-hero {
  border-top: 4px solid var(--course-accent, var(--signal));
  border-bottom: 1px solid var(--line-strong);
  padding: clamp(34px, 6vw, 80px) clamp(18px, 5vw, 70px);
}

.course-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.55fr);
  gap: 50px;
  align-items: end;
}

.course-hero h1 {
  margin-top: 22px;
  font-size: clamp(52px, 8vw, 104px);
}

.course-hero p,
.redeem-hero p {
  max-width: 760px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.7;
}

.course-hero dl {
  border-top: 1px solid var(--line-strong);
  margin: 0;
}

.course-hero dl > div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.course-hero dt {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.course-hero dd {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.course-hero .row {
  margin-top: 32px;
}

.course-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 38px;
  margin-top: 42px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  border-top: 2px solid var(--course-accent, var(--signal));
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: rgba(248, 244, 234, 0.76);
}

.sidebar-head {
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.sidebar-head h2 {
  margin: 8px 0;
  font-family: var(--font-display);
  font-size: 27px;
}

.sidebar-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.sidebar-search {
  display: block;
  padding: 14px;
}

.sidebar-search input {
  border-color: var(--line);
  background: var(--paper-raised);
  color: var(--ink);
}

.chapter-list {
  padding: 0 14px 18px;
}

.part-title {
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding: 14px 4px 8px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.05em;
  line-height: 1.45;
}

.chapter-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-left: 2px solid transparent;
  padding: 9px 5px;
  text-decoration: none;
}

.chapter-link:hover,
.chapter-link.is-active {
  border-left-color: var(--course-accent, var(--signal));
  background: rgba(255, 255, 255, 0.52);
}

.chapter-code {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.chapter-link strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-link small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
}

.chapter-link i {
  color: var(--ink-soft);
  font-size: 10px;
  font-style: normal;
}

.access-ribbon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.access-ribbon > div {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.access-ribbon b,
.access-ribbon span {
  display: block;
}

.access-ribbon b {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
}

.access-ribbon span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.course-parts {
  min-width: 0;
}

.part-section {
  margin-top: 46px;
}

.part-section > header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 15px;
}

.part-section > header > span {
  color: var(--signal);
  font-family: var(--font-display);
  font-size: 34px;
}

.part-section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 550;
}

.part-section header p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

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

.chapter-tile {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 7px 14px;
  min-height: 110px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px;
  text-decoration: none;
}

.chapter-tile:hover {
  background: var(--paper-raised);
}

.chapter-tile > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.chapter-tile strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.chapter-tile small {
  grid-column: 2;
  color: var(--ink-soft);
  font-size: 8px;
}

.chapter-tile.status-mastered {
  box-shadow: inset 3px 0 var(--signal);
}

.chapter-tile.is-locked {
  opacity: 0.68;
}

.reader-layout {
  align-items: start;
}

.reader {
  min-width: 0;
  overflow: hidden;
  border-top: 4px solid var(--course-accent, var(--signal));
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.reader-route {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  border-bottom: 1px solid rgba(248, 244, 234, 0.15);
  background: var(--ink);
  padding: 12px 24px;
  color: var(--paper-raised);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.reader-route i {
  grid-column: 1 / -1;
  background: rgba(248, 244, 234, 0.15);
}

.reader-head {
  border-bottom: 1px solid var(--line);
  padding: clamp(28px, 5vw, 70px);
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.reader-head h1 {
  max-width: 920px;
  margin: 28px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(46px, 7vw, 92px);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.reader-head > p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.7;
}

.reader-head .row {
  margin-top: 28px;
}

.reader-body {
  padding: clamp(26px, 5vw, 72px);
}

.markdown {
  max-width: 860px;
  color: #2d2e29;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.95;
}

.markdown > *:first-child {
  margin-top: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.markdown h1 { font-size: clamp(36px, 5vw, 58px); }

.markdown h2 {
  margin-top: 64px;
  border-top: 1px solid var(--line-strong);
  padding-top: 24px;
  font-size: clamp(29px, 4vw, 40px);
}

.markdown h3 {
  margin-top: 38px;
  font-size: 24px;
}

.markdown a {
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.markdown img {
  display: block;
  width: min(100%, 920px);
  height: auto;
  margin: 30px 0;
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow-tight);
}

.markdown table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 28px 0;
  background: var(--paper-raised);
  font-family: var(--font-ui);
  font-size: 12px;
}

.markdown th,
.markdown td {
  min-width: 140px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  line-height: 1.65;
  text-align: left;
  vertical-align: top;
}

.markdown th {
  background: var(--paper-deep);
  font-weight: 750;
}

.markdown code {
  border: 1px solid var(--line-soft);
  background: #e8e0cf;
  padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86em;
}

.markdown pre {
  overflow-x: auto;
  border-left: 4px solid var(--signal);
  background: var(--ink);
  padding: 20px;
  color: var(--paper-raised);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.markdown pre code {
  display: block;
  min-width: max-content;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.locked-screen {
  max-width: 860px;
  border-top: 4px solid var(--signal);
  background: var(--paper);
  padding: clamp(28px, 5vw, 60px);
}

.locked-screen h2 {
  margin: 18px 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 550;
}

.locked-screen > p {
  max-width: 700px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.locked-value {
  border-left: 2px solid var(--signal);
  margin: 28px 0;
  padding: 2px 0 2px 18px;
}

.locked-value small {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.mastery-panel,
.next-card,
.checkin-card {
  max-width: 900px;
  margin-top: 64px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
}

.mastery-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.mastery-panel h2,
.next-card h2,
.checkin-card h2,
.redeem-box h2,
.purchase-panel h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 550;
  letter-spacing: -0.035em;
}

.mastery-panel > p,
.checkin-card p,
.next-card p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.mastery-status {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  padding: 6px 9px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.mastery-status.status-mastered { border-color: var(--signal); background: var(--signal); color: var(--ink); }
.mastery-status.status-review { border-color: var(--coral); color: var(--coral); }
.mastery-status.status-learning { border-color: var(--teal); color: var(--teal); }

.mastery-checks {
  display: grid;
  margin-top: 24px;
}

.mastery-checks label {
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.mastery-checks label:last-child {
  border-bottom: 1px solid var(--line);
}

.mastery-checks input {
  position: absolute;
  opacity: 0;
}

.mastery-checks label > span {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  transition: background 160ms ease;
}

.mastery-checks label:hover > span,
.mastery-checks input:focus-visible + span {
  background: var(--paper);
}

.mastery-checks input:checked + span {
  background: rgba(226, 183, 20, 0.14);
}

.mastery-checks i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 9px;
  font-style: normal;
}

.mastery-checks input:checked + span i {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--ink);
}

.mastery-checks strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 550;
  line-height: 1.65;
}

.mastery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.review-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.review-toggle input {
  accent-color: var(--coral);
}

.next-card,
.checkin-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.checkin-card canvas {
  width: min(100%, 420px);
  margin-top: 18px;
  border: 1px solid var(--line);
}

.toast {
  min-height: 20px;
  color: var(--teal);
  font-size: 11px;
}

.redeem-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.6fr);
  gap: 60px;
  align-items: end;
  border-top-color: var(--signal);
}

.redeem-hero h1 {
  font-size: clamp(52px, 8vw, 102px);
}

.redeem-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.65fr);
  border-bottom: 1px solid var(--line);
}

.redeem-box,
.purchase-panel {
  padding: clamp(30px, 5vw, 70px);
}

.redeem-box {
  border-right: 1px solid var(--line);
  background: var(--paper-raised);
}

.redeem-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 28px;
}

.redeem-form input {
  min-height: 52px;
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.purchase-panel > p,
.purchase-panel li span {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.purchase-panel ol {
  display: grid;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin: 28px 0 0;
  padding: 24px 0 0 20px;
}

.purchase-panel li b,
.purchase-panel li span {
  display: block;
}

.purchase-panel li b {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 17px;
}

.qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.qr-card {
  border: 1px solid var(--line);
  background: white;
  padding: 14px;
}

.qr-card strong,
.qr-card img {
  display: block;
}

.qr-card img {
  width: 100%;
  margin-top: 10px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid rgba(248, 244, 234, 0.16);
  background: var(--ink);
  padding: 34px clamp(20px, 5vw, 74px);
  color: var(--paper-raised);
}

.footer > div:first-child {
  display: grid;
  gap: 5px;
}

.footer b {
  font-family: var(--font-display);
  font-size: 17px;
}

.footer span,
.footer a {
  color: rgba(248, 244, 234, 0.5);
  font-size: 9px;
  letter-spacing: 0.07em;
}

.footer > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--signal);
}

.loading-panel,
.error-panel {
  display: grid;
  min-height: 60vh;
  place-content: center;
  place-items: center;
  text-align: center;
}

.loading-panel h2,
.error-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 500;
}

@keyframes draw-route {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes signal {
  50% { box-shadow: 0 0 0 9px rgba(226, 183, 20, 0); }
}

@media (max-width: 1240px) {
  .route-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .atlas-shell {
    grid-template-columns: 220px minmax(420px, 1fr);
  }

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

  .inspector-node {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr);
    gap: 0 32px;
  }

  .inspector-node::before,
  .inspector-meta,
  .inspector-node h2,
  .inspector-lead {
    grid-column: 1;
  }

  .node-facts,
  .inspector-section,
  .route-badges,
  .unlock-note,
  .inspector-node .button,
  .inspector-node .text-link {
    grid-column: 2;
  }

  .node-facts {
    grid-row: 1 / span 4;
    margin-top: 0;
  }
}

@media (max-width: 980px) {
  .nav-link:nth-of-type(2),
  .nav-link:nth-of-type(3),
  .progress-chip {
    display: none;
  }

  .atlas-intro,
  .course-hero-grid,
  .redeem-hero,
  .redeem-grid {
    grid-template-columns: 1fr;
  }

  .atlas-intro {
    min-height: auto;
  }

  .atlas-proof {
    max-width: 620px;
  }

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

  .course-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
  }

  .part-chapter-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  .topbar {
    min-height: 64px;
    padding: 9px 14px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

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

  .brand small,
  .nav-link {
    display: none;
  }

  .nav {
    flex-wrap: nowrap;
  }

  .button {
    min-height: 44px;
  }

  .page,
  .atlas-page {
    width: min(100% - 20px, 720px);
  }

  .atlas-intro {
    gap: 42px;
    border-top: 0;
    padding: 48px 18px 42px;
  }

  .atlas-title-block h1 {
    font-size: clamp(47px, 15vw, 72px);
    letter-spacing: -0.07em;
  }

  .atlas-title-block > p {
    font-size: 17px;
  }

  .atlas-actions .button {
    width: 100%;
  }

  .atlas-proof > div {
    min-height: 104px;
    padding: 16px;
  }

  .route-dock {
    padding: 52px 0 38px;
  }

  .route-dock > header,
  .map-list > header,
  .conversion-band,
  .next-card,
  .checkin-card {
    align-items: stretch;
    flex-direction: column;
  }

  .route-dock > header,
  .map-list > header {
    display: grid;
  }

  .route-grid {
    display: flex;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    border-left: 0;
    padding: 4px 10px 24px 0;
    scroll-snap-type: x mandatory;
  }

  .route-card {
    flex: 0 0 min(82vw, 330px);
    min-height: 210px;
    border-left: 1px solid var(--line);
    scroll-snap-align: start;
  }

  .atlas-shell {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: visible;
  }

  .map-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(248, 244, 234, 0.15);
    padding: 18px;
  }

  .control-heading {
    grid-column: 1 / -1;
  }

  .control-heading h2 {
    margin-bottom: 4px;
  }

  .map-search,
  .layer-switches {
    margin-top: 0;
  }

  .layer-switches {
    padding-top: 0;
    border-top: 0;
  }

  .map-legend,
  .control-note {
    display: none;
  }

  .map-controls .text-button {
    align-self: end;
    justify-self: start;
    margin-top: 0;
  }

  .map-stage {
    min-height: min(70vh, 640px);
  }

  .map-viewport,
  .knowledge-map-svg {
    min-height: min(70vh, 640px);
  }

  .map-inspector {
    position: relative;
    bottom: auto;
    z-index: 10;
    max-height: none;
    margin-top: -28px;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 42px rgba(44, 38, 26, 0.16);
  }

  .inspector-node {
    display: block;
  }

  .node-facts,
  .inspector-section,
  .route-badges,
  .unlock-note,
  .inspector-node .button,
  .inspector-node .text-link {
    grid-column: auto;
  }

  .map-list {
    padding: 36px 16px;
  }

  .map-list-grid {
    grid-template-columns: 1fr;
  }

  .conversion-band {
    display: flex;
  }

  .conversion-band .button {
    width: 100%;
  }

  .course-hero,
  .redeem-hero {
    padding: 42px 18px;
  }

  .course-hero h1,
  .redeem-hero h1 {
    font-size: clamp(46px, 14vw, 72px);
  }

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

  .sidebar {
    position: relative;
    top: auto;
    max-height: 320px;
  }

  .reader-layout .sidebar {
    max-height: 260px;
  }

  .reader-head,
  .reader-body {
    padding: 28px 20px;
  }

  .reader-head h1 {
    font-size: clamp(40px, 12vw, 66px);
  }

  .markdown {
    font-size: 16px;
    line-height: 1.9;
  }

  .mastery-panel > header,
  .mastery-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .mastery-panel > header,
  .mastery-actions {
    display: flex;
  }

  .mastery-checks label > span {
    grid-template-columns: 38px 1fr;
    padding: 12px 2px;
  }

  .mastery-checks i {
    width: 32px;
    height: 32px;
  }

  .next-card,
  .checkin-card {
    display: flex;
  }

  .next-card .button,
  .checkin-card .row,
  .checkin-card .button {
    width: 100%;
  }

  .access-ribbon > div {
    padding: 13px 10px;
  }

  .access-ribbon b {
    font-size: 20px;
  }

  .redeem-form {
    grid-template-columns: 1fr;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .page,
  .atlas-page {
    width: calc(100% - 12px);
  }

  .button-compact {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 10px;
  }

  .atlas-intro {
    border-right: 0;
    border-left: 0;
  }

  .atlas-proof {
    grid-template-columns: 1fr 1fr;
  }

  .map-controls {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .control-heading,
  .map-search,
  .layer-switches {
    grid-column: 1;
  }

  .map-stage-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .map-stage-head {
    display: flex;
  }

  .map-list-group button {
    grid-template-columns: 48px 1fr;
  }

  .map-list-group button small {
    grid-column: 2;
  }

  .course-hero .row .button,
  .reader-head .row .button {
    width: 100%;
  }

  .access-ribbon {
    grid-template-columns: 1fr;
  }

  .part-chapter-grid {
    grid-template-columns: 1fr;
  }

  .chapter-tile {
    grid-template-columns: 50px 1fr;
  }

  .reader-route {
    padding: 12px 16px;
  }

  .mastery-checks strong {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.interview-page {
  padding-bottom: 72px;
}

.interview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: clamp(28px, 5vw, 80px);
  border: 1px solid var(--line-strong);
  border-top: 10px solid var(--ink);
  background: var(--paper-raised);
  padding: clamp(32px, 6vw, 86px);
  box-shadow: var(--shadow);
}

.interview-hero h1 {
  max-width: 820px;
  margin: 16px 0 22px;
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 94px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.interview-hero h1 em {
  color: var(--coral);
  font-style: normal;
}

.interview-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.8;
}

.interview-hero dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-self: end;
  margin: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.interview-hero dl div {
  display: grid;
  gap: 5px;
  min-height: 118px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 20px;
}

.interview-hero dt {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.interview-hero dd {
  align-self: end;
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
}

.interview-controls {
  position: sticky;
  top: 72px;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(130px, 0.8fr)) auto;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: rgba(238, 232, 218, 0.96);
  padding: 14px;
  backdrop-filter: blur(16px);
}

.interview-controls label {
  display: grid;
  gap: 5px;
}

.interview-controls label > span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.interview-controls input,
.interview-controls select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper-raised);
  padding: 9px 11px;
  color: var(--ink);
}

.practice-roadmap {
  margin-top: 56px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--paper-raised);
}

.practice-roadmap > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(26px, 4vw, 48px);
}

.practice-roadmap h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 62px);
}

.practice-roadmap > header p {
  max-width: 480px;
  margin: 0;
  color: rgba(248, 244, 234, 0.68);
  line-height: 1.7;
}

.practice-track-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid rgba(248, 244, 234, 0.24);
}

.practice-track {
  min-width: 0;
  padding: 24px 18px 28px;
}

.practice-track + .practice-track {
  border-left: 1px solid rgba(248, 244, 234, 0.24);
}

.practice-track > span {
  display: inline-block;
  background: var(--signal);
  padding: 5px 8px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
}

.practice-track h3 {
  margin: 16px 0 9px;
  font-family: var(--font-display);
  font-size: 27px;
}

.practice-track p {
  min-height: 78px;
  color: rgba(248, 244, 234, 0.64);
  font-size: 12px;
  line-height: 1.65;
}

.practice-track ol {
  margin: 18px 0 0;
  padding-left: 22px;
}

.practice-track li {
  margin-bottom: 9px;
  color: rgba(248, 244, 234, 0.46);
}

.practice-track a {
  display: inline-grid;
  grid-template-columns: 44px 1fr;
  gap: 6px;
  color: var(--paper-raised);
  font-size: 11px;
  line-height: 1.45;
  text-decoration: none;
}

.practice-track a:hover {
  color: var(--signal-soft);
}

.practice-track b {
  color: var(--signal);
}

.interview-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 60px 0 20px;
}

.interview-results-head h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 64px);
}

.interview-results-head p {
  max-width: 420px;
  color: var(--ink-soft);
}

.question-list {
  display: grid;
  gap: 18px;
}

.question-card {
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  box-shadow: var(--shadow-tight);
}

.question-card.status-fuzzy {
  border-left: 8px solid var(--coral);
}

.question-card.status-mastered {
  border-left: 8px solid var(--teal);
}

.question-card-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(160px, 0.35fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 42px);
}

.question-index {
  display: grid;
  align-content: start;
  gap: 9px;
}

.question-index span,
.question-index i {
  width: max-content;
  background: var(--ink);
  padding: 6px 9px;
  color: var(--paper-raised);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.question-index i {
  background: var(--signal);
  color: var(--ink);
}

.question-heading h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 44px);
  line-height: 1.16;
}

.question-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.question-tags {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.question-tags span {
  border: 1px solid var(--line);
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 700;
}

.question-answer {
  border-top: 1px solid var(--line);
}

.question-answer summary {
  padding: 16px clamp(22px, 4vw, 42px);
  font-weight: 800;
  list-style-position: inside;
}

.question-answer[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--signal-soft);
}

.answer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
}

.answer-grid section {
  min-width: 0;
  padding: clamp(22px, 3vw, 38px);
}

.answer-grid section + section {
  border-left: 1px solid var(--line);
}

.answer-grid small {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.answer-grid h3 {
  margin: 7px 0 16px;
  font-family: var(--font-display);
  font-size: 23px;
}

.answer-grid li {
  margin-bottom: 10px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.code-exercise {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--signal);
  background: var(--paper);
  padding: 13px;
  line-height: 1.6;
}

.question-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line-strong);
  background: var(--paper);
  padding: 14px clamp(22px, 4vw, 42px);
}

.question-status,
.question-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.question-status button {
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px 11px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.question-status button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-raised);
}

.question-links span {
  font-size: 11px;
  font-weight: 800;
}

.question-links a {
  border-bottom: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.interview-empty {
  border: 1px dashed var(--line-strong);
  padding: 70px 24px;
  text-align: center;
}

@media (max-width: 1080px) {
  .interview-hero,
  .question-card-head {
    grid-template-columns: 1fr;
  }

  .interview-controls {
    position: static;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .interview-search {
    grid-column: span 2;
  }

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

  .answer-grid section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .practice-track:nth-child(odd) {
    border-left: 0;
  }

  .practice-track:nth-child(n + 3) {
    border-top: 1px solid rgba(248, 244, 234, 0.24);
  }
}

@media (max-width: 680px) {
  .interview-hero {
    padding: 30px 20px;
  }

  .interview-controls {
    grid-template-columns: 1fr;
  }

  .interview-search {
    grid-column: auto;
  }

  .interview-results-head,
  .practice-roadmap > header,
  .question-card-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .practice-track-grid {
    grid-template-columns: 1fr;
  }

  .practice-track + .practice-track {
    border-top: 1px solid rgba(248, 244, 234, 0.24);
    border-left: 0;
  }

  .practice-track p {
    min-height: 0;
  }

  .question-card-head {
    gap: 17px;
    padding: 24px 18px;
  }
}
