* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2933; }
#app { display: flex; height: 100%; }
#map { flex: 1; min-width: 0; }

#panel { width: 380px; overflow-y: auto; background: #fff; border-left: 1px solid #d9dee5; padding: 4px 16px 16px; }
#panel section { padding: 12px 0; border-bottom: 1px solid #eef1f4; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #52606d; margin: 4px 0 10px; }
.row { margin-bottom: 8px; position: relative; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.muted { color: #7b8794; }
.small { font-size: 12px; }
.hint { font-size: 12px; color: #52606d; background: #f5f7fa; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }

input, select { width: 100%; padding: 7px 9px; border: 1px solid #cbd2d9; border-radius: 6px; font: inherit; background: #fff; }
input:focus, select:focus { outline: 2px solid #3e7bfa55; border-color: #3e7bfa; }
button, .button { padding: 6px 12px; border: 1px solid #cbd2d9; border-radius: 6px; background: #fff; font: inherit; cursor: pointer; color: inherit; text-decoration: none; }
button:hover, .button:hover { background: #f5f7fa; }
button.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
button.primary:hover { background: #1d4ed8; }
button.danger { color: #c92a2a; }
button:disabled { opacity: .5; cursor: default; }

.dropdown { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #cbd2d9; border-radius: 6px; box-shadow: 0 6px 18px #0002; max-height: 320px; overflow-y: auto; }
.dropdown div { padding: 6px 10px; cursor: pointer; }
.dropdown div:hover { background: #eef4ff; }
.dropdown small { display: block; color: #7b8794; }

#ops-list { list-style: none; padding: 0; margin: 8px 0 0; }
#ops-list li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid #f0f2f5; }
#ops-list li .name { flex: 1; min-width: 0; cursor: pointer; }
#ops-list li .name small { display: block; color: #7b8794; }
#ops-list li button { padding: 1px 7px; border: none; background: none; color: #7b8794; }
#ops-list li button:hover { color: #c92a2a; }
.op { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; color: #fff; }
.op.add { background: #2f9e44; }
.op.sub { background: #e03131; }

#check-result .res { padding: 10px 12px; border-radius: 8px; margin-top: 4px; }
#check-result .yes { background: #ebfbee; border: 1px solid #8ce99a; }
#check-result .no { background: #fff5f5; border: 1px solid #ffa8a8; }
#check-result .res b { font-size: 15px; }

#level-badge { position: absolute; top: 10px; left: 50px; z-index: 5; background: #fffffff0; border-radius: 8px; padding: 6px 12px; box-shadow: 0 2px 8px #0002; max-width: calc(100% - 480px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1f2933; color: #fff; padding: 8px 16px; border-radius: 8px; z-index: 20; box-shadow: 0 4px 14px #0004; }

gmp-place-autocomplete { width: 100%; }

.basemap-ctrl button { width: auto !important; padding: 0 8px !important; font-size: 12px; }

@media (max-width: 800px) {
  #app { flex-direction: column; }
  #map { height: 55vh; flex: none; }
  #panel { width: 100%; border-left: none; }
  #level-badge { max-width: calc(100% - 100px); }
}
