:root {
  --paper: #f4f0e8;
  --paper-deep: #e9e3d8;
  --ink: #15221d;
  --ink-soft: #617069;
  --white: #fffdf8;
  --line: #dcd6ca;
  --route: #2d9b60;
  --route-rgb: 45, 155, 96;
  --typed-red: #c64b42;
  --wrong: #da4c3f;
  --yellow: #f1b73b;
  --shadow: 0 18px 55px rgba(33, 46, 39, 0.11);
  --sans: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Inter, sans-serif;
  --font-step: 1px;
}

html[data-text-size="standard"] {
  --font-step: 0px;
}

html[data-text-size="comfortable"] {
  --font-step: 1px;
}

html[data-text-size="large"] {
  --font-step: 3px;
}

html[data-theme="oldmac"] {
  --paper: #d6d6d6;
  --paper-deep: #b8b8b8;
  --ink: #000;
  --ink-soft: #3c3c3c;
  --white: #f7f7f7;
  --line: #555;
  --typed-red: #000;
  --wrong: #c40000;
  --yellow: #000;
  --shadow: 5px 5px 0 #000;
  --sans: Geneva, Tahoma, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

html[data-theme="dos"] {
  --paper: #000084;
  --paper-deep: #00005a;
  --ink: #fff;
  --ink-soft: #c0c0c0;
  --white: #00006a;
  --line: #aaaaff;
  --typed-red: #ffff55;
  --wrong: #ff5555;
  --yellow: #ffff55;
  --shadow: 8px 8px 0 #000;
  --sans: "Courier New", "D2Coding", "Nanum Gothic Coding", monospace;
}

html[data-theme="xp"] {
  --paper: #ece9d8;
  --paper-deep: #d6d2c2;
  --ink: #17365d;
  --ink-soft: #536b87;
  --white: #fff;
  --line: #9eafc6;
  --typed-red: #d13d32;
  --wrong: #d13d32;
  --yellow: #ffcc33;
  --shadow: 0 14px 42px rgba(28, 67, 121, 0.18);
  --sans: Tahoma, "Malgun Gothic", "Noto Sans KR", sans-serif;
}

html[data-theme="night"] {
  --paper: #0b1020;
  --paper-deep: #10172b;
  --ink: #eef2ff;
  --ink-soft: #aab4cf;
  --white: #151c31;
  --line: #3a4667;
  --typed-red: #f2cf6f;
  --wrong: #ff7588;
  --yellow: #f2cf6f;
  --shadow: 0 20px 65px rgba(0, 0, 0, 0.38);
}

html[data-theme="terminal"] {
  --paper: #020b06;
  --paper-deep: #03140b;
  --ink: #baffce;
  --ink-soft: #66c987;
  --white: #06160c;
  --line: #1ca04a;
  --typed-red: #ffff66;
  --wrong: #ff5f68;
  --yellow: #ffff66;
  --shadow: 7px 7px 0 #0c5226;
  --sans: "Courier New", "D2Coding", "Nanum Gothic Coding", monospace;
}

html[data-theme="paper"] {
  --paper: #ded1b3;
  --paper-deep: #c8b893;
  --ink: #34291f;
  --ink-soft: #6a5948;
  --white: #efe4c9;
  --line: #84705a;
  --typed-red: #8f3025;
  --wrong: #a62922;
  --yellow: #b08227;
  --shadow: 0 12px 30px rgba(58, 43, 29, 0.18);
  --sans: Georgia, "Batang", "Noto Serif KR", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  word-break: keep-all;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.prompt-area:focus-visible {
  outline: 3px solid rgba(var(--route-rgb), 0.25);
  outline-offset: 3px;
}

.map-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.46;
  background-image:
    linear-gradient(rgba(21, 34, 29, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 34, 29, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 76px;
  display: grid;
  grid-template-columns: 330px 1fr auto;
  align-items: center;
  padding: 0 34px;
  border-bottom: 1px solid rgba(21, 34, 29, 0.1);
  background: rgba(244, 240, 232, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  width: max-content;
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 27px;
  height: 27px;
  margin-right: 10px;
  border: 7px solid var(--ink);
  border-radius: 50%;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 5px;
  left: 11px;
  top: 4px;
  border-radius: 5px;
  background: var(--route);
  transform: rotate(-43deg);
  transform-origin: left center;
}

.brand-mark span {
  position: absolute;
  width: 5px;
  height: 5px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: var(--paper);
}

.brand-name {
  font-size: calc(19px + var(--font-step));
  font-weight: 850;
  letter-spacing: -0.06em;
}

.brand-sub {
  margin-left: 9px;
  padding-left: 9px;
  border-left: 1px solid rgba(21, 34, 29, 0.2);
  color: #7e8984;
  font-size: calc(8px + var(--font-step));
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.12em;
}

.topnav {
  height: 100%;
  display: flex;
  justify-content: center;
  gap: 34px;
}

.nav-link {
  position: relative;
  border: 0;
  background: none;
  color: #7c8781;
  font-size: calc(13px + var(--font-step));
  font-weight: 700;
  cursor: pointer;
}

.nav-link.active {
  color: var(--ink);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 26px;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--ink);
  transform: translateX(-50%);
}

.header-actions {
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(21, 34, 29, 0.13);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.6);
  cursor: pointer;
}

.icon-button svg {
  width: 17px;
  fill: var(--ink);
}

.text-size-button {
  position: relative;
  gap: 0;
  font-weight: 850;
  letter-spacing: -0.08em;
}

.text-size-button > span {
  transform: translate(-1px, 1px);
}

.text-size-button > b {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 13px;
  color: var(--route);
  font-size: calc(8px + var(--font-step));
  letter-spacing: -0.08em;
}

.theme-button[aria-expanded="true"] {
  border-color: var(--route);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(var(--route-rgb), 0.12);
}

.theme-menu {
  position: absolute;
  z-index: 90;
  width: 380px;
  right: 0;
  top: 50px;
  padding: 12px;
  border: 1px solid rgba(21, 34, 29, 0.16);
  border-radius: 17px;
  background: var(--white);
  box-shadow: 0 22px 60px rgba(21, 34, 29, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.18s, transform 0.18s;
}

.theme-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.theme-menu-head {
  padding: 5px 5px 10px;
}

.theme-menu-head span,
.theme-menu-head strong {
  display: block;
}

.theme-menu-head span {
  margin-bottom: 3px;
  color: var(--route);
  font-size: calc(7px + var(--font-step));
  font-weight: 850;
  letter-spacing: 0.14em;
}

.theme-menu-head strong {
  font-size: calc(13px + var(--font-step));
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.theme-grid > button {
  position: relative;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--paper) 72%, var(--white));
  text-align: left;
  cursor: pointer;
}

.theme-grid > button:hover {
  border-color: rgba(var(--route-rgb), 0.45);
}

.theme-grid > button.active {
  border-color: var(--route);
  box-shadow: inset 0 0 0 1px var(--route);
}

.theme-grid > button > span:nth-child(2) {
  min-width: 0;
}

.theme-grid b,
.theme-grid small {
  display: block;
}

.theme-grid b {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: calc(10px + var(--font-step));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-grid small {
  color: var(--ink-soft);
  font-size: calc(7px + var(--font-step));
  line-height: 1.25;
}

.theme-grid em {
  position: absolute;
  top: 5px;
  right: 6px;
  display: none;
  color: var(--route);
  font-size: calc(8px + var(--font-step));
  font-style: normal;
  font-weight: 900;
}

.theme-grid > button.active em {
  display: block;
}

.theme-preview {
  position: relative;
  width: 42px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(21, 34, 29, 0.24);
  border-radius: 7px;
  background: #f4f0e8;
}

.theme-preview i {
  position: absolute;
  display: block;
}

.theme-preview i:nth-child(1) {
  inset: 0 0 auto;
  height: 10px;
  background: #15221d;
}

.theme-preview i:nth-child(2) {
  left: 5px;
  right: 5px;
  top: 17px;
  height: 8px;
  border: 2px solid #2d9b60;
  background: #fffdf8;
}

.theme-preview i:nth-child(3) {
  left: 5px;
  right: 11px;
  bottom: 7px;
  height: 3px;
  background: #a8afa9;
}

.theme-preview-oldmac {
  border-radius: 1px;
  background: #fff;
}

.theme-preview-oldmac i:nth-child(1),
.theme-preview-oldmac i:nth-child(3) {
  background: #000;
}

.theme-preview-oldmac i:nth-child(2) {
  border-color: #000;
  border-radius: 0;
  background: #fff;
}

.theme-preview-dos {
  border-radius: 0;
  background: #000084;
}

.theme-preview-dos i:nth-child(1) {
  background: #00aaaa;
}

.theme-preview-dos i:nth-child(2) {
  border-color: #fff;
  border-radius: 0;
  background: #000084;
}

.theme-preview-dos i:nth-child(3) {
  background: #ffff55;
}

.theme-preview-xp {
  background: #ece9d8;
}

.theme-preview-xp i:nth-child(1) {
  background: linear-gradient(#3c8cf4, #0644a5);
}

.theme-preview-xp i:nth-child(2) {
  border-color: #2b62c9;
  background: #fff;
}

.theme-preview-xp i:nth-child(3) {
  background: #58a928;
}

.theme-preview-night {
  background: #101528;
}

.theme-preview-night i:nth-child(1) {
  background: #202945;
}

.theme-preview-night i:nth-child(2) {
  border-color: #8f83ff;
  background: #171d34;
}

.theme-preview-night i:nth-child(3) {
  background: #f2cf6f;
}

.theme-preview-terminal {
  border-radius: 0;
  background: #020b06;
}

.theme-preview-terminal i:nth-child(1),
.theme-preview-terminal i:nth-child(3) {
  background: #34ff77;
}

.theme-preview-terminal i:nth-child(2) {
  border-color: #34ff77;
  border-radius: 0;
  background: #020b06;
}

.theme-preview-paper {
  background: #ded1b3;
}

.theme-preview-paper i:nth-child(1),
.theme-preview-paper i:nth-child(3) {
  background: #3c3024;
}

.theme-preview-paper i:nth-child(2) {
  border-color: #9b3d2b;
  border-radius: 0;
  background: #f0e4c8;
}

.icon-button .sound-wave {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.icon-button.muted .sound-wave {
  opacity: 0;
}

.streak {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(21, 34, 29, 0.13);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.6);
  color: #64716b;
  font-size: calc(11px + var(--font-step));
  font-weight: 650;
}

.streak strong {
  color: var(--ink);
  font-size: calc(12px + var(--font-step));
}

.streak-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(241, 183, 59, 0.17);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 46px;
  margin: 0 auto;
  padding: 34px 46px 50px;
}

.route-sidebar {
  align-self: start;
  min-width: 0;
  padding: 18px 20px 20px;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.62);
  box-shadow: 0 12px 36px rgba(35, 48, 42, 0.055);
}

.sidebar-heading {
  display: flex;
  justify-content: space-between;
  padding: 2px 3px 18px;
}

.eyebrow {
  color: var(--route);
  font-size: calc(9px + var(--font-step));
  font-weight: 850;
  letter-spacing: 0.16em;
}

.sidebar-heading h1 {
  margin: 8px 0 0;
  font-size: clamp(calc(23px + var(--font-step)), calc(2vw + var(--font-step)), calc(29px + var(--font-step)));
  line-height: 1.24;
  letter-spacing: -0.055em;
}

.close-sidebar {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: calc(28px + var(--font-step));
  cursor: pointer;
}

.search-wrap {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid rgba(21, 34, 29, 0.12);
  border-radius: 11px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--route);
  box-shadow: 0 0 0 3px rgba(var(--route-rgb), 0.09);
}

.search-wrap svg {
  width: 17px;
  fill: none;
  stroke: #7c8882;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: calc(12px + var(--font-step));
}

.search-wrap input::placeholder {
  color: #9fa7a3;
}

.search-wrap kbd {
  min-width: 22px;
  padding: 3px 6px;
  border: 1px solid #ddd8cf;
  border-radius: 5px;
  background: #f3f0ea;
  color: #8b948f;
  font-family: inherit;
  font-size: calc(10px + var(--font-step));
  text-align: center;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 14px 0 12px;
}

.filter {
  flex: 0 0 auto;
  padding: 7px 7px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #7b8680;
  font-size: calc(10px + var(--font-step));
  font-weight: 750;
  cursor: pointer;
}

.filter.active {
  background: var(--ink);
  color: white;
}

.route-list {
  display: grid;
  gap: 5px;
  max-height: 510px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: rgba(21, 34, 29, 0.2) transparent;
  scrollbar-width: thin;
}

.route-list::-webkit-scrollbar {
  width: 5px;
}

.route-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: rgba(21, 34, 29, 0.18);
}

