/* v8 skin: neumorphism. Soft extruded surfaces, one matte ground, light from top-left. */
:root{--bg:#E3E8F0;--card:#E3E8F0;--sep:rgba(184,193,209,.45);--sep2:#B8C1D1;--text:#1B2130;--sub:#6F7A8E;--sub2:#5D6779;--accent:#1A56DB;
--sh-d:#B8C1D1;--sh-l:#FFFFFF;
--raise:7px 7px 14px var(--sh-d),-7px -7px 14px var(--sh-l);
--raise-sm:4px 4px 8px var(--sh-d),-4px -4px 8px var(--sh-l);
--raise-xs:2px 2px 5px var(--sh-d),-2px -2px 5px var(--sh-l);
--inset:inset 4px 4px 8px var(--sh-d),inset -4px -4px 8px var(--sh-l);
--inset-sm:inset 2px 2px 5px var(--sh-d),inset -2px -2px 5px var(--sh-l);
--fire:#C0392B;--water:#1A56DB;--storm:#8A4B00;--impact:#5B3FA0;
--hot:#A12A1E;--warm:#8A4B00;--cool:#3C4658;--ok:#2FB35A;--mark:#FFE9A8}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--text);font:15px/1.35 -apple-system,"SF Pro Text","Segoe UI",Roboto,system-ui,sans-serif;height:100%;overscroll-behavior-y:none}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
a{color:var(--accent);text-decoration:none}
#app{max-width:560px;margin:0 auto;min-height:100%;position:relative}
.nav{position:sticky;top:0;z-index:5;background:var(--bg);padding:max(12px,env(safe-area-inset-top)) 18px 10px}
.nav-row{display:flex;align-items:center;gap:8px;min-height:44px}
.title{font-size:28px;font-weight:600;letter-spacing:-.4px;display:flex;align-items:center;gap:4px}
.title svg{width:18px;height:18px;color:var(--accent)}
.icobtn{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--accent);background:var(--bg);box-shadow:var(--raise-sm)}
.icobtn:active{box-shadow:var(--inset-sm)}
.icobtn svg{width:22px;height:22px}
.seg{display:flex;background:var(--bg);border-radius:14px;padding:5px;margin-top:12px;box-shadow:var(--inset)}
.seg button{flex:1;padding:9px 0;border-radius:10px;font-size:13px;font-weight:500;color:var(--sub2)}
.seg button.on{background:var(--bg);color:var(--text);box-shadow:var(--raise-sm)}
.chips{display:flex;gap:12px;padding:12px 18px 8px;overflow-x:auto;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{display:flex;align-items:center;gap:4px;white-space:nowrap;background:var(--bg);border-radius:18px;padding:8px 14px;font-size:13px;min-height:36px;box-shadow:var(--raise-sm);color:var(--sub2)}
.chip.on{box-shadow:var(--inset-sm);color:var(--accent);font-weight:500}
.chip svg{width:14px;height:14px}
.sect{font-size:13px;color:var(--sub2);padding:16px 34px 8px}
.card{background:var(--card);border-radius:20px;margin:0 18px 18px;overflow:hidden;box-shadow:var(--raise)}
.row{display:flex;align-items:center;gap:12px;padding:11px 16px;min-height:60px;border-bottom:1px solid var(--sep);width:100%;text-align:left}
.row:last-child{border-bottom:0}
.ic{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--bg);box-shadow:var(--inset-sm)}
.ic svg{width:20px;height:20px}
.ic.FIRE{color:var(--fire)}.ic.WATER{color:var(--water)}.ic.STORM{color:var(--storm)}.ic.IMPACT,.ic.OTHER{color:var(--impact)}
.row .tx{flex:1;min-width:0;display:flex;flex-direction:column}
.t{display:block;font-size:16px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.s{display:block;font-size:13px;color:var(--sub);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.s b{font-weight:500;color:var(--accent)}
.rt{display:flex;align-items:center;gap:8px;flex-shrink:0;color:var(--sep2)}
.rt svg{width:16px;height:16px}
.pill{font-size:13px;font-weight:600;padding:4px 10px;border-radius:10px;background:var(--bg);box-shadow:var(--inset-sm)}
.pill.hot{color:var(--hot)}.pill.warm{color:var(--warm)}.pill.cool{color:var(--cool)}
.empty{text-align:center;color:var(--sub);padding:60px 32px;font-size:15px}
.empty b{display:block;color:var(--text);font-weight:600;margin-bottom:6px;font-size:17px}
#map{position:fixed;inset:0;top:0;z-index:1;display:none}
body.mapmode #map{display:block}
body.mapmode .nav{background:rgba(227,232,240,.92);backdrop-filter:blur(12px)}
body.mapmode #list,body.mapmode .chips{display:none}
#scan{display:none}
body.scanmode #scan{display:block}
body.scanmode #list,body.scanmode .chips{display:none}
#scan .line{padding:10px 16px;width:100%;text-align:left;align-items:flex-start}
#scan .line .tm{width:64px}
#scan .line.hit{border-left:4px solid var(--ok);padding-left:12px;opacity:1}
#scan .line.hit .tx{color:var(--text)}
#scan .line .rt{margin-top:2px}
.lead-tag{display:inline-block;font-size:12px;font-weight:600;color:var(--ok);margin-bottom:3px}
.bub{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;border-radius:11px;background:var(--ok);color:#fff;font-size:12px;font-weight:600;margin-left:6px;vertical-align:middle;box-shadow:var(--raise-xs)}
.scan-total{font-size:12px;color:var(--ok);font-weight:600}
.leaflet-container{font:inherit}
.pop .t{font-weight:600}
.pop a{display:inline-block;margin-top:6px;font-weight:500}
/* lead */
#lead{position:fixed;inset:0;z-index:20;background:var(--bg);overflow-y:auto;transform:translateX(100%);transition:transform .28s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column;max-width:560px;margin:0 auto}
#lead.open{transform:none}
#lead>*{flex-shrink:0}
.lnav{position:sticky;top:0;background:rgba(227,232,240,.94);backdrop-filter:blur(12px);z-index:2;padding:max(10px,env(safe-area-inset-top)) 14px 8px;display:flex;align-items:center;min-height:44px}
.back{display:flex;align-items:center;color:var(--accent);font-size:17px;min-height:44px;padding-right:8px}
.back svg{width:22px;height:22px;margin-left:-4px}
.lhead{padding:6px 18px 14px}
.lhead .when{font-size:13px;color:var(--sub);margin-top:6px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.lhead h1{font-size:24px;font-weight:600;letter-spacing:-.3px;margin:8px 0 2px;line-height:1.15}
.lhead .where{font-size:15px;color:var(--sub)}
.sat{display:block;margin:0 18px 18px;border-radius:20px;overflow:hidden;background:#cfd6c8;height:150px;position:relative;box-shadow:var(--raise)}
.sat img{width:100%;height:100%;object-fit:cover;display:block}
.sat .pin{position:absolute;left:50%;top:50%;transform:translate(-50%,-100%);color:var(--fire);filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}
.sat .pin svg{width:30px;height:30px}
.grid{display:grid;grid-template-columns:1fr 1fr}
.cell{padding:12px 16px;border-bottom:1px solid var(--sep)}
.cell:nth-child(odd){border-right:1px solid var(--sep)}
.grid .cell:nth-last-child(-n+2){border-bottom:0}
.grid.odd .cell:last-child{border-bottom:0}
.lab{font-size:12px;color:var(--sub)}
.val{font-size:15px;font-weight:500;margin-top:2px;line-height:1.25}
.val.muted{color:var(--sub);font-weight:400}
.chain{padding:10px 0 6px}
.step{display:flex;gap:12px;padding:7px 16px;font-size:15px;line-height:1.3;align-items:flex-start}
.dot{width:12px;height:12px;border-radius:50%;background:var(--bg);box-shadow:var(--raise-xs);flex-shrink:0;margin-top:5px}
.step.first .dot{background:var(--fire);box-shadow:var(--raise-xs)}
.step .tm{margin-left:auto;font-size:13px;color:var(--sub);flex-shrink:0;padding-top:1px}
.linkrow{color:var(--accent)}
.linkrow .t{color:var(--accent);font-weight:500}
.sub-list{padding:0 16px 12px;font-size:14px;color:var(--sub2);line-height:1.5}
.sub-list div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-top:1px solid var(--sep)}
.sub-list .abs{color:var(--warm);font-size:12px;white-space:nowrap}
.why{padding:10px 16px 14px;font-size:13px;color:var(--sub2);line-height:1.6}
.why span{display:inline-block;margin-right:10px}
details summary{list-style:none;cursor:pointer}
details summary::-webkit-details-marker{display:none}
.toolbar{position:sticky;bottom:0;margin-top:auto;background:var(--bg);box-shadow:0 -8px 18px rgba(184,193,209,.55);border-radius:24px 24px 0 0;display:grid;grid-template-columns:repeat(4,1fr);padding:12px 8px max(12px,env(safe-area-inset-bottom))}
.toolbar button,.toolbar a{display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--accent);font-size:12px;min-height:56px;justify-content:center}
.toolbar svg{width:22px;height:22px}
.toolbar .dis{color:var(--sep2)}
.toolbar .done{color:var(--ok)}
/* sheets */
.veil{position:fixed;inset:0;background:rgba(27,33,48,.28);z-index:30;opacity:0;pointer-events:none;transition:opacity .25s}
.veil.open{opacity:1;pointer-events:auto}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:31;background:var(--bg);border-radius:26px 26px 0 0;max-height:88vh;display:flex;flex-direction:column;transform:translateY(105%);transition:transform .3s cubic-bezier(.2,.8,.2,1);max-width:560px;margin:0 auto;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -12px 28px rgba(184,193,209,.7)}
.sheet.open{transform:none}
.sheet>*{flex-shrink:0}
.sheet>.sbody{flex:1 1 auto;min-height:0}
.grab{width:40px;height:6px;border-radius:3px;background:var(--bg);box-shadow:var(--inset-sm);margin:10px auto 4px;flex-shrink:0}
.shead{display:flex;align-items:center;padding:8px 18px 12px;flex-shrink:0}
.shead .st{font-size:17px;font-weight:600}
.shead .ss{font-size:13px;color:var(--sub)}
.shead .act{margin-left:auto;color:var(--accent);font-size:17px;font-weight:500;min-height:44px;display:flex;align-items:center;padding-left:12px}
.sbody{overflow-y:auto;flex:1;padding-bottom:6px}
.pills{display:flex;flex-wrap:wrap;gap:12px;padding:6px 18px 12px}
.pills button{background:var(--bg);border-radius:18px;padding:9px 16px;font-size:14px;min-height:38px;box-shadow:var(--raise-sm);color:var(--sub2)}
.pills button.on{box-shadow:var(--inset-sm);color:var(--accent);font-weight:500}
.check{display:flex;align-items:center;gap:12px;padding:0 16px;min-height:48px;border-bottom:1px solid var(--sep);width:100%;text-align:left;font-size:15px}
.check:last-child{border-bottom:0}
.check .n{margin-left:auto;color:var(--sub);font-size:13px}
.check .box{width:24px;height:24px;border-radius:50%;background:var(--bg);box-shadow:var(--raise-xs);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:transparent}
.check.on .box{background:var(--accent);color:#fff;box-shadow:var(--inset-sm)}
.check .box svg{width:14px;height:14px}
.tog{display:flex;align-items:center;padding:0 16px;min-height:50px;border-bottom:1px solid var(--sep);width:100%;font-size:15px;text-align:left}
.tog:last-child{border-bottom:0}
.sw{margin-left:auto;width:54px;height:32px;border-radius:16px;background:var(--bg);box-shadow:var(--inset-sm);position:relative;transition:background .2s;flex-shrink:0}
.sw::after{content:"";position:absolute;top:3px;left:3px;width:26px;height:26px;border-radius:50%;background:var(--bg);box-shadow:var(--raise-xs);transition:transform .2s,background .2s}
.tog.on .sw::after{transform:translateX(22px);background:var(--ok)}
.line{display:flex;gap:10px;padding:12px 16px;border-bottom:1px solid var(--sep);font-size:15px;line-height:1.4}
.line .tm{color:var(--sub);font-size:13px;flex-shrink:0;width:54px;padding-top:2px}
.line .tx{flex:1}
.line .pl{color:var(--accent);flex-shrink:0;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:-4px -6px 0 0;background:var(--bg);box-shadow:var(--raise-xs)}
.line .pl svg{width:16px;height:16px}
.line .pl.playing{color:var(--fire);box-shadow:var(--inset-sm)}
.line.dim{opacity:.55}
mark{background:var(--mark);color:#000;border-radius:3px;padding:0 2px}
textarea{width:100%;border:0;border-radius:16px;background:var(--bg);box-shadow:var(--inset);padding:14px 16px;font:inherit;color:var(--text);min-height:92px;resize:none;display:block}
textarea:focus{outline:none}
.primary{display:block;margin:10px 18px 14px;background:var(--accent);color:#fff;border-radius:16px;padding:15px;font-size:17px;font-weight:600;text-align:center;width:calc(100% - 36px);box-shadow:var(--raise-sm)}
.primary:active{box-shadow:var(--inset-sm)}
.primary:disabled{opacity:.4}
.who{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:10px 18px 20px}
.who button{background:var(--bg);border-radius:20px;padding:22px 0;font-size:22px;font-weight:600;box-shadow:var(--raise)}
.who button:active{box-shadow:var(--inset)}
.who button small{display:block;font-size:13px;color:var(--sub);font-weight:400;margin-top:4px}
.swept{font-size:12px;color:var(--sub);text-align:center;padding:8px 16px 28px}
.spin{display:inline-block;width:12px;height:12px;border:2px solid var(--sep2);border-top-color:var(--accent);border-radius:50%;animation:sp 1s linear infinite;vertical-align:-2px}
@keyframes sp{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
