.city-dialog {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #c7d6c5;
    color: #314d44;
    font-family: system-ui, sans-serif;
    overflow: hidden;
}
.city-dialog::backdrop {
    background: #253d38;
}
.city-dialog #city-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    outline: none;
}
.city-heading {
    position: absolute;
    top: 25px;
    left: 30px;
    max-width: calc(100% - 220px);
    padding: 16px 22px;
    background: #fcf8e9ed;
    border: 1px solid #ffffffb0;
    border-radius: 5px 22px 22px 22px;
    box-shadow: 0 6px 24px #2a433327;
    pointer-events: none;
}
.city-eyebrow {
    font-size: 10px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: #7d8c72;
}
.city-heading h2 {
    font:
        600 clamp(24px, 3vw, 38px)/1.1 Georgia,
        serif;
    margin: 7px 0;
}
.city-heading p {
    font-size: 12px;
    margin: 8px 0;
    color: #6e7c68;
}
.city-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.city-stats span {
    font-size: 11px;
    background: #e6ead8;
    padding: 5px 9px;
    border-radius: 8px;
}
.city-window {
    position: absolute;
    right: 24px;
    top: 25px;
    display: flex;
    gap: 8px;
}
.city-tools {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    padding: 8px;
    border-radius: 22px;
    background: #f5f0dbe8;
    box-shadow: 0 8px 32px #2a43332a;
    max-width: 95vw;
}
.city-tool {
    border: 1px solid #e0d7ba;
    background: #fffbed;
    color: #425c4d;
    border-radius: 14px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    cursor: pointer;
    min-width: 61px;
    min-height: 54px;
    white-space: nowrap;
}
.city-tool-icon {
    font-size: 23px;
    line-height: 25px;
    color: #687e59;
}
.city-tools.city-build-palette {
    justify-content: flex-start;
    width: max-content;
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.city-build-palette .city-tool {
    flex: 0 0 auto;
    min-width: 76px;
}
.city-build-palette .city-tool small {
    font-size: 10px;
    font-weight: normal;
}
.city-build-palette [data-city='build-back'] {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #e5ebd9;
}
.city-build-palette [aria-pressed='true'] {
    background: #d3e2be;
    border-color: #6d8755;
    box-shadow: inset 0 0 0 1px #6d8755;
}
.city-dialog:has(.city-build-palette) .city-camera {
    bottom: 140px;
}
.city-tool:hover,
.city-button:hover {
    background: #e5ebd9;
}
.city-tool:focus-visible,
.city-button:focus-visible,
.city-dialog select:focus-visible,
.city-dialog input:focus-visible {
    outline: 3px solid #b29148;
    outline-offset: 2px;
}
.city-tool:disabled,
.city-button:disabled {
    opacity: 0.45;
    cursor: default;
}
.city-window .city-tool {
    min-width: 40px;
    min-height: 40px;
    padding: 5px;
    font-size: 0;
}
.city-camera {
    position: absolute;
    bottom: 30px;
    left: 24px;
    display: flex;
    gap: 5px;
}
.city-camera .city-tool {
    min-width: 40px;
    padding: 5px;
    font-size: 0;
}
.city-panel {
    position: absolute;
    right: 24px;
    top: 91px;
    bottom: 125px;
    width: 310px;
    max-width: calc(100vw - 48px);
    background: #fffbedf5;
    border: 1px solid #d8cfb5;
    border-radius: 18px;
    box-shadow: 0 15px 40px #2e46332b;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
}
.city-batch-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.city-batch-fields input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
[data-city='batch-position'] {
    display: block;
    width: 100%;
    margin-top: 10px;
}
@media (max-width: 700px) {
    .city-dialog.city-batching .city-panel {
        top: auto;
        bottom: 145px;
        max-height: 46vh;
        width: calc(100vw - 20px);
    }
}
.city-panel[hidden],
.city-status[hidden],
.city-minimized[hidden] {
    display: none;
}
.city-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}
.city-panel h3 {
    font:
        600 24px Georgia,
        serif;
    margin: 0;
}
.city-dismiss {
    border: 0;
    background: none;
    color: #6a7b63;
    cursor: pointer;
    font-size: 12px;
}
.city-copy {
    font-size: 12px;
    line-height: 1.7;
    color: #71806b;
}
.city-button {
    border: 1px solid #d3d7bf;
    border-radius: 9px;
    background: #eef0de;
    color: #425b45;
    padding: 10px 12px;
    cursor: pointer;
    font: 600 12px system-ui;
    min-height: 40px;
}
.city-row {
    display: flex;
    gap: 6px;
    margin: 12px 0;
}
.city-row > * {
    flex: 1;
}
.city-row .selected {
    background: #516f58;
    color: #fff5dc;
}
.city-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    margin: 14px 0;
}
.city-dialog select,
.city-dialog input {
    font: 13px system-ui;
    background: #fffdf5;
    color: #364f43;
    border: 1px solid #c6ceb8;
    border-radius: 7px;
    padding: 10px;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
}
.city-move {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}
.city-coords {
    font-size: 12px;
    letter-spacing: 1px;
    color: #7e8065;
}
.city-validation {
    font-size: 12px;
    line-height: 1.5;
    color: #896c3e;
}
.city-clear {
    background: #f0e5d5;
    width: 100%;
    margin-top: 16px;
    color: #826047;
}
.city-catalog {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
.city-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 9px;
    border: 1px solid #e3deca;
    border-radius: 12px;
    background: #fffdf4;
}
.city-card strong {
    font-size: 12px;
}
.city-card small {
    font-size: 10px;
    color: #809074;
}
.city-request {
    border-top: 1px solid #dedbc6;
    padding: 17px 0;
    font-size: 12px;
    line-height: 1.6;
}
.city-request strong {
    color: #456b55;
}
.city-request p {
    color: #71806b;
}
.city-request h4 {
    margin-bottom: 5px;
}
.city-request .city-button {
    display: block;
    width: 100%;
    margin-top: 10px;
}
.city-visit-list,
.city-exhibit-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
    max-height: 320px;
    overflow: auto;
}
.city-exhibit-list button {
    text-align: left;
}
.city-exhibit-icon {
    font-size: 50px;
    text-align: center;
    margin: 20px;
}
.city-status {
    position: absolute;
    left: 50%;
    bottom: 115px;
    transform: translateX(-50%);
    max-width: min(500px, 85vw);
    border-radius: 10px;
    background: #324f43ed;
    color: #fff2d4;
    padding: 11px 18px;
    font-size: 13px;
    box-shadow: 0 6px 20px #0002;
}
.city-minimized {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 30;
}
.city-minimized button {
    box-shadow: 0 5px 20px #0003;
}
@media (max-width: 700px) {
    .city-heading {
        left: 10px;
        top: 10px;
        padding: 10px 13px;
        max-width: calc(100% - 155px);
    }
    .city-heading h2 {
        font-size: 23px;
    }
    .city-heading p {
        display: none;
    }
    .city-eyebrow {
        font-size: 8px;
        letter-spacing: 1px;
    }
    .city-stats {
        gap: 3px;
        margin-top: 8px;
    }
    .city-stats span {
        font-size: 9px;
        padding: 4px;
    }
    .city-window {
        top: 12px;
        right: 10px;
        gap: 4px;
    }
    .city-window .city-tool {
        min-width: 34px;
    }
    .city-tools {
        bottom: 12px;
        padding: 5px;
        gap: 3px;
        border-radius: 15px;
    }
    .city-tool {
        min-width: 43px;
        padding: 6px 8px;
        font-size: 9px;
        border-radius: 10px;
        min-height: 50px;
    }
    .city-tool-icon {
        font-size: 21px;
    }
    .city-camera {
        left: 10px;
        bottom: 85px;
        gap: 3px;
    }
    .city-camera .city-tool {
        min-width: 30px;
        min-height: 32px;
    }
    .city-panel {
        top: 115px;
        right: 10px;
        bottom: 145px;
        width: 270px;
        padding: 15px;
        max-width: calc(100vw - 20px);
    }
    .city-status {
        bottom: 145px;
        font-size: 12px;
    }
    .city-panel h3 {
        font-size: 21px;
    }
}

