:root {
  --ink: #23303a;
  --muted: #66747f;
  --paper: #fffdf6;
  --panel: #ffffff;
  --line: #d8e0df;
  --navy: #24466b;
  --rail: #6b5a46;
  --green: #2e8b69;
  --yamanote-green: #9acd32;
  --yellow: #f6c847;
  --orange: #ee7a3d;
  --red: #d94f45;
  --blue: #3c8ec9;
  --shadow: 0 18px 48px rgba(35, 48, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, #cfeafa 0, #eef7e4 42%, #f9efe0 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100px;
}

.brand-lockup {
  min-width: 0;
  width: min(500px, 62vw);
}

.app-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  inline-size: 100%;
  height: auto;
  max-height: 118px;
  object-fit: contain;
}

.music-toggle {
  position: absolute;
  right: 0;
  bottom: 10px;
  min-height: 40px;
  border: 2px solid rgba(35, 48, 58, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 250, 245, 0.92)),
    #fffdf6;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 1000;
  box-shadow: 0 4px 0 rgba(35, 48, 58, 0.08);
}

.music-toggle[aria-pressed="true"] {
  border-color: rgba(46, 139, 105, 0.42);
  background:
    linear-gradient(135deg, rgba(239, 250, 245, 0.96), rgba(255, 246, 198, 0.82)),
    #fffdf6;
  color: var(--green);
}

.kicker,
.section-heading p {
  margin: 0;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.65rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
  padding: 6px;
  border: 1px solid rgba(35, 48, 58, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

body[data-role="driver"] .mode-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-role="parent"] .mode-switch {
  display: none;
}

.mode-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mode-button.active {
  background: var(--navy);
  color: #fff;
}

.earned-badge {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  max-width: 150px;
  padding: 5px 9px 5px 6px;
  border: 2px solid rgba(35, 48, 58, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(135deg, #ffffff 0%, #fff4bd 58%, #dff3fb 100%);
  box-shadow: 3px 3px 0 rgba(35, 48, 58, 0.12);
}

.earned-badge strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--yamanote-green);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 1000;
  line-height: 1;
}

.earned-badge span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.earned-badge.locked {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.62);
  opacity: 0.8;
}

.earned-badge.locked strong {
  background: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.journey-grid,
.parent-layout,
.route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.driver-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.child-route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.parent-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.parent-page-title {
  display: grid;
  gap: 5px;
  margin: 2px 0 18px;
  padding: 16px 18px;
  border-left: 6px solid var(--navy);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 20px rgba(35, 48, 58, 0.08);
}

.parent-page-title span {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 1000;
}

.parent-page-title h2 {
  color: var(--navy);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  font-weight: 1000;
}

.mission-board,
.parent-panel,
.reward-settings-panel,
.task-list-panel,
.approval-panel,
.route-board,
.journal-panel,
.run-history-panel,
.scene-panel {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.mission-board,
.parent-panel,
.reward-settings-panel,
.task-list-panel,
.approval-panel,
.route-board,
.journal-panel,
.run-history-panel {
  padding: 22px;
}

.driver-task-board,
.driver-route-heading,
.driver-route-board,
.run-history-panel {
  margin-top: 18px;
}

.driver-route-board {
  margin-top: 10px;
}

.driver-control-panel {
  display: grid;
  align-content: start;
}

.driver-control-panel .station-terminal {
  height: 100%;
  margin-bottom: 0;
}

.driver-task-board {
  display: block;
}

.driver-stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.58fr);
  align-items: stretch;
  gap: 14px;
}

.stage-title-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 250, 245, 0.88)),
    repeating-linear-gradient(90deg, rgba(60, 142, 201, 0.08) 0 10px, transparent 10px 20px);
  box-shadow: 0 8px 0 rgba(35, 48, 58, 0.08);
  overflow: hidden;
}

.stage-title-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--green);
}

.stage-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.stage-title-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.stage-title-main h2 {
  color: var(--ink);
  font-size: clamp(1.65rem, 3.7vw, 2.8rem);
  font-weight: 1000;
  line-height: 0.98;
}

.stage-title-main p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.stage-line-code {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 4px solid rgba(35, 48, 58, 0.82);
  border-radius: 50%;
  background: var(--yamanote-green);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 1000;
  box-shadow: 5px 5px 0 rgba(35, 48, 58, 0.13);
}

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

.stage-status-card {
  display: grid;
  align-content: center;
  justify-items: end;
  min-width: 0;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(239, 250, 245, 0.9)),
    #fffdf6;
  box-shadow: 0 5px 0 rgba(35, 48, 58, 0.07);
}

.stage-status-card.point {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 198, 0.9)),
    #fffdf6;
}

.stage-status-card span {
  display: block;
  justify-self: start;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 1000;
  line-height: 1.12;
}

.stage-status-card strong {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(1.44rem, 3.4vw, 2.24rem);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: right;
  transform: rotate(-1deg);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    2px 3px 0 rgba(35, 48, 58, 0.16);
}

.stage-reward-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(35, 48, 58, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(246, 251, 243, 0.82)),
    repeating-linear-gradient(90deg, rgba(111, 190, 68, 0.06) 0 8px, transparent 8px 16px);
  box-shadow:
    0 4px 0 rgba(35, 48, 58, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.54);
}

.reward-score-card,
.reward-tier {
  min-width: 0;
  border-radius: 999px;
}

.reward-score-card {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex: 0 0 auto;
  padding: 6px 10px;
  background: rgba(35, 48, 58, 0.9);
  color: #fff;
  white-space: nowrap;
}

.reward-score-card span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.76rem;
  font-weight: 1000;
  line-height: 1.1;
}

.reward-score-card strong {
  display: inline-block;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 1000;
  line-height: 1;
  transform: rotate(-1deg);
}

.reward-tier small {
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 1000;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-tier-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.reward-tier {
  display: inline-grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 8px 4px 5px;
  border: 1px solid rgba(35, 48, 58, 0.1);
  background: rgba(255, 253, 246, 0.86);
}

.reward-tier span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 1000;
  box-shadow: 1px 1px 0 rgba(35, 48, 58, 0.12);
}

.reward-tier strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.reward-settings-form {
  display: grid;
  gap: 12px;
}

.reward-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239, 250, 245, 0.88), rgba(255, 246, 198, 0.58)),
    #fffdf6;
}

.reward-settings-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-settings-head strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 1000;
}

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

.reward-input-grid label {
  gap: 6px;
}

.reward-input-grid label > span {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 1000;
}

.reward-tier.high {
  border-color: rgba(211, 154, 22, 0.28);
  background: rgba(255, 249, 219, 0.9);
}

.reward-tier.high span {
  background: #d39a16;
}

.reward-tier.middle {
  border-color: rgba(111, 190, 68, 0.28);
  background: rgba(239, 250, 233, 0.9);
}

.reward-tier.middle span {
  background: var(--green);
}

.reward-tier.low {
  border-color: rgba(60, 142, 201, 0.26);
  background: rgba(236, 247, 255, 0.92);
}

.reward-tier.low span {
  background: var(--blue);
}

.stage-reward-panel.is-complete {
  border-color: rgba(211, 154, 22, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 249, 219, 0.88)),
    repeating-linear-gradient(90deg, rgba(211, 154, 22, 0.1) 0 9px, transparent 9px 18px);
}

.badge-page-panel {
  width: 100%;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 250, 245, 0.88)),
    #fffdf6;
  box-shadow: var(--shadow);
}

.badge-page-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.badge-page-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 1000;
}

.badge-page-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.badge-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.badge-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(35, 48, 58, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 252, 244, 0.9)),
    #fffdf6;
  box-shadow:
    0 16px 34px rgba(35, 48, 58, 0.14),
    0 4px 0 rgba(35, 48, 58, 0.08);
}

.badge-card-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.9) 0 28%, rgba(248, 246, 230, 0.72) 52%, rgba(219, 235, 215, 0.62) 100%),
    linear-gradient(135deg, rgba(154, 205, 50, 0.16), rgba(246, 200, 71, 0.18));
}

.badge-card-art::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  pointer-events: none;
}

.badge-card-art img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 310px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 14px 18px rgba(35, 48, 58, 0.24));
}

.badge-card-art span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--yamanote-green);
  color: #fff;
  font-size: 2.1rem;
  font-weight: 1000;
  box-shadow: 0 10px 0 rgba(35, 48, 58, 0.16);
}

.badge-card-art-placeholder {
  filter: grayscale(0.75);
}

.badge-card.locked {
  border-style: dashed;
}

.badge-card.locked .badge-card-art,
.badge-card.locked .badge-card-body {
  opacity: 0.72;
}

.badge-card.preview {
  border-color: rgba(211, 154, 22, 0.42);
}

.badge-card-body {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px 16px 15px;
}

.badge-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge-card-stage,
.badge-card-code {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
}

.badge-card-stage {
  background: var(--navy);
  color: #fff;
}

.badge-card-code {
  border: 2px solid rgba(154, 205, 50, 0.82);
  background: rgba(255, 255, 255, 0.86);
  color: #184132;
}

.badge-card-body h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 1000;
  line-height: 1.05;
}

.badge-card-body p,
.badge-card-body small {
  margin: 0;
  font-weight: 850;
  line-height: 1.35;
}

.badge-card-body p {
  color: var(--ink);
}

.badge-card-body small {
  color: var(--muted);
}

.badge-clear-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.badge-clear-stats div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.badge-clear-stats dt,
.badge-clear-stats dd {
  margin: 0;
}

.badge-clear-stats dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.1;
}

.badge-clear-stats dd {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1.08;
}

.badge-clear-stats dd span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.badge-reward-list {
  display: grid;
  gap: 4px;
  margin-top: 0;
}

