:root {
  color-scheme: dark;
  --bg: #182023;
  --panel: #222d30;
  --line: #3c4c50;
  --ink: #f3f0e6;
  --dim: #a4b9b9;
  --acc: #e9bb88;
  --accink: #342a20;
  --mono: ui-monospace, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font:
    14px/1.5 'Segoe UI',
    system-ui,
    sans-serif;
}
a {
  color: inherit;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
}
button:hover {
  background: #35454a;
}
button[aria-pressed='true'],
.primary {
  background: var(--acc);
  color: var(--accink);
  border-color: var(--acc);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}
select {
  background: var(--panel);
}
input[type='range'] {
  accent-color: var(--acc);
  width: 100%;
  margin: 7px 0 0;
}
input[type='checkbox'] {
  accent-color: var(--acc);
}
[hidden] {
  display: none !important;
}
.app {
  max-width: var(--ob-page-max);
  margin: auto;
  padding: 24px var(--ob-gutter) 30px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.eyebrow,
.label {
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.eyebrow a {
  text-decoration: none;
}
h1 {
  font:
    400 43px/1.1 Georgia,
    serif;
  letter-spacing: -1.2px;
  margin: 7px 0;
}
h1 em {
  color: var(--acc);
}
header p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 12px;
}
.topright {
  display: flex;
  align-items: center;
  gap: 17px;
}
.back {
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
}
.segmented {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.segmented button {
  border: 0;
  font-size: 12px;
  padding: 8px 13px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: start;
}
.stage {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  min-width: 0;
}
.toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 11px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.toolbar button {
  font-size: 11px;
}
.toolbar .spacer {
  flex: 1;
}
.viewport {
  position: relative;
  background: #cedde0;
  height: clamp(410px, 53vw, 690px);
}
#city {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
.viewbadge {
  position: absolute;
  top: 16px;
  left: 17px;
  font: 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #495e61;
  pointer-events: none;
  text-shadow: 0 0 5px #d8e4e8;
}
.night .viewbadge {
  color: #b4c0ca;
  text-shadow: none;
}
.viewcontrols {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 5px;
}
.viewcontrols button {
  background: #182023dd;
  font-size: 12px;
  color: #f3f0e6;
}
.viewcontrols #lockMouse {
  font-size: 10px;
}
.walkpad {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 40px);
  gap: 4px;
}
.walkpad button {
  background: #182023dc;
  color: var(--ink);
  font-size: 16px;
  padding: 8px;
  touch-action: none;
  user-select: none;
}
.walkpad [data-walk='forward'] {
  grid-column: 2;
}
.walkpad [data-walk='left'] {
  grid-column: 1;
}
.walkpad [data-walk='back'] {
  grid-column: 2;
}
.walkpad [data-walk='right'] {
  grid-column: 3;
}
.hint {
  background: var(--panel);
  padding: 10px 13px;
  color: var(--dim);
  font-size: 11px;
  min-height: 38px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 13px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.stats span {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--dim);
  letter-spacing: 0.09em;
}
.stats strong {
  display: block;
  color: var(--ink);
  font: 17px var(--mono);
  margin-top: 4px;
}
.sidebar {
  display: grid;
  gap: 13px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 17px;
}
.panel h2 {
  font-size: 14px;
  margin: 0 0 5px;
}
.panel p {
  font-size: 11px;
  color: var(--dim);
  margin: 5px 0 12px;
  line-height: 1.6;
}
.panel summary {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.planNote {
  margin-top: 12px !important;
}
#plan {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  background: #e6e8dc;
  border-radius: 8px;
  touch-action: none;
  cursor: crosshair;
}
.field {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 11px 0;
  font-size: 11px;
  color: var(--dim);
}
.field select {
  font-size: 11px;
  padding: 6px 8px;
}
.sliders {
  display: grid;
  gap: 14px;
  margin-top: 15px;
}
.sliders label {
  font-size: 11px;
  color: var(--dim);
}
.sliders label > span {
  display: flex;
  justify-content: space-between;
}
.sliders output {
  color: var(--ink);
  font-family: var(--mono);
}
.row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.row > * {
  flex: 1;
}
.row button {
  font-size: 11px;
}
.check {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: var(--dim);
  margin: 12px 0;
}
.wide {
  width: 100%;
}
.danger {
  color: #e5aa95;
  border-color: #755e55;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}
.filebar {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}
.filebar button {
  font-size: 11px;
}
.how,
.exports {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 17px;
  margin-top: 17px;
}
.how summary,
.exports summary {
  font-size: 12px;
  cursor: pointer;
}
.helpgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
  margin-top: 15px;
  color: var(--dim);
  font-size: 12px;
}
.helpgrid strong {
  color: var(--ink);
  font-weight: 500;
}
.helpgrid p {
  margin: 0 0 12px;
}
.exports .row {
  margin-top: 13px;
  justify-content: flex-start;
}
.exports .row > * {
  flex: 0 1 auto;
}
.exports button {
  font-size: 12px;
}
#exportStatus {
  min-height: 16px;
  margin-top: 9px;
  font-size: 11px;
  color: var(--acc);
}
.footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--dim);
  font-size: 10px;
}
#notice {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  background: #f3f0e6;
  color: #303e40;
  padding: 11px 17px;
  border-radius: 9px;
  z-index: 20;
  font-size: 12px;
}
.fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 35px;
  color: #405458;
  background: #dbe6df;
  text-align: center;
}
.fallback h2 {
  font:
    30px Georgia,
    serif;
  margin: 0 0 10px;
}
.fallback p {
  font-size: 13px;
  max-width: 360px;
}
.key {
  font: 10px var(--mono);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 4px;
}
#busy {
  position: absolute;
  top: 14px;
  right: 15px;
  color: #536364;
  font-size: 10px;
  background: #f5f2e5c9;
  border-radius: 5px;
  padding: 5px 9px;
}
.seed {
  font: 11px var(--mono);
  color: var(--dim);
}
@media (max-width: 950px) {
  .app {
    padding: 18px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 255px;
    gap: 12px;
  }
  .panel {
    padding: 14px;
  }
  .toolbar {
    gap: 4px;
  }
  .toolbar button {
    font-size: 10px;
    padding: 8px;
  }
  .topright .back {
    display: none;
  }
  h1 {
    font-size: 37px;
  }
  .stats {
    gap: 5px;
  }
  .stats strong {
    font-size: 14px;
  }
  .stats span {
    font-size: 8px;
  }
}
@media (max-width: 680px) {
  .app {
    padding: 14px 12px 24px;
  }
  header {
    padding-bottom: 14px;
    margin-bottom: 13px;
    gap: 8px;
  }
  h1 {
    font-size: 32px;
  }
  header p {
    display: none;
  }
  .eyebrow {
    font-size: 8px;
  }
  .segmented button {
    font-size: 10px;
    padding: 7px 9px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .viewport {
    height: 440px;
  }
  .toolbar {
    gap: 5px;
    padding: 9px;
  }
  .toolbar button {
    font-size: 10px;
    padding: 8px;
  }
  .toolbar .spacer {
    display: none;
  }
  #undo,
  #redo {
    margin-left: auto;
  }
  #redo {
    margin-left: 0;
  }
  .stats {
    padding: 11px;
  }
  .stats strong {
    font-size: 14px;
  }
  .sidebar {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 15px;
  }
  .hint {
    font-size: 10px;
  }
  .helpgrid {
    grid-template-columns: 1fr;
  }
  .footer {
    flex-direction: column;
    gap: 6px;
  }
  .viewbadge {
    font-size: 8px;
    left: 12px;
    top: 12px;
  }
  .walkpad {
    grid-template-columns: repeat(3, 42px);
  }
  .viewcontrols button {
    font-size: 11px;
  }
  .filebar button {
    font-size: 10px;
  }
  .field select {
    min-width: 130px;
  }
  .exports .row button {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
