:root { font-family: system-ui, sans-serif; color: #211a1d; }
body { margin: 0; }
#map { height: 100vh; height: 100dvh; }
header, #sheet, .legend, #location { position: fixed; z-index: 1000; background: #fff; border-radius: 14px; box-shadow: 0 3px 16px #2223; }
header { inset: 8px 8px auto; max-width: 530px; padding: 12px; }
.heading { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
h1 { font-size: 1rem; margin: 0; }
button, input, select { font: inherit; box-sizing: border-box; min-height: 44px; border: 1px solid #d5cbcf; border-radius: 8px; padding: 6px 10px; }
button { background: #960c24; color: white; cursor: pointer; }
button:disabled { opacity: .6; }
input, select { width: 100%; background: white; }
#search { margin-top: 8px; }
#status { margin: 4px 0 0; font-size: .85rem; }
#status:empty { display: none; }
#location { right: 10px; bottom: 108px; color: #173653; }
.legend { display: grid; gap: 4px; left: 8px; bottom: 24px; padding: 8px; font-size: .8rem; }
.legend span { padding: 2px 6px; border-radius: 5px; background: #505c67; color: #fff; font-weight: 600; }
.legend .operational { background: #28692f; }
.legend .damaged { background: #960c24; }
#mapLoading { position: fixed; inset: 0; z-index: 1100; overflow: auto; background: #edeae7; padding: clamp(24px, 5vw, 42px) 14px; }
#mapLoading[hidden] { display: none; }
.loading-card { box-sizing: border-box; width: min(100%, 420px); margin: 0 auto; padding: clamp(24px, 6vw, 34px); text-align: center; border-radius: 22px; background: #fff; box-shadow: 0 12px 36px #211a1d14; }
.loading-card svg { width: 48px; height: 48px; color: #960c24; }
.loading-card h2 { max-width: 16ch; margin: 10px auto 0; font-size: clamp(22px, 6vw, 30px); line-height: 1.15; }
.loading-card p { margin: 14px 0 0; }
#retryMap { margin-top: 14px; }
#sheet { left: 8px; right: 8px; bottom: 22px; max-width: 480px; max-height: 55dvh; overflow: auto; padding: 16px; }
#sheet #close { float: right; }
#details h2 { margin: 0 46px 10px 0; font-size: 1.2rem; }
#details p { border-bottom: 1px solid #eee; padding-bottom: 6px; }
summary { color: #960c24; padding: 10px 0; cursor: pointer; }
form label { display: block; margin: 8px 0; }
form button { margin: 4px 4px 4px 0; }
dialog { width: min(400px, calc(100vw - 64px)); border: none; border-radius: 16px; padding: 22px; }
dialog::backdrop { background: #211a1d77; }
.pin { display: grid; place-items: center; box-sizing: border-box; border: 2px solid white; border-radius: 50% 50% 50% 12%; color: white; font-weight: 800; background: #505c67; }
.pin.operational { background: #28692f; }
.pin.damaged { background: #960c24; }
.pin.selected { box-shadow: 0 0 0 2px #292316, 0 0 0 7px #ffd447, 0 0 0 9px #292316; }
@media (max-width: 600px) { #sheet { inset: auto 0 0; border-radius: 16px 16px 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); } }
#login { box-sizing: border-box; width: min(420px, calc(100vw - 28px)); border-radius: 22px; padding: clamp(22px, 6vw, 34px); box-shadow: 0 12px 40px #211a1d44; }
#login .login-icon { display: block; width: 48px; height: 48px; margin: 0 auto 12px; color: #960c24; }
#login h2, #login h3, #loginIntro, #loginStatus { text-align: center; }
#login h2 { font-size: clamp(22px, 6vw, 28px); line-height: 1.15; margin: 0 0 12px; }
#login button { width: 100%; margin: 6px 0 0; }
#login #changeEmail, #login #cancelLogin { background: white; color: #960c24; border-color: transparent; text-decoration: underline; }
#welcome { position: fixed; z-index: 1200; top: 130px; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 8px; background: #fff; box-shadow: 0 2px 8px #0003; pointer-events: none; }
