:root {
    --bg: #0f1115;
    --panel: #171a21;
    --ink: #eaeef7;
    --muted: #9aa3b2;
    --accent: #6cf;
    --btn: #2a2f3a;
    --btn2: #394150;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

#app {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 80vh;
    gap: 12px;
    padding: 12px;
}

#controls {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

#map {
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    flex-wrap: wrap;
}

label {
    width: 132px;
    color: var(--muted);
    font-size: 12px;
}

input,
select,
button {
    background: var(--btn);
    color: var(--ink);
    border: 1px solid #222733;
    padding: 8px 10px;
    border-radius: 10px;
    outline: none;
}

input[type="number"] {
    width: 96px;
}

select {
    width: 120px;
}

button {
    cursor: pointer;
    transition: background .15s ease;
}

button:hover {
    background: var(--btn2);
}

fieldset {
    border: 1px solid #253047;
    border-radius: 12px;
    margin: 12px 0;
    padding: 8px 10px;
}

legend {
    color: var(--muted);
    padding: 0 6px;
    font-size: 12px;
}

.hint {
    color: var(--muted);
    font-size: 12px;
}

#status {
    margin-top: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color: var(--accent);
    white-space: pre-wrap;
    max-height: 800px;
    overflow: auto;
}

#previews {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    height: 20vh;
}

#previews canvas {
    width: 100%;
    height: 100%;
    background: #0b0c10;
    border-radius: 10px;
    border: 1px dashed #2a2f3a;
}

.leaflet-container {
    background: #0c0e13;
}

.leaflet-control-container .leaflet-draw-toolbar a {
    background: var(--panel);
    border: 1px solid #2c3445;
}