@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #101b20;
  --panel: #17252b;
  --line: #304047;
  --muted: #9bafb7;
  --text: #ecf0ed;
  --accent: #f2b568;
}
.room-button {
  white-space: nowrap;
  border-color: #6ca995;
}
#room-banner {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  z-index: 650;
  min-height: 30px;
  padding: 7px 18px;
  background: #203f38;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  font-size: 12px;
}
#room-banner[hidden] {
  display: none;
}
#room-banner.offline {
  background: #644125;
}
body.in-room main {
  padding-top: 32px;
}
body.in-room .map-top {
  top: 18px;
}
#room-heading {
  font-weight: 700;
}
#room-connection {
  text-align: right;
}
#rooms-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: 90dvh;
}
#rooms-dialog h2 {
  margin: 6px 0;
}
#rooms-dialog h3 {
  margin: 12px 0;
}
#room-error {
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #ffce8d;
}
#room-end {
  border-color: #b97461;
  color: #ffbea6;
}
#room-ended-note {
  padding: 14px;
  border: 1px solid #6ca995;
  border-radius: 7px;
  line-height: 1.6;
}
.room-card {
  background: #101d23;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  margin: 16px 0;
}
.room-card summary {
  cursor: pointer;
  min-height: 28px;
  font-weight: 700;
}
.room-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.room-row button:first-child {
  flex: 1;
  text-align: left;
}
#room-edit-code,
#room-view-code,
#room-code {
  font-family: monospace;
  letter-spacing: 1px;
}
body.room-viewer #sidebar,
body.room-viewer #show-sidebar,
body.room-viewer #inspector,
body.room-viewer #lock,
body.room-viewer #map-settings,
body.room-viewer #undo,
body.room-viewer #redo,
body.room-viewer #import,
body.room-viewer #new-scenario,
body.room-viewer #mode-banner {
  display: none !important;
}
body.room-viewer main {
  grid-template-columns: 1fr;
}
body.in-room #import,
body.in-room #new-scenario,
body.in-room #demo,
body.in-room #calibrate,
body.in-room .file-button {
  display: none;
}
@media (max-width: 760px) {
  #room-banner {
    top: 65px;
    padding: 5px 8px;
    gap: 8px;
    font-size: 11px;
  }
  body.in-room main {
    padding-top: 46px;
  }
  body.in-room aside {
    top: 111px;
  }
  #room-connection {
    max-width: 46%;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px "DM Sans",
    sans-serif;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #203138;
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover {
  background: #34464c;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button.active {
  border-color: var(--accent);
  background: #4a3d2c;
  color: #ffce8d;
}
.primary {
  background: var(--accent);
  color: #1c262a;
  border-color: var(--accent);
  font-weight: 700;
}
.primary:hover {
  background: #ffca88;
}
.wide {
  width: 100%;
  margin: 5px 0;
}
input:not([type="range"]):not([type="color"]):not([type="checkbox"]):not(
    [type="file"]
  ),
select {
  min-height: 44px;
  width: 100%;
  background: #101d23;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 30px;
}
input[type="color"] {
  width: 100%;
  height: 38px;
  border: 0;
  background: transparent;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  accent-color: var(--accent);
}
label {
  display: block;
  color: #bfced2;
  margin: 14px 0;
  font-size: 12px;
}
label input:not([type="checkbox"]),
label select {
  display: block;
  margin-top: 6px;
}
output {
  float: right;
  color: var(--text);
}
header {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 240px;
  font:
    700 17px "Space Grotesk",
    sans-serif;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  color: var(--muted);
  font:
    9px "DM Sans",
    sans-serif;
  letter-spacing: 1.6px;
  margin-top: 5px;
}
.brandmark {
  font: 700 35px "Space Grotesk";
  letter-spacing: -5px;
  color: var(--accent);
}
.brandmark span {
  color: #f3e9d8;
}
#scenario-name {
  max-width: 260px;
  border: 0 !important;
  background: transparent !important;
  font-weight: 600;
}
.header-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-left: auto;
}
#save-status {
  font-size: 11px;
  color: var(--muted);
  margin-right: 14px;
}
main {
  height: calc(100dvh - 76px);
  display: flex;
}
aside {
  width: 280px;
  flex: 0 0 280px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.aside-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}