.badge-reward-item {
  display: grid;
  grid-template-columns: 24px minmax(50px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid rgba(35, 48, 58, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.badge-reward-item.high {
  background: rgba(255, 249, 221, 0.84);
}

.badge-reward-item.middle {
  background: rgba(239, 250, 233, 0.84);
}

.badge-reward-item.low {
  background: rgba(236, 247, 255, 0.84);
}

.badge-reward-item span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 1000;
}

.badge-reward-item.high span {
  background: #d39a16;
}

.badge-reward-item.middle span {
  background: var(--green);
}

.badge-reward-item.low span {
  background: var(--blue);
}

.badge-reward-item strong,
.badge-reward-item small {
  min-width: 0;
  margin: 0;
  line-height: 1.15;
}

.badge-reward-item strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 1000;
}

.badge-reward-item small {
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

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

.station-sign {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 18px;
  border: 4px solid var(--navy);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.station-terminal {
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #dff3fb;
  text-align: left;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px 0;
}

.station-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  justify-self: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.terminal-status {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff36d;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 1000;
  box-shadow: 3px 3px 0 rgba(35, 48, 58, 0.14);
}

.terminal-state-closing .terminal-status {
  background: #ffb84d;
  color: #2c2a1e;
  animation: terminalStatusPulse 520ms steps(2, end) infinite;
}

.terminal-state-departed .terminal-status {
  background: #6fbe44;
  color: #fff;
}

.terminal-state-arriving .terminal-status {
  background: #6fbe44;
  color: #fff;
}

.terminal-state-opening .terminal-status {
  background: #ffb84d;
  color: #2c2a1e;
  animation: terminalStatusPulse 520ms steps(2, end) infinite;
}

.terminal-state-arrived .terminal-status {
  background: #bcefff;
}

.terminal-state-suspended .terminal-status {
  background: #dfe7ec;
  color: #526572;
}

.terminal-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 232px;
  overflow: hidden;
  border-top: 3px solid rgba(35, 48, 58, 0.16);
  border-bottom: 3px solid rgba(35, 48, 58, 0.2);
  background: #cfeafa;
}

.terminal-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  transition:
    opacity 420ms ease,
    transform 420ms ease;
  pointer-events: none;
}

.terminal-art-platform {
  opacity: 1;
}

.terminal-art-interior {
  opacity: 0;
  object-position: center center;
  transform: scale(1.02);
}

.terminal-run-glass {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 42%, rgba(255, 255, 255, 0.16) 48%, transparent 56%),
    linear-gradient(105deg, transparent 0 64%, rgba(255, 255, 255, 0.1) 70%, transparent 76%);
  mix-blend-mode: screen;
}

.terminal-state-departed .terminal-art-platform {
  opacity: 0;
  transform: scale(1.02);
}

.terminal-state-departed .terminal-art-interior {
  opacity: 1;
  animation: terminalCabinRattle 760ms steps(2, end) infinite;
}

.terminal-state-departed .terminal-run-glass {
  opacity: 0.28;
  animation: terminalWindowFlow 2.8s ease-in-out infinite;
}

.terminal-state-departed .terminal-door-stage {
  opacity: 0;
}

.terminal-state-arriving .terminal-art-platform {
  opacity: 1;
  animation: terminalTrainArrive 900ms cubic-bezier(0.18, 0.84, 0.22, 1) forwards;
}

.terminal-state-arriving .terminal-art-interior,
.terminal-state-opening .terminal-art-interior,
.terminal-state-arrived .terminal-art-interior {
  opacity: 0;
}

.terminal-departure-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 1px;
  width: min(62%, 270px);
  padding: 9px 14px 11px;
  border: 2px solid rgba(35, 48, 58, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(246, 200, 71, 0.22) 10px 20px, transparent 20px 30px),
    rgba(255, 253, 246, 0.74);
  backdrop-filter: blur(2px);
  color: var(--ink);
  text-align: center;
  box-shadow:
    4px 4px 0 rgba(35, 48, 58, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.terminal-state-ready .terminal-departure-card {
  opacity: 1;
  transform: translate(-50%, -48%) scale(1);
}

.terminal-state-suspended .terminal-departure-card {
  border-color: rgba(82, 101, 114, 0.74);
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(82, 101, 114, 0.16) 10px 20px, transparent 20px 30px),
    rgba(247, 251, 254, 0.8);
}

.terminal-state-suspended .terminal-departure-card strong {
  color: #334452;
  font-size: clamp(1.55rem, 4.8vw, 2.25rem);
  line-height: 1.05;
}

.terminal-state-suspended .terminal-departure-card em {
  border-color: rgba(82, 101, 114, 0.45);
  background: #eef3f5;
  color: #334452;
}

.terminal-state-announcing .terminal-departure-card {
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.96);
}

.terminal-run-timer {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 4;
  width: min(82%, 350px);
  opacity: 0;
  transform: translate(-50%, 8px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.terminal-run-timer.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.terminal-departure-card span {
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 1000;
}

.terminal-departure-card time {
  color: #526572;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
}

.terminal-departure-card strong {
  color: var(--ink);
  font-size: clamp(2rem, 6.4vw, 3.35rem);
  line-height: 0.95;
}

.terminal-departure-card em {
  margin-top: 4px;
  padding: 3px 10px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: #e9f7e0;
  color: #1f6f54;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 1000;
}

.terminal-arrival-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(74%, 360px);
  max-height: calc(100% - 20px);
  padding: 13px 16px 15px;
  overflow: hidden;
  border: 2px solid rgba(35, 48, 58, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(111, 190, 68, 0.18) 10px 20px, transparent 20px 30px),
    rgba(255, 253, 246, 0.76);
  backdrop-filter: blur(2px);
  color: var(--ink);
  text-align: center;
  box-shadow:
    4px 4px 0 rgba(35, 48, 58, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
  opacity: 0;
  transform: translate(-50%, -45%) scale(0.97);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.terminal-arrival-card.is-visible {
  opacity: 1;
  transform: translate(-50%, -45%) scale(1);
  pointer-events: auto;
}

.terminal-arrival-card span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 1000;
}

.terminal-arrival-card strong {
  color: var(--ink);
  font-size: clamp(1.25rem, 3.7vw, 1.8rem);
  line-height: 1.08;
}

.terminal-arrival-card p {
  margin: 0;
  color: #526572;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.35;
}

.arrival-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.compact-action {
  min-height: 38px;
  padding-inline: 14px;
  border: 2px solid rgba(35, 48, 58, 0.12);
  font-size: 0.86rem;
  box-shadow: 0 3px 0 rgba(35, 48, 58, 0.18);
}

.arrival-proof-preview {
  width: min(100%, 220px);
  max-height: 98px;
  border: 3px solid rgba(35, 48, 58, 0.78);
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 3px 3px 0 rgba(35, 48, 58, 0.12);
}

.terminal-arrival-card.stage-sent {
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(246, 200, 71, 0.2) 10px 20px, transparent 20px 30px),
    rgba(255, 253, 246, 0.8);
}

.terminal-arrival-card.has-photo {
  gap: 4px;
  padding: 9px 14px 10px;
}

.terminal-arrival-card.has-photo strong {
  font-size: clamp(1.08rem, 3.2vw, 1.45rem);
}

.terminal-arrival-card.has-photo .compact-action {
  min-height: 34px;
}

.terminal-arrival-card.has-photo .arrival-proof-preview {
  max-height: 68px;
}

.proof-camera-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.terminal-door-stage {
  position: absolute;
  left: 37.25%;
  top: 27.25%;
  z-index: 1;
  width: 25.1%;
  height: 51.9%;
  overflow: hidden;
  border-radius: 8px 8px 6px 6px;
  opacity: 1;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.terminal-door-stage::before,
.terminal-door-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: 13%;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0) 20%),
    linear-gradient(180deg, rgba(246, 249, 249, 0.94) 0 64%, rgba(111, 190, 68, 0.92) 64% 80%, rgba(239, 241, 239, 0.94) 80% 100%);
}

.terminal-door-stage::before {
  left: 0;
  border-radius: 8px 0 0 6px;
}

.terminal-door-stage::after {
  right: 0;
  border-radius: 0 8px 6px 0;
}

.terminal-state-closing .terminal-door-stage::before,
.terminal-state-closing .terminal-door-stage::after,
.terminal-state-departed .terminal-door-stage::before,
.terminal-state-departed .terminal-door-stage::after,
.terminal-state-arriving .terminal-door-stage::before,
.terminal-state-arriving .terminal-door-stage::after {
  opacity: 1;
}

.terminal-state-opening .terminal-door-stage::before,
.terminal-state-opening .terminal-door-stage::after {
  opacity: 0;
}

.terminal-door-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 50.2%;
  border: 2px solid rgba(39, 48, 53, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 18%),
    linear-gradient(90deg, rgba(38, 47, 53, 0.12), rgba(255, 255, 255, 0.34) 34%, rgba(38, 47, 53, 0.1)),
    linear-gradient(180deg, #f7faf9 0 62%, #6fbe44 62% 79%, #eef1ef 79% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.58),
    inset 0 -10px 14px rgba(35, 48, 58, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.34);
}

.terminal-door-panel::before {
  content: "";
  position: absolute;
  top: 16%;
  bottom: 49%;
  width: 46%;
  border: 2px solid rgba(34, 44, 49, 0.82);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 28%, transparent 28% 44%, rgba(255, 255, 255, 0.28) 44% 58%, transparent 58%),
    linear-gradient(180deg, rgba(165, 226, 250, 0.88), rgba(75, 166, 202, 0.72));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.terminal-door-panel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(48, 57, 66, 0.75);
}

.terminal-door-panel.left {
  left: 0;
  border-radius: 8px 0 0 6px;
  transform: translateX(-112%);
}

.terminal-door-panel.left::before {
  right: 18%;
}

.terminal-door-panel.left::after {
  right: -1px;
}

.terminal-door-panel.right {
  right: 0;
  border-radius: 0 8px 6px 0;
  transform: translateX(112%);
}

.terminal-door-panel.right::before {
  left: 18%;
}

.terminal-door-panel.right::after {
  left: -3px;
  width: 3px;
  background: #303942;
  box-shadow: 0 0 5px rgba(48, 57, 66, 0.2);
}

.terminal-state-closing .terminal-door-panel.left {
  animation: terminalDoorLeftClose 1500ms cubic-bezier(0.25, 0.8, 0.2, 1) forwards;
}

.terminal-state-closing .terminal-door-panel.right {
  animation: terminalDoorRightClose 1500ms cubic-bezier(0.25, 0.8, 0.2, 1) forwards;
}

.terminal-state-departed .terminal-door-panel.left,
.terminal-state-arriving .terminal-door-panel.left {
  transform: translateX(0);
}

