:root { color-scheme: light; font: 16px/1.45 system-ui, sans-serif; color: #182727; background: #e5ebe7; }
* { box-sizing: border-box; }
body { margin: 0; }
main { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 7px clamp(320px, var(--sidebar-width, 460px), calc(100vw - 327px)); }
aside { overflow: auto; scrollbar-gutter: stable; min-width: 0; background: #f8faf8; padding: 26px; border-left: 1px solid #c8d5cd; }
header strong { color: #126b5c; letter-spacing: .08em; }
h1 { font-size: 25px; line-height: 1.15; margin: 8px 0 25px; }
label { display: grid; gap: 5px; margin: 0 0 14px; font-size: .9rem; }
input, select, button { font: inherit; color: inherit; padding: 8px 10px; background: white; border: 1px solid #aebeb5; border-radius: 6px; min-width: 0; }
button { cursor: pointer; }
button[aria-pressed="true"] { background: #126b5c; color: white; }
dl { margin: 20px 0 0; padding-top: 10px; border-top: 1px solid #c8d5cd; font-size: .87rem; }
dl div { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; }
dd { margin: 0; font-weight: 650; white-space: nowrap; }
p { font-size: .875rem; margin: 12px 0 0; }
section { position: relative; min-height: 440px; }
#map { position: absolute; inset: 0; }
.modes, #map-error { position: absolute; z-index: 1; left: 14px; }
.modes { bottom: 16px; display: flex; gap: 4px; }
#map-error { top: 58px; background: #fff; padding: 10px; }
@media (max-width: 700px) { main { height: auto; grid-template-columns: 1fr; } section { grid-row: 1; min-height: 52dvh; } aside { padding: 16px; } }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin: 0 0 10px; font-size: .92rem; font-weight: 650; }
.fields { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 7px; }
.check input { accent-color: #126b5c; }
.result { border-top: 1px solid #c8d5cd; }
.panel { margin-top: 12px; }
.panel > summary { font-weight: 650; cursor: pointer; padding: 5px 0; }
.statistics-panel { margin-top: 8px; }
#types span { width: 10px; height: 10px; border-radius: 2px; }
.primary { background: #126b5c; color: white; width: 100%; margin-top: 14px; }
button:disabled { opacity: .5; cursor: default; }
#map-error { top: 16px; }
.statistics { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .875rem; }
.statistics th, .statistics td { padding: 4px 3px; text-align: right; border-bottom: 1px solid #e2eae4; }
.statistics th:first-child { text-align: left; }
.statistics tbody th { font-weight: normal; }
.statistics .selected { background: #e7f2ed; }
#types span { display: inline-block; margin-right: 7px; }
#block-settings { padding-top: 10px; margin-top: 12px; border-top: 1px solid #d3e0d8; }
#recommended { color: #126b5c; font-weight: 650; margin-bottom: 12px; }
.modes { align-items: end; z-index: 2; }
.modes label { background: #f8faf8; margin: 0; padding: 5px 8px; border-radius: 6px; }
.modes button { background: #f8faf8; }
.modes button[aria-pressed="true"] { background: #126b5c; }

label[hidden] { display: none; }
#metrics td { white-space: nowrap; }
.advanced { display: grid; gap: 1px; margin-top: 8px; }
select:disabled { color: #576760; background: #edf2ef; }

#sidebar-resize { background: #d9e4de; cursor: col-resize; touch-action: none; }
#sidebar-resize:hover, #sidebar-resize:focus-visible { background: #83a79b; outline-offset: -2px; }
.balance-control { margin: 0 0 14px; }
.balance-control label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.balance-control output { white-space: nowrap; }
.balance-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.balance-input button { font-size: .8rem; padding: 4px 8px; }
.balance-input input { appearance: none; width: 100%; height: 10px; padding: 0; margin: 0;
  background: linear-gradient(90deg, #fb9523, #f6f587); border: 1px solid #b29551; border-radius: 8px; }
.balance-input input::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #684e1a; background: #fffdf4; cursor: ew-resize; }
.balance-input input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #684e1a; background: #fffdf4; cursor: ew-resize; }
@media (max-width: 700px) { #sidebar-resize { display: none; } }

.layer-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 18px; }
#load-samples, #clear-layers, #layer-status { grid-column: 1 / -1; }
#layer-status { margin: 0 0 8px; }
#status:empty { display: none; }

#layer-status:empty { display: none; }
.map-loading { position: absolute; z-index: 3; top: 16px; left: 16px; width: 30px; height: 30px;
  border: 3px solid #ffffffd9; border-top-color: #126b5c; border-radius: 50%;
  box-shadow: 0 0 3px #18272755; pointer-events: none; animation: map-spin .75s linear infinite; }
@keyframes map-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .map-loading { animation: none; } }
#drawing-tools { position: absolute; z-index: 3; top: 16px; left: 16px; max-width: calc(100% - 70px);
  background: #f8faf8; border-radius: 7px; padding: 10px; }
#drawing-hint { margin: 0 0 8px; }
#drawing-tools button { padding: 5px 8px; font-size: .85rem; }
