.places-dialog {
  --hall-fg: #f4f4fb;
  --hall-muted: #a5abba;
  --hall-border: #343849;
  --hall-surface: #171924;
  --hall-floor: #10121b;
  --hall-wall: #404555;
  --hall-fixture: #8e99af;
  --hall-accent: #ff79a8;
  --hall-selected: #f5f1ff;
  --hall-free: #165044;
  --hall-free-edge: #56c3a4;
  --hall-busy: #56263c;
  --hall-busy-edge: #f486b0;
  --hall-unknown: #262936;
  --hall-unknown-edge: #60687e;
  --hall-reserved: #ffd17a;
  --room-all: #ff8db5;
  --room-hall: #91bbff;
  --room-lounge: #63dfcf;
  --room-vip: #d7a3ff;
  --room-gold: #ffd277;
}

html[data-theme="light"] .places-dialog {
  --hall-fg: #2b2838;
  --hall-muted: #615d71;
  --hall-border: #d6cfdc;
  --hall-surface: #fff;
  --hall-floor: #f0edf4;
  --hall-wall: #b1aabd;
  --hall-fixture: #566078;
  --hall-accent: #9f2354;
  --hall-selected: #241b32;
  --hall-free: #ceefe4;
  --hall-free-edge: #247253;
  --hall-busy: #fbd7e5;
  --hall-busy-edge: #a43668;
  --hall-unknown: #ebe8f0;
  --hall-unknown-edge: #827991;
  --hall-reserved: #98601b;
  --room-all: #a62757;
  --room-hall: #275da9;
  --room-lounge: #06736a;
  --room-vip: #7343a7;
  --room-gold: #8a560b;
}

.places-dialog [data-room="all"] { --room-color: var(--room-all); }
.places-dialog [data-room="hall"] { --room-color: var(--room-hall); }
.places-dialog [data-room="lounge"] { --room-color: var(--room-lounge); }
.places-dialog [data-room="vip"] { --room-color: var(--room-vip); }
.places-dialog [data-room="gold"] { --room-color: var(--room-gold); }

.places-dialog .places-top { align-items: center; margin-bottom: 14px; }
.places-dialog .places-top h2 { margin: 0; font-size: clamp(20px, 5.8vw, 28px); }
.places-dialog .places-select-label { margin-bottom: 5px; }
.places-dialog .places-address { margin-block: 6px 10px; }
.places-dialog[data-view="map"] .places-summary { min-height: 0; margin-block: 10px; padding: 10px 12px; gap: 8px; }
.places-dialog[data-view="map"] .places-main-count { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; }
.places-dialog[data-view="map"] .places-main-count strong { margin: 0; font-size: 30px; }
.places-dialog[data-view="map"] .places-main-count small { letter-spacing: .07em; }
.places-dialog[data-view="map"] .places-busy-count { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.places-dialog .places-room-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(91px, 1fr));
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 2px 8px;
  overflow: visible;
}
.places-dialog .places-room-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 48px;
  padding: 6px;
  align-items: center;
  gap: 3px 5px;
  text-align: start;
}
.places-dialog .places-room-button > strong,
.places-dialog .places-room-button > small { white-space: normal; line-height: 1.15; }
.places-dialog .places-room-button > strong { font-size: 12px; }
.places-dialog .places-room-button[data-room="other"] > strong,
.places-dialog .places-room-button > small { grid-column: 1 / -1; }
.places-dialog .places-room-button > small { padding-inline: 2px; }
.places-room-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  color: var(--room-color, var(--hall-muted));
}
.places-room-button .places-room-icon {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.places-room-icon svg { display: block; width: 15px; height: 15px; }
.places-dialog .places-room-button[data-room][aria-pressed="true"],
html[data-theme="light"] .places-dialog .places-room-button[data-room][aria-pressed="true"] {
  border-color: var(--room-color, var(--hall-muted));
  background: color-mix(in srgb, var(--room-color, var(--hall-muted)) 12%, var(--hall-surface));
  color: var(--hall-fg);
  box-shadow: none;
}
.places-dialog .places-room-button[data-room][aria-pressed="true"] small { color: var(--hall-muted); }
.places-pc-number { display: flex; align-items: center; gap: 5px; }
.places-pc-number .places-room-icon svg { width: 13px; height: 13px; }
.places-dialog .places-grid .places-pc[data-room]:not([data-room="other"]) {
  border-inline-start: 3px solid var(--room-color);
}

@media (max-width: 480px) {
  .places-dialog { max-height: calc(100dvh - 20px); }
  .places-dialog .places-content { padding: 13px; }
  .places-dialog .places-top { margin-bottom: 9px; }
  .places-dialog .places-select { min-height: 44px; padding-block: 8px; }
}

.places-view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--hall-border);
  border-radius: 14px;
  background: var(--hall-floor);
}