.terminal-state-departed .terminal-door-panel.right,
.terminal-state-arriving .terminal-door-panel.right {
  transform: translateX(0);
}

.terminal-state-opening .terminal-door-panel.left {
  animation: terminalDoorLeftOpen 1500ms cubic-bezier(0.25, 0.8, 0.2, 1) forwards;
}

.terminal-state-opening .terminal-door-panel.right {
  animation: terminalDoorRightOpen 1500ms cubic-bezier(0.25, 0.8, 0.2, 1) forwards;
}

.terminal-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(35, 48, 58, 0.06), transparent 34%, rgba(35, 48, 58, 0.2)),
    linear-gradient(90deg, rgba(35, 48, 58, 0.18), transparent 24%, transparent 76%, rgba(35, 48, 58, 0.08));
}

.platform-roof {
  position: absolute;
  left: -8px;
  right: -8px;
  top: 0;
  height: 34px;
  border-bottom: 4px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, #f5f0da 0 28px, #e7ddbe 28px 56px),
    #efe7c8;
}

.platform-roof::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -15px;
  height: 12px;
  border: 3px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #6fbe44;
  box-shadow: 0 7px 0 rgba(35, 48, 58, 0.1);
}

@keyframes terminalDoorLeftClose {
  from {
    transform: translateX(-112%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes terminalDoorRightClose {
  from {
    transform: translateX(112%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes terminalDoorLeftOpen {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-112%);
  }
}

@keyframes terminalDoorRightOpen {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(112%);
  }
}

@keyframes terminalTrainArrive {
  0% {
    opacity: 0.78;
    transform: translateX(-7%) scale(1.045);
    filter: saturate(0.92) brightness(1.04);
  }

  68% {
    opacity: 1;
    transform: translateX(1%) scale(1.015);
    filter: saturate(1) brightness(1);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: none;
  }
}

@keyframes terminalStatusPulse {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.18);
  }
}

@keyframes terminalCabinRattle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1.02);
  }

  50% {
    transform: translateY(1px) rotate(-0.08deg) scale(1.02);
  }
}

@keyframes terminalWindowFlow {
  from {
    background-position:
      0 0,
      0 0;
  }

  to {
    background-position:
      -34px 0,
      -22px 0;
  }
}

.waiting-train {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 28px;
  height: 78px;
  border: 4px solid var(--ink);
  border-radius: 14px 18px 8px 8px;
  background:
    linear-gradient(180deg, #f7fbff 0 62%, #d9e8ee 62% 100%);
  box-shadow: 9px 9px 0 rgba(35, 48, 58, 0.16);
}

.waiting-train::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 8px;
  background: #6fbe44;
}

.waiting-train::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(35, 48, 58, 0.18);
}

.train-window-row {
  position: absolute;
  left: 18px;
  right: 132px;
  top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(34px, 1fr));
  gap: 10px;
}

.train-window-row span {
  height: 28px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: linear-gradient(180deg, #bcefff, #eaf9ff);
}

.train-door {
  position: absolute;
  right: 48px;
  bottom: 0;
  width: 64px;
  height: 66px;
  border-inline: 3px solid var(--ink);
  background: #eef6f7;
}

.train-door span {
  position: absolute;
  top: 4px;
  bottom: 5px;
  width: 24px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: #f9ffff;
}

.train-door.open span:first-child {
  left: -16px;
}

.train-door.open span:last-child {
  right: -16px;
}

.train-face-light {
  position: absolute;
  right: 12px;
  top: 25px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff36d;
  box-shadow: 0 0 12px rgba(246, 200, 71, 0.68);
}

.train-green-line {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  height: 8px;
  border-radius: 999px;
  background: #6fbe44;
}

.platform-edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  border-top: 4px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, #fff36d 0 18px, #29323b 18px 30px),
    #f4d35e;
}

.terminal-route-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 18px 18px;
  padding: 12px;
  border: 3px solid rgba(36, 70, 107, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 46%),
    #f7fbfe;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.72),
    4px 4px 0 rgba(35, 48, 58, 0.1);
}

.terminal-route-station {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 104px;
  align-content: start;
  padding: 10px 8px;
  border-radius: 6px;
  background: rgba(222, 242, 251, 0.78);
  text-align: center;
}

.terminal-route-station.next {
  background: rgba(233, 247, 224, 0.92);
}

.terminal-route-station span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.terminal-route-station small {
  color: #426275;
  font-size: clamp(0.78rem, 2.5vw, 0.95rem);
  font-weight: 900;
  line-height: 1;
}

.terminal-route-station strong {
  overflow: hidden;
  white-space: nowrap;
  word-break: keep-all;
  align-self: center;
  min-height: 3.1rem;
  color: var(--ink);
  font-size: clamp(1.7rem, 5.2vw, 3.15rem);
  line-height: 0.98;
}

.terminal-route-station strong.station-name-multiline {
  display: grid;
  align-items: center;
  overflow: visible;
  white-space: normal;
  white-space: pre-line;
  word-break: normal;
  min-height: 3.1rem;
  line-height: 0.9;
}

.terminal-route-arrow {
  position: relative;
  width: clamp(34px, 7vw, 54px);
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow:
    0 3px 0 rgba(35, 48, 58, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.terminal-route-arrow::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 0;
  height: 0;
  border-block: 12px solid transparent;
  border-left: 16px solid var(--green);
  transform: translateY(-50%);
}

.station-sign > strong {
  font-size: clamp(2rem, 9vw, 4.8rem);
  line-height: 1;
}

.station-sign > span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.mission-focus {
  min-height: 178px;
  padding: 0;
  border: 2px dashed rgba(35, 48, 58, 0.2);
  border-radius: 8px;
  background: #fbfaf3;
  overflow: hidden;
}

.task-directive {
  display: grid;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 251, 232, 0.92)),
    repeating-linear-gradient(90deg, rgba(47, 170, 107, 0.08) 0 8px, transparent 8px 16px);
}

.driver-task-board .mission-focus {
  min-height: 0;
  width: 100%;
}

.driver-task-board .task-directive {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
}

.task-directive-top {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(500px, 1.2fr);
  align-items: center;
  gap: 18px;
  border-bottom: 2px solid rgba(35, 48, 58, 0.1);
  padding-bottom: 12px;
}

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

.driver-task-board .task-directive-head {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.task-section-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding-left: 14px;
  color: var(--ink);
  font-size: clamp(1.18rem, 2.25vw, 1.58rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0;
}

.task-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  bottom: 0.08em;
  width: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 3px 0 0 var(--yellow);
}

.mission-title {
  margin: 0;
  min-width: 0;
  font-size: clamp(1.25rem, 4.6vw, 2rem);
  line-height: 1.08;
  text-align: right;
  overflow-wrap: anywhere;
}

.driver-task-board .mission-title {
  font-size: clamp(1.25rem, 2.4vw, 1.72rem);
  text-align: left;
}

.run-history-panel .section-heading {
  margin-bottom: 14px;
}

.task-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.task-time-card {
  position: relative;
  min-width: 0;
  border: 3px solid rgba(35, 48, 58, 0.14);
  border-radius: 8px;
  padding: 12px 12px 13px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 255, 246, 0.58)),
    rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(3px) saturate(1.08);
  box-shadow: 0 6px 0 rgba(35, 48, 58, 0.12);
  text-align: center;
}

.task-time-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.task-time-card small {
  display: block;
  margin-top: 8px;
  color: #435763;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
}

.task-time-card strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  font-weight: 900;
  line-height: 1;
}

.task-time-card.departure {
  border-color: rgba(217, 79, 69, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 246, 219, 0.58)),
    repeating-linear-gradient(-45deg, rgba(238, 122, 61, 0.045) 0 10px, transparent 10px 20px),
    rgba(255, 255, 255, 0.56);
}

.task-time-card.departure span {
  background: var(--orange);
}

.task-time-card.departure strong {
  color: var(--red);
}

.task-time-card.arrival {
  border-color: rgba(46, 139, 105, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 255, 246, 0.58)),
    repeating-linear-gradient(45deg, rgba(46, 139, 105, 0.045) 0 10px, transparent 10px 20px),
    rgba(255, 255, 255, 0.56);
}

.task-time-card.arrival span {
  background: var(--green);
}

.task-time-card.arrival strong {
  color: var(--green);
}

.task-time-arrow {
  position: relative;
  width: 28px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 3px 0 rgba(35, 48, 58, 0.13);
}

.task-time-arrow::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 0;
  height: 0;
  border-block: 9px solid transparent;
  border-left: 12px solid var(--orange);
  transform: translateY(-50%);
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.task-note-item {
  grid-column: 1 / -1;
}

.task-detail-item {
  min-width: 0;
  border: 1px solid rgba(35, 48, 58, 0.1);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.7);
}

.task-detail-item dt {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
}

.task-detail-item dd {
  margin: 0;
  color: var(--ink);
  font-size: clamp(0.98rem, 3.6vw, 1.2rem);
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.child-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.driver-action-bar {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.88), rgba(239, 250, 245, 0.9)),
    repeating-linear-gradient(90deg, rgba(60, 142, 201, 0.08) 0 10px, transparent 10px 20px);
  box-shadow: 0 12px 30px rgba(35, 48, 58, 0.1);
}

.driver-action-bar .primary-action,
.driver-action-bar .secondary-action {
  min-height: 62px;
  font-size: 1.12rem;
}

.driver-task-board .child-actions {
  align-self: stretch;
  grid-template-columns: 1fr;
  margin-top: 0;
}

.driver-task-board .child-actions button {
  min-height: 0;
  height: 100%;
}

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

.run-history-item {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(300px, 1fr) minmax(110px, 0.38fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 246, 0.92)),
    #fbfaf3;
  box-shadow: 0 5px 0 rgba(35, 48, 58, 0.06);
}

.run-history-item.approved {
  background:
    linear-gradient(90deg, rgba(238, 247, 228, 0.9), rgba(255, 253, 246, 0.92)),
    #eef7e4;
}

.run-history-item.checking {
  background:
    linear-gradient(90deg, rgba(255, 250, 222, 0.86), rgba(255, 253, 246, 0.92)),
    #fff7ce;
}

