:root {
  --bussp-red: #c8102e;
  --bussp-bg: #09090b;
  --bussp-panel: #18181b;
  --bussp-text: #fafafa;
  --bussp-muted: #a1a1aa;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html,
body {
  height: 100%;
  background: var(--bussp-bg);
  color: var(--bussp-text);
  overscroll-behavior: none;
}

.pwa-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: calc(64px + var(--safe-bottom));
}

.pwa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, var(--bussp-bg) 100%);
  border-bottom: 1px solid #27272a;
}

.pwa-brand {
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
  color: var(--bussp-red);
}

.pwa-main {
  flex: 1;
  min-height: 0;
  position: relative;
}

.pwa-tab {
  display: none;
  height: 100%;
  min-height: calc(100dvh - 120px - var(--safe-bottom));
}

.pwa-tab.is-active {
  display: flex;
  flex-direction: column;
}

.pwa-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-bottom));
  background: rgba(9, 9, 11, 0.96);
  border-top: 1px solid #27272a;
  backdrop-filter: blur(10px);
  z-index: 40;
}

.pwa-nav button {
  background: transparent;
  border: 0;
  color: var(--bussp-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 6px 2px;
  border-radius: 10px;
}

.pwa-nav button.is-active {
  color: #fff;
  background: #27272a;
}

.pwa-nav button span {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

#map-canvas {
  flex: 1;
  min-height: 280px;
  width: 100%;
}

.sheet {
  background: var(--bussp-panel);
  border-top: 1px solid #3f3f46;
  border-radius: 18px 18px 0 0;
  padding: 14px 16px 20px;
  max-height: 45%;
  overflow: auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #27272a;
  color: #e4e4e7;
  font-size: 0.8rem;
}

.list-card {
  border: 1px solid #27272a;
  border-radius: 14px;
  padding: 12px 14px;
  background: #121214;
  margin-bottom: 10px;
}

.list-card h3 {
  font-size: 1rem;
  font-weight: 700;
}

.muted {
  color: var(--bussp-muted);
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--bussp-red);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}

.btn-ghost {
  background: #27272a;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
}

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #3f3f46;
  background: #09090b;
  color: #fff;
  padding: 12px 14px;
  outline: none;
}

.input:focus {
  border-color: var(--bussp-red);
}

.phase-arriving {
  color: #fbbf24;
}

.phase-arrived {
  color: #4ade80;
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--bussp-muted);
}

.ios-hint {
  margin: 12px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1c1917;
  border: 1px solid #44403c;
  font-size: 0.85rem;
  color: #fafaf9;
}
