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

.street-mode .heading {
  position: relative;
  inset: auto;
  flex-wrap: wrap;
  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, .street-outdoors { display: flex; flex: 1; flex-direction: column; min-width: 0; }

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

.app:not(.street-mode:has(.street-view:not([hidden], [data-mini-room]) .street-outdoors:not([hidden]))) .street-context { display: none; }
#street-title { color: var(--muted); font-size: var(--md); font-weight: 700; 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-tools, .street-wayfinding, .street-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

#street-map { white-space: nowrap; }

.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 {
  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-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); }

.street-room { flex: 1; min-width: 0; background: var(--panel); }
.room-sound {
  position: sticky;
  z-index: 5;
  bottom: var(--s2);
  align-self: flex-end;
  margin: var(--s2);
  margin-block-start: auto;
}
.room-sound:empty { display: none; }
.street-room-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-block: 1px solid var(--line);
  background: var(--page);
}
.street-room-head h2 { font-size: clamp(1.1rem, 2.6vw, 1.65rem); line-height: 1.2; }
.street-room-actions { display: flex; flex-shrink: 0; align-items: center; gap: var(--s2); }
.street-room-actions .street-control { white-space: nowrap; }
.street-room-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  align-items: start;
}
.street-room-picture { overflow: hidden; margin: 0; background: var(--page); }
.street-room-picture img { display: block; width: 100%; height: auto; }
#club-room img {
  max-height: max(18rem, calc(100svh - 8.5rem));
  object-fit: contain;
}
.street-room-picture 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;
}
.shop-counter, .workshop-interactions { min-width: 0; }
.shop-counter {
  border-inline-start: 1px solid var(--line);
  font-size: var(--sm);
}
.shop-counter h3, .workshop-interactions h3 { font-size: var(--md); }
.shop-counter p { margin-block: var(--s2); color: var(--muted); }
#district-trade {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line);
  background: var(--page);
  color: var(--accent);
}
#district-trade:empty { padding: 0; border: 0; }

.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); }
.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-dialog > .district-content { overflow: auto; }
.district-content { padding: var(--s2) var(--s4) var(--s4); }
.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-content 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-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; }
.district-item p { margin: 0; font-size: var(--xs); }
.district-content button[aria-disabled="true"] { background: var(--page); }
:is(.shop-counter, .district-dialog) p#district-outcome { color: var(--accent); }
.district-content :is(#district-wait, #district-outcome):empty { margin: 0; }
.district-content :is(#district-crime-title, #district-resale-title) { scroll-margin-top: 88px; }
.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; }

.workshop-picture { position: relative; }
#workshop-door-exit { top: 54%; left: 13%; }
[data-workshop-point="owner"] { top: 38%; left: 71%; }
[data-workshop-point="ledger"] { top: 58%; left: 59%; }
[data-workshop-point="bench"] { top: 46%; left: 38%; }
[data-workshop-point="order"] { top: 61%; left: 84%; }
.workshop-tabs { display: flex; flex-wrap: wrap; gap: var(--s2); }
.workshop-tabs .street-control[aria-pressed="true"],
.workshop-card .street-control[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-bg);
  color: var(--accent);
}
#workshop-stock { color: var(--accent); font: 650 var(--sm)/1.45 var(--mono); }
#workshop-result { color: var(--accent); scroll-margin-top: 80px; }
#workshop-result:empty { margin-block-end: calc(-1 * var(--s3)); }
.workshop-panel, #workshop-orders, #workshop-services { display: grid; gap: var(--s3); }
#workshop-appraisal { display: grid; gap: var(--s2); justify-items: start; color: var(--muted); }
.workshop-card #workshop-appraisal-result { color: var(--accent); }
#workshop-appraisal-result:empty { margin-block-end: calc(-1 * var(--s2)); }
.workshop-panel h3 { scroll-margin-top: 80px; }
.workshop-card {
  display: grid;
  justify-items: start;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: var(--page);
  font-size: var(--sm);
}
.workshop-card h4, .workshop-card fieldset { margin: 0; }
.workshop-card h4 { color: var(--text); font-size: var(--md); }
.workshop-card p { color: var(--muted); }
.workshop-card .workshop-amount { color: var(--accent); font: 650 var(--sm)/1.4 var(--mono); }
.workshop-card fieldset { min-width: 0; padding: var(--s2); border: 1px solid var(--line); }
.workshop-card fieldset button { margin: 0 var(--s1) var(--s1) 0; }
.workshop-lamps { display: flex; flex-wrap: wrap; gap: var(--s2); }
.workshop-lamps span {
  padding: var(--s1) var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: var(--raised);
}
.workshop-lamps span.lit { border-color: #8eaf88; background: #273a2b; color: #c6e6be; }
#street-interaction p#street-workshop-note { color: var(--accent); }

@media (min-width: 841px) {
  .workshop-picture { position: sticky; top: 66px; }
}

@media (max-width: 840px) {
  .street-mode .heading-title { min-height: 28px; }
  .street-mode .heading-title .kicker { display: none; }
  #street-title { font-size: var(--sm); }
  .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); }
  .street-room-body { grid-template-columns: minmax(0, 1fr); }
  .shop-counter { border-inline-start: 0; }
}

@media (max-width: 400px) {
  #street-map { padding-inline: var(--s2); font-size: var(--xs); }
  .street-surface { min-height: 36svh; }
  .street-room-actions { gap: var(--s1); }
  .street-room-actions .street-control { padding-inline: var(--s2); font-size: var(--xs); }
  .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; }
  .street-footer { flex-direction: row; align-items: center; }
  .street-surface { min-height: max(135px, 42svh); }
}