.route-item {
  position: relative;
  width: 100%;
  min-height: 65px;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.route-item:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateX(2px);
}

.route-item.active {
  border-color: rgba(var(--item-rgb), 0.18);
  background: rgba(var(--item-rgb), 0.085);
}

.item-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid rgb(var(--item-rgb));
  border-radius: 50%;
  background: var(--white);
  color: rgb(var(--item-rgb));
  font-size: calc(12px + var(--font-step));
  font-weight: 900;
}

.route-item.active .item-symbol {
  background: rgb(var(--item-rgb));
  color: white;
}

.item-copy {
  min-width: 0;
}

.item-copy b,
.item-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-copy b {
  margin-bottom: 4px;
  font-size: calc(12px + var(--font-step));
  letter-spacing: -0.02em;
}

.item-copy small {
  color: #7b8781;
  font-size: calc(9px + var(--font-step));
  font-weight: 650;
}

.item-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #8b948f;
  font-size: calc(8px + var(--font-step));
  font-weight: 750;
}

.item-meta span:first-child {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(21, 34, 29, 0.055);
}

.empty-routes {
  padding: 30px 10px;
  color: #89928d;
  font-size: calc(12px + var(--font-step));
  text-align: center;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 15px 6px 1px;
  border-top: 1px dashed rgba(21, 34, 29, 0.15);
}

.sidebar-foot p {
  margin: 0;
  color: #85908a;
  font-size: calc(9px + var(--font-step));
  line-height: 1.55;
}

.sidebar-foot p strong {
  color: #5b6862;
  font-size: calc(10px + var(--font-step));
}

.mini-network {
  position: relative;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.mini-network::before,
.mini-network::after {
  content: "";
  position: absolute;
  height: 2px;
  border-radius: 2px;
  background: var(--route);
  transform-origin: left;
}

.mini-network::before {
  width: 47px;
  left: 4px;
  top: 20px;
  transform: rotate(-20deg);
}

.mini-network::after {
  width: 27px;
  left: 25px;
  top: 11px;
  background: var(--yellow);
  transform: rotate(23deg);
}

.mini-network span {
  position: absolute;
  z-index: 1;
  width: 8px;
  height: 8px;
  border: 2px solid var(--route);
  border-radius: 50%;
  background: var(--white);
}

.mini-network span:nth-child(1) {
  left: 0;
  top: 18px;
}

.mini-network span:nth-child(2) {
  left: 23px;
  top: 9px;
}

.mini-network span:nth-child(3) {
  right: 0;
  top: 20px;
  border-color: var(--yellow);
}

.journey {
  width: 100%;
  max-width: 1020px;
  min-width: 0;
  justify-self: center;
}

.mobile-route-row {
  display: none;
}

.journey-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-bottom: 18px;
}

