:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #66717d;
  --subtle: #8c96a1;
  --line: #dce2e7;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --canvas: #f6f8fa;
  --quiet: #159a6d;
  --normal: #d99516;
  --busy: #dc4f43;
  --insufficient: #7e8995;
  --accent: #167a82;
  --focus: #1c7ed6;
  --shadow: 0 12px 34px rgba(20, 32, 43, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(28, 126, 214, 0.28);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-rows: 64px 50px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: var(--canvas);
}

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 460px) minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 252, 253, 0.96);
  backdrop-filter: blur(18px) saturate(1.2);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #17242d;
  color: #fff;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.brand-name {
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
}

.brand-name b {
  color: var(--accent);
}

.beta-label {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid #b9c4cc;
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 40px;
  padding: 0 10px 0 13px;
  border: 1px solid #d4dce2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 32, 43, 0.04);
}

.search-shell:focus-within {
  border-color: #8ebac0;
  box-shadow: 0 0 0 3px rgba(22, 122, 130, 0.1);
}

.search-shell > svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.search-shell input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-shell input::placeholder {
  color: #8a949e;
}

.clear-search {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf1f4;
  color: var(--muted);
}

.clear-search[hidden] {
  display: none;
}

.clear-search svg {
  width: 14px;
  height: 14px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: min(460px, 64vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  background: #f1f5f6;
}

.search-result-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--insufficient);
}

.search-result-dot.quiet { background: var(--quiet); }
.search-result-dot.normal { background: var(--normal); }
.search-result-dot.busy { background: var(--busy); }

.search-result-copy {
  min-width: 0;
}

.search-result-copy b,
.search-result-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy b {
  margin-bottom: 3px;
  font-size: 13px;
}

.search-result-copy span {
  color: var(--muted);
  font-size: 11px;
}

.search-result-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.search-empty {
  padding: 24px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.live-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--quiet);
  box-shadow: 0 0 0 4px rgba(21, 154, 109, 0.12);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d6dee4;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #4b5864;
}

.icon-button:hover {
  background: #f0f4f5;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.category-rail {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  scrollbar-width: none;
}

.category-rail::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #d8e0e5;
  border-radius: 17px;
  background: #fff;
  color: #4f5c67;
  font-size: 13px;
  font-weight: 650;
}

.category-chip:hover {
  border-color: #aebac3;
  background: #f7f9fa;
}

.category-chip.active {
  border-color: #17242d;
  background: #17242d;
  color: #fff;
}

.category-loading {
  color: var(--subtle);
  font-size: 12px;
}

.map-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #e7ecef;
}

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

.map-canvas .maplibregl-canvas {
  outline: none;
}

.map-canvas .maplibregl-ctrl-bottom-left,
.map-canvas .maplibregl-ctrl-bottom-right {
  bottom: 12px;
}

.map-canvas .maplibregl-ctrl-attrib {
  border-radius: 4px 0 0 0;
  background: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}

.map-summary {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(199, 208, 215, 0.82);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(20, 32, 43, 0.1);
  backdrop-filter: blur(18px) saturate(1.2);
  color: #4d5a65;
  font-size: 11px;
  font-weight: 650;
}

.summary-separator {
  width: 1px;
  height: 14px;
  background: #d5dde3;
}

.map-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 112px;
  height: 38px;
  padding: 3px;
  border: 1px solid rgba(199, 208, 215, 0.88);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(20, 32, 43, 0.1);
  backdrop-filter: blur(18px) saturate(1.2);
}

.mode-control button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.mode-control button.active {
  background: #26343d;
  color: #fff;
  box-shadow: 0 2px 6px rgba(20, 32, 43, 0.18);
}

.map-tool-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(199, 208, 215, 0.88);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(20, 32, 43, 0.1);
  color: #34434f;
  backdrop-filter: blur(18px) saturate(1.2);
}

.map-tool-button:hover {
  color: var(--accent);
}

.map-tool-button.active {
  border-color: rgba(22, 136, 61, 0.45);
  background: rgba(236, 248, 240, 0.92);
  color: #16883d;
}

.map-tool-button svg {
  width: 19px;
  height: 19px;
}

.legend {
  position: absolute;
  bottom: 18px;
  left: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(199, 208, 215, 0.82);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(20, 32, 43, 0.1);
  backdrop-filter: blur(18px) saturate(1.2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4f5c67;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--insufficient);
}

.legend-dot.quiet { background: var(--quiet); }
.legend-dot.normal { background: var(--normal); }
.legend-dot.busy { background: var(--busy); }
.legend-dot.insufficient { background: var(--insufficient); }

.detail-panel {
  position: absolute;
  top: 66px;
  right: 14px;
  bottom: 14px;
  z-index: 12;
  width: min(360px, calc(100vw - 28px));
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(204, 213, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.15);
}

.crowd-feedback[hidden] {
  display: none !important;
}

