:root {
  /* Airbnb + 100x Mobile App Designer High-Craft Spatial Discovery Tokens */
  --canvas-bg: #FFFFFF;
  --text-primary: #222222;
  --text-secondary: #6A6A6A;
  --text-muted: #717171;
  --surface: #FFFFFF;
  --surface-subtle: #F7F7F7;
  --surface-hover: #F2F2F2;
  --hairline: #EBEBEB;
  --hairline-strong: #DDDDDD;
  --accent: #FF385C;
  --accent-hover: #E00B41;
  --accent-soft: #FFF0F3;
  --open-ink: #047857;
  --open-soft: #ECFDF5;
  --warn-ink: #B45309;
  --warn-soft: #FFFBEB;
  --info-ink: #1D4ED8;
  --info-soft: #EFF6FF;
  --shadow-sm: rgba(0, 0, 0, 0.02) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 6px;
  --shadow-md: rgba(0, 0, 0, 0.02) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 6px, rgba(0, 0, 0, 0.1) 0px 4px 8px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-sans: 'DM Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'DM Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 62ch;
}

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

html {
  background-color: var(--canvas-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--canvas-bg);
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--text-primary);
  padding: 0.7rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.wordmark h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.wordmark .edition {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.42rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.site-nav a:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.site-nav a[aria-current="page"] {
  background: var(--text-primary);
  color: var(--surface);
}

.provenance-strip {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--hairline);
  padding: 0.5rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-height: 2.35rem;
  min-width: 0;
}

.chrome-bar {
  min-height: 2.35rem;
  height: auto;
  contain: layout;
}

#snapshot-counts {
  min-height: 1.2em;
  white-space: nowrap;
}

.provenance-strip .stamp {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-primary);
  min-width: 6.5rem;
  display: inline-block;
}

.layout {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr) minmax(0, 400px);
  gap: 0;
  align-items: stretch;
  height: calc(100vh - var(--chrome-h, 101px));
  overflow: hidden;
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }

  .detail-pane {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--hairline);
  }
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    height: auto;
    overflow: visible;
  }

  .browse-pane {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    flex: 0 0 auto;
    height: 66vh;
    max-height: 66vh;
    min-height: 420px;
    contain: layout;
  }

  .venue-list {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    overflow-y: auto;
  }

  .map-pane {
    height: 26rem;
    max-height: 26rem;
    min-height: 26rem;
  }

  .map-sheet {
    height: 100%;
  }

  #map {
    height: 100%;
    min-height: 0;
  }

  .detail-pane {
    max-height: none;
    overflow: visible;
  }
}

.browse-pane {
  background: var(--canvas-bg);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

@media (max-width: 880px) {
  .browse-pane {
    flex: 0 0 auto;
    height: 66vh;
    max-height: 66vh;
    min-height: 420px;
  }

  .venue-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
  }
}

.controls {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.field label {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
}

.field input,
.field select {
  width: 100%;
  padding: 0.52rem 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.result-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.result-count strong {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-primary);
}

.venue-list {
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.venue-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.venue-row:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.venue-row:active {
  transform: translateY(0);
}

.venue-row[aria-pressed="true"] {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.venue-row-name {
  display: block;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.venue-row-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.18rem;
}

.map-pane {
  position: relative;
  background: var(--surface-subtle);
  min-height: 420px;
  height: 100%;
  contain: layout paint;
}

#map {
  position: absolute;
  inset: 2px 0 0 0;
  width: 100%;
  height: calc(100% - 2px);
}

.maplibregl-map {
  position: absolute;
  overflow: hidden;
}

.map-sheet {
  position: absolute;
  inset: 0;
  background-color: #EFEADF;
  background-image:
    linear-gradient(rgba(29, 26, 20, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 26, 20, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

@media (max-width: 880px) {
  .map-pane {
    height: 62vh;
    min-height: 320px;
  }
}

#map {
  width: 100%;
  height: 100%;
  min-height: 320px;
}

.map-fallback {
  padding: 1.5rem;
  max-width: var(--measure);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.map-status {
  position: absolute;
  left: 0.9rem;
  top: 0.9rem;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.4rem 0.7rem;
  max-width: 22rem;
}

.detail-pane {
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  padding: 1.15rem 1.25rem 2rem;
  overflow-y: auto;
  max-height: 100%;
}

.detail-pane h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.14;
  color: var(--text-primary);
}

.detail-loc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.9rem 0 1rem;
}

.fact {
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}

.fact-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fact-value {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.1rem;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--surface-subtle);
  border-color: var(--text-secondary);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFDF8;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFDF8;
}

.btn-buy {
  background: var(--open-ink);
  border-color: var(--open-ink);
  color: #FFFDF8;
}

.btn-buy:hover {
  background: #163A22;
  border-color: #163A22;
  color: #FFFDF8;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.2rem 0 0.55rem;
  border-top: 1px solid var(--hairline);
  padding-top: 0.85rem;
}

.event-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.event-item {
  background: var(--canvas-bg);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
}

.event-when {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.event-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.15rem;
  line-height: 1.32;
}

.event-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.42rem;
}

.badge {
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.14rem 0.45rem;
  border-radius: 4px;
}

.badge-open {
  background: var(--open-soft);
  color: var(--open-ink);
}

.badge-link {
  background: var(--info-soft);
  color: var(--info-ink);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.badge-plain {
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.event-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.36rem 0.65rem;
}

.empty-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: var(--measure);
}

.lead-block {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
}

.lead-copy {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.36;
  color: var(--text-primary);
  max-width: var(--measure);
  margin-bottom: 0.7rem;
}

.attribution {
  grid-column: 1 / -1;
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 0.62rem 1.5rem;
  font-size: 0.76rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.attribution a {
  color: #FFFFFF;
  text-decoration: underline;
}

.attribution a:hover {
  color: #FFFFFF;
}

.doc {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.doc h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}

.doc .lede {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0.7rem 0 1.6rem;
  max-width: var(--measure);
}

.doc h2 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.8rem 0 0.55rem;
}

.doc p,
.doc li {
  font-size: 0.93rem;
  color: var(--text-secondary);
  max-width: var(--measure);
}

.doc ul {
  margin: 0.5rem 0 0.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0.8rem 0 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.86rem;
}

caption {
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 0.4rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--hairline-strong);
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-subtle);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  margin-top: 1.2rem;
  max-width: 640px;
}

.order-state {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.order-card h2 {
  margin-top: 0.65rem;
  font-size: 1.2rem;
}

.codes {
  list-style: none;
  margin: 0.7rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.codes li {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  overflow-wrap: anywhere;
}

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

.status-line {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.no-map-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--hairline);
  margin-top: 0.8rem;
  padding-top: 0.6rem;
}

.maplibregl-ctrl-attrib {
  font-size: 0.7rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