.run-history-item.redo {
  background:
    linear-gradient(90deg, rgba(255, 238, 235, 0.86), rgba(255, 253, 246, 0.92)),
    #fff1ed;
}

.run-history-main,
.run-history-status {
  min-width: 0;
}

.run-history-route {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
}

.run-history-main h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.run-history-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.run-history-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.run-history-times div {
  min-width: 0;
  padding: 8px 9px 9px;
  border: 1px solid rgba(35, 48, 58, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.run-history-times span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.run-history-times dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 5px 0 0;
}

.run-history-times dl div {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.run-history-times dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.run-history-times dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
}

.run-history-status {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff3bf;
  color: #6c5617;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.status-pill.approved {
  background: var(--green);
  color: #fff;
}

.status-pill.running {
  background: var(--navy);
  color: #fff;
}

.status-pill.checking {
  background: var(--yellow);
  color: #5d4a12;
}

.status-pill.redo {
  background: var(--red);
  color: #fff;
}

.history-points {
  display: inline-block;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #526572;
  font-size: clamp(1.28rem, 2.7vw, 1.82rem);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0.01em;
  transform: rotate(-1deg);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    2px 3px 0 rgba(35, 48, 58, 0.12);
}

.history-points.points-5 {
  color: #d59b00;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    2px 3px 0 rgba(137, 92, 0, 0.18);
}

.history-points.points-3 {
  color: var(--green);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    2px 3px 0 rgba(46, 139, 105, 0.18);
}

.history-points.points-2 {
  color: var(--blue);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    2px 3px 0 rgba(60, 142, 201, 0.18);
}

.history-points.points-1 {
  color: var(--red);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    2px 3px 0 rgba(217, 79, 69, 0.18);
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(35, 48, 58, 0.2);
}

.primary-action {
  background: var(--orange);
}

.secondary-action {
  background: var(--green);
}

.danger-action {
  background: var(--red);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.scene-panel {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.scene-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #86d8f8;
}

.yamanote-card {
  background: #86d8f8;
}

.yamanote-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("./assets/sky-clouds-sun.png");
  background-position: right top;
  background-size: cover;
  pointer-events: none;
}

.scene-card.scene-running::before {
  animation: skyDrift 14s linear infinite;
}

.city-strip {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 100%);
  width: 300%;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.city-strip.departed {
  animation: sceneryRun 4.8s linear infinite;
}

.city-strip.arriving {
  animation: sceneryArrive 900ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.city-strip.arrived {
  animation: none;
  transform: translateX(-66.666%);
}

.scene-card.scene-running .city-panel::before {
  animation: townRun 1.2s linear infinite;
}

.city-panel {
  position: relative;
  min-width: 100%;
  background:
    linear-gradient(180deg, transparent 0 45%, rgba(217, 245, 255, 0.72) 45% 48%, #9ddf89 48% 74%, #f5cf75 74%);
}

.city-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 126px;
  height: 92px;
  opacity: 0.72;
  background:
    repeating-linear-gradient(
      90deg,
      #8fc1de 0 28px,
      #8fc1de 28px 46px,
      transparent 46px 58px,
      #f0b476 58px 96px,
      #f0b476 96px 122px,
      transparent 122px 140px,
      #a99ee1 140px 176px,
      #a99ee1 176px 198px,
      transparent 198px 218px
    );
  clip-path: polygon(
    0 36%,
    8% 36%,
    8% 10%,
    16% 10%,
    16% 42%,
    28% 42%,
    28% 18%,
    38% 18%,
    38% 50%,
    48% 50%,
    48% 6%,
    58% 6%,
    58% 40%,
    70% 40%,
    70% 22%,
    80% 22%,
    80% 46%,
    90% 46%,
    90% 14%,
    100% 14%,
    100% 100%,
    0 100%
  );
}

.midtown {
  background:
    linear-gradient(180deg, transparent 0 43%, rgba(215, 242, 255, 0.72) 43% 47%, #9bdd91 47% 74%, #efc66d 74%);
}

.station-town {
  background:
    linear-gradient(180deg, transparent 0 42%, rgba(223, 246, 255, 0.72) 42% 47%, #b6df92 47% 73%, #eec878 73%);
}

.cloud {
  display: none;
}

.cloud-a {
  left: 52px;
  top: 52px;
}

.cloud-b {
  right: 120px;
  top: 92px;
  transform: scale(0.82);
}

.cloud-c {
  left: 42%;
  top: 42px;
  transform: scale(0.9);
}

.building,
.tower,
.shop,
.billboard,
.tree,
.station-illustration {
  position: absolute;
  bottom: 126px;
  border: 4px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(35, 48, 58, 0.14);
}

.building {
  width: 72px;
  background:
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(255, 255, 255, 0.55) 18px 28px),
    #75a9d8;
}

.building::before {
  content: "";
  position: absolute;
  inset: 14px 12px;
  background: repeating-linear-gradient(180deg, #fff8b6 0 12px, transparent 12px 24px);
}

.b1 {
  left: 48px;
  height: 152px;
  background-color: #5aa6d6;
}

.b2 {
  left: 142px;
  height: 112px;
  background-color: #f2996e;
}

.b3 {
  right: 86px;
  height: 176px;
  background-color: #9b8edb;
}

.b4 {
  left: 82px;
  height: 188px;
  background-color: #4aa3c8;
}

.b5 {
  left: 188px;
  height: 132px;
  background-color: #f0a45f;
}

.b6 {
  right: 72px;
  height: 154px;
  background-color: #78bd80;
}

.b7 {
  left: 46px;
  height: 118px;
  background-color: #7aa4df;
}

.b8 {
  right: 52px;
  height: 142px;
  background-color: #ef8d74;
}

.b9 {
  left: 476px;
  width: 56px;
  height: 128px;
  background-color: #6fbe44;
}

.b10 {
  right: 218px;
  width: 88px;
  height: 104px;
  background-color: #f6c847;
}

.b11 {
  left: 390px;
  width: 62px;
  height: 166px;
  background-color: #d976a9;
}

.b12 {
  right: 214px;
  width: 80px;
  height: 116px;
  background-color: #60b7d7;
}

.b13 {
  right: 330px;
  width: 52px;
  height: 92px;
  background-color: #f6c847;
}

.b14 {
  left: 300px;
  width: 64px;
  height: 104px;
  background-color: #75b4e5;
}

.b15 {
  right: 284px;
  width: 70px;
  height: 124px;
  background-color: #9b8edb;
}

.b16 {
  left: 482px;
  width: 58px;
  height: 108px;
  background-color: #ed7f68;
}

.b17 {
  right: 390px;
  width: 74px;
  height: 146px;
  background-color: #72a8d8;
}

.b18 {
  right: 480px;
  width: 52px;
  height: 92px;
  background-color: #f6c847;
}

.b19 {
  left: 396px;
  width: 56px;
  height: 138px;
  background-color: #6fbe44;
}

.b20 {
  right: 384px;
  width: 82px;
  height: 104px;
  background-color: #f2996e;
}

.b21 {
  right: 480px;
  width: 58px;
  height: 154px;
  background-color: #5aa6d6;
}

.tower {
  left: 250px;
  width: 48px;
  height: 226px;
  border-radius: 22px 22px 4px 4px;
  background: #f3f7fb;
}

.tower::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -42px;
  width: 8px;
  height: 42px;
  transform: translateX(-50%);
  background: var(--ink);
}

.tower::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16px;
  width: 24px;
  height: 24px;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #9ee3ff;
}

.shop {
  left: 338px;
  display: grid;
  place-items: center;
  width: 116px;
  height: 76px;
  border-radius: 8px;
  background: #fff3b6;
  color: var(--navy);
  font-weight: 1000;
}

.shop::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: -24px;
  height: 26px;
  border: 4px solid var(--ink);
  border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg, #e8504f 0 18px, #fff 18px 36px);
}

.billboard {
  left: 300px;
  top: 108px;
  bottom: auto;
  display: grid;
  place-items: center;
  width: 84px;
  height: 58px;
  border-radius: 8px;
  background: #6fbe44;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 1000;
}

.tree {
  bottom: 126px;
  width: 34px;
  height: 54px;
  border: 0;
  background: #7a5638;
  box-shadow: none;
}

.tree::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -34px;
  width: 68px;
  height: 58px;
  transform: translateX(-50%);
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #5bbf6c;
}

.t1 {
  left: 430px;
}

.t2 {
  right: 226px;
}

.station-illustration {
  left: 50%;
  display: grid;
  place-items: center;
  width: 230px;
  height: 130px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: #fff7ce;
}

.station-clock {
  position: absolute;
  top: -46px;
  width: 58px;
  height: 58px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}

.station-clock::before,
.station-clock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 18px;
  transform-origin: bottom;
  background: var(--ink);
}

.station-clock::before {
  transform: translate(-50%, -100%) rotate(0deg);
}

.station-clock::after {
  height: 14px;
  transform: translate(-50%, -100%) rotate(90deg);
}

.station-canopy {
  position: absolute;
  left: -14px;
  right: -14px;
  top: -18px;
  height: 32px;
  border: 4px solid var(--ink);
  border-radius: 8px 8px 0 0;
  background: #6fbe44;
}

.station-front {
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 1000;
}

.yamanote-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.station-thread {
  position: absolute;
  left: 32%;
  right: 32%;
  top: 62px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 0 0 2px rgba(111, 190, 68, 0.38),
    0 5px 14px rgba(35, 48, 58, 0.16);
}

.station-active-line {
  position: absolute;
  left: 32%;
  top: 59px;
  z-index: 1;
  width: 36%;
  height: 10px;
  transform: scaleX(0.08);
  transform-origin: left center;
  border-radius: 999px;
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 246, 164, 0.96), rgba(111, 190, 68, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 255, 255, 0.7) 14px 20px);
  box-shadow:
    0 0 0 2px rgba(255, 246, 164, 0.48),
    0 0 18px rgba(246, 200, 71, 0.85),
    0 0 26px rgba(111, 190, 68, 0.58);
}

.neighbor-station,
.real-station {
  position: absolute;
  z-index: 1;
  display: grid;
  gap: 4px;
  text-align: center;
}

