/* Цвета темы заданы в одном месте; остальные правила используют их имена. */
:root{color-scheme:light;--text:#173c36;--page:#e9eee6;--muted:#586b60;--border:#cbd7c9;--surface:#f8f9f2;--card:#ffffff;--hover:#e5eddc;--accent:#155c48;--on-accent:#ffffff;--highlight:#e9ef9c;--error:#a22f21}
:root[data-theme="dark"]{color-scheme:dark;--text:#e5eee6;--page:#101914;--muted:#adc0b2;--border:#374d40;--surface:#18261f;--card:#203127;--hover:#2d4637;--accent:#a7d6af;--on-accent:#10251b;--highlight:#3f5031;--error:#ffb4a8}
*{box-sizing:border-box}body{margin:0;color:var(--text);background:var(--page);font:16px/1.5 system-ui,sans-serif}.layout{max-width:1060px;margin:48px auto;padding:24px;display:grid;grid-template-columns:1fr 420px;gap:70px}aside{padding:36px 0}h1{font-size:44px;line-height:1.15;letter-spacing:-1.5px}h2{font-size:28px;line-height:1.2;letter-spacing:-.6px}h3{margin:8px 0}small,.muted{font-size:12px;color:var(--muted)}hr{border:0;border-top:1px solid var(--border);margin:24px 0}.phone{background:var(--surface);border:1px solid var(--border);border-radius:28px;overflow:hidden;align-self:start;box-shadow:0 24px 60px #173c3615}header{padding:22px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between}header span{font-weight:400}main{padding:22px;min-height:570px}nav{display:grid;grid-template-columns:repeat(5,1fr);border-top:1px solid var(--border);background:var(--card);padding:10px 5px}button,input,select,textarea{font:inherit}button{border:1px solid var(--border);border-radius:12px;padding:11px 14px;min-height:44px;color:var(--text);background:var(--card);cursor:pointer}button:hover{background:var(--hover)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #9d7414;outline-offset:2px}nav button{font-size:22px;border:0;padding:3px}nav span{display:block;font-size:11px}nav [aria-current=page]{background:var(--hover)}nav button[data-go=catch]{background:var(--accent);color:var(--on-accent)}.primary{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.wide{width:100%;margin-top:12px}label{display:block;font-size:14px;font-weight:600;margin:16px 0}input,select,textarea{display:block;width:100%;min-width:0;padding:12px;border:1px solid var(--border);background:var(--card);border-radius:10px;margin-top:6px;color:var(--text)}input[type=file]{font-size:12px}.card{background:var(--card);border:1px solid var(--border);border-radius:18px;padding:18px;margin:16px 0}.map{height:270px;position:relative;overflow:hidden;border-radius:18px;background:repeating-linear-gradient(25deg,#dce7ce 0 30px,#e7edda 30px 65px)}.river{position:absolute;width:130px;height:450px;background:#a8c9c7;border:14px solid #c4d9cf;top:-70px;left:110px;transform:rotate(28deg);border-radius:45%}.map button{position:absolute;background:var(--accent);color:var(--on-accent);border:3px solid var(--card);border-radius:50%;width:48px;height:48px;padding:0}.map small{position:absolute;bottom:8px;left:10px;background:#ffffffe0;padding:3px 6px}.tag{display:inline-block;background:var(--highlight);padding:5px 9px;border-radius:20px;font-size:11px}.facts{display:grid;grid-template-columns:1fr 1fr;gap:16px}.facts span{display:block;font-size:11px;color:var(--muted)}.facts p{margin:0;font-size:14px}#status:not(:empty){padding:12px 22px;background:var(--highlight);font-size:13px}.error{color:var(--error)}.avatar{width:64px;height:64px;background:var(--hover);border-radius:50%;display:grid;place-items:center;font-size:24px}img{max-width:100%;max-height:180px;border-radius:12px}.empty{padding:24px 0}textarea{resize:vertical}@media(max-width:760px){.layout{display:block;margin:0;padding:0}aside{padding:20px}aside h1{font-size:28px}aside>p,aside hr,aside h3{display:none}.phone{max-width:460px;margin:auto;border-radius:22px 22px 0 0}main{min-height:500px}}

.header-tools{display:flex;gap:10px;align-items:center}.demo-label{font-size:10px;color:var(--muted)}.theme-control{font-size:10px;margin:0;font-weight:500}.theme-control select{font-size:12px;margin-top:2px;padding:6px;min-height:34px}header{align-items:center;gap:8px;padding:16px}.feed-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.feed-heading h2{margin-bottom:12px}.feed-tabs{display:flex;gap:8px;margin:8px 0 20px}.feed-tabs button{flex:1;border-radius:24px;font-size:14px}.feed-tabs [aria-pressed=true]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.post{margin:0 -22px 26px;border-bottom:1px solid var(--border);padding-bottom:20px}.post-author{display:flex;align-items:center;gap:10px;padding:0 16px 12px}.post-author .avatar{width:38px;height:38px;font-size:15px;flex-shrink:0}.post-author .identity{flex:1;min-width:0}.identity strong{display:block;font-size:14px;overflow-wrap:anywhere}.identity small{font-size:11px}.post-author button{padding:7px 10px;font-size:12px;min-height:44px}.post-media{position:relative;background:var(--hover)}.post-media img{display:block;width:100%;height:auto;aspect-ratio:4/3;max-height:none;border-radius:0;object-fit:cover}.post-media .media-label{position:absolute;left:12px;bottom:12px;background:#10251bd9;color:#fff;border-radius:16px;padding:4px 8px;font-size:10px}.post-content{padding:12px 16px 0}.post-actions{display:flex;gap:8px;flex-wrap:wrap}.post-actions button{font-size:14px;background:transparent;border-color:transparent;padding:7px 9px}.post-actions [aria-pressed=true]{color:var(--accent);background:var(--hover)}.post-content h3{font-size:20px}.post-content p{font-size:14px;margin:8px 0;overflow-wrap:anywhere}.post-content .muted{font-size:12px}.feed-foot{font-size:12px;text-align:center;color:var(--muted)}.comment-context{border-left:3px solid var(--accent);padding-left:12px}.map{color:#173c36}.map small{color:#173c36}.map button{background:#155c48;color:white;border-color:white}.error{color:var(--error)}
@media(max-width:360px){header{padding:12px}.demo-label{display:none}.post-author{gap:6px}.post-author button{font-size:11px;padding:6px}.brand{font-size:14px}}

.feed-pagination{padding:0 0 24px}.feed-pagination .feed-foot{margin:8px 0}.post{overflow-anchor:auto}

/* touch-action оставляет прокрутку и масштабирование щипком. */
.post-media{touch-action:manipulation;user-select:none}.post-media img{-webkit-user-drag:none}.like-burst{position:absolute;z-index:1;left:50%;top:50%;font-size:90px;line-height:1;color:#fff;filter:drop-shadow(0 3px 10px #0006);opacity:0;transform:translate(-50%,-50%);pointer-events:none}.like-burst.show{animation:like-pop .7s ease-out forwards}@keyframes like-pop{0%{opacity:0;transform:translate(-50%,-50%) scale(.5)}25%,65%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.15)}}@media(prefers-reduced-motion:reduce){.like-burst.show{animation:like-static .7s forwards}@keyframes like-static{0%,90%{opacity:1}100%{opacity:0}}}

/* Карта Leaflet имеет собственные элементы управления. Старые стили кнопок не должны их менять. */
#lake-map{height:430px;width:100%;border:1px solid var(--border);border-radius:16px;background:#d9e3c5;isolation:isolate;color:#173c36}#lake-map img{max-height:none;border-radius:0}#lake-map .leaflet-control-attribution{font:10px/1.5 system-ui;background:#ffffffe6;color:#173c36;max-width:240px}#lake-map .leaflet-control-attribution a{color:#155c48}#lake-map .leaflet-control-zoom a{width:40px;height:40px;line-height:40px;color:#173c36;background:white}#lake-map .leaflet-tooltip{color:#173c36;background:white}.map-warning{font-size:12px;padding:10px 12px;border-left:3px solid #ad741a;background:var(--highlight)}.lake-toggles{display:flex;flex-wrap:wrap;gap:8px 16px}.lake-toggles label{display:flex;align-items:center;gap:6px;font-size:12px;margin:4px 0;min-height:44px}.lake-toggles input{display:inline-block;width:18px;height:18px;margin:0;accent-color:var(--accent)}.depth-legend{display:flex;flex-wrap:wrap;gap:8px;font-size:11px;margin-top:10px}.depth-legend span::before{content:'';display:inline-block;background:var(--swatch);width:14px;height:10px;margin-right:4px;border:1px solid #246e85}.depth-label{background:#ffffffe6;color:#155065;text-align:center;font:bold 12px/24px system-ui;border-radius:12px;border:1px solid #246e85}.hazard-marker{background:#fff0d5;border:2px solid #966022;border-radius:8px;text-align:center;font:bold 10px/24px system-ui;color:#59340e;box-shadow:0 2px 5px #0002}.hazard-marker.depth{background:#e4f5fa;border-color:#246e85;color:#155065}.spot-marker{color:#155c48;font:bold 28px/30px system-ui;text-shadow:0 0 3px white,0 0 3px white}.map-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.map-tools button{font-size:12px;flex:1}.map-list{margin-top:16px}.map-list summary{padding:12px 0;font-size:13px;cursor:pointer}#map-note-list{display:grid;gap:6px}#map-note-list button{text-align:left;font-size:13px}@media(max-width:360px){#lake-map{height:380px}}

/* Панель открывается поверх страницы и не сдвигает карту. */
.map-detail[hidden]{display:none}.map-detail{position:fixed;z-index:2000;left:50%;bottom:16px;transform:translateX(-50%);width:min(390px,calc(100vw - 24px));max-height:min(65vh,600px);max-height:min(65dvh,600px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--border);border-radius:20px;background:var(--surface);box-shadow:0 12px 60px #0005;color:var(--text)}.map-detail-bar{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--border);z-index:1}.map-detail-bar strong{font-size:14px}.map-detail-bar button{min-width:44px}.map-detail>.card{border:0;border-radius:0;margin:0;background:transparent;padding:16px}.map-detail h3{font-size:21px}.map-detail label{margin:12px 0}.map-detail p{font-size:13px}.map-detail textarea{min-height:70px}

.hazard-marker.mine{background:#e3f7df;border-color:#286c38;color:#154723;font-weight:800}.saved-note{display:block;width:100%;text-align:left;margin:8px 0;padding:12px}.saved-note strong,.saved-note span{display:block;overflow-wrap:anywhere}.saved-note span{font-size:12px;color:var(--muted);margin-top:4px}.saved-confirmation{color:var(--accent);font-weight:700}

/* Явный режим выбора: карта видна сразу, без прокрутки к инструкции. */
.phone.place-mode{position:fixed;inset:12px;width:min(460px,calc(100vw - 24px));margin:0 auto;z-index:1500;display:flex;flex-direction:column;overflow:hidden;border-radius:24px}.phone.place-mode header{flex-shrink:0}.phone.place-mode nav{display:none}.phone.place-mode #screen{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1;padding:14px}.phone.place-mode #screen>:not(#map-help):not(#cancel-place-flow):not(#lake-map):not(#map-detail){display:none}.phone.place-mode #map-help{margin:0;font-size:16px;font-weight:700;color:var(--text);background:var(--highlight);padding:12px;border-radius:12px}.phone.place-mode #cancel-place-flow{margin:0;flex-shrink:0}.phone.place-mode #lake-map{height:auto;min-height:150px;flex:1}.phone.place-mode #status{flex-shrink:0}.phone.place-mode .map-detail{width:min(420px,calc(100vw - 32px))}

.phone.place-mode{height:calc(100vh - 24px);height:calc(100dvh - 24px)}

.phone.map-expanded:not(.place-mode){position:fixed;inset:12px;width:min(700px,calc(100vw - 24px));height:calc(100vh - 24px);height:calc(100dvh - 24px);margin:0 auto;z-index:1500;display:flex;flex-direction:column;overflow:hidden;border-radius:24px}.phone.map-expanded:not(.place-mode) header{flex-shrink:0}.phone.map-expanded:not(.place-mode) nav{display:none}.phone.map-expanded:not(.place-mode) #screen{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1;padding:12px}.phone.map-expanded:not(.place-mode) #screen>:not(#map-help):not(#close-expanded-map):not(#lake-map):not(#map-detail):not(.map-tools):not(.lake-toggles):not(#tile-status){display:none}.phone.map-expanded:not(.place-mode) #lake-map{height:auto;min-height:140px;flex:1}.phone.map-expanded:not(.place-mode) #map-help{margin:0}.phone.map-expanded:not(.place-mode) #close-expanded-map{margin:0;flex-shrink:0}.phone.map-expanded:not(.place-mode) .map-tools{display:grid;grid-template-columns:1fr 1fr;margin:0;gap:6px}.phone.map-expanded:not(.place-mode) .map-tools button{margin:0}.phone.map-expanded:not(.place-mode) .lake-toggles label{min-height:30px}.phone.map-expanded:not(.place-mode) #tile-status{margin:0;font-size:11px}
.map-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.map-tools button{width:100%;margin:0}

/* Отдельная карта занимает всё окно, а управление лежит поверх неё. */
.phone.map-expanded:not(.place-mode),.phone.place-mode{inset:0;width:100%;height:100vh;height:100dvh;max-width:none;margin:0;border:0;border-radius:0;box-shadow:none;background:var(--surface)}
.phone.map-expanded:not(.place-mode) header,.phone.place-mode header{display:none}
.phone.map-expanded:not(.place-mode) #screen,.phone.place-mode #screen{position:relative;display:block;flex:1;min-height:0;padding:0}
.phone.map-expanded:not(.place-mode) #lake-map,.phone.place-mode #lake-map{position:absolute;inset:0;width:100%;height:100%;min-height:0;border:0;border-radius:0}
.phone.map-expanded:not(.place-mode) #map-help,.phone.place-mode #map-help{position:absolute;z-index:1001;top:max(12px,env(safe-area-inset-top));left:68px;right:12px;margin:0;padding:10px 14px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font-size:13px;line-height:1.4;max-width:600px;box-shadow:0 2px 10px #0002}
.phone.map-expanded:not(.place-mode) #close-expanded-map,.phone.place-mode #cancel-place-flow{position:absolute;z-index:1001;top:78px;left:12px;right:auto;width:auto;max-width:calc(100% - 24px);margin:0;background:var(--surface);box-shadow:0 2px 10px #0002}
.phone.map-expanded:not(.place-mode) .lake-toggles{position:absolute;z-index:1001;top:78px;right:12px;max-width:calc(100% - 220px);gap:4px 12px;padding:6px 12px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 2px 10px #0002}
.phone.map-expanded:not(.place-mode) .map-tools{position:absolute;z-index:1001;bottom:max(40px,env(safe-area-inset-bottom));left:12px;right:12px;max-width:600px;margin:0;display:flex;gap:8px;flex-wrap:wrap}
.phone.map-expanded:not(.place-mode) .map-tools button{flex:1 1 120px;width:auto;background:var(--surface);box-shadow:0 2px 10px #0002}
.phone.map-expanded:not(.place-mode) .map-tools .primary{background:var(--accent)}
.phone.map-expanded:not(.place-mode) #tile-status{position:absolute;z-index:1001;bottom:12px;left:12px;max-width:70%;margin:0;background:var(--surface);border-radius:6px;padding:0 8px}
.phone.map-expanded #status,.phone.place-mode #status{display:none}
.phone.map-expanded .map-detail,.phone.place-mode .map-detail{z-index:2001}
@media(max-width:600px){.phone.map-expanded:not(.place-mode) .lake-toggles{top:auto;bottom:160px;left:12px;right:12px;max-width:none;gap:2px 10px}.phone.map-expanded:not(.place-mode) .lake-toggles label{font-size:11px}.phone.map-expanded:not(.place-mode) .map-tools{display:grid;grid-template-columns:1fr 1fr}.phone.map-expanded:not(.place-mode) #map-help,.phone.place-mode #map-help{font-size:12px;padding:8px 10px}.phone.place-mode #cancel-place-flow{top:94px}}
.phone.map-expanded:not(.place-mode) #close-expanded-map{top:112px}

/* Обычная стрелка вместо курсора захвата Leaflet. */
#lake-map.leaflet-container,#lake-map.leaflet-grab,#lake-map.leaflet-dragging,#lake-map .leaflet-interactive,#lake-map .leaflet-marker-draggable{cursor:default!important}

.header-tools{flex-wrap:wrap;justify-content:flex-end;gap:6px}.header-tools label{font-size:10px}.header-tools select{min-height:36px}.phone>header{flex-wrap:wrap}.language-control select{max-width:130px}.phone>header>strong{flex-shrink:0}.map-detail button,.map-tools button{overflow-wrap:anywhere}

#account-button{font-size:12px;min-height:36px;padding:6px 10px}.show-password{display:flex;align-items:center;gap:8px;font-weight:400}.show-password input{width:18px;height:18px;margin:0}.account-card p{overflow-wrap:anywhere}button:disabled{opacity:.6;cursor:wait}#auth-error:not(:empty){padding:12px;border:1px solid var(--error);border-radius:10px}

.password-match-ok{color:var(--accent);font-weight:600}

#lake-map .leaflet-gl-layer{pointer-events:none}#lake-map .maplibregl-canvas{cursor:default!important}#lake-map .maplibregl-control-container{display:none}

.feed-return{position:sticky;top:8px;z-index:1001;padding:8px 0;margin-bottom:12px;background:var(--surface)}.feed-return button{box-shadow:0 2px 8px #0002}

.brand-button{background:transparent;border:0;padding:0;min-height:44px;font-weight:800;border-radius:6px}.brand-button:hover{background:transparent}.brand-button span{font-weight:400}
.video-intro{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#15221c;color:#fff;overflow:hidden}.video-intro::backdrop{background:#15221c}.video-intro video,.video-intro .intro-shade{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}.intro-shade{background:linear-gradient(180deg,#0c1e1920,#0c1e1955 45%,#0c1e19aa)}.intro-brand{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;pointer-events:none}.intro-brand>p:first-child{font-size:clamp(32px,7vw,72px);font-weight:800;letter-spacing:-1.5px;line-height:1.1;margin:0;text-shadow:0 2px 24px #0007}.intro-brand>p:first-child span{font-weight:350}.intro-brand .intro-tagline{font-size:clamp(12px,2vw,17px);font-weight:400;letter-spacing:.6px;margin:14px 0 0;color:#f5f5ee;text-shadow:0 1px 10px #0008}.video-intro.is-leaving{opacity:0;transition:opacity 100ms ease-out}@media(prefers-reduced-motion:no-preference){.video-intro[open] .intro-brand{animation:intro-brand-in 220ms ease-out both}@keyframes intro-brand-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}}@media(prefers-reduced-motion:reduce){.video-intro.is-leaving{transition:none}}
/* Переключатель подложки доступен и в полноэкранной карте. */
.basemap-picker{display:flex;align-items:center;gap:8px;margin:8px 0}.basemap-picker select{width:auto;min-width:170px;margin:0}
.phone.map-expanded:not(.place-mode) #screen>.basemap-picker,.phone.place-mode #screen>.basemap-picker{display:flex;position:absolute;z-index:1001;top:160px;left:12px;margin:0;padding:6px 10px;border:1px solid var(--border);border-radius:10px;background:var(--surface);font-size:12px;box-shadow:0 2px 10px #0002}
.phone.map-expanded:not(.place-mode) #screen>.basemap-picker,.phone.place-mode #screen>.basemap-picker{display:flex!important}