.route-identity {
  display: flex;
  align-items: center;
  gap: 13px;
}

.route-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 4px solid var(--route);
  border-radius: 50%;
  background: var(--white);
  color: var(--route);
  font-size: calc(16px + var(--font-step));
  font-weight: 900;
  box-shadow: 0 4px 13px rgba(var(--route-rgb), 0.15);
}

.route-symbol.compact {
  font-size: calc(9px + var(--font-step));
  letter-spacing: -0.04em;
}

.route-region {
  display: block;
  margin-bottom: 3px;
  color: #8a948f;
  font-size: calc(8px + var(--font-step));
  font-weight: 800;
  letter-spacing: 0.15em;
}

.route-identity h2 {
  margin: 0;
  font-size: calc(20px + var(--font-step));
  letter-spacing: -0.045em;
}

.journey-tools {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-toggle {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(21, 34, 29, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.64);
}

.language-toggle button {
  height: 30px;
  min-width: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #84908a;
  font-size: calc(9px + var(--font-step));
  font-weight: 850;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.language-toggle button.active {
  background: var(--ink);
  color: white;
  box-shadow: 0 3px 9px rgba(21, 34, 29, 0.17);
}

.mode-button,
.more-button {
  height: 38px;
  border: 1px solid rgba(21, 34, 29, 0.12);
  background: rgba(255, 253, 248, 0.63);
  cursor: pointer;
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 20px;
  color: #66736c;
  font-size: calc(10px + var(--font-step));
  font-weight: 750;
}

.mode-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.mode-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--route);
  box-shadow: 0 0 0 3px rgba(var(--route-rgb), 0.12);
}

.more-button {
  width: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}

.more-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 0.25s;
}

.more-button[aria-expanded="true"] {
  border-color: var(--route);
  color: var(--route);
  background: var(--white);
}

.more-button[aria-expanded="true"] svg {
  transform: translateX(2px);
}

.transition-menu {
  position: absolute;
  z-index: 20;
  width: 272px;
  right: 0;
  top: 48px;
  padding: 9px;
  border: 1px solid rgba(21, 34, 29, 0.13);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.97);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 18px 48px rgba(21, 34, 29, 0.2);
  backdrop-filter: blur(18px);
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.2s, transform 0.2s;
}

.transition-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.transition-menu-head {
  padding: 7px 9px 9px;
  text-align: left;
}

.transition-menu-head span,
.transition-menu-head strong {
  display: block;
}

.transition-menu-head span {
  margin-bottom: 3px;
  color: var(--route);
  font-size: calc(7px + var(--font-step));
  font-weight: 850;
  letter-spacing: 0.14em;
}

.transition-menu-head strong {
  font-size: calc(12px + var(--font-step));
}

.transition-menu > button {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.transition-menu > button:hover {
  background: rgba(21, 34, 29, 0.04);
}

.transition-menu > button.active {
  border-color: rgba(var(--route-rgb), 0.2);
  background: rgba(var(--route-rgb), 0.08);
}

.transition-menu > button > span:nth-child(2) b,
.transition-menu > button > span:nth-child(2) small {
  display: block;
}

.transition-menu > button > span:nth-child(2) b {
  margin-bottom: 3px;
  font-size: calc(10px + var(--font-step));
}

.transition-menu > button > span:nth-child(2) small {
  color: #8a948f;
  font-size: calc(7px + var(--font-step));
}

.transition-menu > button em {
  color: var(--route);
  font-size: calc(7px + var(--font-step));
  font-style: normal;
  font-weight: 850;
}

.transition-preview {
  position: relative;
  width: 38px;
  height: 30px;
  overflow: hidden;
  border: 1px solid #ded9d0;
  border-radius: 7px;
  background: #f4f1eb;
}

.transition-preview i {
  position: absolute;
  width: 14px;
  height: 4px;
  border-radius: 5px;
  background: var(--route);
}

.preview-travel i:first-child {
  left: 5px;
  top: 9px;
}

.preview-travel i:last-child {
  right: -3px;
  bottom: 7px;
  opacity: 0.32;
}

.preview-travel::after {
  content: "→";
  position: absolute;
  right: 5px;
  top: 5px;
  color: #6d7872;
  font-size: calc(10px + var(--font-step));
}

.preview-platform i:first-child {
  left: 7px;
  top: 6px;
}

.preview-platform i:last-child {
  right: 7px;
  bottom: 6px;
  opacity: 0.35;
}

.preview-zoom i {
  left: 11px;
  top: 12px;
  transform: scale(1.3);
}

.preview-zoom::before,
.preview-zoom::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(var(--route-rgb), 0.2);
  border-radius: 50%;
}

.preview-zoom::after {
  inset: 9px;
}

.preview-instant i {
  left: 11px;
  top: 12px;
}

.preview-instant::before,
.preview-instant::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: #a4ada8;
}

.preview-instant::before {
  left: 7px;
}

.preview-instant::after {
  right: 7px;
}

.route-board {
  position: relative;
  overflow: hidden;
  padding: 20px 26px 17px;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0.78)),
    radial-gradient(circle at 1px 1px, rgba(21, 34, 29, 0.18) 1px, transparent 1.2px);
  background-size: auto, 18px 18px;
  box-shadow: 0 9px 35px rgba(31, 45, 38, 0.06);
}

.route-backdrop {
  position: relative;
  height: 178px;
  margin: -20px -26px 17px;
  overflow: hidden;
  border-bottom: 1px solid rgba(21, 34, 29, 0.1);
  background:
    radial-gradient(circle at 75% 30%, rgba(var(--route-rgb), 0.36), transparent 32%),
    linear-gradient(135deg, #202e29, #0f1915);
}

.route-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.18) 1px, transparent 1.2px);
  background-size: 24px 24px;
  opacity: 0.25;
  pointer-events: none;
}

.route-backdrop img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.78) contrast(1.08);
  transform: scale(1.04);
  transition: opacity 0.75s ease, transform 1.2s ease;
}

.route-backdrop.has-image img {
  opacity: 0.7;
  transform: scale(1);
}

.route-backdrop.image-failed img {
  display: none;
}

.backdrop-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 20, 16, 0.68), rgba(11, 20, 16, 0.08) 65%),
    linear-gradient(0deg, rgba(11, 20, 16, 0.6), transparent 65%);
}

.visual-art {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.visual-art svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.visual-art .orbit-line,
.visual-art .constellation-line,
.visual-art .map-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 1;
}

.visual-art .orbit-line {
  transform-origin: center;
  animation: orbitDrift 18s linear infinite;
}

.visual-art .visual-dot {
  fill: white;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.visual-art .visual-accent {
  fill: var(--route);
  filter: drop-shadow(0 0 8px rgba(var(--route-rgb), 0.8));
}

.visual-art .galaxy-arm {
  fill: none;
  stroke: rgba(255, 255, 255, 0.56);
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.image-status {
  position: absolute;
  z-index: 4;
  left: 17px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: calc(7px + var(--font-step));
  letter-spacing: 0.12em;
  transition: opacity 0.25s;
}

.image-status span {
  width: 6px;
  height: 6px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.route-backdrop.has-image .image-status,
.route-backdrop.image-failed .image-status {
  opacity: 0;
}

.image-credit {
  position: absolute;
  z-index: 5;
  right: 14px;
  bottom: 11px;
  max-width: 45%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(8, 15, 12, 0.38);
  color: rgba(255, 255, 255, 0.82);
  font-size: calc(6px + var(--font-step));
  font-weight: 750;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s;
}

.route-backdrop.has-image .image-credit {
  opacity: 1;
}

.route-backdrop:hover .image-credit {
  color: white;
  background: rgba(8, 15, 12, 0.65);
}

.route-board::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -75px;
  top: -76px;
  border: 24px solid rgba(var(--route-rgb), 0.045);
  border-radius: 50%;
}

.board-meta {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.live-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid rgba(var(--route-rgb), 0.2);
  border-radius: 6px;
  background: rgba(var(--route-rgb), 0.07);
  color: var(--route);
  font-size: calc(8px + var(--font-step));
  letter-spacing: 0.07em;
}

.live-chip span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--route);
  animation: livePulse 1.7s infinite;
}