.detail-panel[hidden] {
  display: none;
}

.map-stage.detail-open .legend {
  display: none;
}

.sheet-handle {
  display: none;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-header > div {
  min-width: 0;
}

.detail-category {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.detail-header h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 21px;
  line-height: 1.38;
}

.detail-header .icon-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}

.detail-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(126, 137, 149, 0.12);
  color: var(--insufficient);
  font-size: 14px;
  font-weight: 800;
}

.status-badge.quiet {
  background: rgba(21, 154, 109, 0.11);
  color: #0e7a55;
}

.status-badge.normal {
  background: rgba(217, 149, 22, 0.13);
  color: #a56800;
}

.status-badge.busy {
  background: rgba(220, 79, 67, 0.11);
  color: #c13b31;
}

.freshness {
  text-align: right;
}

.freshness span,
.freshness b {
  display: block;
}

.freshness span {
  color: var(--subtle);
  font-size: 10px;
}

.freshness b {
  margin-top: 2px;
  font-size: 12px;
}

.forecast-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 20px;
}

.forecast-cell {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid #dde4e9;
  border-radius: 6px;
  background: #f9fafb;
  text-align: center;
}

.forecast-cell span,
.forecast-cell b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-cell span {
  color: var(--subtle);
  font-size: 10px;
}

.forecast-cell b {
  margin-top: 5px;
  color: var(--insufficient);
  font-size: 12px;
}

.forecast-cell.quiet b { color: var(--quiet); }
.forecast-cell.normal b { color: #a56800; }
.forecast-cell.busy b { color: var(--busy); }

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 0;
}

.detail-facts > div {
  padding: 12px;
  border-left: 2px solid #d6dee4;
  background: #f7f9fa;
}

.detail-facts dt {
  color: var(--muted);
  font-size: 10px;
}

.detail-facts dd {
  margin: 5px 0 0;
  font-size: 15px;
  font-weight: 800;
}

.confidence-track {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 3px;
  background: #e3e8ec;
}

.confidence-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 240ms ease;
}

.detail-reason {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.venue-meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.venue-meta > div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #4f5c67;
  font-size: 12px;
  line-height: 1.6;
}

.venue-meta svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--subtle);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 7px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid #17242d;
  background: #17242d;
  color: #fff;
}

.primary-button:hover {
  background: #263944;
}

.secondary-button {
  border: 1px solid #d5dde3;
  background: #fff;
  color: var(--ink);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

#recenterButton {
  width: 100%;
  margin-top: 20px;
}

.beta-note {
  margin: 13px 0 0;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.loading-state {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(238, 242, 244, 0.92);
  color: #52606b;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loading-state.done {
  visibility: hidden;
  opacity: 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #c9d2d9;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.app-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #d7dfe5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 32, 43, 0.28);
  color: var(--ink);
}

.app-dialog::backdrop {
  background: rgba(18, 27, 34, 0.42);
  backdrop-filter: blur(5px);
}

.app-dialog form {
  padding: 24px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #eaf4f4;
  color: var(--accent);
}

.dialog-icon svg {
  width: 22px;
  height: 22px;
}

.app-dialog h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
}

.app-dialog p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  margin-top: 22px;
}

.location-choice-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.location-choice {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(126, 136, 145, 0.2);
  border-radius: 9px;
  background: #f8fafb;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.location-choice:hover,
.location-choice:focus-visible {
  border-color: rgba(29, 29, 31, 0.32);
  background: #fff;
  outline: none;
}

.location-choice b {
  font-size: 13px;
}

.location-choice span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.location-choice.primary-choice {
  border-color: rgba(22, 136, 61, 0.34);
  background: #eef8f1;
}

.location-fineprint {
  font-size: 11px !important;
}

.location-dialog-actions {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dialog-header > div > span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.about-grid {
  display: grid;
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.about-grid > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 13px;
  background: #f9fafb;
}

.about-grid svg {
  grid-row: 1 / 3;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent);
}

.about-grid b {
  font-size: 12px;
}

.about-grid span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.about-copy {
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: #f3f7f7;
}

.full-width {
  width: 100%;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 15px;
  border: 1px solid rgba(38, 52, 61, 0.22);
  border-radius: 7px;
  background: rgba(24, 36, 44, 0.94);
  box-shadow: 0 10px 32px rgba(20, 32, 43, 0.24);
  color: #fff;
  font-size: 12px;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.toast[hidden] {
  display: none;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: 58px 46px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 16px;
  }

  .beta-label,
  .live-indicator {
    display: none;
  }

  .search-shell {
    height: 38px;
  }

  .top-actions {
    gap: 0;
  }

  .top-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .category-rail {
    gap: 7px;
    padding: 6px 12px;
  }

  .category-chip {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }

  .map-summary {
    top: 10px;
    left: 10px;
    max-width: calc(100vw - 154px);
    min-height: 32px;
    overflow: hidden;
    padding: 0 10px;
  }

  .map-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #updatedAt,
  .summary-separator {
    display: none;
  }

  .map-tools {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .mode-control {
    width: 94px;
    height: 36px;
  }

  .map-tool-button {
    width: 38px;
    height: 38px;
  }

  .legend {
    right: 10px;
    bottom: 12px;
    left: 10px;
    justify-content: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 8px;
  }

  .legend span {
    font-size: 9px;
  }

  .detail-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(58dvh, 520px);
    padding: 10px 18px max(18px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
    background: #ffffff;
    animation: sheet-in 220ms ease-out;
  }

  @keyframes sheet-in {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .sheet-handle {
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 2px;
    background: #cbd3d9;
  }

  .detail-header h1 {
    font-size: 19px;
  }

  .detail-status-row,
  .forecast-row,
  .detail-facts {
    margin-top: 14px;
  }

  .venue-meta {
    margin-top: 14px;
    padding-top: 14px;
  }

  #recenterButton {
    margin-top: 16px;
  }

  .toast {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* Dual renderer: Apple MapKit JS for 2D, MapLibre for real WebGL 3D. */
.map-layer[hidden],
.pitch-control[hidden] {
  display: none;
}

#map3d {
  background: #edf1f3;
}

#map3d .maplibregl-canvas {
  outline: none;
}

#map3d .maplibregl-ctrl-bottom-left {
  bottom: 8px;
  left: 8px;
}

#map3d .maplibregl-ctrl-attrib {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  backdrop-filter: blur(12px) saturate(1.2);
}

