.app.street-mode {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  min-height: 100dvh;
}

.street-mode .heading {
  position: relative;
  inset: auto;
  align-items: center;
  padding: var(--s2) var(--s3);
  background: var(--page);
}

.street-mode .heading-title { min-height: 0; padding: var(--s1); border: 0; background: transparent; }
.street-mode .layout { display: flex; flex: 1; flex-direction: column; }
.street-view { display: flex; flex: 1; flex-direction: column; min-width: 0; }

.street-head, .street-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  padding: var(--s2) var(--s3);
  background: var(--page);
}

.street-head { border-block: 1px solid var(--line); }
.street-title { min-width: 0; }
.street-title h2 { font-size: 1.2rem; line-height: 1.25; }
#street-bearing { display: block; color: var(--muted); font-size: var(--xs); }
.street-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.street-actions, .street-tools, .street-wayfinding, .street-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.street-actions { justify-content: flex-end; }
.street-actions #street-map { white-space: nowrap; }
#street-clock { color: var(--accent); font-family: var(--mono); }

.street-surface {
  position: relative;
  flex: 1 1 auto;
  min-height: max(240px, 36svh);
  overflow: hidden;
  isolation: isolate;
  outline-offset: -4px;
  background: var(--page);
  cursor: grab;
  touch-action: none;
}

.street-surface.dragging { cursor: grabbing; }
.street-canvas, .street-fallback, .street-hotspots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.street-fallback { background-repeat: repeat-x; }
.street-hotspot, .street-signal {
  position: absolute;
  transform: translate(-50%, -50%);
}

.street-hotspot {
  display: grid;
  place-items: center;
  pointer-events: auto;
  width: var(--control);
  height: var(--control);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
}

.street-hotspot-symbol {
  display: block;
  width: calc(2 * var(--s4));
  height: calc(2 * var(--s4));
  padding: calc(var(--s3) / 2);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--hud);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.street-hotspot-caption {
  position: absolute;
  bottom: calc(100% + var(--s1));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(224px, calc(100vw - 2 * var(--s3)));
  padding: var(--s1) var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: var(--hud);
  color: var(--text);
  font-size: var(--xs);
  font-weight: 650;
  visibility: hidden;
  pointer-events: none;
}