.board-meta p {
  margin: 0;
  overflow: hidden;
  color: #718078;
  font-size: calc(10px + var(--font-step));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-count {
  color: #7a8680;
  font-variant-numeric: tabular-nums;
  font-size: calc(9px + var(--font-step));
  font-weight: 800;
  letter-spacing: 0.08em;
}

.station-map-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 11px 0 8px;
  padding: 23px 0 10px;
  scrollbar-width: none;
}

.station-map-wrap::-webkit-scrollbar {
  display: none;
}

.station-map {
  position: relative;
  min-width: 750px;
  height: 91px;
}

.route-rail,
.route-progress-rail {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 36px;
  height: 7px;
  border-radius: 10px;
}

.route-rail {
  background: rgba(var(--route-rgb), 0.16);
}

.route-progress-rail {
  right: auto;
  width: 0;
  background: var(--route);
  transition: width 0.55s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.map-station {
  position: absolute;
  z-index: 2;
  top: 26px;
  width: 27px;
  height: 27px;
  border: 6px solid rgba(var(--route-rgb), 0.42);
  border-radius: 50%;
  background: var(--white);
  transform: translateX(-50%);
  transition: border-color 0.35s, background 0.35s, transform 0.35s;
}

.map-station.passed,
.map-station.current {
  border-color: var(--route);
}

.map-station.passed {
  background: var(--route);
}

.map-station.passed::after {
  content: "✓";
  position: absolute;
  inset: -5px;
  display: grid;
  place-items: center;
  color: white;
  font-size: calc(9px + var(--font-step));
  font-weight: 900;
}

.map-station.current {
  background: var(--white);
  box-shadow:
    0 0 0 6px rgba(var(--route-rgb), 0.13),
    0 4px 12px rgba(var(--route-rgb), 0.2);
  transform: translateX(-50%) scale(1.09);
}

.map-station.current::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--route);
}

.station-name {
  position: absolute;
  top: 58px;
  width: 106px;
  overflow: hidden;
  color: #7b8781;
  font-size: calc(9px + var(--font-step));
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: color 0.3s, font-weight 0.3s;
}

.station-map.english .station-name {
  width: 128px;
}

.station-name span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #a0a8a4;
  font-size: calc(7px + var(--font-step));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-name.current {
  color: var(--ink);
  font-weight: 850;
}

.train-marker {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 5%;
  width: 31px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 6px 6px 4px 4px;
  background: var(--white);
  color: var(--ink);
  transform: translateX(-50%);
  transition: left 0.55s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.train-marker::before,
.train-marker::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.train-marker::before {
  left: 4px;
}

.train-marker::after {
  right: 4px;
}

.train-marker svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.next-stop-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 12px 7px 8px;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 10px;
  background: rgba(244, 240, 232, 0.7);
}

.next-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.next-icon svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.next-stop-card span {
  display: block;
  margin-bottom: 2px;
  color: #909993;
  font-size: calc(7px + var(--font-step));
  font-weight: 800;
  letter-spacing: 0.1em;
}

.next-stop-card strong {
  display: block;
  font-size: calc(11px + var(--font-step));
}

.arrival-time {
  min-width: 58px;
  padding-left: 14px;
  border-left: 1px solid rgba(21, 34, 29, 0.11);
  text-align: right;
}

.arrival-time strong {
  color: var(--route);
  font-size: calc(12px + var(--font-step));
  font-variant-numeric: tabular-nums;
}

.typing-card {
  position: relative;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid rgba(21, 34, 29, 0.11);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.typing-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--route);
}

.typing-card.complete::after {
  content: "CLEAR";
  position: absolute;
  right: -18px;
  top: 49px;
  padding: 4px 25px;
  background: var(--route);
  color: white;
  font-size: calc(8px + var(--font-step));
  font-weight: 900;
  letter-spacing: 0.12em;
  transform: rotate(45deg);
}

.typing-card.has-mistake {
  border-color: rgba(218, 76, 63, 0.34);
}

.typing-card.has-mistake .prompt-text {
  animation: mistakeNudge 0.18s ease-out;
}

.typing-card.transition-out .prompt-area,
.typing-card.transition-in .prompt-area {
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.prompt-transition-ghost {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  opacity: 0.14;
  will-change: transform, opacity, filter;
}

.typing-card.input-locked .prompt-area {
  cursor: default;
}

.typing-card.effect-travel.transition-out .prompt-area {
  animation: routeWordOut 0.16s cubic-bezier(0.4, 0, 0.7, 0.25) both;
}

.typing-card.effect-travel.transition-in .prompt-area:not(.prompt-transition-ghost) {
  animation: routeWordIn 0.16s cubic-bezier(0.16, 0.82, 0.24, 1) both;
}

.prompt-transition-ghost.ghost-travel.running {
  animation: routeWordOut 0.2s cubic-bezier(0.4, 0, 0.7, 0.25) both;
}

.typing-card.effect-platform.transition-out .prompt-area {
  animation: platformWordOut 0.16s ease-in both;
}

.typing-card.effect-platform.transition-in .prompt-area:not(.prompt-transition-ghost) {
  animation: platformWordIn 0.16s cubic-bezier(0.18, 0.85, 0.3, 1) both;
}

.prompt-transition-ghost.ghost-platform.running {
  animation: platformWordOut 0.2s ease-in both;
}

.typing-card.effect-zoom.transition-out .prompt-area {
  animation: zoomWordOut 0.16s ease-in both;
}

.typing-card.effect-zoom.transition-in .prompt-area:not(.prompt-transition-ghost) {
  animation: zoomWordIn 0.16s cubic-bezier(0.16, 0.82, 0.24, 1) both;
}

.prompt-transition-ghost.ghost-zoom.running {
  animation: zoomWordOut 0.2s ease-in both;
}

.typing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 23px 15px 27px;
  border-bottom: 1px solid #ebe7df;
}

.step-label {
  display: block;
  margin-bottom: 4px;
  color: var(--route);
  font-size: calc(8px + var(--font-step));
  font-weight: 850;
  letter-spacing: 0.14em;
}

.typing-head h3 {
  margin: 0;
  font-size: calc(15px + var(--font-step));
  letter-spacing: -0.035em;
}

.metrics {
  display: flex;
  align-items: stretch;
}

.metric {
  min-width: 72px;
  padding: 0 13px;
  border-left: 1px solid #e4e0d8;
}

.metric > span {
  display: block;
  margin-bottom: 3px;
  color: #949d98;
  font-size: calc(7px + var(--font-step));
  font-weight: 750;
}