.pulse-user-dot {
  display: block;
  width: 16px;
  height: 16px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #087df1;
  box-shadow: 0 1px 5px rgba(0, 80, 170, 0.42);
}

.map-tools {
  align-items: flex-end;
}

.mode-control {
  order: 1;
}

.zoom-control {
  order: 2;
}

#locationButton {
  order: 3;
}

.pitch-control {
  order: 4;
  display: grid;
  grid-template-columns: 16px auto minmax(72px, 1fr) 34px;
  align-items: center;
  gap: 7px;
  width: 190px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(193, 202, 209, 0.82);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.82);
  box-shadow: 0 7px 20px rgba(32, 44, 54, 0.13);
  color: #323a41;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(20px) saturate(1.3);
}

.pitch-control svg {
  width: 16px;
  height: 16px;
}

.pitch-control input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: #252b31;
  cursor: ew-resize;
}

.pitch-control output {
  color: #5e6872;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 540px) {
  .pitch-control {
    grid-template-columns: 16px minmax(68px, 1fr) 32px;
    width: 154px;
  }

  .pitch-control > span {
    display: none;
  }
}

/* Venue crowd feedback stays inside the detail sheet as a quiet utility. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.crowd-feedback {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(100, 107, 114, 0.15);
}

.crowd-feedback-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.crowd-feedback-heading span,
.crowd-feedback-heading h2,
.crowd-feedback-heading small {
  display: block;
  margin: 0;
}

.crowd-feedback-heading span {
  color: #73787d;
  font-size: 9px;
  font-weight: 650;
}

.crowd-feedback-heading h2 {
  margin-top: 2px;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.crowd-feedback-heading > small {
  color: #8a8f94;
  font-size: 9px;
}

.crowd-feedback-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(76, 82, 88, 0.2);
  border-radius: 7px;
}

.crowd-feedback-options label {
  min-width: 0;
  cursor: pointer;
}

.crowd-feedback-options label + label {
  border-left: 1px solid rgba(76, 82, 88, 0.16);
}

.crowd-feedback-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.crowd-feedback-options label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.62);
  color: #555b60;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 130ms ease, color 130ms ease;
}

.crowd-feedback-options i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--quiet);
}

.crowd-feedback-options label:nth-of-type(2) i { background: var(--normal); }
.crowd-feedback-options label:nth-of-type(3) i { background: var(--busy); }

.crowd-feedback-options input:checked + span {
  background: #292a2c;
  color: #fff;
}

.crowd-feedback-options input:focus-visible + span {
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #292a2c;
}

.crowd-feedback-count {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  color: #555b60;
  font-size: 10px;
  font-weight: 650;
}

.crowd-feedback-count > span > small {
  margin-left: 3px;
  color: #8a8f94;
  font-size: 9px;
  font-weight: 500;
}

.crowd-feedback-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid rgba(76, 82, 88, 0.32);
}

.crowd-feedback-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.crowd-feedback-input input::placeholder {
  color: #a1a5a9;
}

.crowd-feedback-input b {
  color: #73787d;
  font-size: 10px;
  font-weight: 550;
  text-align: right;
}

.feedback-submit {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid #292a2c;
  border-radius: 7px;
  background: #292a2c;
  color: #fff;
  font-size: 11px;
  font-weight: 650;
}

.feedback-submit:hover,
.feedback-submit:focus-visible {
  background: #111214;
}

.feedback-submit:disabled {
  border-color: #aaadb0;
  background: #aaadb0;
  cursor: default;
}

#feedbackNote {
  margin: 7px 0 0;
  color: #858a8f;
  font-size: 8.5px;
  line-height: 1.5;
}

#feedbackNote.success {
  color: #16733a;
}

@media (max-width: 540px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .search-shell input {
    font-size: 13px;
  }

  .search-shell input::placeholder {
    color: #8a949e;
  }

  .search-results {
    position: fixed;
    top: 52px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 52dvh;
  }

  .legend span {
    gap: 4px;
  }

  .legend-dot {
    width: 7px;
    height: 7px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}

/* Xcode PULSE visual parity. The native source remains read-only. */
.pulse-header {
  position: absolute;
  top: 4px;
  right: 60px;
  left: 8px;
  z-index: 45;
  display: grid;
  gap: 6px;
  width: min(720px, calc(100vw - 68px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 16px;
  background: rgba(238, 242, 246, 0.62);
  box-shadow: 0 10px 30px rgba(21, 31, 40, 0.09);
  backdrop-filter: blur(28px) saturate(1.42);
  transition: top 280ms cubic-bezier(.2,.8,.2,1), bottom 280ms cubic-bezier(.2,.8,.2,1);
}

.header-bottom .pulse-header {
  top: auto;
  bottom: max(4px, env(safe-area-inset-bottom));
}

.header-bottom.detail-active .pulse-header {
  top: 4px;
  bottom: auto;
}

.pulse-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  align-items: center;
  gap: 6px;
}

.pulse-header .search-shell {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  height: 38px;
  padding-right: 7px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: none;
}

.pulse-header .search-shell:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.18);
}

