/* SPDX-License-Identifier: AGPL-3.0-only */
:root {
  --bg: #f3f6f5;
  --panel: #ffffff;
  --ink: #18201b;
  --muted: #68736d;
  --line: #dbe2df;
  --line-strong: #b7c3bd;
  --accent: #2e6f56;
  --accent-2: #315f7f;
  --surface: #f8faf9;
  --surface-2: #eef4f1;
  --warn: #b24747;
  --focus: #174d9b;
  --shadow: 0 14px 36px rgba(17, 30, 24, 0.08);
  --map-view-width: 958;
  --map-view-height: 585;
  --map-frame-width: 899;
  --map-frame-height: 540;
  --map-render-width: 1680px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #f8faf9 0, #f3f6f5 360px, #eef2f0 100%);
  color: var(--ink);
  font-family:
    "Inter",
    "Pretendard",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

.site-disclaimer {
  padding: 9px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #14211c;
  color: #f4faf6;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(18px, 3vw, 40px) 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(18, 32, 26, 0.02);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: 0;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.event-meta span,
.event-meta a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.workspace {
  width: min(1680px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 28px) 32px;
}

.page-disclaimer {
  width: min(1680px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 28px) 34px;
  color: #5f625b;
  font-size: 13px;
  line-height: 1.55;
}

.page-disclaimer p {
  margin: 0;
}

.page-disclaimer p + p {
  margin-top: 4px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px auto minmax(220px, auto);
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.search-field,
.select-field,
.check-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-field {
  align-items: center;
  grid-template-columns: auto auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.04);
}

.check-field input {
  width: 16px;
  height: 16px;
}

.search-field input,
.select-field select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.04);
}

.search-field input {
  padding: 0 14px;
}

.select-field select {
  padding: 0 12px;
}

.search-field input:focus,
.select-field select:focus,
button:focus-visible {
  outline: 3px solid rgba(23, 77, 155, 0.28);
  outline-offset: 2px;
}

button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #2e6f56;
  border-radius: 8px;
  background: #2e6f56;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

button:hover {
  background: #245942;
  box-shadow: 0 8px 18px rgba(46, 111, 86, 0.14);
}

.stats {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.tag-filter {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tag-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.tag-filter-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.tag-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tag-mode {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tag-mode button {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.tag-mode button.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.tag-clear-button {
  min-height: 34px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.tag-clear-button:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: none;
}

.tag-chips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.tag-chip-group {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfa 100%);
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.04);
}

.tag-chip-group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 0 0;
  color: #2f332b;
  font-size: 13px;
  font-weight: 900;
}

.tag-chip-group h3::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tag-group-accent, var(--accent));
  content: "";
}

.tag-chip-group-tea {
  --tag-group-accent: #2f6f55;
}

.tag-chip-group-ware {
  --tag-group-accent: #9a6b31;
}

.tag-chip-group-food {
  --tag-group-accent: #b96848;
}

.tag-chip-group-other {
  --tag-group-accent: #5e6372;
}

.tag-chip-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 7px;
  max-height: clamp(42px, 10svh, 128px);
  min-width: 0;
  overflow-y: auto;
  padding: 1px 0 2px;
}