.metric strong {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.metric b {
  font-size: calc(17px + var(--font-step));
  font-variant-numeric: tabular-nums;
}

.metric small {
  color: #8e9792;
  font-size: calc(7px + var(--font-step));
  font-weight: 700;
}

.prompt-area {
  position: relative;
  min-height: 132px;
  padding: 30px 31px 23px;
  cursor: text;
  transition: background-color 0.16s, box-shadow 0.16s;
}

.typing-card:focus-within {
  border-color: rgba(var(--route-rgb), 0.42);
}

.prompt-area:focus-within {
  background: rgba(var(--route-rgb), 0.025);
  box-shadow: inset 0 0 0 2px rgba(var(--route-rgb), 0.12);
}

.prompt-text {
  max-width: 880px;
  min-height: 51px;
  color: #a8afa9;
  font-size: clamp(calc(20px + var(--font-step)), calc(2.1vw + var(--font-step)), calc(27px + var(--font-step)));
  font-weight: 650;
  line-height: 1.75;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: normal;
}

.prompt-text.jamo-mode {
  display: flex;
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 11px 9px;
  font-size: clamp(calc(24px + var(--font-step)), calc(2.5vw + var(--font-step)), calc(32px + var(--font-step)));
  line-height: 1.35;
}

.prompt-text.syllable-mode {
  display: flex;
  align-items: flex-end;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 10px 5px;
  font-size: clamp(calc(30px + var(--font-step)), calc(3vw + var(--font-step)), calc(39px + var(--font-step)));
  line-height: 1.25;
  word-break: keep-all;
}

.syllable-char {
  position: relative;
  min-width: 0.88em;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0 2px 5px;
  color: #aab2ad;
  line-height: 1;
}

.syllable-char > b,
.component-ink b {
  display: block;
  font-size: 1em;
  font-weight: 760;
  line-height: 1;
}

.syllable-char.correct > b {
  color: var(--typed-red);
}

.syllable-char.partial > b {
  color: #aab2ad;
}

.syllable-char.wrong {
  background: transparent;
}

.syllable-char.wrong > b {
  color: #aab2ad;
}

.component-ink {
  position: absolute;
  inset: 0 2px 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--typed-red);
  opacity: 0;
  clip-path: var(--component-clip);
  pointer-events: none;
  transition: opacity 0.08s;
}

.component-ink.correct {
  opacity: 1;
}

.component-ink.wrong {
  color: var(--wrong);
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(218, 76, 63, 0.25));
}

.syllable-char.current::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 1px;
  width: 2px;
  height: 31px;
  border-radius: 2px;
  background: var(--route);
  animation: cursorBlink 0.9s steps(1) infinite;
}

.syllable-char.current:not(.started)::before {
  top: 0;
  height: 1em;
}

.syllable-char.current.started::before {
  left: auto;
  right: -3px;
}

.syllable-char.space-unit {
  width: 11px;
  min-width: 11px;
}

.auto-space {
  opacity: 0.42;
  pointer-events: none;
}

.syllable-char.space-unit .component-ink {
  display: none;
}

.syllable-char.extra {
  min-width: 25px;
  font-size: calc(18px + var(--font-step));
}

.jamo-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.char.jamo {
  position: relative;
  min-width: 24px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 3px;
  border: 1px solid #e1ddd5;
  border-bottom-width: 3px;
  border-radius: 7px;
  background: #f7f4ee;
  color: #a5ada8;
  font-size: 0.84em;
  font-weight: 800;
  line-height: 1;
  transition: color 0.08s, background 0.08s, border-color 0.08s, transform 0.08s;
}

.char.jamo.correct {
  border-color: rgba(var(--route-rgb), 0.34);
  border-bottom-color: var(--route);
  background: rgba(var(--route-rgb), 0.07);
  color: var(--ink);
}

.char.jamo.wrong {
  border-color: rgba(218, 76, 63, 0.34);
  border-bottom-color: var(--wrong);
  background: rgba(218, 76, 63, 0.08);
  color: var(--wrong);
  text-decoration: none;
  transform: translateY(-1px);
}

.char.jamo.current {
  border-color: rgba(var(--route-rgb), 0.48);
  box-shadow: 0 0 0 3px rgba(var(--route-rgb), 0.09);
}

.char.jamo.current::before {
  left: 5px;
  top: 5px;
  height: 24px;
}

.char.space-unit {
  min-width: 11px;
}

.char.jamo.space-unit {
  min-width: 5px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.char {
  position: relative;
  transition: color 0.08s, background 0.08s;
}

.char.correct {
  color: var(--typed-red);
  font-weight: 800;
}

.char.wrong {
  color: var(--wrong);
  border-radius: 3px;
  background: rgba(218, 76, 63, 0.08);
  text-decoration: underline;
  text-decoration-color: rgba(218, 76, 63, 0.45);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.char.current::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 2px;
  width: 2px;
  height: 1.25em;
  border-radius: 2px;
  background: var(--route);
  animation: cursorBlink 0.9s steps(1) infinite;
}

.char.current:not(.at-end)::before {
  top: 0;
  height: 1em;
}

.char.current.at-end::before {
  left: auto;
  right: -2px;
}

.prompt-area:not(:focus-within) :is(.syllable-char.current, .char.current)::before {
  animation: none;
  opacity: 0.28;
}

#typingInput {
  position: absolute;
  width: 1px;
  height: 1px;
  left: 30px;
  bottom: 22px;
  padding: 0;
  opacity: 0;
  border: 0;
  resize: none;
  pointer-events: none;
}

.typing-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: #9ba39f;
  font-size: calc(9px + var(--font-step));
  font-weight: 600;
  transition: opacity 0.2s;
}

.typing-hint.hidden {
  opacity: 0;
}

.cursor-key {
  width: 23px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid #ddd8d0;
  border-radius: 5px;
  background: #f5f2ec;
  font-size: calc(10px + var(--font-step));
}

.typing-foot {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 67px;
  padding: 12px 18px 12px 27px;
  border-top: 1px solid #ebe7df;
  background: #faf8f3;
}

.progress-group {
  flex: 1;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #88928d;
  font-size: calc(8px + var(--font-step));
  font-weight: 700;
}

.progress-copy b {
  color: var(--route);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #e7e3dc;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--route);
  transition: width 0.16s;
}

.typing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-button,
.next-button {
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  font-size: calc(10px + var(--font-step));
  font-weight: 750;
  cursor: pointer;
}

.text-button {
  padding: 0 12px;
  border: 1px solid #dcd7cf;
  background: var(--white);
  color: #727e78;
}

.text-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.next-button {
  min-width: 91px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  box-shadow: 0 5px 12px rgba(21, 34, 29, 0.16);
}

.next-button:disabled {
  border-color: #d8d8d3;
  background: #d8d8d3;
  color: #9fa39f;
  box-shadow: none;
  cursor: not-allowed;
}

.next-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.next-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.data-note {
  margin: 11px 5px 0;
  color: #929b96;
  font-size: calc(8px + var(--font-step));
  text-align: right;
}

.sidebar-scrim {
  display: none;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  background: var(--ink);
  color: white;
  font-size: calc(11px + var(--font-step));
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(21, 34, 29, 0.25);
  transform: translate(-50%, 20px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--route);
  font-size: calc(11px + var(--font-step));
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 27, 23, 0.72);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  transition: opacity 0.25s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.result-card {
  position: relative;
  width: min(430px, 100%);
  padding: 34px 37px 25px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 1px 1px, rgba(21, 34, 29, 0.07) 1px, transparent 1.1px),
    var(--white);
  background-size: 16px 16px, auto;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-backdrop.open .result-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  z-index: 2;
  right: 15px;
  top: 14px;
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 34, 29, 0.07);
  color: #6d7772;
  font-size: calc(22px + var(--font-step));
  cursor: pointer;
}

.ticket-punch {
  position: absolute;
  left: -34px;
  top: 28px;
  width: 150px;
  padding: 6px;
  background: var(--route);
  color: white;
  font-size: calc(7px + var(--font-step));
  font-weight: 900;
  letter-spacing: 0.14em;
  transform: rotate(-45deg);
}

