:root{
  --brand:#0b5c44;--ink:#14261f;--muted:#4a5f57;--line:#d5ded9;--bg:#eef3ec;
  --normal:#157a45;--caution:#c99200;--caution-ink:#1a1400;--warning:#c2410c;--severe:#b42318;
  --sheet-peek:100px;--sos-h:54px;--ease:cubic-bezier(.22,.8,.28,1);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);font:17px/1.5 "Pretendard","Apple SD Gothic Neo","Noto Sans KR",system-ui,sans-serif;word-break:keep-all;-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid #e67700;outline-offset:2px}
.sprites{position:absolute;width:0;height:0;overflow:hidden}
#app{position:fixed;inset:0;overflow:hidden}
#map{position:absolute;inset:0;background:#dfe9da;z-index:0;isolation:isolate}
.leaflet-container{font:inherit;background:#dfe9da}
.leaflet-control-attribution{font-size:10px!important;max-width:58vw;background:#ffffffd0!important}
.leaflet-bottom{bottom:calc(var(--sheet-peek) + var(--sos-h) + 4px)}
.char-layer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:450}
.tag-layer{position:absolute;inset:0;pointer-events:none;z-index:460}
.char-tag{position:absolute;left:0;top:0;pointer-events:auto;min-height:32px;padding:2px 10px;border-radius:999px;border:2px solid #fff;color:#fff;font-weight:800;font-size:14px;white-space:nowrap;box-shadow:0 2px 6px #0003;transition:transform .2s var(--ease),opacity .2s}
.char-dom{position:absolute;left:0;top:0;transition:transform .2s var(--ease)}
.char-dom img{display:block;width:100%;position:relative;animation:bob 1.6s ease-in-out infinite}
.char-dom i{position:absolute;left:10%;right:10%;bottom:-4%;height:22%;border-radius:50%;border:3px solid var(--ring);animation:pulse 1.8s ease-out infinite}
@keyframes bob{50%{transform:translateY(-4%)}}
@keyframes pulse{from{transform:scale(.4);opacity:.9}to{transform:scale(1.5);opacity:0}}
.topbar{position:absolute;z-index:600;top:max(8px,env(safe-area-inset-top));left:8px;right:8px;display:flex;align-items:center;gap:8px;background:#fffffff5;border-radius:16px;padding:8px 12px;box-shadow:0 2px 10px #0001;border:1px solid #ffffffa0}
.brand{display:flex;flex-direction:column;line-height:1.2;margin-right:auto;min-width:0}
.brand b{font-size:18px;color:var(--brand);letter-spacing:-.3px}
.brand small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chip{font-size:12px;font-weight:800;border-radius:999px;padding:5px 10px;white-space:nowrap;letter-spacing:-.2px}
.chip-ex{background:#fff4d6;color:#5c3c00;border:1px solid #efd48a}
.risk{position:absolute;z-index:600;top:calc(max(8px,env(safe-area-inset-top)) + 58px);left:8px;right:8px;border-radius:16px;padding:10px 12px;color:#fff;background:var(--normal);box-shadow:0 3px 12px #0002;transition:background-color .4s var(--ease),color .3s}
.risk-main{display:flex;align-items:center;gap:10px}
.risk-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.risk strong{font-size:22px;letter-spacing:-.4px;line-height:1.1}
.risk-copy span{font-size:16px;font-weight:650;opacity:.96}
.risk-dot{width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px #fff5;flex:none}
.play{flex:none;display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 10px;border:0;border-radius:12px;background:#0003;color:inherit;font-weight:800;font-size:13px}
.play svg{width:16px;height:16px}
.play[aria-pressed=true]{background:#fff;color:var(--ink)}
.risk.lv-caution{background:var(--caution);color:var(--caution-ink)}.risk.lv-caution .risk-dot{background:var(--caution-ink)}.risk.lv-caution .play{background:#0002}
.risk.lv-warning{background:var(--warning)}
.risk.lv-severe{background:var(--severe)}
.risk.pulse{animation:flash 1.2s ease-in-out 1}
@keyframes flash{50%{filter:brightness(1.12)}}
.map-tools{position:absolute;z-index:600;right:8px;top:var(--below,150px);display:flex;flex-direction:column;gap:6px}
.tool{width:56px;min-height:54px;border:0;border-radius:14px;background:#fffffff5;box-shadow:0 2px 8px #0002;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px 2px;color:var(--brand)}
.tool svg{width:20px;height:20px}
.tool span{font-size:11px;font-weight:800;color:var(--ink);margin-top:1px}
.legend{position:absolute;z-index:600;left:8px;top:var(--below,150px);max-width:min(260px,calc(100% - 80px));background:#fffffff5;border-radius:14px;padding:4px 12px;font-size:13px;box-shadow:0 2px 8px #0001}
.legend summary{cursor:pointer;font-weight:800;min-height:36px;display:flex;align-items:center}
.legend ul{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:6px;color:#31443c}
.lv,.sw{display:inline-block;width:12px;height:12px;border-radius:50%;vertical-align:-1px;margin:0 3px 0 6px}
.lv:first-child,.sw:first-child{margin-left:0}
.lv-normal{background:var(--normal)}.lv-caution{background:var(--caution)}.lv-warning{background:var(--warning)}.lv-severe{background:var(--severe)}
.sw-river{background:#4dabf7;border-radius:3px;height:7px}.sw-route{border:2px dashed #6741d9;border-radius:3px;height:7px;background:none;width:16px}.sw-report{background:#fff;border:3px solid #845ef7}.sw-shelter{background:#fff;border:2px dashed #1864ab;border-radius:4px}
.role-dot{display:inline-flex;align-items:center;gap:4px;margin-right:8px;font-weight:700}
.role-dot i{width:10px;height:10px;border-radius:50%}
.sheet{position:absolute;z-index:700;left:0;right:0;bottom:var(--sos-h);background:#fff;border-radius:22px 22px 0 0;box-shadow:0 -8px 28px #00000022;display:flex;flex-direction:column;height:calc(48dvh);transition:height .32s var(--ease);max-width:640px;margin:auto}
.sheet[data-state=peek]{height:var(--sheet-peek)}.sheet[data-state=peek] .panels{visibility:hidden}
.sheet[data-state=full]{height:calc(100dvh - var(--sos-h) - 66px)}
.handle{border:0;background:none;height:22px;display:flex;align-items:center;justify-content:center;flex:none;touch-action:none}
.handle i{width:44px;height:5px;border-radius:3px;background:#c5cec9}
.tabs{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;padding:0 8px 8px;flex:none}
.tabs button{border:0;background:#f1f5f2;border-radius:14px;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 0;color:#2c4038}
.tabs button svg{width:22px;height:22px}
.tabs button span{font-size:12px;font-weight:800}
.tabs button[aria-selected=true]{background:var(--brand);color:#fff}
.panels{overflow:auto;overscroll-behavior:contain;padding:4px 16px 24px;flex:1}
.panels h2{font-size:20px;margin:4px 0 12px;letter-spacing:-.3px}
.panels h2 small{font-size:14px;color:var(--muted);font-weight:650}
.panels h3{font-size:16px;margin:20px 0 8px}
.note{font-size:14px;color:var(--muted);margin:8px 0}
.levels{border:0;padding:0;margin:0 0 14px;display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.levels legend{font-size:13px;color:var(--muted);margin-bottom:6px;padding:0}
.levels button{min-height:48px;border-radius:12px;border:2px solid var(--line);background:#fff;font-weight:800}
.levels button[aria-pressed=true][data-level=normal]{background:var(--normal);border-color:var(--normal);color:#fff}
.levels button[aria-pressed=true][data-level=caution]{background:var(--caution);border-color:var(--caution);color:var(--caution-ink)}
.levels button[aria-pressed=true][data-level=warning]{background:var(--warning);border-color:var(--warning);color:#fff}
.levels button[aria-pressed=true][data-level=severe]{background:var(--severe);border-color:var(--severe);color:#fff}
.checklist{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.checklist label{display:flex;gap:12px;align-items:center;min-height:56px;padding:10px 12px;border-radius:14px;background:#f4f7f5;border:1.5px solid var(--line);font-size:17px;font-weight:650}
.checklist input{width:26px;height:26px;flex:none;accent-color:var(--brand)}
.checklist input:checked+span{text-decoration:line-through;color:#6c7a74}
.stations{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.stations li{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:12px;background:#f6f8f7;font-size:15px}
.stations b{margin-left:auto;white-space:nowrap}
.st-badge{flex:none;min-width:48px;text-align:center;border-radius:8px;padding:3px 6px;font-weight:800;color:#fff;font-size:13px}
.st-badge.lv-caution{color:var(--caution-ink)}
.big{min-height:56px;border-radius:14px;border:2px solid var(--line);background:#fff;font-weight:800;font-size:17px;padding:8px 12px;width:100%;margin-top:8px}
.big.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.big.ok{background:#157a45;border-color:#157a45;color:#fff}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.nearest{border-radius:16px;background:#eef5ff;border:1.5px solid #bad4f0;padding:14px 16px}
.nearest b{font-size:20px;display:block}
.nearest .dist{font-size:28px;font-weight:900;color:#1864ab;letter-spacing:-.5px}
.guide-box{background:#f6f8f7;border:1px solid var(--line);border-radius:14px;padding:12px 14px;font-size:14px;color:#31443c;margin-top:14px}
.empty{text-align:center;padding:22px 12px;color:var(--muted);background:#f6f8f7;border-radius:14px;border:1.5px dashed var(--line)}
.empty b{display:block;color:var(--ink);margin-bottom:4px;font-size:16px}
.contacts{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.contacts li{display:flex;gap:8px;align-items:center;background:#f4f7f5;border-radius:12px;padding:6px 10px}
.contacts li span{margin-right:auto;font-weight:700}
.contacts a,.contacts button{min-height:44px;min-width:52px;border-radius:10px;border:1px solid var(--line);background:#fff;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:var(--ink);font-weight:700;font-size:14px}
.contact-form{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}
.contact-form .big{grid-column:1/-1}
label{display:block;font-weight:700;margin-top:12px}
input,select,textarea{width:100%;min-height:48px;border:1.5px solid var(--line);border-radius:12px;padding:8px 10px;background:#fff}
textarea{min-height:0;resize:vertical}
.mic{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;margin-top:12px;background:var(--brand);color:#fff;border:0;border-radius:16px;min-height:60px;font-weight:800;font-size:19px}
.mic[aria-pressed=true]{background:#863620}
.mic svg{width:24px;height:24px}
.bubble{font-size:18px}
.preview{background:#e8f2eb;border-radius:16px;padding:10px 12px;margin-top:12px}
.preview textarea{border:0;background:transparent;font-size:16px}
#preview{display:block;width:100%;max-height:200px;object-fit:contain;margin-top:8px;background:#eff2ee}
[hidden]{display:none!important}
.role-switch{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:6px 0 12px}
.role-switch button{min-height:48px;border-radius:12px;border:2px solid var(--line);background:#fff;font-weight:800;font-size:16px}
.role-switch button[aria-checked=true]{background:var(--brand);border-color:var(--brand);color:#fff}
.picker{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.picker button{border:2px solid var(--line);border-radius:14px;background:#f8faf9;padding:6px 2px 8px;font-size:12px;font-weight:700;display:flex;flex-direction:column;align-items:center;min-height:92px;color:#31443c}
.picker button[aria-pressed=true]{border-color:var(--brand);background:#e6f4ea;color:var(--brand)}
.picker canvas{width:46px;height:62px}
.swatches{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.swatches button{width:44px;height:44px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 2px #adb5bd}
.swatches button[aria-pressed=true]{box-shadow:0 0 0 3px var(--ink)}
.share-toggle{margin-top:14px;background:#f6f8f7;border-radius:14px;padding:10px 12px}
.switch{display:flex;align-items:center;gap:12px;margin:0;min-height:48px}
.switch input{width:26px;height:26px;min-height:0;accent-color:var(--brand)}
.sos{position:absolute;z-index:800;left:0;right:0;bottom:0;margin:0;min-height:var(--sos-h);padding:7px 12px calc(7px + env(safe-area-inset-bottom));background:#161a18;color:#f1f3f1;font-size:13px;line-height:1.35;display:flex;align-items:center;justify-content:center;text-align:center}
.sos a{color:#ffd8a8;font-size:18px;font-weight:900}
.map-pin{border:0;background:none}
.st-pin,.rp-pin,.sh-pin{animation:pin-in .35s var(--ease) both}
@keyframes pin-in{from{opacity:0;transform:translate(-50%,-40%) scale(.86)}to{opacity:1}}
.st-pin{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;border-radius:999px;padding:3px 8px;color:#fff;font-weight:800;font-size:12px;border:2px solid #fff;box-shadow:0 2px 6px #0004;transform:translate(-50%,-50%)}
.st-pin.lv-caution{color:var(--caution-ink)}
.rp-pin{display:inline-block;transform:translate(-50%,-100%);background:#fff;border:2px solid #7048e8;border-radius:12px 12px 12px 2px;padding:2px 8px;font-size:12px;font-weight:800;white-space:nowrap;box-shadow:0 2px 6px #0003;color:#3b2b7a}
.rp-pin.mine{border-color:#e64980;color:#a61e4d}
.sh-pin{display:inline-block;transform:translate(-50%,-50%);background:#fff;border:2px dashed #1864ab;color:#1864ab;border-radius:10px;padding:3px 8px;font-size:12px;font-weight:800;white-space:nowrap}
.map-fallback{position:absolute;z-index:500;left:50%;transform:translateX(-50%);top:var(--below,150px);background:#fff;border-radius:10px;padding:4px 10px;font-size:13px}
.route-tip{font-size:12px;font-weight:800;color:#5f3dc4;padding:2px 8px}
#toast{position:absolute;z-index:900;left:12px;right:12px;bottom:calc(var(--sos-h) + 12px);background:#212529;color:#fff;border-radius:14px;padding:12px 14px;font-size:16px;text-align:center}
body.embed .legend,body.embed .map-tools{display:none}
body.embed .sheet{--sheet-peek:90px}
body.embed .risk strong{font-size:18px}body.embed .risk-copy span{font-size:14px}
body.embed .brand small{display:none}
body.embed .tabs button{min-height:48px}
body.embed .play span{display:none}
@media (min-width:700px){.sheet{left:12px;right:auto;width:400px;bottom:calc(var(--sos-h) + 12px);border-radius:22px}.risk,.topbar{right:auto;width:400px}}
@media (max-width:369px){
  .brand b{font-size:16px}.chip{padding:4px 8px;font-size:11px}
  .risk{padding:8px 10px}.risk strong{font-size:20px}.risk-copy span{font-size:14px}
  .play span{display:none}.play{padding:0 8px;min-height:36px}
  .tool{width:48px;min-height:48px}.tabs button{min-height:50px}.tabs button span{font-size:11px}
  :root{--sheet-peek:92px}
}
@media (prefers-reduced-motion:reduce){
  .sheet,.char-tag,.char-dom,.risk{transition:none!important}
  .char-dom img,.char-dom i,.risk.pulse,.st-pin,.rp-pin,.sh-pin{animation:none!important}
}
.chip-board{background:var(--brand);color:#fff;text-decoration:none;border:1px solid var(--brand)}
.chip-live{display:block;margin-top:5px;background:#ffffffeb;color:#0b4a8b;border-radius:999px;padding:2px 9px;font-size:12.5px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;width:max-content}
.chip-live[hidden]{display:none}
.risk-copy{min-width:0}
.chip-live::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:#1c7ed6;margin-right:5px;vertical-align:middle;box-shadow:0 0 0 0 rgba(28,126,214,.6);animation:livepulse 1.8s infinite}
@keyframes livepulse{70%{box-shadow:0 0 0 7px rgba(28,126,214,0)}100%{box-shadow:0 0 0 0 rgba(28,126,214,0)}}
@media (prefers-reduced-motion:reduce){.chip-live::before{animation:none}}
.stations li.real{background:#e7f5ff;border-radius:12px}
.st-badge.real{background:#1c7ed6;color:#fff}