.real-station {
  top: 24px;
  width: 152px;
  min-height: 72px;
  padding: 9px 8px;
  overflow: visible;
  border: 3px solid #6fbe44;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.real-station.origin {
  left: 32%;
  transform: translateX(-50%);
}

.real-station.destination {
  left: 68%;
  transform: translateX(-50%);
}

.real-station::before,
.real-station::after {
  content: "";
  position: absolute;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.real-station::before {
  inset: -9px;
  border-radius: 11px;
  background:
    radial-gradient(circle at 18% 24%, #fff9b4 0 4px, transparent 5px),
    radial-gradient(circle at 82% 16%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 74% 82%, #fff9b4 0 4px, transparent 5px),
    linear-gradient(135deg, rgba(255, 246, 164, 0.78), rgba(111, 190, 68, 0.35));
  filter: blur(1px);
}

.real-station::after {
  left: 12px;
  right: 12px;
  bottom: -9px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 246, 164, 0.9);
  box-shadow: 0 0 14px rgba(246, 200, 71, 0.9);
}

.neighbor-station {
  top: 34px;
  width: 100px;
  min-height: 58px;
  padding: 8px;
  border: 2px solid rgba(111, 190, 68, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16);
}

.neighbor-station.previous {
  left: 0;
  transform: translateX(-25%);
}

.neighbor-station.next {
  left: 100%;
  transform: translateX(-75%);
}

.neighbor-station.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.station-code {
  justify-self: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #6fbe44;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 1000;
}

.real-station strong {
  overflow: hidden;
  white-space: nowrap;
  word-break: keep-all;
  font-size: 1.25rem;
  line-height: 1.05;
}

.neighbor-station .station-code {
  padding-inline: 7px;
  font-size: 0.64rem;
  background: rgba(111, 190, 68, 0.82);
}

.neighbor-station strong {
  overflow: hidden;
  white-space: nowrap;
  word-break: keep-all;
  color: var(--navy);
  font-size: 0.9rem;
  line-height: 1.05;
}

.station-state-origin .real-station.origin,
.station-state-destination .real-station.destination {
  border-color: #f6c847;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.2),
    0 0 0 4px rgba(255, 246, 164, 0.5),
    0 0 28px rgba(246, 200, 71, 0.78);
  animation: stationGlow 1.7s ease-in-out infinite;
}

.station-state-origin .real-station.origin::before,
.station-state-destination .real-station.destination::before {
  opacity: 1;
}

.station-state-origin .real-station.origin::before,
.station-state-destination .real-station.destination::before {
  animation: stationSparkle 1.25s steps(2, end) infinite;
}

.station-state-in-transit .station-active-line {
  opacity: 1;
  transform: scaleX(1);
  animation: linePulse 920ms ease-in-out infinite alternate;
}

.station-state-in-transit .real-station.origin,
.station-state-in-transit .real-station.destination {
  border-color: rgba(111, 190, 68, 0.9);
  box-shadow:
    0 9px 22px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 246, 164, 0.3);
}

@keyframes stationGlow {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

@keyframes stationSparkle {
  0% {
    transform: scale(0.96) rotate(0deg);
  }
  100% {
    transform: scale(1.02) rotate(2deg);
  }
}

@keyframes linePulse {
  0% {
    filter: saturate(1);
  }
  100% {
    filter: saturate(1.25) brightness(1.12);
  }
}

.platform-station {
  position: absolute;
  bottom: 94px;
  width: 158px;
  height: 104px;
  z-index: 1;
}

.origin-platform {
  left: 18px;
}

.destination-platform {
  right: 18px;
}

.platform-art {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  filter: drop-shadow(5px 7px 0 rgba(35, 48, 58, 0.12));
  pointer-events: none;
}

.platform-sign {
  position: absolute;
  left: 50%;
  top: 34px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 72px;
  min-height: 30px;
  transform: translateX(-50%);
  border: 4px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 1000;
  box-shadow: 4px 4px 0 rgba(35, 48, 58, 0.14);
  overflow: hidden;
}

.platform-sign::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 5px;
  border-radius: 999px;
  background: #6fbe44;
  z-index: 0;
}

.platform-sign span {
  position: relative;
  z-index: 1;
  padding-bottom: 5px;
}

.real-track {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: 68px;
  height: 32px;
  z-index: 2;
}

.real-track img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.scene-card.scene-running .real-track img {
  width: calc(100% + 36px);
  margin-left: -18px;
  animation: trackRun 480ms linear infinite;
}

.illustration-train {
  position: absolute;
  left: var(--train-x, 74px);
  bottom: 84px;
  width: 172px;
  height: auto;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 4;
}

.illustration-train img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(5px 7px 0 rgba(35, 48, 58, 0.12));
  pointer-events: none;
}

.illustration-train.departed {
  transform: translateX(var(--train-mid-shift, 0px));
  animation: trainRattle 560ms steps(4, end) infinite;
}

.illustration-train.arriving {
  animation: trainArrive 900ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.illustration-train.arrived {
  animation: none;
  transform: translateX(var(--train-destination-shift, 0px));
}

.illustration-train.departed img {
  animation: trainImageRattle 280ms steps(2, end) infinite;
}

.illustration-train.arriving img {
  animation: trainImageRattle 280ms steps(2, end) infinite;
}

.illustration-train.arrived img {
  animation: none;
}

.run-time-panel {
  position: absolute;
  left: 50%;
  top: 53%;
  z-index: 7;
  display: grid;
  gap: 9px;
  width: min(78%, 390px);
  transform: translate(-50%, -50%) scale(0.96);
  padding: 12px;
  border: 4px solid rgba(35, 48, 58, 0.88);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 255, 246, 0.58)),
    rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(3px) saturate(1.08);
  box-shadow:
    8px 10px 0 rgba(35, 48, 58, 0.16),
    0 0 0 3px rgba(255, 255, 255, 0.44);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 240ms ease,
    transform 240ms ease;
}

.run-time-panel.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.run-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.run-time-block {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 3px solid rgba(35, 48, 58, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.run-time-block.departure {
  border-color: rgba(239, 95, 56, 0.58);
  background: rgba(255, 255, 255, 0.68);
}

.run-time-block.arrival {
  border-color: rgba(46, 151, 111, 0.58);
  background: rgba(255, 255, 255, 0.68);
}

.run-time-block.pending {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px 16px),
    rgba(255, 255, 255, 0.68);
}

.run-time-block > span {
  justify-self: center;
  padding: 2px 10px 3px;
  border-radius: 999px;
  background: #2e976f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 1000;
}

.run-time-block.departure > span {
  background: #ef713b;
}

.run-time-block dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.run-time-block dl div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
}

.run-time-block dt {
  color: #526572;
  font-size: 0.68rem;
  font-weight: 900;
}

.run-time-block dd {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.1rem, 3.4vw, 1.55rem);
  font-weight: 1000;
  line-height: 1;
  text-align: right;
}

.run-time-block.pending dd:last-child {
  color: rgba(82, 101, 114, 0.52);
  letter-spacing: 0;
}

.run-timer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 9px 11px;
  border: 3px solid rgba(60, 142, 201, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.terminal-run-timer .run-timer {
  margin-top: 0;
  min-height: 66px;
  padding: 12px 14px;
  border-color: rgba(35, 48, 58, 0.7);
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(246, 200, 71, 0.18) 10px 20px, transparent 20px 30px),
    rgba(255, 253, 246, 0.78);
  backdrop-filter: blur(2px);
  box-shadow:
    4px 4px 0 rgba(35, 48, 58, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.terminal-run-timer .run-timer span {
  font-size: 0.88rem;
}

.terminal-run-timer .run-timer strong {
  font-size: clamp(1.65rem, 4.8vw, 2.35rem);
}

.run-timer span {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 1000;
}

.run-timer strong {
  color: var(--ink);
  font-size: clamp(1.25rem, 3.8vw, 1.8rem);
  font-weight: 1000;
  line-height: 1;
  text-align: right;
}

.run-timer.delayed {
  border-color: rgba(217, 79, 69, 0.58);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px 16px),
    rgba(255, 246, 236, 0.82);
}

.run-timer.delayed span,
.run-timer.delayed strong {
  color: var(--red);
}

.arrival-pop {
  position: absolute;
  left: 50%;
  top: 27%;
  z-index: 8;
  display: none;
  transform: translate(-50%, -50%) rotate(-4deg);
  padding: 8px 18px 11px;
  border: 5px solid var(--ink);
  border-radius: 14px;
  background: #fff36d;
  color: #ef5f38;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    3px 3px 0 #fff,
    5px 5px 0 rgba(35, 48, 58, 0.18);
  box-shadow: 10px 10px 0 rgba(35, 48, 58, 0.18);
}

.arrival-pop.visible {
  display: block;
  animation: arrivalBounce 540ms cubic-bezier(0.18, 0.9, 0.25, 1.25);
}

.scene-card.scene-arriving .arrival-pop.visible {
  animation-delay: 620ms;
  animation-fill-mode: both;
}

@keyframes skyDrift {
  0% {
    background-position: left top;
  }
  100% {
    background-position: right top;
  }
}

@keyframes sceneryRun {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-66.666%);
  }
}

@keyframes sceneryArrive {
  0% {
    transform: translateX(-34%);
  }
  100% {
    transform: translateX(-66.666%);
  }
}

@keyframes townRun {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -140px 0;
  }
}

@keyframes trackRun {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-18px);
  }
}

@keyframes trainRattle {
  0%,
  100% {
    transform: translateX(var(--train-mid-shift, 0px)) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(var(--train-mid-shift, 0px)) translateY(-2px) rotate(-0.8deg);
  }
  50% {
    transform: translateX(var(--train-mid-shift, 0px)) translateY(1px) rotate(0.7deg);
  }
  75% {
    transform: translateX(var(--train-mid-shift, 0px)) translateY(-1px) rotate(-0.35deg);
  }
}

@keyframes trainArrive {
  0% {
    transform: translateX(var(--train-mid-shift, 0px));
  }
  100% {
    transform: translateX(var(--train-destination-shift, 0px));
  }
}

@keyframes trainImageRattle {
  0% {
    filter: drop-shadow(5px 7px 0 rgba(35, 48, 58, 0.12));
  }
  100% {
    filter: drop-shadow(6px 8px 0 rgba(35, 48, 58, 0.16));
  }
}