.pulse-header .search-shell input {
  font-size: 15px;
}

.search-count {
  flex: 0 0 auto;
  min-width: 26px;
  color: #74777d;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.header-command {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 2px 5px rgba(20, 30, 38, 0.08);
  color: #6b7178;
}

.header-command.primary {
  background: #007aff;
  color: #fff;
}

.header-command svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.pulse-header .category-rail,
.crowd-rail {
  position: static;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 27px;
  padding: 0 2px;
  overflow-x: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  scrollbar-width: none;
}

.pulse-header .category-rail::-webkit-scrollbar,
.crowd-rail::-webkit-scrollbar {
  display: none;
}

.pulse-header .category-chip,
.crowd-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: none;
  color: #1d1d1f;
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.pulse-header .category-chip small {
  color: #7c8187;
  font-size: 9px;
  font-weight: 450;
}

.pulse-header .category-chip.active,
.crowd-chip.active {
  background: rgba(29, 29, 31, 0.9);
  color: #fff;
}

.pulse-header .category-chip.active small {
  color: rgba(255, 255, 255, 0.68);
}

.crowd-chip .legend-dot {
  width: 6px;
  height: 6px;
}

.header-bottom .search-results {
  top: auto;
  bottom: calc(100% + 8px);
}

.map-summary,
.legend {
  display: none !important;
}

.map-tools {
  top: 6px;
  right: 10px;
  z-index: 42;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-stage.detail-open .map-tools {
  right: 10px;
}

.mode-control,
.zoom-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 38px;
  height: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: rgba(238, 242, 246, 0.66);
  box-shadow: 0 3px 8px rgba(20, 30, 38, 0.1);
  backdrop-filter: blur(22px) saturate(1.35);
}

.mode-control button,
.zoom-control button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1d1d1f;
  font-size: 11px;
  font-weight: 700;
}

.mode-control button {
  height: 26px;
}

.mode-control button.active {
  margin: 0;
  background: rgba(29, 29, 31, 0.88);
  box-shadow: none;
  color: #fff;
}

.mode-control > span,
.zoom-control > span {
  width: 28px;
  height: 1px;
  background: rgba(90, 96, 102, 0.18);
}

.zoom-control svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

.map-tool-button,
.settings-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(238, 242, 246, 0.68);
  box-shadow: 0 3px 8px rgba(20, 30, 38, 0.1);
  color: #1d1d1f;
  backdrop-filter: blur(22px) saturate(1.35);
}

.map-tool-button svg,
.settings-button svg {
  width: 17px;
  height: 17px;
}

.settings-button {
  position: absolute;
  right: 10px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 42;
}

.header-bottom .settings-button {
  bottom: 152px;
}

.pulse-map-label {
  --marker-color: #8e8e93;
  display: block;
  max-width: 168px;
  overflow: hidden;
  padding: 4px 3px;
  color: var(--marker-color);
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.96),
    1px -1px 0 rgba(255, 255, 255, 0.96),
    -1px 1px 0 rgba(255, 255, 255, 0.96),
    1px 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(255, 255, 255, 0.98);
  white-space: nowrap;
  opacity: 1;
  transition: color 140ms ease, opacity 120ms ease, transform 140ms ease;
}