.places-view-switch button,
.places-map-zoom {
  min-width: 0;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--hall-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.places-view-switch button[aria-pressed="true"] {
  border-color: var(--hall-border);
  background: var(--hall-surface);
  color: var(--hall-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hall-accent) 38%, transparent);
}

.places-map-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--hall-border);
  border-radius: 16px;
  background: var(--hall-surface);
}

.places-map-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  padding: 7px 9px;
}
.places-map-zoom { min-width: 44px; border-color: var(--hall-border); color: var(--hall-fg); }
.places-map-zoom:disabled { opacity: .45; cursor: default; }
.places-map-zoom:not(:disabled):hover { border-color: var(--hall-accent); }
.places-map-zoom:first-child,
.places-map-zoom:last-child { font-size: 20px; line-height: 1; }

.places-map-viewport {
  max-height: min(60vh, 470px);
  max-height: min(60dvh, 470px);
  margin-inline: 8px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--hall-border);
  border-radius: 11px;
  background-color: var(--hall-floor);
  background: radial-gradient(circle, color-mix(in srgb, var(--hall-wall) 25%, transparent) 1px, transparent 1px) 1px 1px / 16px 16px, var(--hall-floor);
  scrollbar-width: thin;
}

.places-map-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 100%;
  width: max-content;
  padding: 7px;
}
.places-map-plan { display: block; flex: none; user-select: none; -webkit-user-select: none; }
.places-map-wall { fill: var(--hall-wall); }
.places-map-zone { fill: color-mix(in srgb, var(--hall-wall) 20%, transparent); stroke: var(--hall-wall); stroke-width: 4px; }
.places-map-caption { fill: var(--hall-fixture); font-weight: 760; letter-spacing: .035em; }
.places-map-icon path { fill: none; stroke: var(--hall-fixture); stroke-width: 1.65px; stroke-linecap: round; stroke-linejoin: round; }
.places-map-seat { cursor: pointer; --seat-fill: var(--hall-unknown); --seat-edge: var(--hall-unknown-edge); }
.places-map-seat[data-state="free"] { --seat-fill: var(--hall-free); --seat-edge: var(--hall-free-edge); }
.places-map-seat[data-state="busy"] { --seat-fill: var(--hall-busy); --seat-edge: var(--hall-busy-edge); }
.places-map-seat[data-outside="true"] { opacity: .27; pointer-events: none; }
.places-map-face { fill: var(--seat-fill); stroke: var(--seat-edge); stroke-width: 5px; }
.places-map-room-mark {
  stroke: var(--room-color, transparent);
  stroke-width: 1.65px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.places-map-number { fill: var(--hall-fg); font-weight: 820; pointer-events: none; }
.places-map-reservation { fill: var(--hall-reserved); stroke: var(--hall-floor); stroke-width: 4px; opacity: 0; pointer-events: none; }
.places-map-seat[data-reserved="true"] .places-map-reservation { opacity: 1; }
.places-map-seat:hover .places-map-face,
.places-map-seat:focus-visible .places-map-face,
.places-map-seat[aria-pressed="true"] .places-map-face { stroke: var(--hall-selected); stroke-width: 10px; }
.places-map-seat:focus-visible { outline: none; }

.places-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin: 0;
  padding: 10px 12px 11px;
  list-style: none;
  color: var(--hall-muted);
  font-size: 11px;
  line-height: 1.35;
}
.places-map-legend-item { display: flex; align-items: center; gap: 5px; }
.places-map-legend-item i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--hall-unknown-edge); }
.places-map-legend-item i[data-state="free"] { background: var(--hall-free-edge); }
.places-map-legend-item i[data-state="busy"] { background: var(--hall-busy-edge); }
.places-map-legend-item i[data-state="reserved"] { background: var(--hall-reserved); }
.places-map-empty, .places-map-message { margin: 0; padding: 15px 12px; color: var(--hall-muted); font-size: 13px; }

.places-map-selection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--hall-border);
  background: var(--hall-floor);
}
.places-map-selection-number {
  min-width: 39px;
  display: grid;
  place-items: center;
  min-height: 39px;
  border: 1px solid var(--hall-border);
  border-radius: 10px;
  background: var(--hall-surface);
  color: var(--hall-fg);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.places-map-selection-copy { display: grid; min-width: 0; gap: 3px; color: var(--hall-fg); line-height: 1.35; overflow-wrap: anywhere; }
.places-map-selection-copy small { color: var(--hall-muted); font-size: 11px; }
.places-map-book {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #9e2859;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.places-map-book:hover { background: #b63267; }
.places-map-book:disabled { opacity: .48; cursor: default; }
.places-dialog .places-pc.unknown {
  border-color: var(--hall-border);
  background: var(--hall-surface);
  color: var(--hall-muted);
}

@media (max-width: 430px) {
  .places-map-selection { grid-template-columns: auto minmax(0, 1fr); }
  .places-map-book { grid-column: 1 / -1; width: 100%; }
}