@keyframes arrivalBounce {
  0% {
    transform: translate(-50%, -50%) scale(0.45) rotate(-10deg);
    opacity: 0;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.12) rotate(-3deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(-4deg);
  }
}

@keyframes runStatusPop {
  0% {
    transform: scale(0.72);
  }
  70% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.sun {
  position: absolute;
  top: 36px;
  right: 44px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 12px rgba(246, 200, 71, 0.24);
}

.mountain {
  position: absolute;
  bottom: 150px;
  width: 240px;
  height: 160px;
  transform: rotate(45deg);
  background: #66a777;
}

.mountain-a {
  left: -48px;
}

.mountain-b {
  right: -74px;
  bottom: 138px;
  background: #4f8f73;
}

.station-mini {
  position: absolute;
  bottom: 86px;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 132px;
  z-index: 2;
}

.station-mini.origin {
  left: 18px;
}

.station-mini.destination {
  right: 18px;
}

.station-nameplate {
  display: grid;
  place-items: center;
  min-width: 104px;
  max-width: 128px;
  min-height: 34px;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 1000;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(35, 48, 58, 0.18);
}

.station-house {
  position: relative;
  width: 106px;
  height: 74px;
  border: 4px solid var(--ink);
  border-radius: 6px;
  background: #fff4cf;
  box-shadow: 8px 8px 0 rgba(35, 48, 58, 0.12);
}

.station-roof {
  position: absolute;
  left: -8px;
  right: -8px;
  top: -22px;
  height: 28px;
  border: 3px solid var(--ink);
  border-radius: 6px 6px 0 0;
  background: var(--red);
}

.station-door {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 34px;
  height: 48px;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  border-bottom: 0;
  background: #8d674c;
}

.scene-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  height: 64px;
  z-index: 1;
}

.rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid rgba(35, 48, 58, 0.38);
  background: #6e6258;
}

.rail-top {
  top: 17px;
}

.rail-bottom {
  bottom: 12px;
}

.sleepers {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 16px,
      #7f5f3e 16px 28px,
      transparent 28px 44px
    );
  clip-path: polygon(0 20%, 100% 20%, 100% 92%, 0 92%);
}

.train {
  position: absolute;
  left: 62px;
  bottom: 82px;
  width: 128px;
  height: 66px;
  border: 4px solid var(--ink);
  border-radius: 20px 22px 10px 10px;
  background:
    linear-gradient(180deg, #fdf7d6 0 34%, var(--blue) 34% 100%);
  box-shadow: 8px 8px 0 rgba(35, 48, 58, 0.15);
  transition: transform 420ms ease;
  z-index: 3;
}

.train-window {
  position: absolute;
  top: 12px;
  width: 34px;
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #e4f5ff;
}

.window-a {
  left: 18px;
}

.window-b {
  left: 58px;
}

.train-face {
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.train::before,
.train::after {
  content: "";
  position: absolute;
  bottom: -15px;
  width: 20px;
  height: 20px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #2d2f34;
}

.train::before {
  left: 18px;
}

.train::after {
  right: 18px;
}

.train.departed {
  transform: translateX(clamp(82px, 24vw, 150px));
}

.train.arrived {
  transform: translateX(clamp(150px, 42vw, 270px));
}

.arrival-stamp {
  position: absolute;
  right: 28px;
  bottom: 96px;
  display: none;
  place-items: center;
  width: 112px;
  height: 112px;
  transform: rotate(-12deg);
  border: 8px solid rgba(217, 79, 69, 0.88);
  border-radius: 50%;
  color: rgba(217, 79, 69, 0.95);
  font-size: 1.6rem;
  font-weight: 1000;
  z-index: 5;
}

.arrival-stamp.visible {
  display: grid;
}

.mission-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-error {
  display: none;
  margin: 0;
  border: 1px solid rgba(217, 79, 69, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(217, 79, 69, 0.08);
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 900;
}

.form-error.visible {
  display: block;
}

.is-hidden {
  display: none !important;
}

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

.task-list-item {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(46, 139, 105, 0.09), rgba(255, 255, 255, 0.78) 34%),
    #fbfaf3;
}

.task-list-item.editing {
  outline: 3px solid rgba(246, 200, 71, 0.9);
}

.task-list-main {
  display: grid;
  gap: 4px;
}

.task-list-main h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.15;
}

.task-list-main p,
.task-list-times span {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.task-list-status {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.task-list-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.task-list-times span {
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.72);
}

.task-list-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.approval-list,
.journal-list {
  display: grid;
  gap: 10px;
}

.approval-item,
.journal-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf3;
}

.approval-item h3,
.journal-item h3 {
  margin: 0;
  font-size: 1.1rem;
}

.approval-item p,
.journal-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.approval-item.approved {
  background: #eef7e4;
}

.approval-item-head {
  display: grid;
  gap: 5px;
}

.approval-item-head span {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.approval-item.approved .approval-item-head span {
  background: var(--green);
}

.report-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-time-grid div {
  border: 1px solid rgba(35, 48, 58, 0.09);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.report-time-grid dt {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
}

.report-time-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.report-photo-button {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.report-photo-button img {
  width: 78px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
}

.report-photo-empty,
.approval-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(35, 48, 58, 0.72);
}

.photo-viewer[hidden] {
  display: none;
}

.photo-viewer img {
  max-width: min(92vw, 920px);
  max-height: 82vh;
  border: 4px solid #fff;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.photo-viewer-close {
  position: fixed;
  right: 18px;
  top: 18px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(35, 48, 58, 0.58);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(420px, 92vw);
  border: 3px solid rgba(35, 48, 58, 0.86);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(250, 244, 225, 0.98)),
    var(--paper);
  text-align: center;
  box-shadow:
    0 18px 46px rgba(35, 48, 58, 0.24),
    6px 6px 0 rgba(35, 48, 58, 0.13);
}

.confirm-dialog h2 {
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 1000;
}

.confirm-dialog p {
  margin: 12px 0 20px;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 900;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-modal.confirm-arrive #confirmPrimaryButton {
  background: var(--green);
}

#confirmCancelButton {
  background: #2f363b;
  color: #fff;
}

.badge-award-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 247, 201, 0.62), transparent 34%),
    linear-gradient(180deg, rgba(15, 32, 48, 0.72), rgba(35, 48, 58, 0.82));
}

.badge-award-modal[hidden] {
  display: none;
}

.badge-award-dialog {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(460px, 94vw);
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 24px 22px 22px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(242, 250, 239, 0.97)),
    var(--paper);
  text-align: center;
  box-shadow:
    0 26px 70px rgba(8, 20, 30, 0.42),
    0 0 0 8px rgba(255, 255, 255, 0.16);
  animation: badge-award-enter 560ms cubic-bezier(0.18, 0.9, 0.18, 1.08) both;
}

.badge-award-modal.is-leaving .badge-award-dialog {
  animation: badge-award-leave 180ms ease both;
}

.badge-award-ribbon {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  padding: 6px 14px;
  border: 1px solid rgba(97, 68, 10, 0.26);
  border-radius: 999px;
  background: linear-gradient(135deg, #f7d76a, #fff0a8 48%, #d39a16);
  color: #5c3b00;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0;
  box-shadow: 0 7px 14px rgba(109, 78, 8, 0.22);
}

.badge-award-cheer {
  display: grid;
  gap: 2px;
  margin-top: 30px;
  color: var(--navy);
  text-align: center;
  transform: rotate(-2deg);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.92),
    0 7px 16px rgba(246, 200, 71, 0.28);
  animation: badge-cheer-pop 700ms cubic-bezier(0.14, 0.9, 0.18, 1.12) 160ms both;
}

.badge-award-cheer span,
.badge-award-cheer strong {
  display: block;
  line-height: 0.96;
  letter-spacing: 0;
}

.badge-award-cheer span {
  color: #f0804f;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-weight: 1000;
}

.badge-award-cheer strong {
  color: var(--green);
  font-size: clamp(1.45rem, 5.8vw, 2.1rem);
  font-weight: 1000;
}

.badge-award-medal {
  position: relative;
  display: grid;
  place-items: center;
  width: min(74vw, 260px);
  aspect-ratio: 1 / 1;
  margin-top: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.92), rgba(252, 246, 219, 0.48) 55%, rgba(154, 205, 50, 0.24) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.8),
    0 20px 34px rgba(35, 48, 58, 0.24);
  animation: badge-medal-pop 780ms cubic-bezier(0.14, 0.86, 0.16, 1.08) both;
}

.badge-award-medal::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(246, 200, 71, 0.34), rgba(154, 205, 50, 0.12), rgba(255, 255, 255, 0.3), rgba(246, 200, 71, 0.34));
  filter: blur(2px);
  animation: badge-award-glow 2600ms linear infinite;
}

.badge-award-medal img {
  width: min(100%, 240px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 16px 18px rgba(35, 48, 58, 0.28));
}

.badge-award-medal span {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--yamanote-green);
  color: #fff;
  font-size: 2.4rem;
  font-weight: 1000;
}

.badge-award-copy {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.badge-award-copy span {
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 1000;
}

.badge-award-copy h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  font-weight: 1000;
  line-height: 1;
}

.badge-award-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
}

.badge-award-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  margin: 16px 0 0;
}