.map-stage.map-moving .pulse-map-label:not(.selected) {
  opacity: 0;
  pointer-events: none;
}

.pulse-map-label.quiet { --marker-color: #16883d; }
.pulse-map-label.normal { --marker-color: #b86500; }
.pulse-map-label.busy { --marker-color: #d62920; }
.pulse-map-label.insufficient { --marker-color: #73777d; }

.pulse-map-label:hover {
  color: color-mix(in srgb, var(--marker-color) 82%, #000);
  transform: scale(1.04);
}

.pulse-map-label.selected {
  z-index: 5;
  max-width: 220px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 7px rgba(20, 28, 34, 0.2);
  font-size: 12px;
  font-weight: 750;
  text-shadow: none;
  transform: scale(1.03);
  backdrop-filter: blur(10px) saturate(1.2);
}

.detail-panel {
  top: auto;
  right: auto;
  bottom: 10px;
  left: 50%;
  width: min(620px, calc(100vw - 20px));
  max-height: min(62dvh, 620px);
  padding: 12px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background: rgba(246, 247, 249, 0.88);
  box-shadow: 0 18px 50px rgba(20, 30, 38, 0.22);
  transform: translateX(-50%);
  backdrop-filter: blur(30px) saturate(1.4);
}

.detail-panel .sheet-handle {
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 2px;
  background: rgba(118, 124, 130, 0.34);
}

.detail-panel .detail-category {
  color: #73777c;
}

.detail-panel .detail-facts > div {
  border-left-color: rgba(110, 118, 126, 0.22);
  background: rgba(255, 255, 255, 0.58);
}

.detail-panel .forecast-cell {
  border-color: rgba(118, 126, 134, 0.16);
  background: rgba(255, 255, 255, 0.6);
}

.detail-panel #recenterButton {
  border-radius: 999px;
  background: #007aff;
  border-color: #007aff;
}

@media (max-width: 820px) {
  .pulse-header {
    top: 4px;
    right: 58px;
    left: 8px;
    width: auto;
    padding: 8px 9px;
  }

  .pulse-header-row {
    grid-template-columns: minmax(0, 1fr) 38px 38px;
  }

  .pulse-header .search-shell input {
    font-size: 14px;
  }

  .pulse-header .category-rail,
  .crowd-rail {
    right: auto;
    left: auto;
    padding: 0 2px;
  }

  .map-tools {
    top: 6px;
  }

  .detail-panel {
    bottom: 0;
    width: 100%;
    max-height: min(62dvh, 560px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    background: rgba(247, 248, 250, 0.96);
  }

  .map-stage.detail-open .settings-button {
    display: none;
  }
}

@media (max-width: 540px) {
  .pulse-header {
    right: 56px;
  }

  .search-count {
    display: none;
  }

  .pulse-header .search-shell input {
    min-width: 0;
  }

  .pulse-header .category-chip,
  .crowd-chip {
    padding-right: 8px;
    padding-left: 8px;
  }

  .pulse-header .category-chip small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* MapKit JS layout: full-bleed Apple Maps with compact floating controls. */
.app-shell {
  position: relative;
  display: block;
  height: 100dvh;
  background: #e9eef1;
}

.map-stage {
  position: absolute;
  inset: 0;
}

.map-canvas {
  background: #e9eef1;
}

.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 36px 42px;
  gap: 9px 12px;
  width: 390px;
  height: auto;
  padding: 11px;
  border: 1px solid rgba(198, 206, 213, 0.88);
  border-radius: 12px;
  background: rgba(250, 251, 252, 0.88);
  box-shadow: 0 12px 34px rgba(32, 44, 54, 0.16);
  backdrop-filter: blur(24px) saturate(1.35);
}

.topbar .brand {
  grid-column: 1;
  grid-row: 1;
}

.topbar .search-shell {
  grid-column: 1 / 3;
  grid-row: 2;
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.94);
}

.topbar .top-actions {
  grid-column: 2;
  grid-row: 1;
}

.category-rail {
  position: absolute;
  top: 116px;
  right: 14px;
  left: 14px;
  z-index: 35;
  gap: 7px;
  width: auto;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.category-rail > * {
  pointer-events: auto;
}

.category-chip {
  height: 36px;
  border-color: rgba(193, 202, 209, 0.88);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(32, 44, 54, 0.1);
  backdrop-filter: blur(16px) saturate(1.25);
}

.category-chip.active {
  border-color: #1d1d1f;
  background: #1d1d1f;
}

.map-summary {
  top: 164px;
  bottom: auto;
}

.legend {
  bottom: 18px;
  left: 86px;
}

.map-tools {
  top: 14px;
  transition: right 180ms ease;
}

.map-stage.detail-open .map-tools {
  right: 388px;
}

.mode-control {
  width: 126px;
}

.mode-control button {
  padding: 0 9px;
}

.detail-panel {
  top: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.map-setup {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  width: min(390px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(200, 208, 214, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 60px rgba(32, 44, 54, 0.2);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(22px) saturate(1.25);
}

.map-setup[hidden] {
  display: none;
}

.map-setup-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: #eaf2fa;
  color: #007aff;
}

.map-setup-mark svg {
  width: 27px;
  height: 27px;
}

.map-setup > span {
  display: block;
  color: #007aff;
  font-size: 11px;
  font-weight: 800;
}

.map-setup h2 {
  margin: 7px 0 0;
  font-size: 20px;
}

.map-setup p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.map-setup .primary-button {
  width: 100%;
}

@media (max-width: 820px) {
  .topbar {
    top: 10px;
    right: 10px;
    left: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 40px;
    gap: 8px;
    width: auto;
    padding: 6px 7px;
    border-radius: 11px;
  }

  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar .brand-mark {
    width: 32px;
    height: 32px;
  }

  .topbar .brand-name {
    font-size: 15px;
  }

  .topbar .beta-label {
    display: none;
  }

  .topbar .search-shell {
    grid-column: 2;
    grid-row: 1;
    height: 38px;
  }

  .topbar .top-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .category-rail {
    top: 72px;
    right: 0;
    left: 10px;
    padding-right: 10px;
  }

  .category-chip {
    height: 34px;
  }

  .map-summary {
    top: 118px;
    bottom: auto;
  }

  .map-tools {
    top: 116px;
  }

  .map-stage.detail-open .map-tools {
    right: 10px;
  }

  .detail-panel {
    top: auto;
    background: #ffffff;
  }

  .legend {
    right: 10px;
    bottom: 44px;
    left: 62px;
  }

  .map-setup {
    padding: 24px 20px;
  }
}

@media (max-width: 540px) {
  .topbar .brand-name {
    display: inline;
    font-size: 14px;
  }

  .topbar .brand-name b {
    display: none;
  }

  .topbar .search-shell input::placeholder {
    color: #8a949e;
  }

  .legend {
    bottom: 44px;
  }
}

/* Final native-parity overrides must follow the retired web-shell rules. */
.map-tools {
  top: 6px;
  right: 10px;
  flex-direction: column;
  gap: 8px;
}

.map-stage.detail-open .map-tools {
  right: 10px;
}

.mode-control,
.zoom-control {
  display: flex;
  flex-direction: column;
  width: 38px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(238, 242, 246, 0.66);
}

.mode-control button,
.zoom-control button {
  width: 38px;
  padding: 0;
}

.detail-panel {
  top: auto;
  right: auto;
  bottom: 10px;
  left: 50%;
  width: min(620px, calc(100vw - 20px));
  max-height: min(62dvh, 620px);
  border-radius: 18px;
  background: rgba(246, 247, 249, 0.88);
  transform: translateX(-50%);
}

@media (max-width: 820px) {
  .map-tools {
    top: 6px;
  }

  .detail-panel {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 100%;
    border-radius: 18px 18px 0 0;
    background: rgba(247, 248, 250, 0.96);
  }
}

/* Minimal map chrome: quiet tabs and a single, unboxed information sheet. */
.pulse-header {
  width: min(680px, calc(100vw - 68px));
  gap: 3px;
  padding: 7px 10px 6px;
  border-color: rgba(255, 255, 255, 0.64);
  border-radius: 12px;
  background: rgba(250, 251, 252, 0.82);
  box-shadow: 0 7px 20px rgba(25, 32, 38, 0.09);
  backdrop-filter: blur(24px) saturate(1.18);
}

.pulse-header-row {
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  gap: 5px;
}

.pulse-header .search-shell {
  height: 36px;
  border: 1px solid rgba(104, 112, 120, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.pulse-header .search-shell:focus-within {
  border-color: rgba(29, 29, 31, 0.32);
  box-shadow: 0 0 0 2px rgba(29, 29, 31, 0.06);
}

.pulse-header .search-shell input {
  font-size: 14px;
  font-weight: 450;
}

.header-command {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(104, 112, 120, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  color: #51565c;
}

.header-command:hover,
.header-command:focus-visible {
  background: rgba(255, 255, 255, 0.96);
  color: #1d1d1f;
}

.header-command.primary {
  border-color: #28282a;
  background: #28282a;
  color: #fff;
}

.pulse-header .category-rail,
.crowd-rail {
  gap: 10px;
  min-height: 29px;
  padding: 0 3px;
}

.crowd-rail {
  min-height: 27px;
  border-top: 1px solid rgba(104, 112, 120, 0.12);
}

.pulse-header .category-chip,
.crowd-chip {
  position: relative;
  height: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6c7177;
  font-size: 11px;
  font-weight: 560;
  white-space: nowrap;
  backdrop-filter: none;
}

.pulse-header .category-chip::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 1px;
  background: transparent;
  content: "";
}

.pulse-header .category-chip:hover,
.crowd-chip:hover {
  color: #1d1d1f;
}

.pulse-header .category-chip.active,
.crowd-chip.active {
  background: transparent;
  color: #1d1d1f;
  font-weight: 700;
}

.pulse-header .category-chip.active::after {
  background: #1d1d1f;
}

.pulse-header .category-chip small,
.pulse-header .category-chip.active small {
  display: none;
}

.crowd-chip.active {
  color: #111214;
}

.crowd-chip .legend-dot {
  width: 6px;
  height: 6px;
}

.detail-panel {
  bottom: 10px;
  width: min(520px, calc(100vw - 20px));
  max-height: min(64dvh, 560px);
  padding: 10px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 12px;
  background: rgba(253, 253, 253, 0.93);
  box-shadow: 0 14px 38px rgba(20, 27, 33, 0.18);
  backdrop-filter: blur(26px) saturate(1.12);
}

.detail-panel .sheet-handle {
  width: 30px;
  height: 3px;
  margin-bottom: 8px;
  background: rgba(94, 99, 104, 0.22);
}

.detail-header {
  align-items: center;
  gap: 12px;
}

.detail-panel .detail-category {
  margin-bottom: 3px;
  color: #747980;
  font-size: 10px;
  font-weight: 600;
}

.detail-header h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-header .icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #666b70;
}

.detail-header .icon-button:hover,
.detail-header .icon-button:focus-visible {
  background: rgba(90, 96, 102, 0.08);
  color: #1d1d1f;
}

.detail-status-row {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(100, 107, 114, 0.14);
}

.status-badge,
.status-badge.quiet,
.status-badge.normal,
.status-badge.busy {
  gap: 7px;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.status-badge::before {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--insufficient);
  content: "";
}

.status-badge.quiet::before { background: var(--quiet); }
.status-badge.normal::before { background: var(--normal); }
.status-badge.busy::before { background: var(--busy); }

.freshness span {
  font-size: 9px;
}

.freshness b {
  font-size: 11px;
  font-weight: 600;
}

.forecast-row {
  gap: 0;
  margin-top: 13px;
  border-top: 1px solid rgba(100, 107, 114, 0.14);
  border-bottom: 1px solid rgba(100, 107, 114, 0.14);
}

.detail-panel .forecast-cell {
  padding: 11px 7px 10px;
  border: 0;
  border-right: 1px solid rgba(100, 107, 114, 0.12);
  border-radius: 0;
  background: transparent;
}

.detail-panel .forecast-cell:last-child {
  border-right: 0;
}

.forecast-cell span {
  font-size: 9px;
}

.forecast-cell b {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}

.detail-facts {
  gap: 0;
  margin-top: 13px;
}

.detail-panel .detail-facts > div {
  padding: 2px 12px 2px 0;
  border: 0;
  border-right: 1px solid rgba(100, 107, 114, 0.14);
  background: transparent;
}

.detail-panel .detail-facts > div + div {
  padding-right: 0;
  padding-left: 12px;
  border-right: 0;
}

.detail-facts dt {
  font-size: 9px;
}

.detail-facts dd {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
}

.confidence-track {
  height: 3px;
  margin-top: 9px;
  border-radius: 0;
  background: rgba(100, 107, 114, 0.13);
}

.confidence-track i {
  border-radius: 0;
  background: #323436;
}

.detail-reason {
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.55;
}

.venue-meta {
  gap: 6px;
  margin-top: 12px;
  padding-top: 11px;
  border-top-color: rgba(100, 107, 114, 0.14);
}

.venue-meta > div {
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 7px;
  font-size: 11px;
  line-height: 1.45;
}

.venue-meta svg {
  width: 14px;
  height: 14px;
}

.detail-panel #recenterButton {
  min-height: 40px;
  margin-top: 13px;
  border-color: #292a2c;
  border-radius: 8px;
  background: #292a2c;
  font-size: 12px;
  font-weight: 650;
}

.detail-panel #recenterButton:hover,
.detail-panel #recenterButton:focus-visible {
  border-color: #111214;
  background: #111214;
}

.beta-note {
  margin-top: 9px;
  font-size: 9px;
}

@media (max-width: 820px) {
  .pulse-header {
    right: 56px;
    width: auto;
    padding: 7px 9px 6px;
  }

  .pulse-header-row {
    grid-template-columns: minmax(0, 1fr) 36px 36px;
  }

  .detail-panel {
    bottom: 0;
    width: 100%;
    max-height: min(68dvh, 570px);
    padding: 9px 16px max(14px, env(safe-area-inset-bottom));
    border-radius: 12px 12px 0 0;
    background: rgba(253, 253, 253, 0.97);
  }
}

@media (max-width: 540px) {
  .pulse-header .category-rail,
  .crowd-rail {
    gap: 11px;
  }

  .pulse-header .category-chip,
  .crowd-chip {
    padding: 0 1px;
    font-size: 10px;
  }

  .detail-header h1 {
    font-size: 17px;
  }
}

/* Support, consent and legal surfaces. */
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.detail-panel .detail-actions #recenterButton,
.detail-panel .detail-actions #reportStoreButton {
  width: 100%;
  min-height: 40px;
  margin-top: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}

.detail-panel .detail-actions #reportStoreButton {
  border-color: rgba(79, 87, 94, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.consent-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid rgba(94, 103, 111, 0.17);
  border-radius: 8px;
  background: #f8fafb;
  cursor: pointer;
}

.consent-option input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: #1d1d1f;
}

.consent-option span,
.consent-option small {
  display: block;
}

.consent-option b {
  font-size: 12px;
}

.consent-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.settings-links {
  display: grid;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-links a,
.settings-links button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #30353a;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.settings-links svg {
  width: 17px;
  height: 17px;
  color: #737a80;
}

.correction-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: min(88dvh, 760px);
  overflow: auto;
}

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

.correction-dialog .dialog-header + p {
  margin: -2px 0 0;
}

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

.form-field {
  display: grid;
  gap: 6px;
}

.form-field > span {
  color: #535a61;
  font-size: 11px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d5dce1;
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: #1d1d1f;
  font: inherit;
  font-size: 13px;
}

.form-field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.6;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #555d64;
  box-shadow: 0 0 0 3px rgba(45, 51, 56, 0.08);
}

.form-note {
  margin: -2px 0 0 !important;
  font-size: 10px !important;
  line-height: 1.55 !important;
}

.form-note a {
  color: inherit;
}

.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 540px) {
  .detail-actions,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .correction-dialog form {
    padding: 20px;
  }
}

/* Nationwide map controls and lightweight regional tendency layer. */
.pulse-header .category-rail {
  cursor: grab;
  touch-action: pan-x;
  user-select: none;
}

.pulse-header .category-rail.dragging {
  cursor: grabbing;
}

.pitch-control {
  grid-template-columns: 1fr;
  grid-template-rows: 16px auto 112px auto;
  justify-items: center;
  gap: 6px;
  width: 42px;
  min-height: 186px;
  padding: 9px 0 8px;
}

.pitch-control input[type="range"] {
  width: 20px;
  height: 112px;
  cursor: ns-resize;
  direction: rtl;
  writing-mode: vertical-lr;
}

.pitch-control output {
  text-align: center;
}

.area-layer-label,
.data-attribution {
  position: absolute;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(92, 99, 105, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: #5f656b;
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(14px) saturate(1.15);
}

.area-layer-label[hidden] {
  display: none !important;
}

.area-layer-label {
  right: 62px;
  bottom: 38px;
  gap: 6px;
  padding: 0 8px;
  border-radius: 7px;
}

.area-layer-swatch {
  width: 17px;
  height: 8px;
  border-radius: 50%;
  background: rgba(242, 169, 31, 0.11);
  box-shadow: 0 0 7px rgba(242, 169, 31, 0.14);
}

.data-attribution {
  right: 62px;
  bottom: 8px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 500;
}

.header-bottom:not(.detail-active) .area-layer-label {
  bottom: 148px;
}

.header-bottom:not(.detail-active) .data-attribution {
  bottom: 118px;
}

@media (max-width: 540px) {
  .pitch-control {
    grid-template-columns: 1fr;
    grid-template-rows: 16px 100px auto;
    width: 38px;
    min-height: 152px;
  }

  .pitch-control input[type="range"] {
    height: 100px;
  }

  .area-layer-label {
    right: 54px;
    bottom: 35px;
  }

  .data-attribution {
    right: 54px;
    max-width: 188px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.pulse-header .search-results {
  z-index: 120;
}

@media (max-width: 820px) {
  .map-stage.detail-open .area-layer-label {
    display: none !important;
  }

  .map-stage.detail-open .data-attribution {
    bottom: calc(min(68dvh, 570px) + 8px);
  }
}

@media (max-height: 500px) {
  .detail-panel {
    max-height: calc(100dvh - 132px);
  }

  .map-stage.detail-open .map-tools,
  .map-stage.detail-open .settings-button,
  .map-stage.detail-open > .data-attribution,
  .map-stage.detail-open .maplibregl-ctrl-attrib {
    display: none !important;
  }
}

.detail-map-attribution {
  position: sticky;
  top: -10px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
  margin: 7px 0 0;
  padding: 4px 0;
  background: rgba(253, 253, 253, 0.96);
  color: #666b70;
  font-size: 9px;
  line-height: 1.35;
}

.detail-map-attribution a {
  color: #454a50;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