.result-route-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 3px auto 17px;
  border: 5px solid var(--route);
  border-radius: 50%;
  background: var(--white);
  color: var(--route);
  font-size: calc(19px + var(--font-step));
  font-weight: 900;
}

.result-route-mark {
  overflow: hidden;
  font-size: calc(13px + var(--font-step));
}

.result-kicker {
  color: var(--route);
  font-size: calc(9px + var(--font-step));
  font-weight: 850;
  letter-spacing: 0.05em;
}

.result-card h2 {
  margin: 7px 0 8px;
  font-size: calc(26px + var(--font-step));
  letter-spacing: -0.055em;
}

.result-card > p {
  margin: 0;
  color: #75817b;
  font-size: calc(11px + var(--font-step));
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 25px 0 20px;
  padding: 17px 0;
  border-top: 1px dashed #d9d4ca;
  border-bottom: 1px dashed #d9d4ca;
}

.result-stats > div + div {
  border-left: 1px solid #e3ded6;
}

.result-stats span {
  display: block;
  margin-bottom: 5px;
  color: #8f9893;
  font-size: calc(8px + var(--font-step));
  font-weight: 700;
}

.result-stats strong {
  font-size: calc(21px + var(--font-step));
  font-variant-numeric: tabular-nums;
}

.result-stats small {
  margin-left: 2px;
  color: #89928e;
  font-size: calc(7px + var(--font-step));
}

.result-auto-next {
  margin: -7px 0 14px;
  padding: 10px 12px 11px;
  overflow: hidden;
  border: 1px solid rgba(var(--route-rgb), 0.22);
  border-radius: 9px;
  background: rgba(var(--route-rgb), 0.065);
  text-align: left;
}

.result-auto-next > span,
.result-auto-next > strong {
  display: block;
}

.result-auto-next > span {
  margin-bottom: 3px;
  color: var(--route);
  font-size: calc(7px + var(--font-step));
  font-weight: 850;
  letter-spacing: 0.08em;
}

.result-auto-next > strong {
  overflow: hidden;
  font-size: calc(11px + var(--font-step));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-auto-next > b {
  height: 3px;
  display: block;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(var(--route-rgb), 0.15);
}

.result-auto-next > b > i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--route);
}

.result-auto-next.counting > b > i {
  animation: resultCountdown 2s linear forwards;
}

.result-primary,
.result-secondary {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: calc(11px + var(--font-step));
  font-weight: 800;
  cursor: pointer;
}

.result-primary {
  border: 0;
  background: var(--ink);
  color: white;
}

.result-secondary {
  margin-top: 7px;
  border: 1px solid #d9d4cc;
  background: var(--white);
  color: #68746e;
}

.ticket-code {
  margin-top: 17px;
  color: #a5aca8;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: calc(6px + var(--font-step));
  letter-spacing: 0.1em;
}

/* Site themes ------------------------------------------------------------ */

html:not([data-theme="route"]) body {
  transition: color 0.24s, background-color 0.24s;
}

html:not([data-theme="route"]) .topbar {
  border-color: var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}

html:not([data-theme="route"]) :is(
  .route-sidebar,
  .route-board,
  .next-stop-card,
  .typing-card,
  .transition-menu,
  .theme-menu,
  .result-card
) {
  border-color: var(--line);
  background-color: var(--white);
}

html:not([data-theme="route"]) :is(
  .icon-button,
  .streak,
  .search-wrap,
  .language-toggle,
  .mode-button,
  .more-button,
  .route-menu-button,
  .next-stop-card,
  .text-button,
  .cursor-key,
  .transition-preview
) {
  border-color: var(--line);
  background-color: color-mix(in srgb, var(--white) 78%, var(--paper));
}

html:not([data-theme="route"]) :is(
  .brand-sub,
  .nav-link,
  .streak,
  .search-wrap svg,
  .search-wrap input::placeholder,
  .filter,
  .item-copy small,
  .item-meta,
  .empty-routes,
  .sidebar-foot p,
  .sidebar-foot p strong,
  .route-region,
  .language-toggle button,
  .mode-button,
  .transition-menu > button > span:nth-child(2) small,
  .board-meta p,
  .board-count,
  .station-name,
  .station-name span,
  .next-stop-card span,
  .metric > span,
  .metric small,
  .typing-hint,
  .progress-copy,
  .text-button,
  .data-note,
  .result-card > p,
  .result-stats span,
  .result-stats small,
  .ticket-code,
  .mobile-route-row > span
) {
  color: var(--ink-soft);
}

html:not([data-theme="route"]) :is(
  .typing-head,
  .typing-foot,
  .metric,
  .arrival-time,
  .sidebar-foot,
  .result-stats,
  .result-stats > div + div
) {
  border-color: var(--line);
}

html:not([data-theme="route"]) .route-board {
  background:
    linear-gradient(
      color-mix(in srgb, var(--white) 88%, transparent),
      color-mix(in srgb, var(--white) 88%, transparent)
    ),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 17%, transparent) 1px, transparent 1.2px);
  background-size: auto, 18px 18px;
}

html:not([data-theme="route"]) .route-item:hover {
  background: color-mix(in srgb, var(--white) 72%, transparent);
}

html:not([data-theme="route"]) .item-meta span:first-child,
html:not([data-theme="route"]) .transition-menu > button:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

html:not([data-theme="route"]) .typing-foot {
  background: color-mix(in srgb, var(--white) 70%, var(--paper-deep));
}

html:not([data-theme="route"]) :is(.prompt-text, .syllable-char, .syllable-char.partial > b, .syllable-char.wrong > b) {
  color: color-mix(in srgb, var(--ink) 45%, var(--paper));
}

html:not([data-theme="route"]) .progress-track {
  background: color-mix(in srgb, var(--ink) 15%, var(--paper));
}

html:not([data-theme="route"]) .next-button:disabled {
  border-color: color-mix(in srgb, var(--ink) 24%, var(--paper));
  background: color-mix(in srgb, var(--ink) 24%, var(--paper));
  color: color-mix(in srgb, var(--ink) 48%, var(--paper));
}

html:not([data-theme="route"]) .search-wrap kbd {
  border-color: var(--line);
  background: var(--paper-deep);
  color: var(--ink-soft);
}

html:not([data-theme="route"]) .route-sidebar {
  background: color-mix(in srgb, var(--white) 76%, transparent);
}

html:not([data-theme="route"]) .next-stop-card {
  background: color-mix(in srgb, var(--paper) 68%, var(--white));
}

html:not([data-theme="route"]) .modal-close {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  color: var(--ink-soft);
}

html:not([data-theme="route"]) .result-secondary {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink-soft);
}

html:not([data-theme="route"]) .theme-grid > button {
  color: var(--ink);
}