.aside-top button {
  border: 0;
  background: none;
  font-size: 24px;
}
.eyebrow {
  font: 600 10px "Space Grotesk";
  letter-spacing: 1.8px;
  color: var(--muted);
}
.tabs {
  display: flex;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 12px 4px;
  color: var(--muted);
  font-size: 12px;
}
.tabs button.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}
section[data-panel] {
  padding: 16px 18px;
}
.help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 18px;
}
.catalog-heading {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 21px 0 10px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.object-btn {
  min-width: 0;
  overflow-wrap: anywhere;
  height: 85px;
  text-align: left;
  padding: 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #1d2e34;
}
.object-btn[hidden],
.tool-grid[hidden] {
  display: none;
}
#object-search {
  margin: 0 0 12px;
}
#overturn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.object-btn canvas {
  height: 35px;
  width: 70px;
  align-self: center;
}
.draw-btn {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  min-height: 58px;
}
.aside-footer {
  padding: 15px 18px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.aside-footer > span {
  font: 9px "Space Grotesk";
  letter-spacing: 1.8px;
  color: #738b94;
  display: block;
  text-align: center;
  margin-top: 12px;
}
#stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: #233a39;
}
#map,
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#scene {
  z-index: 450;
  touch-action: none;
}
.map-top {
  position: absolute;
  z-index: 600;
  top: 20px;
  left: 22px;
  right: 22px;
  display: flex;
  gap: 8px;
  pointer-events: none;
}
.map-top > * {
  pointer-events: auto;
  box-shadow: 0 3px 12px #0003;
}
.location {
  display: flex;
  background: var(--bg);
  border-radius: 7px;
  width: 240px;
}
.location input {
  border: 0 !important;
  background: none !important;
  font-size: 12px;
}
.location button {
  border: 0;
  background: none;
}
#lock {
  margin-left: auto;
  font-size: 12px;
}
.map-controls {
  position: absolute;
  right: 22px;
  top: 140px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.map-controls button {
  font-size: 22px;
  width: 44px;
  padding: 3px;
  background: #17252bec;
}
.north {
  position: absolute;
  z-index: 500;
  right: 34px;
  bottom: 95px;
  font: 11px "Space Grotesk";
  text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
.north span {
  display: block;
  font-size: 32px;
}
#mode-banner {
  position: absolute;
  z-index: 500;
  left: 22px;
  top: 80px;
  background: #15252aeb;
  padding: 11px 15px;
  border-left: 3px solid var(--accent);
  font: 600 10px "Space Grotesk";
  letter-spacing: 1px;
  pointer-events: none;
}
#mode-banner span {
  display: block;
  color: #c3cfd1;
  font: 12px "DM Sans";
  letter-spacing: 0;
  margin-top: 5px;
}
#instruction {
  position: absolute;
  z-index: 500;
  bottom: 73px;
  left: 50%;
  transform: translateX(-50%);
  background: #122229df;
  border: 1px solid #5d6e6c;
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
}
.bottom-bar {
  position: absolute;
  z-index: 600;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 20px;
  font-size: 11px;
  color: var(--muted);
}
.bottom-bar button {
  font-size: 11px;
  min-height: 34px;
  padding: 5px 10px;
}
.spacer {
  flex: 1;
}
.live-dot {
  width: 6px;
  height: 6px;
  background: #8bc7ab;
  border-radius: 50%;
}
#scale-label {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
#inspector {
  position: absolute;
  z-index: 650;
  right: 82px;
  top: 80px;
  width: 245px;
  background: #17252bf5;
  border: 1px solid #4c6067;
  border-radius: 10px;
  padding: 13px 17px;
  box-shadow: 0 15px 40px #0004;
  max-height: calc(100% - 150px);
  overflow: auto;
  backdrop-filter: blur(12px);
}
.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inspector-head button {
  border: 0;
  background: none;
  font-size: 22px;
  padding: 0;
  min-height: 30px;
  width: 30px;
}
.inspector-actions {
  display: flex;
  gap: 8px;
}
.inspector-actions button {
  flex: 1;
  font-size: 12px;
}
.danger {
  color: #ffb2a4;
  border-color: #85564f;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.wind-dial {
  width: 130px;
  height: 130px;
  border: 1px solid #4b5b5f;
  border-radius: 50%;
  margin: 22px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(#2d4247, #17252b);
}
#wind-arrow {
  font-size: 48px;
  line-height: 1;
  color: var(--accent);
}
#wind-summary {
  font-size: 10px;
  color: var(--muted);
  margin-top: 13px;
}
.notice {
  border-left: 2px solid #6f8587;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  padding-left: 12px;
  margin-top: 20px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}
