:root {
  color-scheme: light;
  --bg: #012A40;
  --surface: #ffffff;
  --surface-soft: #f4f8fa;
  --ink: #1A202C;
  --muted: #8C9084;
  --brand: #21B3D7;
  --brand-dark: #012A40;
  --green: #3ECE7E;
  --green-dark: #28a965;
  --pink: #DF1C74;
  --line: #e4e9ec;
  --danger: #c82333;
  --danger-dark: #971b27;
  --shadow: 0 18px 45px rgba(0, 0, 0, .18);
  --radius: 8px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(33, 179, 215, .12), transparent 360px),
    var(--bg);
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: var(--brand-dark);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: clamp(20px, 4vw, 27px);
  font-weight: 950;
}

.brand::before {
  content: "";
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: url('/static/favicon.svg') center / cover no-repeat;
}

.top .row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.top .row > a,
.nav-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.top .row > a:hover,
.nav-button:hover {
  background: var(--surface-soft);
  color: var(--brand-dark);
}

.wrap > h1,
.page-help,
.dashboard-grid,
.toolbar,
.page-card,
.editor-shell,
.login-card,
.passenger-route,
.error-page {
  width: min(calc(100% - 40px), var(--content));
  margin-left: auto;
  margin-right: auto;
}

.wrap > h1 {
  margin-top: 38px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 8px solid var(--pink);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.04;
  color: #ffffff;
}

.page-help {
  margin-top: -6px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, .82);
  font-weight: 800;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 30px;
}

.tabs {
  width: min(calc(100% - 40px), var(--content));
  margin: -4px auto 18px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tabs a {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, .12);
  color: #ffffff;
  font-weight: 900;
}

.tabs a.active {
  background: var(--pink);
}

.stat-grid {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.stat-card strong {
  display: block;
  color: var(--brand-dark);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1;
}

.wide {
  grid-column: 1 / -1;
}

.login-card,
.passenger-route,
.error-page {
  margin-top: clamp(42px, 9vh, 90px);
  max-width: 560px;
}

.login-card h1,
.passenger-route h1,
.card h2 {
  margin-top: 0;
}

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

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

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(33, 179, 215, .18);
}

.code-input {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--green);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #ffffff;
}

.btn.secondary {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--brand-dark);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.big {
  width: 100%;
  min-height: 58px;
  font-size: 18px;
}

.btn.compact {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
}

.notice {
  width: min(calc(100% - 40px), var(--content));
  margin: 16px auto;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff3f4;
  color: var(--danger-dark);
  border: 1px solid #ffd4da;
  font-weight: 800;
}

.warning-list .notice {
  margin-top: 8px;
  margin-bottom: 8px;
}

.notice.warning {
  background: #fff8e8;
  color: #815500;
  border-color: #f7d99a;
}

.notice.danger {
  background: #fff3f4;
  color: var(--danger-dark);
  border-color: #ffd4da;
}

.notice.ok {
  background: #eefbf4;
  color: #176b3e;
  border-color: #c9f1dc;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 42, 64, .58);
}