.street-hotspot-caption.below { top: calc(100% + var(--s1)); bottom: auto; }
.street-hotspot:focus-visible { z-index: 2; outline: none; }
.street-hotspot:focus-visible .street-hotspot-symbol { outline: 2px solid var(--focus); outline-offset: 2px; }
.street-hotspot:focus-visible .street-hotspot-caption { visibility: visible; }
.street-hotspot:active .street-hotspot-symbol { background: var(--accent-bg); }
@media (hover: hover) {
  .street-hotspot:hover { z-index: 2; }
  .street-hotspot:hover .street-hotspot-symbol { border-color: var(--accent); background: var(--raised); }
  .street-hotspot:hover .street-hotspot-caption { visibility: visible; }
}
#street-feature { color: var(--accent); border-color: var(--accent-line); }
.street-signal { width: 12px; height: 12px; border: 2px solid #28362d; border-radius: 50%; background: #3c5144; }
.street-signal.lit { border-color: #d3f9ba; background: #98f067; box-shadow: 0 0 16px 5px rgb(141 247 107 / .66); }

.street-feedback {
  position: absolute;
  z-index: 3;
  top: var(--s3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: max-content;
  max-width: calc(100% - 2 * var(--s3));
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: var(--hud);
  font-size: var(--sm);
  text-align: center;
  cursor: default;
}

.street-footer { border-top: 1px solid var(--line); }
.street-wayfinding { min-width: 0; }
.street-minimap {
  flex: 0 0 auto;
  padding: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: var(--hud);
  text-align: center;
}

.street-minimap canvas { display: block; width: 112px; height: 42px; }
.street-nav .street-control { text-align: left; }
.street-tools > .street-control, .street-tools summary, .street-nav .street-control { background: transparent; }
.street-tools > .street-control:hover, .street-tools summary:hover { background: var(--raised); }
.street-tools, .street-popover { position: relative; }
.street-tools .street-popover { position: static; }
.street-tools .street-popover-body { inset: auto 0 calc(100% + var(--s2)) auto; }
.street-popover[open] summary, #street-ambient[aria-pressed="true"] {
  background: var(--accent-bg);
  border-color: var(--accent-line);
  color: var(--accent);
}

.street-popover-body {
  position: absolute;
  z-index: 8;
  top: calc(100% + var(--s2));
  right: 0;
  width: min(300px, calc(100vw - 2 * var(--s3)));
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: var(--sm);
}

.street-time-control .street-popover-body { width: min(210px, calc(100vw - 2 * var(--s3))); }
.street-popover-body h3 { font-size: var(--sm); }
.street-look-buttons { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.street-activities .street-popover-body { display: grid; gap: var(--s2); }

.venue-dialog.district-dialog { width: min(500px, calc(100% - 2 * var(--s3))); max-height: calc(100dvh - 2 * var(--s3)); padding: 0; overflow: hidden; }
.district-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.district-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.district-dialog .district-header h2, .district-dialog .district-header form { margin: 0; }
.district-content { overflow: auto; padding: var(--s2) var(--s4) var(--s4); }
.venue-dialog.district-dialog[data-interior] { width: min(820px, calc(100% - 2 * var(--s3))); }
.district-dialog[data-interior] .map-place-close { padding-inline: var(--s2); font-size: var(--sm); white-space: nowrap; }
.district-shop-hero {
  overflow: hidden;
  margin: var(--s2) 0;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: var(--page);
}
.district-shop-hero img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; object-position: center 45%; }
.district-shop-hero figcaption {
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--line);
  color: var(--pin);
  font: 700 var(--md)/1.35 var(--display);
  text-align: center;
}
.district-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--s3) 0 0;
  border-block: 1px solid var(--line);
  background: var(--page);
}
.district-stats > div { display: flex; flex-direction: column; justify-content: space-between; padding: var(--s2); }
.district-stats > div + div { border-inline-start: 1px solid var(--line); }
.district-stats dt { color: var(--muted); font-size: var(--xs); }
.district-stats dd { margin: 0; color: var(--accent); font: 650 var(--sm)/1.6 var(--mono); }
.district-dialog section { border-top: 1px solid var(--line); margin-top: var(--s3); padding-top: var(--s3); }
.district-dialog h3 { font-size: var(--sm); }
.district-shop-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.district-dialog #district-resale { margin-bottom: var(--s2); }
.district-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin: var(--s2) 0; }
.venue-dialog.district-dialog .district-item p { margin: 0; font-size: var(--xs); }
.district-dialog button[aria-disabled="true"] { background: var(--page); }
.district-dialog > #district-trade { margin: 0; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--page); }
.district-dialog > #district-trade:empty { padding: 0; border: 0; }
.district-dialog #district-trade, .district-dialog #district-outcome { color: var(--accent); }
.district-dialog :is(#district-trade, #district-wait, #district-outcome):empty { margin: 0; }
@media (min-width: 720px) and (min-height: 490px) {
  .district-dialog[data-interior] .district-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
  .district-shop-hero { position: sticky; top: 0; align-self: start; }
  .district-shop-hero img { aspect-ratio: 6 / 5; }
}

.workshop-dialog {
  width: min(920px, calc(100% - 2 * var(--s3)));
  max-height: calc(100% - 2 * var(--s3));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.workshop-dialog::backdrop { background: rgb(9 16 17 / .8); }
.workshop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s4); }
.workshop-head h2 { font-size: var(--lg); line-height: 1.2; }
.workshop-picture { background: #26333b; }
.workshop-picture img { display: block; width: 100%; height: clamp(190px, 44dvh, 440px); object-fit: cover; object-position: center 55%; }
.workshop-interactions { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.workshop-response { color: var(--text); }
.workshop-buttons { display: flex; flex-wrap: wrap; gap: var(--s2); }
.owner-dialogue { padding-top: var(--s3); border-top: 1px solid var(--line); }
#talk-owner[aria-expanded="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.street-interaction p { min-height: 1.5em; }

@media (max-width: 840px) {
  .street-mode .heading-title { min-height: 28px; }
  .street-mode .heading-title .kicker { display: none; }
  .street-footer { flex-direction: column; align-items: stretch; }
  .street-wayfinding { display: grid; grid-template-columns: max-content 1fr; }
  .street-minimap canvas { width: 88px; height: 33px; }
  .street-nav .street-control, .street-tools > .street-control, .street-tools summary { font-size: var(--xs); padding-inline: var(--s2); }
  .street-nav { flex-wrap: nowrap; }
  .street-nav .street-control { min-width: 0; overflow-wrap: anywhere; }
  .street-tools { gap: var(--s1); }
}

@media (max-width: 400px) {
  .street-head { gap: var(--s1); }
  .street-head h2 { font-size: var(--sm); }
  .street-actions { flex-wrap: nowrap; gap: var(--s1); }
  .street-actions #street-map, .street-actions summary { padding-inline: var(--s2); font-size: var(--xs); }
  .street-time-control .street-popover-body { right: -70px; }
  .street-surface { min-height: 36svh; }
  .district-stats { grid-template-columns: 1.12fr .9fr 1fr; }
  .district-stats dd { font-size: var(--xs); }
}

@media (max-width: 360px) {
  .street-tools > .street-control, .street-tools summary { padding-inline: 6px; }
  .street-tools summary { gap: var(--s1); }
}

@media (orientation: landscape) and (max-height: 500px) {
  .street-mode .heading { display: flex; flex-wrap: wrap; }
  .street-footer { flex-direction: row; align-items: center; }
  .street-surface { min-height: max(135px, 42svh); }
  .workshop-picture img { height: 42dvh; }
}
