:root {
  --ink: #14161a;
  --mute: rgba(20, 22, 26, 0.52);
  --faint: rgba(20, 22, 26, 0.32);
  --line: rgba(255, 255, 255, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #e4e6ea;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#map { position: absolute; inset: 0; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-bottom-left { display: none; }
.maplibregl-ctrl-bottom-right {
  right: 12px;
  bottom: 10px;
  opacity: 0.38;
}
.maplibregl-ctrl-attrib {
  background: transparent !important;
  font-size: 10px;
}
.maplibregl-ctrl-attrib a { color: var(--faint); }

.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(90% 70% at 50% 38%, transparent 55%, rgba(40, 48, 62, 0.08) 100%);
}

.top {
  position: absolute;
  z-index: 4;
  top: max(20px, env(safe-area-inset-top));
  left: 40px;
  right: 180px;
  pointer-events: none;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}

.top h1 {
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.lg {
  z-index: 5;
  overflow: visible;
  background: rgba(255, 252, 248, 0.62) !important;
  -webkit-backdrop-filter: blur(28px) saturate(108%) !important;
  backdrop-filter: blur(28px) saturate(108%) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 18px 40px rgba(20, 24, 32, 0.1);
  pointer-events: auto !important;
}

html.glass-live .lg {
  background: rgba(255, 255, 255, 0.24) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 14px 36px rgba(20, 24, 32, 0.1);
}

body > canvas[data-liquid-ignore] {
  opacity: 0 !important;
  visibility: hidden !important;
}

html.glass-live body > canvas[data-liquid-ignore] {
  opacity: 1 !important;
  visibility: visible !important;
}

#glass-seed {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #e4e6ea;
}

.lg .content {
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
}

.btn,
.link,
.line,
.x,
.sound,
.tab,
.endbtn,
.stop,
.back,
select {
  pointer-events: auto !important;
}

.chip {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: 40px;
  border-radius: 999px;
  z-index: 5;
}

.chip .content {
  padding: 9px 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
}

.dock-anchor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pane {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: min(62svh, 540px);
  border-radius: 32px;
  pointer-events: auto !important;
}

#dock {
  max-height: min(62svh, 540px);
  overflow: auto;
  padding: 22px 22px 20px;
  -webkit-overflow-scrolling: touch;
}

.pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
}

.pair .st {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pair .st.end { text-align: right; }
.pair .arrow { color: var(--faint); padding-bottom: 4px; }

.lead {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 8px 0 8px;
  line-height: 1.2;
}

.meta {
  margin-top: 10px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.btn {
  width: 100%;
  height: 50px;
  margin-top: 18px;
  border: 0;
  border-radius: 25px;
  background: #14161a;
  color: #fff;
  font: 650 15px/1 inherit;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: 0.35; cursor: default; }

.link {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: 0;
  color: var(--mute);
  font: 500 13px inherit;
  cursor: pointer;
  text-align: center;
}

.head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.head h2 {
  font-size: 17px;
  font-weight: 650;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back {
  border: 0;
  background: none;
  color: var(--mute);
  font: 500 13px inherit;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.x {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid rgba(20, 22, 26, 0.12);
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

.tab {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font: 500 13px inherit;
  cursor: pointer;
}

.tab.on {
  background: #14161a;
  color: #fff;
}

.ticket {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.ticket-rail {
  width: 6px;
  border-radius: 6px;
  background: var(--line);
  flex-shrink: 0;
}

.ticket-line {
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 8px;
}

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

.endbtn {
  text-align: left;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.48);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.endbtn span {
  display: block;
  font-size: 11px;
  color: var(--mute);
}

.endbtn b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endbtn.on {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(20, 22, 26, 0.14);
}

.stops {
  max-height: 240px;
  overflow: auto;
  margin-top: 10px;
}

.stop {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: 500 14px inherit;
  text-align: left;
  cursor: pointer;
}

.stop i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stop.on {
  background: rgba(255, 255, 255, 0.72);
  font-weight: 650;
}

.pick-sum { margin: 14px 0 0; }

.lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(40svh, 320px);
  overflow: auto;
}

.line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px 8px 0;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.line .rail {
  width: 5px;
  height: 38px;
  border-radius: 3px;
  flex-shrink: 0;
}

.line:hover { background: rgba(255, 255, 255, 0.42); }
.line.on {
  background: rgba(255, 255, 255, 0.62);
}

.line .name { font-size: 15px; font-weight: 650; }
.line .sub { font-size: 11px; color: var(--mute); margin-top: 2px; }

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

label {
  display: block;
  font-size: 11px;
  color: var(--mute);
  margin-bottom: 6px;
}

select {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(20, 22, 26, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  padding: 0 10px;
  font: 500 13px inherit;
  outline: none;
  appearance: none;
}

select option { color: #111; }

.clock {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 52px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
}

html.on-focus .top h1 {
  font-size: 30px;
  max-width: min(62vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.on-focus .chip .content {
  font-size: 15px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

html.on-focus .pane {
  max-height: none;
}

html.on-focus #dock {
  padding: 18px 20px 14px;
}

.ride-ends {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.ride-ends .st {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ride-ends .st.end { text-align: right; }

.ticks {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.ticks i {
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: rgba(20, 22, 26, 0.12);
}

.ticks i.on {
  background: var(--line, var(--ink));
}

.ride-live {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.live-kicker {
  font-size: 11px;
  color: var(--mute);
  margin-bottom: 3px;
}

.live-name {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.ride-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--mute);
}

.ride-live .sound {
  margin-top: 0;
}

.clock-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sound {
  width: 36px;
  height: 36px;
  margin-top: 8px;
  flex-shrink: 0;
  border-radius: 18px;
  border: 1px solid rgba(20, 22, 26, 0.12);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font: 600 13px inherit;
  cursor: pointer;
}

.sound.off { opacity: 0.42; }

.bar {
  height: 2px;
  margin: 16px 0 0;
  background: rgba(20, 22, 26, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
}

.arrive {
  font-size: 12px;
  color: var(--mute);
}

.arrive-name {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 6px 0 12px;
}

@media (max-width: 720px) {
  .top { left: 18px; right: 130px; top: 18px; }
  .top h1 { font-size: 26px; }
  .chip { top: max(16px, env(safe-area-inset-top)); right: 16px; }
  .dock-anchor { bottom: max(16px, env(safe-area-inset-bottom)); }
}