.tag-chip-group-tea .tag-chip-group-list {
  max-height: clamp(64px, 14svh, 170px);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.tag-chip:hover {
  border-color: var(--tag-group-accent, var(--accent));
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

.tag-chip.is-active {
  border-color: var(--accent);
  background: var(--surface-2);
  color: #1d513d;
}

.tag-chip.is-active:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  color: #1d513d;
}

@media (hover: none), (pointer: coarse) {
  .tag-chip:hover,
  .tag-chip:active {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: none;
    transform: none;
  }

  .tag-chip.is-active:hover,
  .tag-chip.is-active:active {
    border-color: var(--accent);
    background: var(--surface-2);
    color: #1d513d;
  }
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.map-region,
.inspector,
.results {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-region {
  position: relative;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.map-heading {
  min-width: 0;
}

.map-heading p {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.map-heading h2 {
  margin: 0;
  color: #22300f;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.2;
  letter-spacing: 0;
}

.map-tools {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.05);
}

.map-tools button {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.map-tools button:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: none;
}

.map-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#zoomValue {
  min-width: 44px;
  font-size: 13px;
}

.map-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: var(--map-frame-width) / var(--map-frame-height);
  height: auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 30, 24, 0.02);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  cursor: grab;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
}

.map-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.booth-map {
  display: block;
  width: var(--map-render-width);
  min-width: var(--map-render-width);
  max-width: none;
  height: auto;
  aspect-ratio: var(--map-view-width) / var(--map-view-height);
  background: #fff;
  transform-origin: top left;
}

.hall-outline {
  fill: #fff;
  stroke: #1f211c;
  stroke-width: 2;
}

.facility {
  fill: #fff;
  stroke: #1f211c;
  stroke-width: 1.4;
}

.facility-label {
  fill: #22251f;
  font-size: 10px;
  font-weight: 800;
}

.support-zone {
  fill: #f5eb2a;
  stroke: #1f211c;
  stroke-width: 0.8;
}

.support-label {
  fill: #384000;
  font-size: 5px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

.entrance-label {
  fill: #242721;
  font-size: 6px;
  font-weight: 800;
}

.grid-overlay {
  pointer-events: none;
}

.grid-overlay line {
  stroke: rgba(23, 77, 155, 0.28);
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}

.booth {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.booth rect {
  pointer-events: all;
  stroke: rgba(35, 35, 30, 0.82);
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
  transition:
    stroke-width 120ms ease,
    filter 120ms ease,
    opacity 120ms ease;
}

.booth text {
  pointer-events: none;
  fill: #191c17;
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0;
}

.booth-id {
  fill: #30332d;
  font-size: 4.8px;
  font-weight: 800;
}

.booth-name {
  font-size: 5.15px;
  font-weight: 800;
}

.booth.is-dimmed {
  opacity: 0.22;
}

.booth.is-tag-match rect {
  stroke: #174d9b;
  stroke-width: 1.45;
  filter: drop-shadow(0 0 4px rgba(23, 77, 155, 0.22));
}

.booth.is-empty rect {
  stroke-dasharray: none;
}

@media (hover: hover) and (pointer: fine) {
  .booth:hover rect {
    stroke: #2e6f56;
    stroke-width: 1.25;
    filter: drop-shadow(0 0 3px rgba(46, 111, 86, 0.16));
  }
}

.booth:focus-visible rect {
  stroke: #9b6a37;
  stroke-width: 1.45;
  filter: drop-shadow(0 0 4px rgba(155, 106, 55, 0.22));
}

.booth.is-selected rect,
.booth.is-selected:hover rect,
.booth.is-selected:focus-visible rect {
  stroke: #c86a2b;
  stroke-width: 1.65;
  filter: drop-shadow(0 0 5px rgba(200, 106, 43, 0.26));
}

@media (hover: none), (pointer: coarse) {
  .booth,
  .booth:focus,
  .booth:focus-visible {
    outline: none;
  }

  .booth:active rect,
  .booth:focus rect,
  .booth:focus-visible rect {
    filter: none;
  }

  .booth.is-selected rect,
  .booth.is-selected:active rect,
  .booth.is-selected:focus rect,
  .booth.is-selected:focus-visible rect {
    stroke: #c86a2b;
    stroke-width: 1.55;
    filter: drop-shadow(0 0 3px rgba(200, 106, 43, 0.2));
  }
}

.inspector {
  position: static;
  top: auto;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.details-panel {
  padding: 18px;
}

.empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.detail-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-title h2 {
  margin: 0;
  font-size: 26px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.vendor-block + .vendor-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.vendor-block h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.summary {
  margin-bottom: 12px;
  color: #39443e;
  line-height: 1.65;
}

.link-row,
.search-row,
.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.tag-row,
.product-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.tag-pill,
.product-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf4ef;
  color: #214f3c;
  font-size: 12px;
  font-weight: 800;
}

.product-pill {
  background: #eef4fb;
  color: #315f7f;
}

.status-pill {
  margin-left: 6px;
  background: #f3f5f4;
  color: #5d675f;
}

.source-row span,
.source-row a {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #252821;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.05);
}

.social-link:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 33, 28, 0.28);
}

.social-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-facebook .social-icon,
.social-naver-blog .social-icon,
.social-band .social-icon {
  fill: currentColor;
  stroke: none;
}

.social-instagram {
  color: #b23372;
  background: #fff7fb;
}

.social-facebook {
  color: #1b61c9;
  background: #f5f8ff;
}

.social-youtube {
  color: #c92828;
  background: #fff6f6;
}

.social-naver-blog,
.social-naver-cafe,
.social-band {
  color: #138a4d;
  background: #f5fbf7;
}

.social-linktree {
  color: #2f6b43;
  background: #f6fbf4;
}

.search-row {
  margin-top: 0;
}

.search-link {
  display: inline-grid;
  grid-template-columns: 18px minmax(64px, auto);
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-items: center;
  max-width: 100%;
  min-height: 38px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #252821;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.05);
}

.search-link small {
  grid-column: 2;
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-icon {
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-naver-search {
  color: #138a4d;
}

.search-naver-search .search-icon {
  fill: currentColor;
  stroke: none;
}

.search-google-search {
  color: #3f5f9d;
}

.incident-section {
  margin: 12px 0 14px;
}

.incident-section h4 {
  margin: 0 0 8px;
  color: #2f312b;
  font-size: 13px;
  font-weight: 900;
}

.incident-grid {
  display: grid;
  gap: 8px;
}

.incident-note {
  border: 1px solid #d9ded4;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbf5;
}

.incident-note strong {
  display: block;
  margin-bottom: 6px;
  color: #284535;
}

.incident-note p {
  margin-bottom: 8px;
  color: #41483e;
  font-size: 13px;
  line-height: 1.55;
}

.incident-note small {
  color: var(--muted);
}

.incident-note.incident-needs-human-review,
.incident-note.incident-public-allegation {
  border-color: #e5c7a4;
  background: #fff8ee;
}

.incident-note.incident-needs-human-review strong,
.incident-note.incident-public-allegation strong {
  color: #8a4f16;
}

.incident-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.incident-links a {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #2f4e68;
  font-size: 12px;
  font-weight: 800;
}

.review-grid {
  display: grid;
  gap: 8px;
}

.review-theme {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.review-theme strong {
  display: block;
  margin-bottom: 6px;
  color: #264636;
}

.review-theme p {
  margin-bottom: 8px;
  color: #4c4941;
  font-size: 14px;
  line-height: 1.55;
}

.review-theme small {
  color: var(--muted);
}

.review-detail-section {
  margin-top: 12px;
}

.review-detail-section h4 {
  margin: 0 0 8px;
  color: #2f312b;
  font-size: 13px;
  font-weight: 900;
}

.review-detail-grid {
  display: grid;
  gap: 8px;
}

.review-detail {
  border: 1px solid #d9dfd7;
  border-radius: 8px;
  padding: 10px;
  background: #fbfff8;
}

.review-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.review-detail-head strong {
  color: #243d2e;
  line-height: 1.35;
}

.review-detail-head span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf4ef;
  color: #214f3c;
  font-size: 11px;
  font-weight: 900;
}

.review-detail p {
  margin-bottom: 8px;
  color: #41483e;
  font-size: 13px;
  line-height: 1.55;
}

.review-detail small {
  color: var(--muted);
}

.review-detail-source {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.review-detail-source a,
.review-detail-source span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #2f4e68;
  font-size: 12px;
  font-weight: 800;
}

.results {
  margin-top: 16px;
  padding: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  min-width: 0;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.sort-field {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sort-field select {
  min-height: 34px;
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
}

.booth-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.booth-list button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(17, 30, 24, 0.04);
}

.booth-list button:hover,
.booth-list button.is-selected {
  border-color: var(--focus);
  background: #f3f7ff;
}

.list-booth-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  color: #1d201c;
  font-weight: 900;
}

.list-vendors {
  min-width: 0;
}

.list-vendors strong,
.list-vendors span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-vendors span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .event-meta {
    justify-content: flex-start;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) 132px;
  }

  .stats {
    justify-self: stretch;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .tag-filter-head {
    align-items: flex-start;
  }

  .tag-chips {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  body {
    background: #f3f6f5;
  }

  .topbar {
    gap: 12px;
    padding: 18px 12px 14px;
  }

  h1 {
    font-size: 23px;
  }

  .event-meta {
    width: 100%;
  }

  .event-meta span,
  .event-meta a {
    min-height: 34px;
    padding: 6px 8px;
  }

  .workspace {
    padding-inline: 10px;
  }

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

  .stats {
    text-align: left;
  }

  .tag-filter,
  .results,
  .details-panel {
    font-size: 13px;
  }

  .tag-filter-head {
    display: grid;
    gap: 10px;
  }

  .tag-controls {
    justify-content: flex-start;
  }

  .tag-mode {
    justify-self: start;
  }

  .tag-chips {
    margin-inline: -2px;
    padding: 2px 2px 8px;
    grid-template-columns: 1fr;
  }

  .tag-chip-group {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .tag-chip-group h3 {
    margin-top: 0;
  }

  .tag-chip-group-list {
    max-height: clamp(96px, 24svh, 220px);
  }

  .tag-chip-group-tea .tag-chip-group-list {
    max-height: clamp(130px, 34svh, 300px);
  }

  .tag-chip {
    min-width: 0;
  }

  .map-head {
    align-items: stretch;
    flex-direction: column;
  }

  .map-heading {
    order: 2;
  }

  .map-tools {
    order: 1;
    align-self: flex-start;
  }

  .map-scroll {
    min-height: 0;
  }

  .inspector {
    position: static;
    max-height: none;
    overflow: auto;
  }

  .details-panel {
    padding: 14px;
  }

  .detail-title h2 {
    font-size: 22px;
  }

  .booth-list {
    grid-template-columns: 1fr;
    max-height: 52svh;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-field {
    justify-content: space-between;
    width: 100%;
  }

  .sort-field select {
    flex: 1;
  }

  .link-row,
  .search-row,
  .source-row {
    gap: 6px;
  }

  .search-link {
    width: 100%;
  }

  .search-link small {
    max-width: min(68vw, 260px);
  }
}