html[data-theme="oldmac"] .topbar {
  border-bottom: 2px solid #000;
  background:
    repeating-linear-gradient(0deg, #fff 0 1px, #c7c7c7 1px 2px);
  backdrop-filter: none;
}

html[data-theme="oldmac"] .brand-mark {
  width: 25px;
  height: 25px;
  border-width: 4px;
  border-radius: 3px;
}

html[data-theme="oldmac"] .brand-mark::after {
  width: 14px;
  height: 4px;
  left: 10px;
  top: 5px;
  border-radius: 0;
  background: #000;
}

html[data-theme="oldmac"] :is(
  .route-sidebar,
  .route-board,
  .typing-card,
  .transition-menu,
  .theme-menu,
  .result-card
) {
  border: 2px solid #000;
  border-radius: 0;
  box-shadow: var(--shadow);
}

html[data-theme="oldmac"] :is(
  .icon-button,
  .streak,
  .search-wrap,
  .filter,
  .route-item,
  .language-toggle,
  .language-toggle button,
  .mode-button,
  .more-button,
  .route-menu-button,
  .next-stop-card,
  .next-icon,
  .text-button,
  .next-button,
  .theme-grid > button,
  .transition-menu > button
) {
  border-radius: 0;
}

html[data-theme="oldmac"] :is(.icon-button, .mode-button, .more-button, .text-button, .theme-grid > button) {
  border: 2px outset #fff;
  background: #e7e7e7;
}

html[data-theme="oldmac"] :is(.filter.active, .language-toggle button.active, .next-icon, .next-button) {
  background: #000;
  color: #fff;
}

html[data-theme="oldmac"] .route-symbol,
html[data-theme="oldmac"] .map-station,
html[data-theme="oldmac"] .streak-dot,
html[data-theme="oldmac"] .live-chip span {
  border-radius: 0;
}

html[data-theme="oldmac"] .route-backdrop img {
  filter: grayscale(1) contrast(1.2);
}

html[data-theme="dos"] body {
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.12);
}

html[data-theme="dos"] .topbar {
  border: 0;
  border-bottom: 3px double #fff;
  background: #00aaaa;
  color: #000;
  backdrop-filter: none;
}

html[data-theme="dos"] .topbar :is(.brand, .brand-sub, .nav-link, .streak) {
  color: #000;
}

html[data-theme="dos"] .topbar :is(.icon-button, .streak) {
  border: 1px solid #000;
  background: #c0c0c0;
}

html[data-theme="dos"] .topbar :is(.icon-button svg, .icon-button .sound-wave) {
  fill: #000;
  stroke: #000;
}

html[data-theme="dos"] .brand-mark {
  border-color: #000;
}

html[data-theme="dos"] .brand-mark span,
html[data-theme="dos"] .brand-mark::after {
  background: #00aaaa;
}

html[data-theme="dos"] :is(
  .route-sidebar,
  .route-board,
  .typing-card,
  .transition-menu,
  .theme-menu,
  .result-card
) {
  border: 2px solid #fff;
  border-radius: 0;
  box-shadow: var(--shadow);
}

html[data-theme="dos"] :is(
  .icon-button,
  .streak,
  .search-wrap,
  .filter,
  .route-item,
  .item-symbol,
  .route-symbol,
  .language-toggle,
  .language-toggle button,
  .mode-button,
  .more-button,
  .route-menu-button,
  .theme-grid > button,
  .transition-menu > button,
  .transition-preview,
  .next-stop-card,
  .next-icon,
  .map-station,
  .train-marker,
  .text-button,
  .next-button,
  .progress-track,
  .toast
) {
  border-radius: 0;
}

html[data-theme="dos"] :is(.filter.active, .language-toggle button.active, .next-icon, .next-button) {
  background: #00aaaa;
  color: #000;
}

html[data-theme="dos"] .map-noise {
  opacity: 0.18;
  background-image: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.38) 2px 3px);
  background-size: auto;
  mask-image: none;
}

html[data-theme="dos"] .route-backdrop img {
  filter: saturate(0) contrast(1.35) sepia(1) hue-rotate(135deg);
}

html[data-theme="dos"] .prompt-text,
html[data-theme="terminal"] .prompt-text {
  letter-spacing: 0;
}

html[data-theme="xp"] .topbar {
  border-bottom: 2px solid #0a3b9e;
  background: linear-gradient(#3b8cf3, #0a57ce 52%, #0845a5);
  color: #fff;
  box-shadow: 0 2px 7px rgba(8, 58, 145, 0.35);
  backdrop-filter: none;
}

html[data-theme="xp"] .topbar :is(.brand, .brand-sub, .nav-link, .nav-link.active, .streak) {
  color: #fff;
}

html[data-theme="xp"] .nav-link.active::after {
  background: #fff;
}

html[data-theme="xp"] .brand-mark {
  border-color: #fff;
}

html[data-theme="xp"] .brand-mark span {
  background: #3b8cf3;
}

html[data-theme="xp"] .topbar :is(.icon-button, .streak) {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="xp"] .topbar :is(.icon-button svg, .icon-button .sound-wave) {
  fill: #fff;
  stroke: #fff;
}

html[data-theme="xp"] :is(.route-sidebar, .route-board, .typing-card, .transition-menu, .theme-menu) {
  border: 2px solid #2b62c9;
  border-radius: 9px;
  box-shadow: var(--shadow);
}

html[data-theme="xp"] :is(.filter.active, .language-toggle button.active, .next-icon, .next-button) {
  background: linear-gradient(#68b739, #3a8e20);
  border-color: #2d7618;
  color: #fff;
}

html[data-theme="xp"] :is(.icon-button, .mode-button, .more-button, .text-button, .theme-grid > button) {
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="xp"] .typing-card::before {
  background: linear-gradient(#2b78e4, #1648aa);
}

html[data-theme="night"] .map-noise {
  opacity: 0.72;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 58%, rgba(145, 136, 255, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 42% 82%, rgba(242, 207, 111, 0.75) 0 1px, transparent 1.6px);
  background-size: 103px 103px, 149px 149px, 191px 191px;
  mask-image: none;
}

html[data-theme="night"] .topbar {
  background: rgba(11, 16, 32, 0.85);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

html[data-theme="night"] :is(.route-sidebar, .route-board, .typing-card) {
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.3);
}

html[data-theme="night"] .route-backdrop {
  background:
    radial-gradient(circle at 75% 30%, rgba(var(--route-rgb), 0.44), transparent 30%),
    linear-gradient(135deg, #171f3b, #070a15);
}

html[data-theme="terminal"] body {
  text-shadow: 0 0 5px rgba(52, 255, 119, 0.2);
}

html[data-theme="terminal"] .topbar {
  border-bottom: 1px solid #34ff77;
  background: rgba(2, 11, 6, 0.93);
  backdrop-filter: none;
}

html[data-theme="terminal"] :is(
  .route-sidebar,
  .route-board,
  .typing-card,
  .transition-menu,
  .theme-menu,
  .result-card
) {
  border: 1px solid #34ff77;
  border-radius: 0;
  box-shadow: var(--shadow);
}

html[data-theme="terminal"] :is(
  .icon-button,
  .streak,
  .search-wrap,
  .filter,
  .route-item,
  .item-symbol,
  .route-symbol,
  .language-toggle,
  .language-toggle button,
  .mode-button,
  .more-button,
  .route-menu-button,
  .theme-grid > button,
  .transition-menu > button,
  .transition-preview,
  .next-stop-card,
  .next-icon,
  .map-station,
  .train-marker,
  .text-button,
  .next-button,
  .progress-track,
  .toast
) {
  border-radius: 0;
}

html[data-theme="terminal"] :is(.filter.active, .language-toggle button.active, .next-icon, .next-button) {
  background: #34ff77;
  color: #020b06;
}

html[data-theme="terminal"] .map-noise {
  opacity: 0.23;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(52, 255, 119, 0.18) 3px 4px),
    linear-gradient(90deg, transparent, rgba(52, 255, 119, 0.035), transparent);
  background-size: auto;
  mask-image: none;
}

html[data-theme="terminal"] .route-backdrop img {
  filter: grayscale(1) sepia(1) hue-rotate(75deg) saturate(4) contrast(1.25);
}

html[data-theme="paper"] body {
  background:
    repeating-linear-gradient(0deg, rgba(66, 49, 32, 0.025) 0 1px, transparent 1px 5px),
    var(--paper);
}

html[data-theme="paper"] .topbar {
  border-bottom: 3px double var(--ink);
  background: rgba(222, 209, 179, 0.94);
  backdrop-filter: blur(7px);
}

html[data-theme="paper"] :is(.route-sidebar, .route-board, .typing-card, .transition-menu, .theme-menu, .result-card) {
  border: 1px solid var(--ink);
  border-radius: 1px;
}

html[data-theme="paper"] :is(
  .icon-button,
  .streak,
  .search-wrap,
  .filter,
  .route-item,
  .language-toggle,
  .language-toggle button,
  .mode-button,
  .more-button,
  .route-menu-button,
  .theme-grid > button,
  .transition-menu > button,
  .next-stop-card,
  .next-icon,
  .text-button,
  .next-button
) {
  border-radius: 1px;
}

html[data-theme="paper"] .route-backdrop img {
  filter: sepia(0.7) saturate(0.65) contrast(1.15);
}

html[data-theme="paper"] .route-board {
  background:
    linear-gradient(rgba(239, 228, 201, 0.9), rgba(239, 228, 201, 0.9)),
    repeating-linear-gradient(0deg, rgba(52, 41, 31, 0.14) 0 1px, transparent 1px 4px);
}

@keyframes resultCountdown {
  to {
    width: 100%;
  }
}

@keyframes livePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--route-rgb), 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(var(--route-rgb), 0);
  }
}