.badge-award-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(35, 48, 58, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.badge-award-stats dt,
.badge-award-stats dd {
  margin: 0;
}

.badge-award-stats dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.badge-award-stats dd {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 1000;
}

.badge-award-actions {
  display: grid;
  width: 100%;
  margin-top: 16px;
}

.badge-award-actions .primary-action {
  min-height: 56px;
  font-size: 1.02rem;
}

.badge-award-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.badge-award-effects span {
  position: absolute;
  top: -40px;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: #f6c847;
  opacity: 0;
  animation: badge-confetti 2400ms ease-in-out infinite;
}

.badge-award-effects span:nth-child(1) { left: 12%; background: #9acd32; animation-delay: 80ms; }
.badge-award-effects span:nth-child(2) { left: 25%; background: #f6c847; animation-delay: 320ms; }
.badge-award-effects span:nth-child(3) { left: 42%; background: #4da3ff; animation-delay: 180ms; }
.badge-award-effects span:nth-child(4) { left: 58%; background: #ffffff; animation-delay: 520ms; }
.badge-award-effects span:nth-child(5) { left: 73%; background: #f0804f; animation-delay: 260ms; }
.badge-award-effects span:nth-child(6) { left: 86%; background: #9acd32; animation-delay: 640ms; }

@keyframes badge-award-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes badge-award-leave {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes badge-medal-pop {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-8deg);
  }
  62% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes badge-cheer-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.84) rotate(-5deg);
  }
  68% {
    opacity: 1;
    transform: translateY(0) scale(1.06) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(-2deg);
  }
}

@keyframes badge-award-glow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes badge-confetti {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(26px, 110vh, 0) rotate(520deg);
  }
}

.stage-transition-overlay {
  --next-stage-line-color: #00b261;
  --next-stage-line-rgb: 0, 178, 97;
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 36%, rgba(var(--next-stage-line-rgb), 0.3), transparent 34%),
    linear-gradient(135deg, rgba(18, 59, 89, 0.94), rgba(var(--next-stage-line-rgb), 0.78));
  animation: stage-transition-in 360ms ease both;
}

.stage-transition-overlay[hidden] {
  display: none;
}

.stage-transition-overlay.is-leaving {
  animation: stage-transition-out 260ms ease both;
}

.stage-transition-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(420px, 92vw);
  padding: 36px 24px 34px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.96);
  color: var(--navy);
  text-align: center;
  box-shadow:
    0 28px 74px rgba(8, 20, 30, 0.42),
    0 0 0 8px rgba(255, 255, 255, 0.12);
  animation: stage-card-pop 680ms cubic-bezier(0.14, 0.9, 0.18, 1.08) both;
}

.stage-transition-card > span {
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f7d76a, #fff0a8 48%, #d39a16);
  color: #5c3b00;
  font-size: 0.82rem;
  font-weight: 1000;
}

.stage-transition-line-code {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin-top: 8px;
  border: 8px solid var(--next-stage-line-color);
  border-radius: 50%;
  background: #fff;
  color: var(--next-stage-line-color);
  font-size: 2rem;
  font-weight: 1000;
  box-shadow: 0 15px 25px rgba(35, 48, 58, 0.18);
}

.stage-transition-card h2 {
  margin: 6px 0 0;
  font-size: clamp(2.1rem, 8vw, 3.2rem);
  line-height: 1;
  font-weight: 1000;
}

.stage-transition-card p {
  margin: 0;
  color: var(--next-stage-line-color);
  font-weight: 1000;
}

.stage-transition-card strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 1000;
}

.stage-transition-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-transition-effects span {
  position: absolute;
  top: 50%;
  left: -22vw;
  width: 38vw;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transform: rotate(-8deg);
  animation: stage-speed-line 1100ms ease-in-out infinite;
}

.stage-transition-effects span:nth-child(2) {
  top: 36%;
  animation-delay: 160ms;
}

.stage-transition-effects span:nth-child(3) {
  top: 64%;
  animation-delay: 320ms;
}

@keyframes stage-transition-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stage-transition-out {
  to { opacity: 0; }
}

@keyframes stage-card-pop {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stage-speed-line {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(-8deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(144vw) rotate(-8deg);
  }
}

.route-board {
  min-height: 0;
}

.driver-route-heading {
  display: grid;
  gap: 6px;
  padding-inline: 4px;
}

.driver-route-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.45rem);
}

.driver-route-board {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.rail-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--station-count, 30), 88px);
  gap: 10px;
  width: max-content;
  min-width: 100%;
  min-height: 172px;
  overflow: hidden;
  padding: 72px 22px 26px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 244, 137, 0.68) 0 8px, transparent 9px),
    radial-gradient(circle at 66% 76%, rgba(255, 255, 255, 0.62) 0 12px, transparent 13px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 12%, transparent 12% 100%),
    #94de65;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.74),
    inset 0 -18px 34px rgba(47, 140, 78, 0.18);
}

.rail-map::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 96px;
  z-index: 1;
  height: 9px;
  border: 2px solid #26323a;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, #fff 0 7px, #26323a 7px 14px);
  box-shadow:
    0 4px 0 rgba(35, 48, 58, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.rail-map::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 99px;
  z-index: 2;
  height: 3px;
  border-top: 1px solid #26323a;
  border-bottom: 1px solid #26323a;
  pointer-events: none;
}

.map-scenery,
.map-scenery span {
  position: absolute;
  pointer-events: none;
}

.map-scenery {
  inset: 0;
  z-index: 0;
}

.map-water {
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.36) 0 5px, transparent 6px),
    linear-gradient(135deg, #39a9e7, #1984cf);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.water-a {
  left: -34px;
  top: -20px;
  width: 154px;
  height: 86px;
  border-radius: 0 0 74px 0;
}

.water-b {
  right: -28px;
  bottom: -34px;
  width: 170px;
  height: 106px;
  border-radius: 82px 0 0;
}

.map-field {
  border: 3px solid rgba(67, 151, 73, 0.44);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 224, 93, 0.32) 0 12px, rgba(132, 209, 84, 0.16) 12px 24px),
    #c9ec6a;
}

.field-a {
  left: 29%;
  top: 18px;
  width: 96px;
  height: 48px;
  transform: rotate(-4deg);
}

.field-b {
  right: 20%;
  bottom: 18px;
  width: 108px;
  height: 54px;
  transform: rotate(3deg);
}

.map-building {
  width: 34px;
  height: 42px;
  border: 3px solid #26323a;
  border-radius: 4px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0 5px, transparent 5px 10px),
    #75c7df;
  box-shadow: 4px 5px 0 rgba(35, 48, 58, 0.14);
}

.building-a {
  left: 14%;
  top: 26px;
}

.building-b {
  left: 61%;
  top: 24px;
  height: 50px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0 5px, transparent 5px 10px),
    #f5b14b;
}

.building-c {
  right: 11%;
  top: 46px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0 5px, transparent 5px 10px),
    #c893e8;
}

.building-d {
  left: 48%;
  bottom: 18px;
  height: 36px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0 5px, transparent 5px 10px),
    #68b8ff;
}

.map-house {
  width: 44px;
  height: 34px;
  border: 3px solid #26323a;
  border-radius: 5px;
  background: #fff5ca;
  box-shadow: 4px 5px 0 rgba(35, 48, 58, 0.12);
}

.map-house::before {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  top: -16px;
  height: 20px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #eb604f;
}

.house-a {
  left: 23%;
  bottom: 25px;
}

.house-b {
  right: 31%;
  top: 30px;
}

.map-tree {
  width: 22px;
  height: 22px;
  border: 3px solid #288052;
  border-radius: 50%;
  background: #33bd68;
  box-shadow:
    -10px 8px 0 -2px #54d977,
    8px 9px 0 -3px #219c58,
    0 17px 0 -8px #9a6b33;
}

.tree-a {
  left: 9%;
  bottom: 34px;
}

.tree-b {
  left: 35%;
  top: 34px;
}

.tree-c {
  left: 42%;
  bottom: 26px;
}

.tree-d {
  right: 7%;
  top: 22px;
}

.tree-e {
  right: 16%;
  bottom: 32px;
}

.tree-f {
  left: 71%;
  bottom: 72px;
}

.map-flower {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff8bc2;
  box-shadow:
    9px 0 0 #ff8bc2,
    4px -8px 0 #ffaad2,
    4px 8px 0 #e86dab;
}

.flower-a {
  left: 18%;
  top: 74px;
}

.flower-b {
  left: 54%;
  bottom: 78px;
}

.flower-c {
  right: 24%;
  top: 74px;
}

.map-pond {
  left: 33%;
  bottom: 20px;
  width: 62px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  background: #32a9d8;
}

.route-station {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 74px;
  z-index: 3;
}

.route-end-label {
  position: absolute;
  top: -36px;
  z-index: 5;
  padding: 4px 11px 5px;
  border: 3px solid #26323a;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #ffd85b 100%);
  color: #f05a48;
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  box-shadow:
    4px 5px 0 rgba(35, 48, 58, 0.18),
    0 0 0 4px rgba(255, 255, 255, 0.62);
}

.route-end-label::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 12px;
  height: 12px;
  border-right: 3px solid #26323a;
  border-bottom: 3px solid #26323a;
  background: #ffd85b;
  transform: translateX(-50%) rotate(45deg);
}