.city-dialog .city-heading {
    display: block;
    width: max-content;
}
.city-dialog .city-heading h2 {
    display: block;
}
.city-dialog .city-panel-heading {
    position: static;
}
.city-dialog button {
    flex-shrink: 0;
}
.city-tools {
    overflow-x: auto;
}
.city-walking .city-heading {
    padding: 10px 16px;
}
.city-walking .city-heading h2 {
    font-size: 23px;
}
.city-walking .city-eyebrow,
.city-walking .city-heading p,
.city-walking .city-stats {
    display: none;
}
.city-walking-hint {
    position: absolute;
    top: 90px;
    left: 24px;
    max-width: min(440px, 80vw);
    color: #fffbed;
    background: #314d44d9;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    pointer-events: none;
}
.city-dialog .city-road-hint {
    top: 195px;
}
@media (max-width: 700px) {
    .city-dialog .city-road-hint {
        top: 122px;
        max-width: calc(100vw - 20px);
    }
}
.city-movement {
    position: absolute;
    left: 24px;
    bottom: 160px;
    display: grid;
    grid-template-columns: repeat(3, 44px);
    gap: 5px;
    touch-action: none;
}
.city-step {
    min-height: 42px;
    background: #fffbeded;
    border: 1px solid #c8c3a8;
    border-radius: 10px;
    color: #314d44;
    touch-action: none;
}
.city-step[data-city='walk-w'] {
    grid-column: 2;
}
.city-step[data-city='walk-a'] {
    grid-column: 1;
}
.city-step[data-city='walk-interact'] {
    grid-column: 1 / 4;
}
.city-movement[hidden],
.city-walking-hint[hidden],
.city-camera button[hidden] {
    display: none;
}
.city-door-button {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: #365f4e;
    color: #fff0be;
    border: 2px solid #e4c575;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
}
.city-door-button[hidden] {
    display: none;
}
@media (max-width: 700px) {
    .city-walking-hint {
        top: 70px;
        left: 10px;
        font-size: 10px;
    }
    .city-movement {
        left: 10px;
        bottom: 140px;
        grid-template-columns: repeat(3, 38px);
    }
    .city-walking .city-heading h2 {
        font-size: 18px;
    }
}
.city-build-palette .city-tool small.city-tool-size {
    font-weight: 600;
    color: #4f6b48;
}
.city-build-palette .city-tool-unavailable {
    opacity: 0.6;
}
.city-build-preview {
    position: absolute;
    top: 252px;
    left: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    width: min(340px, calc(100vw - 48px));
    padding: 10px 12px;
    color: #314d44;
    background: #fffbedf0;
    border: 1px solid #c8c3a8;
    border-radius: 14px;
    box-shadow: 0 6px 18px #2b3d3626;
    pointer-events: none;
}
.city-build-preview[hidden] {
    display: none;
}
.city-preview-art {
    flex: 0 0 96px;
    height: 96px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 60%, #e5ebd9, #cfdcc4);
}
.city-preview-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.city-preview-info {
    min-width: 0;
    font-size: 12px;
}
.city-preview-info strong {
    font-size: 15px;
}
.city-preview-info p {
    margin: 3px 0;
}
.city-preview-size {
    font-weight: 600;
}
.city-preview-grid {
    display: grid;
    grid-template-columns: repeat(var(--w), 12px);
    grid-auto-rows: 12px;
    gap: 2px;
    margin: 4px 0;
}
.city-preview-grid span {
    background: #9cbf8a;
    border: 1px solid #5f8a55;
    border-radius: 2px;
}
.city-preview-warning {
    color: #a24b36;
    font-weight: 600;
}
@media (max-width: 700px) {
    .city-build-preview {
        top: auto;
        bottom: 214px;
        left: 10px;
        width: calc(100vw - 20px);
        padding: 8px;
        gap: 8px;
    }
    .city-preview-art {
        flex-basis: 64px;
        height: 64px;
    }
    .city-preview-grid {
        grid-template-columns: repeat(var(--w), 8px);
        grid-auto-rows: 8px;
    }
}