@keyframes cursorBlink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

@keyframes orbitDrift {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes routeWordOut {
  to {
    opacity: 0;
    filter: blur(1px);
    transform: translate3d(-58px, 0, 0) scale(0.985);
  }
}

@keyframes mistakeNudge {
  35% {
    transform: translateX(-4px);
  }
  70% {
    transform: translateX(3px);
  }
}

@keyframes routeWordIn {
  from {
    opacity: 0.96;
    transform: translate3d(10px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes platformWordOut {
  to {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
}

@keyframes platformWordIn {
  from {
    opacity: 0.96;
    transform: translate3d(0, -8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes zoomWordOut {
  to {
    opacity: 0;
    filter: blur(5px);
    transform: scale(0.78);
  }
}

@keyframes zoomWordIn {
  from {
    opacity: 0.96;
    transform: scale(1.025);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (min-width: 861px) and (max-height: 820px) {
  .topbar {
    height: 66px;
  }

  .app-shell {
    min-height: calc(100vh - 66px);
    padding-top: 18px;
  }

  .journey-topline {
    min-height: 50px;
    margin-bottom: 10px;
  }

  .route-board {
    padding-top: 16px;
  }

  .route-backdrop {
    height: 96px;
    margin-top: -16px;
    margin-bottom: 12px;
  }

  .station-map-wrap {
    margin-top: 5px;
    margin-bottom: 4px;
    padding-top: 19px;
    padding-bottom: 5px;
  }

  .station-map {
    height: 84px;
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 260px 1fr auto;
    padding: 0 24px;
  }

  .app-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
    padding: 30px 28px 45px;
  }

  .route-sidebar {
    padding: 16px;
  }

  .prompt-text {
    font-size: calc(21px + var(--font-step));
  }
}

@media (max-width: 860px) {
  .topbar {
    height: 66px;
    grid-template-columns: 1fr auto;
    padding: 0 18px;
  }

  .topnav {
    display: none;
  }

  .streak {
    display: none;
  }

  .app-shell {
    z-index: auto;
    display: block;
    min-height: calc(100vh - 66px);
    padding: 18px 18px 40px;
  }

  .route-sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(355px, 90vw);
    height: 100vh;
    overflow-y: auto;
    padding: 28px 20px;
    border: 0;
    border-radius: 0 20px 20px 0;
    background: var(--paper);
    box-shadow: 25px 0 60px rgba(21, 34, 29, 0.2);
    transform: translateX(-105%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .route-list {
    max-height: calc(100vh - 315px);
  }

  .route-sidebar.open {
    transform: translateX(0);
  }

  .close-sidebar {
    display: grid;
    place-items: center;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    background: rgba(21, 34, 29, 0.52);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.25s;
  }

  .sidebar-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }

  .journey {
    max-width: 760px;
    margin: 0 auto;
  }

  .mobile-route-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
  }

  .mobile-route-row > span {
    color: #7f8a84;
    font-size: calc(10px + var(--font-step));
    font-weight: 750;
  }

  .route-menu-button {
    height: 34px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid rgba(21, 34, 29, 0.13);
    border-radius: 17px;
    background: rgba(255, 253, 248, 0.7);
    font-size: calc(10px + var(--font-step));
    font-weight: 750;
  }

  .route-menu-button svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.6;
  }

  .journey-topline {
    margin-bottom: 14px;
  }

  .data-note {
    text-align: center;
  }
}

@media (max-width: 600px) {
  .brand-sub {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .theme-menu {
    position: fixed;
    width: min(380px, calc(100vw - 24px));
    max-height: calc(100vh - 82px);
    top: 70px;
    right: 12px;
    overflow-y: auto;
  }

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

  .theme-grid > button {
    min-height: 70px;
    grid-template-columns: 37px minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
  }

  .theme-preview {
    width: 36px;
    height: 43px;
  }

  .app-shell {
    padding: 14px 12px 32px;
  }

  .journey-topline {
    min-height: 52px;
  }

  .route-symbol {
    width: 40px;
    height: 40px;
    border-width: 3px;
    font-size: calc(14px + var(--font-step));
  }

  .route-region {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .route-identity h2 {
    font-size: calc(17px + var(--font-step));
  }

  .mode-button {
    display: none;
  }

  .language-toggle {
    height: 36px;
  }

  .language-toggle button {
    height: 28px;
    min-width: 36px;
    padding: 0 8px;
  }

  .more-button {
    display: grid;
  }

  .transition-menu {
    width: min(272px, calc(100vw - 24px));
  }

  .route-board {
    padding: 16px 14px 13px;
    border-radius: 15px;
  }

  .route-backdrop {
    height: 142px;
    margin: -16px -14px 14px;
  }

  .board-meta {
    gap: 9px;
  }

  .board-meta p {
    font-size: calc(8px + var(--font-step));
  }

  .station-map-wrap {
    margin-top: 7px;
    padding-top: 23px;
  }

  .station-map {
    min-width: 680px;
  }

  .next-stop-card {
    padding-right: 9px;
  }

  .typing-card {
    margin-top: 10px;
    border-radius: 15px;
  }

  .typing-head {
    padding: 15px 14px 13px 20px;
  }

  .typing-head h3 {
    font-size: calc(13px + var(--font-step));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric {
    min-width: 57px;
    padding: 0 8px;
  }

  .metric b {
    font-size: calc(15px + var(--font-step));
  }

  .desktop-only {
    display: none;
  }

  .prompt-area {
    min-height: 150px;
    padding: 26px 20px 20px;
  }

  .prompt-text {
    min-height: 79px;
    font-size: calc(21px + var(--font-step));
    line-height: 1.85;
    word-break: break-all;
  }

  .prompt-text.jamo-mode {
    gap: 9px 7px;
    font-size: calc(26px + var(--font-step));
  }

  .prompt-text.syllable-mode {
    gap: 9px 4px;
    font-size: calc(33px + var(--font-step));
  }

  .syllable-char {
    height: 44px;
  }

  .char.jamo {
    min-width: 22px;
    height: 35px;
  }

  .typing-hint {
    font-size: calc(8px + var(--font-step));
  }

  .typing-foot {
    display: block;
    padding: 13px 14px 14px 20px;
  }

  .typing-actions {
    margin-top: 13px;
  }

  .text-button,
  .next-button {
    flex: 1;
  }

  .data-note {
    line-height: 1.5;
  }

  .result-card {
    padding: 31px 22px 22px;
  }
}

@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;
  }
}