.station-dot {
  display: grid;
  place-items: center;
  width: 88px;
  height: 52px;
  padding: 4px 6px;
  border: 4px solid #26323a;
  border-radius: 7px;
  background: #fff;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  box-shadow:
    5px 6px 0 rgba(35, 48, 58, 0.2),
    inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.route-station.done .station-dot {
  background: #ffd85b;
}

.route-station.current .station-dot {
  border-color: #26323a;
  background: linear-gradient(180deg, #fff7b4 0%, #ffbc3b 100%);
  color: #26323a;
  animation: routeStationGlow 1.45s ease-in-out infinite;
  box-shadow:
    0 0 0 5px rgba(255, 239, 101, 0.78),
    0 0 22px rgba(255, 143, 31, 0.76),
    5px 6px 0 rgba(35, 48, 58, 0.22),
    inset 0 0 0 3px rgba(255, 255, 255, 0.74);
}

@keyframes routeStationGlow {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-3px);
    filter: brightness(1.08);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 16px;
  }

  .section-heading h2 {
    font-size: 1.45rem;
  }

  .mode-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-role="driver"] .mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-role="parent"] .mode-switch {
    display: none;
  }

  .mode-button {
    min-width: 0;
    padding-inline: 6px;
    font-size: 0.9rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .driver-stage-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .stage-title-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 14px 12px 14px 16px;
  }

  .stage-line-code {
    width: 46px;
    height: 46px;
    border-width: 3px;
    font-size: 1rem;
  }

  .stage-reward-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .reward-tier-list {
    width: 100%;
    flex-wrap: wrap;
  }

  .reward-tier {
    flex-basis: min(210px, 100%);
  }

  .reward-input-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
  }

  .music-toggle {
    position: static;
    justify-self: center;
    width: fit-content;
    margin: 0 auto;
  }

  .brand-lockup {
    width: min(280px, calc(100vw - 32px)) !important;
    max-width: min(280px, calc(100vw - 32px));
    inline-size: min(280px, calc(100vw - 32px)) !important;
    max-inline-size: min(280px, calc(100vw - 32px));
    margin: 0 auto;
  }

  .app-logo {
    width: 100% !important;
    max-width: 100%;
    inline-size: 100% !important;
    max-inline-size: 100%;
    max-height: 76px;
  }

  .journey-grid,
  .driver-main-grid,
  .parent-layout,
  .route-layout,
  .child-route-layout {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .scene-panel,
  .scene-card {
    width: 100%;
    max-width: calc(100vw - 32px);
    min-height: 0;
  }

  .scene-panel {
    aspect-ratio: 1.08 / 1;
    height: auto;
  }

  .mission-board,
  .parent-panel,
  .task-list-panel,
  .approval-panel,
  .route-board,
  .journal-panel,
  .run-history-panel,
  .scene-panel {
    max-width: calc(100vw - 32px);
  }

  .driver-task-board .task-directive {
    grid-template-columns: 1fr;
  }

  .driver-task-board {
    grid-template-columns: 1fr;
  }

  .task-directive-top {
    grid-template-columns: 1fr;
  }

  .run-history-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .run-history-status {
    justify-items: start;
  }

  .driver-task-board .child-actions {
    grid-template-columns: 1fr 1fr;
  }

  .terminal-scene {
    min-height: 214px;
  }

  .terminal-departure-card {
    width: min(64%, 240px);
    padding: 8px 12px 10px;
  }

  .terminal-departure-card strong {
    font-size: clamp(1.9rem, 7.8vw, 2.95rem);
  }

  .task-directive {
    gap: 10px;
    padding: 12px;
  }

  .task-directive-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .mission-title {
    text-align: left;
  }

  .terminal-arrival-card {
    width: min(78%, 310px);
    padding: 11px 13px 13px;
  }

  .terminal-arrival-card strong {
    font-size: clamp(1.12rem, 4.6vw, 1.55rem);
  }

  .terminal-arrival-card p {
    font-size: 0.8rem;
  }

  .arrival-proof-preview {
    max-height: 88px;
  }

  .waiting-train {
    left: 7%;
    right: 7%;
    height: 70px;
  }

  .train-window-row {
    right: 112px;
    gap: 7px;
  }

  .train-door {
    right: 42px;
    width: 54px;
    height: 60px;
  }

  .train-door span {
    width: 21px;
  }

  .train-door.open span:first-child {
    left: -13px;
  }

  .train-door.open span:last-child {
    right: -13px;
  }

  .terminal-route-board {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 6px;
    margin-inline: 8px;
    padding: 8px;
  }

  .terminal-route-station {
    min-height: 88px;
    padding: 7px 4px;
  }

  .terminal-route-station span {
    font-size: 0.68rem;
  }

  .terminal-route-station small {
    font-size: 0.72rem;
  }

  .terminal-route-station strong {
    font-size: clamp(1.28rem, 6.8vw, 2rem);
  }

  .terminal-route-arrow {
    width: 22px;
    height: 8px;
  }

  .terminal-route-arrow::after {
    right: -2px;
    border-block-width: 9px;
    border-left-width: 11px;
  }

  .station-thread {
    left: 27%;
    right: 27%;
    top: 54px;
  }

  .station-range-start .station-thread {
    left: 27%;
  }

  .station-range-end .station-thread {
    right: 27%;
  }

  .station-active-line {
    left: 27%;
    top: 51px;
    width: 46%;
    height: 8px;
  }

  .real-station {
    top: 20px;
    width: clamp(118px, 22vw, 146px);
    min-height: 58px;
    padding: 8px 6px;
  }

  .real-station.origin {
    left: 27%;
  }

  .real-station.destination {
    left: 73%;
  }

  .neighbor-station {
    top: 80px;
    width: clamp(86px, 13vw, 104px);
    min-height: 45px;
    padding: 6px 5px;
    gap: 3px;
    opacity: 0.86;
    border-width: 2px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
  }

  .neighbor-station.previous {
    left: 11%;
    transform: translateX(-50%);
  }

  .neighbor-station.next {
    left: 89%;
    transform: translateX(-50%);
  }

  .station-code {
    padding-inline: 6px;
    font-size: 0.62rem;
  }

  .real-station strong {
    font-size: 0.92rem;
  }

  .neighbor-station .station-code {
    padding-inline: 6px;
    font-size: 0.56rem;
  }

  .neighbor-station strong {
    font-size: 0.72rem;
  }

  .station-mini {
    width: 112px;
  }

  .station-nameplate {
    min-width: 88px;
    max-width: 108px;
    font-size: 0.76rem;
  }

  .station-house {
    width: 86px;
    height: 62px;
  }

  .rail-map {
    grid-template-columns: repeat(var(--station-count, 30), 88px);
    gap: 10px;
    width: max-content;
    min-width: 100%;
    min-height: 172px;
    padding: 72px 22px 26px;
  }

  .driver-route-board {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .badge-page-panel {
    padding: 18px;
  }

  .badge-gallery {
    grid-template-columns: 1fr;
  }

  .badge-card-art {
    padding: 12px;
  }

  .badge-card-art img {
    width: min(100%, 250px);
  }

  .badge-card-meta {
    flex-wrap: wrap;
  }

  .rail-map::before {
    left: 22px;
    right: 22px;
    top: 96px;
    height: 9px;
    border-width: 2px;
    box-shadow:
      0 4px 0 rgba(35, 48, 58, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .rail-map::after {
    left: 24px;
    right: 24px;
    top: 99px;
    height: 3px;
  }

  .route-station {
    min-height: 74px;
  }

  .station-dot {
    width: 88px;
    height: 52px;
    padding: 4px 6px;
    border-width: 4px;
    font-size: 0.94rem;
    box-shadow:
      5px 6px 0 rgba(35, 48, 58, 0.2),
      inset 0 0 0 3px rgba(255, 255, 255, 0.7);
  }

  .map-building {
    width: 34px;
    height: 42px;
    border-width: 3px;
  }

  .map-house {
    width: 44px;
    height: 34px;
    border-width: 3px;
  }

  .map-tree {
    width: 22px;
    height: 22px;
    border-width: 3px;
  }
}

@media (max-width: 520px) {
  .neighbor-station {
    width: 76px;
    min-height: 40px;
    padding: 5px 4px;
  }

  .neighbor-station.previous {
    left: 13%;
  }

  .neighbor-station.next {
    left: 87%;
  }

  .neighbor-station .station-code {
    font-size: 0.5rem;
  }

  .neighbor-station strong {
    font-size: 0.62rem;
  }

  .mode-button {
    padding-inline: 4px;
    font-size: 0.78rem;
  }

  .badge-award-modal {
    padding: 14px;
  }

  .badge-award-dialog {
    padding: 22px 14px 16px;
  }

  .badge-award-medal {
    width: min(76vw, 220px);
  }

  .badge-award-medal img {
    width: min(100%, 205px);
  }

  .badge-award-stats,
  .badge-award-actions {
    grid-template-columns: 1fr;
  }

  .badge-clear-stats {
    grid-template-columns: 1fr;
  }

  .badge-reward-item {
    grid-template-columns: 24px 48px minmax(0, 1fr);
    gap: 5px;
  }

  .child-actions,
  .approval-actions,
  .form-actions,
  .task-list-times,
  .task-list-actions,
  .report-time-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .driver-action-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .driver-action-bar .primary-action,
  .driver-action-bar .secondary-action {
    min-height: 52px;
    padding-inline: 8px;
    font-size: 0.98rem;
  }

  .mission-board,
  .parent-panel,
  .task-list-panel,
  .approval-panel,
  .route-board,
  .journal-panel,
  .run-history-panel {
    padding: 16px;
  }

  .station-terminal {
    margin-bottom: 16px;
  }

  .terminal-header {
    align-items: flex-start;
    padding-inline: 12px;
  }

  .terminal-scene {
    min-height: 190px;
  }

  .terminal-departure-card {
    width: min(64%, 210px);
    padding: 7px 9px 8px;
  }

  .terminal-departure-card span {
    font-size: 0.62rem;
  }

  .terminal-departure-card time {
    font-size: 0.66rem;
  }

  .terminal-departure-card strong {
    font-size: clamp(1.65rem, 8.8vw, 2.38rem);
  }

  .terminal-departure-card em {
    margin-top: 3px;
    padding: 2px 9px;
    font-size: 0.68rem;
  }

  .task-time-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .task-time-card {
    padding: 8px 6px;
  }

  .task-time-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .task-time-card span {
    font-size: 0.7rem;
  }

  .task-time-card small {
    font-size: 0.62rem;
  }

  .task-time-card strong {
    font-size: clamp(1.28rem, 7vw, 1.72rem);
  }

  .task-time-arrow {
    width: 20px;
    height: 7px;
  }

  .task-time-arrow::after {
    right: -3px;
    border-block-width: 8px;
    border-left-width: 10px;
  }

  .task-detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .task-note-item {
    grid-column: 1 / -1;
  }

  .task-detail-item {
    padding: 7px;
  }

  .task-detail-item dt {
    font-size: 0.68rem;
  }

  .task-detail-item dd {
    font-size: 0.9rem;
  }

  .terminal-arrival-card {
    width: min(80%, 250px);
    gap: 4px;
    padding: 9px 10px 10px;
  }

  .terminal-arrival-card span {
    font-size: 0.62rem;
  }

  .terminal-arrival-card strong {
    font-size: clamp(0.98rem, 4.6vw, 1.22rem);
  }

  .terminal-arrival-card p {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .arrival-card-actions {
    gap: 6px;
  }

  .compact-action {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.72rem;
  }

  .arrival-proof-preview {
    max-height: 70px;
    border-width: 2px;
  }

  .waiting-train {
    left: 4%;
    right: 4%;
  }

  .train-window-row {
    left: 12px;
    right: 98px;
    grid-template-columns: repeat(2, minmax(34px, 1fr));
  }

  .train-window-row span:nth-child(3) {
    display: none;
  }

  .run-history-times {
    grid-template-columns: 1fr;
  }

  .driver-task-board .child-actions {
    grid-template-columns: 1fr;
  }
}