#toast {
  position: absolute;
  z-index: 1000;
  left: 50%;
  top: 145px;
  transform: translateX(-50%);
  background: #f2b568;
  color: #18252a;
  max-width: 90%;
  padding: 12px 18px;
  border-radius: 6px;
  box-shadow: 0 6px 20px #0003;
  display: none;
}
#measure-result {
  position: absolute;
  z-index: 600;
  left: 22px;
  bottom: 110px;
  background: var(--bg);
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid #586b70;
  border-radius: 12px;
  width: 460px;
  max-width: 95vw;
  padding: 24px;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-head h2 {
  font: 600 24px "Space Grotesk";
  margin: 0;
}
.dialog-head button {
  font-size: 24px;
  border: 0;
  background: none;
}
dialog p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.file-button {
  border: 1px dashed #72847b;
  padding: 14px;
  text-align: center;
  cursor: pointer;
}
.file-button input {
  max-width: 100%;
}
.leaflet-control-attribution {
  margin-bottom: 48px !important;
  max-width: 80%;
  font-size: 9px !important;
  background: #122229df !important;
  color: #dce5e3 !important;
}
.leaflet-control-attribution a {
  color: #c9d9df !important;
}
.leaflet-control-scale {
  display: none;
}
.leaflet-container {
  background: #263936;
}
.leaflet-tile {
  filter: saturate(0.65) brightness(0.85);
}
[hidden] {
  display: none !important;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body.panel-hidden aside {
  display: none;
}
body.panel-hidden #show-sidebar {
  display: block;
}
.aside-top {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
  min-height: 64px;
}
.tabs {
  position: sticky;
  top: 64px;
  background: var(--panel);
  z-index: 2;
  flex-shrink: 0;
}
.aside-footer {
  flex-shrink: 0;
}
#tool-actions {
  position: absolute;
  z-index: 610;
  bottom: 115px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
#tool-actions button {
  font-size: 12px;
  box-shadow: 0 4px 15px #0005;
}
@media (max-width: 1100px) {
  header {
    gap: 10px;
    padding: 0 14px;
  }
  .brand {
    min-width: 215px;
  }
  #save-status {
    display: none;
  }
  aside {
    width: 240px;
    flex-basis: 240px;
  }
  .map-top {
    left: 14px;
    right: 14px;
  }
  .location {
    width: 185px;
  }
  #map-settings {
    font-size: 11px;
    padding: 8px;
  }
  #lock {
    max-width: 165px;
  }
  #scenario-name {
    max-width: 170px;
  }
}
@media (max-width: 760px) {
  header {
    height: 65px;
  }
  .brand {
    min-width: 0;
    font-size: 13px;
    letter-spacing: 1px;
  }
  .brand small {
    font-size: 7px;
  }
  .brandmark {
    font-size: 30px;
  }
  #scenario-name {
    display: none;
  }
  .header-actions button {
    font-size: 11px;
    padding: 6px 9px;
  }
  .header-actions #redo {
    display: none;
  }
  main {
    height: calc(100dvh - 65px);
  }
  aside {
    position: absolute;
    z-index: 700;
    left: 0;
    top: 65px;
    bottom: 0;
    width: 245px;
    box-shadow: 10px 0 30px #0005;
  }
  .map-top {
    top: 12px;
    gap: 5px;
  }
  .location {
    width: 145px;
  }
  #map-settings {
    display: block;
  }
  #lock {
    font-size: 10px;
    max-width: 130px;
    padding: 6px;
  }
  #mode-banner {
    left: 14px;
    top: 72px;
    max-width: 75%;
  }
  #mode-banner span {
    font-size: 10px;
  }
  #inspector {
    right: 68px;
    width: 220px;
    top: 135px;
  }
  #instruction {
    font-size: 9px;
    bottom: 80px;
    padding: 8px;
    max-width: 90%;
    white-space: normal;
    text-align: center;
  }
  .bottom-bar {
    padding: 0 10px;
    gap: 8px;
  }
  #scale-label {
    display: none;
  }
  .north {
    right: 25px;
  }
  .map-controls {
    right: 14px;
  }
  .leaflet-control-attribution {
    font-size: 8px !important;
  }
}
@media (max-width: 520px) {
  .map-top .location {
    display: none;
  }
  #map-settings {
    font-size: 10px;
  }
  .header-actions {
    gap: 4px;
  }
  .brand small {
    letter-spacing: 0.5px;
  }
}
/* Informational overlay: never intercept clicks or participate in map hit testing. */
.hover-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 650;
  pointer-events: none;
  max-width: min(300px, calc(100% - 16px));
  padding: 6px 10px;
  border: 1px solid #d8b679;
  border-radius: 6px;
  background: #14262ef2;
  color: #fff1d8;
  font: 600 12px/1.4 sans-serif;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 12px #0005;
}
.paint-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: -4px 0 16px;
}
.paint-presets button {
  min-height: 42px;
  background: var(--swatch);
  border: 2px solid #81918d;
  border-radius: 6px;
}
.paint-presets button[aria-pressed="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