.modal {
  width: min(100%, 420px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 12px;
}

.modal h2 {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1.15;
}

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

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.modal-error {
  margin-top: 10px;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff3f4;
  color: var(--danger-dark);
  font-size: 14px;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions [data-modal-danger] {
  margin-right: auto;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.list-item,
.route-row,
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--surface-soft);
}

.list-item h3,
.player-row h3,
.list-item p,
.player-row p,
.route-row p {
  margin: 0;
}

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

.reward-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-controls b {
  margin-right: 2px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.page-card {
  margin-bottom: 30px;
}

.editor-shell {
  margin-bottom: 30px;
}

.desktop-only-notice {
  margin-bottom: 12px;
  border: 1px solid rgba(190, 55, 85, .18);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff2f4;
  color: #8d2441;
  font-weight: 900;
}

.editor-shell.editor-disabled .editor-modebar,
.editor-shell.editor-disabled .map-editor,
.editor-shell.editor-disabled .editor-status {
  display: none;
}

.editor-shell.editor-locked .editor-modebar {
  opacity: .72;
}

.editor-modebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.tool-button.active {
  background: var(--pink);
  border-color: var(--pink);
  color: #ffffff;
}

.tool-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.icon-tool {
  min-width: 42px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 20px;
  line-height: 1;
}

.file-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-status {
  margin-top: 12px;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.textarea {
  min-height: 46px;
  resize: vertical;
}

.map-editor {
  position: relative;
  height: min(70vh, 760px);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(1, 42, 64, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 42, 64, .06) 1px, transparent 1px),
    #ffffff;
  background-size: 36px 36px;
  touch-action: none;
}

.map-editor.map-editor-locked {
  cursor: not-allowed;
}

.map-editor.map-editor-locked::after {
  content: "Vergrendeld";
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 7;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(141, 36, 65, .92);
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.map-editor.map-editor-locked .map-frame {
  pointer-events: none;
}

.map-frame {
  position: absolute;
  z-index: 0;
  overflow: hidden;
  border: 1px solid rgba(1, 42, 64, .14);
  border-radius: calc(var(--radius) - 4px);
  background:
    linear-gradient(rgba(1, 42, 64, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 42, 64, .05) 1px, transparent 1px),
    rgba(255, 255, 255, .9);
  background-size: 36px 36px;
}

.map-viewport {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

.map-world {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.map-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: 50% 50%;
  pointer-events: none;
}

.map-background img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.map-control-group {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 20px rgba(1, 42, 64, .12);
  pointer-events: auto;
}

.map-control-group span,
.map-control-group b,
.map-control-group label,
.map-control-group button {
  font-size: 13px;
  font-weight: 950;
}

.map-control-group span {
  color: var(--muted);
  padding: 0 4px;
}

.map-control-group b {
  min-width: 42px;
  text-align: center;
  color: var(--brand-dark);
}

.map-control-group button,
.map-control-group label {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  cursor: pointer;
}

.map-control-group button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.map-editor svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.station {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 68px;
  max-width: 170px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--brand-dark);
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(1, 42, 64, .22);
  cursor: grab;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}

.station.selected {
  background: var(--pink);
}

.connection-label {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  min-width: 28px;
  min-height: 28px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(1, 42, 64, .18);
}

.connection-label.selected {
  background: var(--pink);
}

.connection-label.upgrade {
  background: #21b3d7;
}

.station:active {
  cursor: grabbing;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffe2ea;
  color: #8d2441;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.lock-badge.unlocked {
  background: #e6f8ee;
  color: #177345;
}

.code-pill {
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 92px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
  gap: 8px;
  padding: 12px 10px;
  text-align: center;
  overflow: hidden;
}

.code-pill strong {
  display: block;
  width: 100%;
  font-size: 28px;
  line-height: 1;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}

.code-pill-meta {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.code-pill-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.code-pill form {
  display: inline-flex;
}

.code-pill button {
  cursor: pointer;
}

.code-pill-action {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #ffffff;
  color: var(--brand-dark);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.code-pill-action.danger {
  border-color: #ffd4da;
  background: #fff3f4;
  color: var(--danger-dark);
}

.code-pill.used {
  background: #eaf8f0;
  color: #176b3e;
}

.route-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto auto;
}

.upgrade-row {
  grid-template-columns: 1.4fr auto auto auto;
}

.upgrade-state {
  min-width: 54px;
  text-align: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.upgrade-state.enabled {
  background: #eaf8f0;
  color: #176b3e;
}

.upgrade-state.disabled {
  background: #fff1e5;
  color: #9a4e11;
}

.player-row {
  display: grid;
  grid-template-columns: 1.2fr auto;
}

.player-row > form {
  grid-column: 1 / -1;
}

.muted-row {
  opacity: .58;
}

.route-card {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  text-align: center;
}

.route-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1.1;
}

.route-card strong svg {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-card-label {
  display: block;
}

.route-station {
  display: inline-block;
}

.route-card b {
  color: var(--green-dark);
  font-size: clamp(34px, 10vw, 58px);
  line-height: 1;
}

.passenger-route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.passenger-fullscreen-close {
  display: none;
}

.passenger-route-map {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbfd, #eef5f8);
  overflow: hidden;
}

.passenger-route-map-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.passenger-route-map-zoom-level {
  min-width: 68px;
}

.passenger-route-map-viewport {
  max-height: min(70vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
}

.passenger-route-map-canvas {
  aspect-ratio: 1.55;
  min-height: 280px;
  max-width: none;
}

.passenger-route-map-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

body.route-fullscreen-active {
  background: #000000;
}

body.route-fullscreen-active .top,
body.route-fullscreen-active .site-footer,
body.route-fullscreen-active .passenger-route-meta,
body.route-fullscreen-active .passenger-route-instructions,
body.route-fullscreen-active .notice,
body.route-fullscreen-active .passenger-route-actions,
body.route-fullscreen-active .passenger-route-map,
body.route-fullscreen-active form {
  display: none !important;
}

body.route-fullscreen-active .wrap {
  min-height: 100vh;
}

body.route-fullscreen-active .passenger-route {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  place-items: center;
  align-content: center;
  background: #000000;
  color: #ffffff;
}

body.route-fullscreen-active .passenger-fullscreen-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  display: inline-flex;
}

body.route-fullscreen-active .passenger-route h1 {
  display: none;
}

body.route-fullscreen-active .route-card {
  margin: 0;
}

body.route-fullscreen-active .route-card-label,
body.route-fullscreen-active .route-card b {
  display: block;
}

body.route-fullscreen-active .route-card-label {
  display: none;
}

body.route-fullscreen-active .route-card strong {
  font-size: clamp(42px, 9vw, 110px);
  line-height: 1.05;
  color: #ffffff;
}

body.route-fullscreen-active .route-station-start,
body.route-fullscreen-active .route-direction-arrow {
  display: none;
}

body.route-fullscreen-active .route-card b {
  margin-top: 18px;
  font-size: clamp(30px, 6vw, 64px);
  color: #3ece7e;
}

.site-footer {
  width: min(calc(100% - 40px), var(--content));
  margin: auto auto 0;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
}

.print-page {
  width: min(calc(100% - 40px), var(--content));
  margin: 32px auto;
  background: #ffffff;
  color: #000000;
  padding: 28px;
}

.print-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid #111111;
  margin-bottom: 16px;
  padding-bottom: 10px;
}

.print-header h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.print-header span {
  font-weight: 900;
  color: #333333;
  white-space: nowrap;
}

.print-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.print-options label {
  min-height: 38px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 950;
}

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

.print-code-grid article {
  border: 1px dashed #999999;
  border-radius: var(--radius);
  padding: 14px;
  min-height: 92px;
}

.print-code-grid strong {
  display: block;
  font-size: 28px;
  letter-spacing: .08em;
}

.print-code-grid span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.print-map {
  position: relative;
  aspect-ratio: var(--print-map-aspect-ratio, 1.55);
  min-height: 520px;
  border: 1px solid #222222;
  background: #ffffff;
  overflow: hidden;
}

.print-map-fit {
  position: absolute;
  inset: 0;
}

.print-map-canvas {
  position: absolute;
  inset: 0;
}

.print-map-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

.print-stations {
  break-inside: avoid;
  margin-top: 18px;
}

.print-upgrades {
  break-inside: avoid;
  margin-top: 18px;
}

.print-upgrades h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.print-upgrade-note {
  margin: 0 0 10px;
  font-size: 13px;
  color: #333333;
}

.print-upgrade-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.print-upgrade-list article {
  border: 1px solid #21b3d7;
  background: #eefafe;
  border-radius: 10px;
  padding: 10px 12px;
}

.print-upgrade-list strong,
.print-upgrade-list span {
  display: block;
}

.print-upgrade-list span {
  margin-top: 4px;
  font-size: 12px;
  color: #0f6d84;
}

.print-stations h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.print-stations table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.print-stations th,
.print-stations td {
  border: 1px solid #999999;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.print-stations th {
  background: #eeeeee;
  font-weight: 950;
}

@media (max-width: 800px) {
  .top,
  .site-footer,
  .list-item,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-grid,
  .settings-grid,
  .route-row,
  .upgrade-row,
  .stat-grid,
  .player-row {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .map-editor {
    height: 64vh;
    min-height: 430px;
  }

  .station {
    max-width: 130px;
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .wrap > h1,
  .dashboard-grid,
  .toolbar,
  .page-card,
  .editor-shell,
  .login-card,
  .passenger-route,
  .error-page,
  .editor-shell {
    width: min(calc(100% - 24px), var(--content));
  }

  .editor-modebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
  }

  .tool-button {
    min-height: 44px;
    padding: 7px 8px;
    font-size: 13px;
    white-space: normal;
  }

  .passenger-route-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.route-fullscreen-active .passenger-fullscreen-close {
    top: 12px;
    right: 12px;
  }

  .map-editor {
    height: 58vh;
    min-height: 360px;
    background-size: 28px 28px;
  }

  .station {
    max-width: 112px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .connection-label {
    min-width: 34px;
    min-height: 34px;
  }

  .passenger-route-map-canvas {
    min-height: 220px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #ffffff;
    font-size: 11px;
  }

  .top,
  .site-footer,
  .print-options {
    display: none;
  }

  .print-page {
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .print-map {
    min-height: 0;
    height: 132mm;
  }

  .print-stations table {
    font-size: 9px;
  }

  .print-stations th,
  .print-stations td {
    padding: 3px 5px;
  }
}
