html,body {margin:0;height:100%;font:15px/1.35 system-ui,Segoe UI,Roboto,sans-serif;
           -webkit-text-size-adjust:100%}
#map {position:absolute;top:0;right:0;bottom:0;left:0;background:#e8e4dc}
#bar {position:absolute;z-index:1000;bottom:14px;left:50%;transform:translateX(-50%);
      background:#fff;border-radius:12px;padding:6px;box-shadow:0 2px 10px #0003;
      display:flex;gap:6px;align-items:center;font-size:14px;width:max-content;max-width:96vw;flex-wrap:wrap}
#bar button {font:inherit;padding:10px 12px;border:1px solid #ccc;border-radius:9px;background:#f7f7f7}
#bar button.on {background:#2b6cb0;color:#fff;border-color:#2b6cb0}
#panel {position:absolute;z-index:1100;top:8px;right:8px;width:268px;max-width:92vw;
        background:#fff;border-radius:12px;box-shadow:0 2px 12px #0003;overflow:hidden}
#panel .ph {display:flex;align-items:center;justify-content:space-between;gap:8px;
            padding:9px 11px;background:#f2f4f7;font-weight:600;font-size:14px;position:relative}
@media (max-width:700px){
  #panel .ph {touch-action:none}                    /* тянем шторку за шапку */
  #panel .ph::before {content:'';position:absolute;top:5px;left:50%;transform:translateX(-50%);
                      width:44px;height:4px;border-radius:2px;background:#c3ccd8}
  #panel .ph {padding-top:14px}
}
#panel .ph button {font:inherit;border:0;background:#e2e8f0;border-radius:7px;padding:3px 10px}
#list {max-height:62vh;overflow:auto;padding:6px 8px 10px}
#panel.folded #list {display:none}
.row {padding:6px 2px;border-bottom:1px solid #eef1f4}
.row:last-child {border-bottom:0}
.row .nm {display:flex;align-items:flex-start;gap:7px;font-size:13.5px;line-height:1.25}
.row .nm input {margin-top:2px;width:17px;height:17px;flex:0 0 auto}
.row input[type=range] {width:100%;margin:5px 0 0 24px;width:calc(100% - 24px);height:22px}
.row.historical .nm {font-weight:600}
.row .wbsel {margin:6px 0 0 24px;width:calc(100% - 24px);font:inherit;font-size:12px;
             padding:3px 4px;border:1px solid #cbd5e1;border-radius:6px;background:#fff}
.row .fixchk {display:inline-flex;align-items:center;gap:4px;margin:4px 0 0 24px;
              font-size:11.5px;color:#1a73e8;cursor:pointer;user-select:none}
.row .fixchk input {width:15px;height:15px;margin:0}
.row .fixchk.off {color:#94a3b8}
/* группы слоёв: сворачиваемые списки с общей галочкой */
.grp {margin:10px 2px 2px}
.grph {display:flex;align-items:center;gap:6px;padding:6px 4px;cursor:pointer;user-select:none;
       font-size:11.5px;color:#4b5563;text-transform:uppercase;letter-spacing:.05em;font-weight:600;
       border-top:1px solid #e2e8f0;border-radius:6px}
.grph:hover {background:#f1f5f9}
.grph .gm {width:16px;height:16px;margin:0;accent-color:#1a73e8}
.grph .gt {flex:1}
.grph .gc {font-size:11px;color:#94a3b8;font-weight:400;letter-spacing:0;text-transform:none}
.grph .gx {font-size:11px;color:#94a3b8;transition:transform .15s}
.grpclosed .gx {transform:rotate(-90deg)}
.grpclosed .gb {display:none}
.gb {padding-left:2px}
.grpold {font-size:11px;color:#8a94a6;text-transform:uppercase;letter-spacing:.04em;
         margin:8px 2px 2px}
#coord {position:absolute;z-index:1000;bottom:14px;left:10px;background:#000b;color:#fff;
        padding:5px 9px;border-radius:8px;font-size:12px;font-variant-numeric:tabular-nums}
#status {position:absolute;z-index:1200;bottom:64px;left:50%;transform:translateX(-50%);
         background:#000c;color:#fff;padding:7px 13px;border-radius:9px;display:none;font-size:14px}
.legend {background:#fff;padding:6px 8px;border-radius:8px;box-shadow:0 1px 6px #0003;font-size:13px}
.legend b {display:block;margin-bottom:3px}
.swatch {display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:5px}
/* своя точка GPS: синяя с пульсирующим ореолом */
.gpsdot {position:relative;width:16px;height:16px;border-radius:50%;background:#1a73e8;
         border:3px solid #fff;box-shadow:0 0 0 2px #1a73e855, 0 1px 6px #0006}
.gpsdot::after {content:'';position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px;border-radius:50%;
                border:2px solid #1a73e8cc;animation:gpspulse 2s ease-out infinite}
@keyframes gpspulse {0%{transform:scale(.5);opacity:.9} 100%{transform:scale(1.6);opacity:0}}
/* ---- снимки (аэрофото, сканы) с четырьмя углами ---- */
.photoquad {position:absolute;left:0;top:0;transform-origin:0 0;pointer-events:none;
            will-change:transform}
/* угол снимка: кружок 30 px, а «ловить» палец может в радиусе ~48 px (::before) */
.cornerdot {position:relative;width:30px;height:30px;border-radius:50%;background:#f9a825;
            color:#fff;border:2px solid #fff;box-shadow:0 1px 6px #0007;
            font:600 14px/26px system-ui;text-align:center;cursor:grab;
            touch-action:none;user-select:none;-webkit-user-select:none;
            -webkit-tap-highlight-color:transparent}
.cornerdot::before {content:'';position:absolute;top:-18px;right:-18px;bottom:-18px;left:-18px;border-radius:50%}
.cornerdot:active {background:#e08e00;transform:scale(1.1)}
.leaflet-marker-icon.dragging .cornerdot {background:#e08e00;transform:scale(1.15);
            box-shadow:0 0 0 3px #f9a82555, 0 2px 10px #0008}
body.photodragging #map {cursor:grabbing}
/* пока ставим углы, канвас с метками не должен перехватывать касания */
body.photoing #map canvas {pointer-events:none}
.cornerdot.n {background:#1a73e8}
.row.photo .nm span {font-weight:600}
.row .photobtn {font:inherit;padding:5px 9px;font-size:12px;border-radius:7px;margin:5px 4px 0 24px;
                border:1px solid #cbd5e1;background:#f8fafc;cursor:pointer}
.row .photobtn.on {background:#1a73e8;border-color:#1a73e8;color:#fff}
.row .photodel {font:inherit;padding:5px 8px;font-size:12px;border-radius:7px;margin:5px 0 0 0;
                border:1px solid #fca5a5;background:#fef2f2;color:#b91c1c;cursor:pointer}
#photobar {position:absolute;z-index:2200;left:50%;transform:translateX(-50%);top:64px;
      background:#fff;border-radius:12px;box-shadow:0 4px 18px #0004;padding:10px 12px;
      display:none;width:min(94vw,460px);font-size:13px}
#photobar.on {display:block}
#photobar .hd {display:flex;align-items:center;justify-content:space-between;gap:8px;
      font-weight:600;font-size:14px;margin-bottom:6px}
#photobar .hdbtns {display:flex;gap:5px;flex:0 0 auto}
#photobar button {padding:5px 9px;font-size:12px;border-radius:8px;border:1px solid #cbd5e1;
      background:#f8fafc;cursor:pointer}
#photobar button.primary {background:#1a73e8;border-color:#1a73e8;color:#fff}
body.photoing #map {cursor:crosshair}
body.photoing #bar #btnphoto {background:#1a73e8;border-color:#1a73e8;color:#fff}
.pop b {font-size:15px}
.pop .meta {color:#666;font-size:12px}
.pop .note {margin:5px 0;font-size:12.5px;line-height:1.4;color:#222}
.pop details {margin-top:5px;font-size:12px}
.pop details summary {cursor:pointer;color:#2b6cb0}
.pop .kind-badge {display:inline-block;padding:1px 6px;border-radius:8px;background:#edf2f7;color:#2d3748;font-size:11px;margin-right:4px}
.leaflet-control-zoom a {width:38px!important;height:38px!important;line-height:38px!important;
                         font-size:22px!important}
@media (max-width:700px){
  /* на телефоне панель слоёв — нижняя шторка: карта остаётся видна сверху */
  #panel{top:auto;bottom:0;left:0;right:0;width:auto;max-width:none;border-radius:14px 14px 0 0;
         max-height:30vh;display:flex;flex-direction:column;box-shadow:0 -3px 14px #0003}
  #panel .ph{border-radius:14px 14px 0 0;padding:11px 13px;font-size:15px}
  #panel .ph button{padding:5px 14px;font-size:15px}
  #list{flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch;padding:4px 10px 14px}
  .row .nm{font-size:14px}                            /* крупнее, чтобы попадать пальцем */
  .row{padding:5px 2px}
  .row input[type=range]{height:18px;margin-top:4px}
  .row .nm input{width:20px;height:20px}
  #panel.folded{max-height:52px}
  #bar{top:8px;bottom:auto;padding:5px;left:8px;right:8px;transform:none;width:auto;max-width:none;justify-content:center}
  #bar button{padding:9px 11px}
  #coord{top:8px;bottom:auto;left:8px;font-size:10.5px;padding:4px 8px}
  /* нижние контролы Leaflet (легенда, зум) поднимаем над свёрнутой шторкой */
  .leaflet-bottom.leaflet-left, .leaflet-bottom.leaflet-right{bottom:54px}
  #status{bottom:74px;top:auto;left:8px;right:8px}
  #panel.folded + #coord,
  #panel.folded ~ #coord{top:8px}
}
@media (max-width:420px){
  #bar button{padding:8px 9px;font-size:13px}
  #coord{max-width:44vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
/* телефон повёрнут набок: экран низкий — список делаем покороче */
@media (max-height:520px){
  #list{max-height:48vh}
  #panel{max-height:76vh}
}
/* ---- режим коррекции привязки ---- */
#fix, #ask {position:absolute;z-index:2200;left:50%;transform:translateX(-50%);
      top:64px;background:#fff;border-radius:12px;box-shadow:0 4px 18px #0004;
      padding:10px 12px;display:none;width:min(94vw,460px);font-size:13px}
#fix.on, #ask.on {display:block}
#fix .hd, #ask .hd {font-weight:600;font-size:14px;margin-bottom:6px}
#fix .hd {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
#fix .hdbtns {display:flex;gap:5px;flex:0 0 auto}
#fix .mini {padding:5px 9px!important;font-size:12px!important}
#fix.folded {width:auto;padding:8px 10px}
#fix.folded .hd {margin-bottom:0}
#fix.folded .fixBody {display:none}
#fix.folded #fixTitle {max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#fix select {width:100%;padding:6px;font-size:13px;border-radius:8px;border:1px solid #cbd5e1;background:#fff}
#fix .keys, #ask .keys {display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
#fix button, #ask button {padding:8px 12px;font-size:14px;border-radius:8px;
      border:1px solid #cbd5e1;background:#f8fafc;cursor:pointer}
#fix button.primary, #ask button.primary {background:#1a73e8;border-color:#1a73e8;color:#fff}
#fix button.danger, #ask button.danger {background:#fef2f2;border-color:#fca5a5}
.hint {color:#64748b;font-size:12px;margin-top:6px;line-height:1.35}
body.fixing #map {cursor:grab; touch-action:none}
body.fixing.moving #map {cursor:grabbing}
body.fixing #bar #btnfix {background:#1a73e8;border-color:#1a73e8;color:#fff}
@media (max-width:700px){
  #fix, #ask {top:auto;bottom:calc(52px + 8px);width:calc(100vw - 16px)}
  #fix button, #ask button {padding:9px 10px;font-size:14px;flex:1 1 auto}
}
/* подписи листов разграфки (слой karta1824) */
.sheet-lbl {pointer-events:none}
.sheet-lbl span {position:absolute;transform:translate(-50%,-50%);white-space:nowrap;
      background:rgba(255,255,255,.75);padding:0 4px;border-radius:3px;
      color:#1e3a8a;font:600 12px/1.3 system-ui,sans-serif}
.sheet-lbl.ordered span {color:#14532d;background:rgba(220,252,231,.9)}
/* чат (js/chat.js): панель слева, на телефоне — снизу во всю ширину */
#btnchat.on {background:#1a73e8;border-color:#1a73e8;color:#fff}
#chat {display:none;position:absolute;z-index:2300;left:10px;top:10px;bottom:64px;width:360px;
      max-width:calc(100vw - 20px);background:#fff;border-radius:10px;box-shadow:0 4px 18px rgba(0,0,0,.25);
      flex-direction:column;font-size:14px}
#chat.on {display:flex}
#chat .hd {display:flex;align-items:center;padding:8px 10px;border-bottom:1px solid #e2e8f0;font-weight:600}
#chat .hd .ttl {flex:1 1 auto;margin:0 6px}
#chat .hd button {border:0;background:none;font-size:16px;cursor:pointer;padding:2px 6px}
#chat .back {visibility:hidden}
#chat.inthread .back {visibility:visible}
#chat .list {flex:1 1 auto;overflow-y:auto;padding:8px 10px;-webkit-overflow-scrolling:touch}
#chat .empty {color:#64748b;padding:12px 2px}
#chat .msg {margin:0 0 10px;padding:7px 9px;border-radius:8px;background:#f1f5f9}
#chat .msg.mine {background:#e8f0fe}
#chat .meta {font-size:12px;color:#64748b;margin-bottom:3px}
#chat .txt {white-space:normal;word-wrap:break-word;overflow-wrap:anywhere}
#chat .imgs img {max-width:100%;max-height:220px;border-radius:6px;margin-top:5px;display:block}
#chat .msg button.open {margin-top:5px;border:0;background:none;color:#1a73e8;cursor:pointer;padding:0;font-size:13px}
#chat .acts {float:right}
#chat .acts button {border:0;background:none;cursor:pointer;padding:0 3px;font-size:13px;color:#64748b}
#chat .acts button.sure {color:#c53030;font-weight:600}
#chat .msg.editing {outline:2px solid #1a73e8}
#chat .txt.gone {color:#94a3b8;font-style:italic}
#chat .editbar {display:none;font-size:12px;color:#1a73e8;margin-bottom:4px}
#chat .editbar button {border:0;background:none;color:#c53030;cursor:pointer;padding:0;font-size:12px}
#chat.isedit .editbar {display:block}
#chat.isedit .att, #chat.isedit .pend {display:none}
#chat .pend {padding:0 10px}
#chat .pimg {position:relative;display:inline-block;margin:6px 6px 0 0}
#chat .pimg img {height:54px;border-radius:5px;display:block}
#chat .pimg button {position:absolute;top:-6px;right:-6px;border:0;border-radius:50%;width:20px;height:20px;
      background:#334155;color:#fff;font-size:11px;cursor:pointer;line-height:20px;padding:0}
#chat .compose {border-top:1px solid #e2e8f0;padding:8px 10px}
#chat textarea {width:100%;box-sizing:border-box;resize:vertical;min-height:44px;font:inherit;padding:6px;
      border:1px solid #cbd5e1;border-radius:6px}
#chat .row {display:flex;align-items:center;margin-top:6px}
#chat .row button {margin-right:6px;padding:6px 10px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc;cursor:pointer}
#chat .row .send {margin:0 0 0 auto;background:#1a73e8;border-color:#1a73e8;color:#fff}
@media (max-width:700px){
  #chat {left:8px;right:8px;width:auto;top:auto;height:62vh;bottom:calc(52px + 8px)}
}
/* скетчи (js/sketch.js) */
#chat .skbtn {display:block;margin-top:5px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#1e3a8a;
      cursor:pointer;padding:4px 8px;font-size:13px}
#chat .skbtn .skbase {display:block;font-size:11.5px;color:#64748b;text-align:left}
#sketchbar {display:none;position:absolute;z-index:2400;left:10px;top:10px;width:300px;max-width:calc(100vw - 20px);
      background:#fff;border-radius:10px;box-shadow:0 4px 18px rgba(0,0,0,.25);padding:10px;font-size:13px}
body.sketching #sketchbar {display:block}
#sketchbar button {padding:6px 9px;margin:0 5px 5px 0;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc;cursor:pointer;font-size:13px}
#sketchbar .tools button.on {background:#1a73e8;border-color:#1a73e8;color:#fff}
#sketchbar .colors button {width:26px;height:26px;padding:0;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px #cbd5e1}
#sketchbar .colors button.on {box-shadow:0 0 0 2px #1e293b}
#sketchbar .cap {width:100%;box-sizing:border-box;margin:4px 0 6px;padding:6px;border:1px solid #cbd5e1;border-radius:6px;font:inherit}
#sketchbar .end {display:flex}
#sketchbar .end .done {margin-left:auto;margin-right:0;background:#1a73e8;border-color:#1a73e8;color:#fff}
#sketchbar .hint {color:#64748b;font-size:12px;line-height:1.35}
body.sketching #map {cursor:crosshair}
#map.pencil {cursor:crosshair;touch-action:none}
body.chat-side #sketchbar {left:380px}        /* рядом с открытой темой (ширина чата 360 + отступы) */
@media (max-width:700px){ #sketchbar, body.chat-side #sketchbar {left:8px;right:8px;width:auto} }
#chat .toplace {display:inline-block;margin-top:4px;border:0;background:none;color:#b45309;cursor:pointer;padding:0;font-size:13px}
/* места (js/places.js): панель слева, как у чата */
#btnplaces.on {background:#1a73e8;border-color:#1a73e8;color:#fff}
#places {display:none;position:absolute;z-index:2300;left:10px;top:10px;bottom:64px;width:360px;
      max-width:calc(100vw - 20px);background:#fff;border-radius:10px;box-shadow:0 4px 18px rgba(0,0,0,.25);
      flex-direction:column;font-size:14px}
#places.on {display:flex}
#places .hd {display:flex;align-items:center;padding:8px 10px;border-bottom:1px solid #e2e8f0;font-weight:600}
#places .hd .ttl {flex:1 1 auto;margin:0 6px}
#places .hd button {border:0;background:none;font-size:16px;cursor:pointer;padding:2px 6px}
#places .back, #places .prev, #places .next {display:none}
#places.inplace .back, #places.inplace .prev, #places.inplace .next {display:inline-block}
#places .prev, #places .next {font-size:20px!important;line-height:1}
#places .list {flex:1 1 auto;overflow-y:auto;padding:8px 10px;-webkit-overflow-scrolling:touch}
#places .empty {color:#64748b;padding:12px 2px}
#places .pl {padding:8px 9px;margin-bottom:6px;border-radius:8px;background:#f1f5f9;cursor:pointer}
#places .pl:hover {background:#e2e8f0}
#places .pt {font-weight:600;overflow-wrap:anywhere}
#places .meta {font-size:12px;color:#64748b;margin-top:2px}
#places .card {padding:4px 2px 10px;border-bottom:1px solid #e2e8f0;margin-bottom:8px}
#places .card .pt {font-size:16px}
#places .btns {margin-top:8px;display:flex;flex-wrap:wrap;gap:6px}
#places .btns button {padding:5px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc;cursor:pointer;font-size:13px}
#places .btns button.danger {border-color:#fca5a5;background:#fef2f2;color:#b91c1c}
#places button.sure {color:#c53030!important;font-weight:600}
#places .chd {font-size:12px;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin:4px 0 8px}
#places .msg {margin:0 0 10px;padding:7px 9px;border-radius:8px;background:#f1f5f9}
#places .msg.mine {background:#e8f0fe}
#places .txt {overflow-wrap:anywhere;margin-top:3px}
#places .acts {float:right}
#places .acts button {border:0;background:none;cursor:pointer;padding:0 3px;font-size:13px;color:#64748b}
#places .compose {display:none;border-top:1px solid #e2e8f0;padding:8px 10px}
#places.inplace .compose {display:block}
#places textarea {width:100%;box-sizing:border-box;resize:vertical;min-height:44px;font:inherit;padding:6px;
      border:1px solid #cbd5e1;border-radius:6px}
#places .row {display:flex;margin-top:6px}
#places .row .send {margin-left:auto;padding:6px 10px;border:1px solid #1a73e8;border-radius:6px;background:#1a73e8;color:#fff;cursor:pointer}
@media (max-width:700px){
  #places {left:8px;right:8px;width:auto;top:auto;height:62vh;bottom:calc(52px + 8px)}
}
/* линейка живёт внутри нижней панели кнопок (#bar): отдельная плашка сверху закрывала меню */
#tools {display:flex;align-items:center;gap:6px;padding-left:8px;border-left:1px solid #e2e8f0;font-size:13px;
      max-width:100%}
#tools button {font:inherit;padding:6px 10px;border:1px solid #cbd5e1;border-radius:7px;background:#f8fafc;cursor:pointer;white-space:nowrap}
#tools button.on {background:#1a73e8;border-color:#1a73e8;color:#fff}
#tools .rinfo {display:none;align-items:center;gap:6px}
#tools.active .rinfo {display:flex}
#tools .rsum {font-variant-numeric:tabular-nums;color:#1e293b;white-space:nowrap;padding:0 2px}
#tools .rsum.done {font-weight:600}
body.measuring #map {cursor:crosshair}
.leaflet-tooltip.rlbl {background:rgba(255,255,255,.92);border:1px solid #94a3b8;color:#111827;font:600 11.5px/1.3 system-ui,sans-serif;
      padding:1px 5px;box-shadow:none;border-radius:4px}
.leaflet-tooltip.rlbl::before {display:none}
.leaflet-tooltip.rtip {font-weight:400;border-style:dashed}
@media (max-width:700px){
  #tools {width:auto;justify-content:center;border-left:1px solid #e2e8f0;border-top:0;padding:0 0 0 6px;margin:0}
  #tools .rsum {white-space:normal;font-size:12px}
}
/* просмотр картинок чата */
#lbx {display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:3000;background:rgba(15,23,42,.9)}
#lbx.on {display:block}
#lbx .stage {position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;
      overflow:auto;-webkit-overflow-scrolling:touch}
#lbx img {max-width:96%;max-height:92%;object-fit:contain;cursor:zoom-in;box-shadow:0 6px 30px rgba(0,0,0,.5)}
#lbx.full .stage {display:block}
#lbx.full img {max-width:none;max-height:none;cursor:zoom-out;margin:0 auto;display:block}
#lbx button {position:absolute;border:0;background:rgba(255,255,255,.15);color:#fff;cursor:pointer;border-radius:50%}
#lbx .x {top:12px;right:12px;width:40px;height:40px;font-size:20px}
#lbx .nav {top:50%;margin-top:-26px;width:52px;height:52px;font-size:34px;line-height:48px;display:none}
#lbx.many .nav {display:block}
#lbx .prev {left:12px}
#lbx .next {right:12px}
#lbx .cnt {position:absolute;bottom:14px;left:0;right:0;text-align:center;color:#e2e8f0;font-size:14px}
.sheet-lbl.absent span {color:#6b7280;background:rgba(243,244,246,.6);font-weight:400}
/* карточка трека во всплывашке (popups.js → trackCard) */
.pop table.tcard {border-collapse:collapse;margin:6px 0 2px;font-size:13px}
.pop table.tcard td {padding:2px 0;vertical-align:top}
.pop table.tcard td:first-child {color:#64748b;padding-right:10px;white-space:nowrap}
/* список треков под строкой слоя (data-layers.js → ensureTrackToggle) */
.row .tlbtn {margin:4px 0 0 24px;border:0;background:none;color:#1a73e8;cursor:pointer;padding:0;font-size:12px}
.row .tlist {display:none;margin:4px 0 2px 24px;max-height:260px;overflow-y:auto;border-left:2px solid #e2e8f0}
.row.tlopen .tlist {display:block}
.row .ti {display:flex;flex-wrap:wrap;align-items:center;gap:2px 7px;padding:4px 6px;font-size:12.5px;cursor:pointer;border-radius:5px}
.row .ti:hover {background:#f1f5f9}
.row .ti.sel {background:#e8f0fe}
.row .ti.empty {color:#94a3b8;cursor:default}
.row .ti .td {width:10px;height:10px;border-radius:50%;flex:0 0 auto}
.row .ti .tw {font-variant-numeric:tabular-nums}
.row .ti .tw i {color:#94a3b8;font-style:normal}
.row .ti .tk {color:#64748b;margin-left:auto}
.row .ti .tn {flex:1 0 100%;padding-left:17px;color:#64748b;font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* ---- панель слоёв на компьютере: во всю высоту, выключенные слои — одной строкой, сверху поиск и «Включено» */
.psearch, #onpanel {display:none}
@media (min-width:701px){
  #panel {top:8px;bottom:8px;width:320px;display:flex;flex-direction:column}
  #panel.folded {bottom:auto}
  #list {flex:1 1 auto;max-height:none;padding-top:0}
  .row:not(.on) {padding:3px 2px}
  .row:not(.on) input[type=range], .row:not(.on) .wbsel,
  .row:not(.on) .photobtn, .row:not(.on) .photodel {display:none}
  .psearch {display:block;position:sticky;top:0;z-index:2;background:#fff;padding:8px 0 6px}
  .psearch input {width:100%;box-sizing:border-box;font:inherit;font-size:13px;padding:6px 9px;
        border:1px solid #cbd5e1;border-radius:7px;background:#f8fafc}
  #onpanel {display:block;position:absolute;z-index:1100;top:8px;right:336px;width:250px;max-height:calc(100vh - 90px);
        overflow-y:auto;background:#fff;border-radius:12px;box-shadow:0 2px 12px #0003;padding:0 8px 6px}
  #onpanel:empty {display:none}
  #onpanel .obh {display:flex;align-items:center;position:sticky;top:0;background:#fff;cursor:pointer;user-select:none;
        font-size:11.5px;color:#4b5563;text-transform:uppercase;letter-spacing:.05em;font-weight:600;padding:9px 2px 5px}
  #onpanel .obx {margin-left:auto;color:#94a3b8;transition:transform .15s}
  #onpanel.closed .obx {transform:rotate(-90deg)}
  #onpanel.closed .obl {display:none}
  #onpanel.closed {padding-bottom:0}
  .obr {padding:3px 4px 4px;border-radius:6px;background:#f1f5f9;margin:3px 0}
  .obn {display:flex;align-items:center;gap:6px;font-size:13px;line-height:1.25}
  .obn span {flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .obn button {border:0;background:none;color:#94a3b8;cursor:pointer;font-size:13px;padding:0 2px}
  .obn button:hover {color:#c53030}
  .obs {display:flex;align-items:center;gap:6px}
  .obs input {flex:1 1 auto;height:18px;margin:0}
  .obs .pc {font-size:11px;color:#64748b;width:34px;text-align:right;font-variant-numeric:tabular-nums}
  #list.searching .grpclosed .gb {display:block}
  .row.nomatch, .grp.nomatch, #list.searching .grpold {display:none}
}
/* окно уже — не залезаем на нижние кнопки */
@media (min-width:701px) and (max-width:1300px){ #panel {bottom:70px} }

/* форма точки: добавление и правка (point-form.js) */
#ptform {position:absolute;z-index:2300;left:50%;transform:translateX(-50%);bottom:70px;
  width:min(430px, calc(100vw - 20px));background:#fff;border:1px solid #d7dbe0;border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.22);padding:10px 12px 12px;font:14px/1.35 system-ui,sans-serif}
#ptform[hidden] {display:none}
#ptform .pthd {display:flex;align-items:center;margin-bottom:4px;font-size:14px}
#ptform .pthd button {margin-left:auto;border:0;background:none;font-size:16px;color:#64748b;padding:2px 6px;cursor:pointer}
#ptform label.ptf {display:block;margin:6px 0 0;font-size:12px;color:#4b5563}
#ptform label.ptf select,#ptform label.ptf input,#ptform label.ptf textarea {
  display:block;width:100%;margin-top:3px;padding:9px 10px;font:15px/1.3 inherit;color:#111827;
  border:1px solid #cbd5e1;border-radius:8px;background:#fff;box-sizing:border-box}
#ptform label.ptf textarea {resize:vertical;min-height:44px}
#ptform .pthint {font-size:12px;color:#6b7280;margin-top:6px}
#ptform .ptact {display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
#ptform .ptact button {flex:1 1 auto;padding:11px 12px;font:inherit;font-size:15px;border-radius:9px;
  border:1px solid #cbd5e1;background:#f8fafc;cursor:pointer}
#ptform .ptact button.primary {background:#1a73e8;border-color:#1a73e8;color:#fff}
#ptform .ptact button.danger {background:#fef2f2;border-color:#fca5a5;color:#b91c1c}
.ptbar {margin-top:8px}
.ptbar .ptedit {padding:6px 10px;font:inherit;font-size:13px;border:1px solid #cbd5e1;border-radius:7px;
  background:#f8fafc;cursor:pointer}
.ptdot i {display:block;width:22px;height:22px;border-radius:50%;background:#fff;border:4px solid #c53030;
  box-sizing:border-box;box-shadow:0 1px 4px rgba(0,0,0,.35)}
@media (max-width:700px){
  #ptform {bottom:calc(56px + 6px);padding:8px 10px 10px}
  #ptform label.ptf select,#ptform label.ptf input,#ptform label.ptf textarea {font-size:16px}  /* iOS не зумит */
}
#ptform {max-height: calc(100vh - 140px);overflow:auto;-webkit-overflow-scrolling:touch}
/* на широком экране форма уходит вправо: центр карты остаётся свободным для перетаскивания */
@media (min-width:701px){
  #ptform {left:auto;right:14px;transform:none;bottom:74px;width:360px;max-height:calc(100vh - 170px)}
}

/* привязка снимка по точкам (photo-gcp.js): синяя — место на снимке, красная — на карте */
.gcpdot {width:22px;height:22px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px #0007;
      color:#fff;font:600 11px/18px system-ui,sans-serif;text-align:center;box-sizing:border-box}
.gcpdot.img {background:#1a73e8}
.gcpdot.map {background:#dc2626}
.gcpdot.pend {background:#f59e0b;animation:gcpblink 1s infinite}
@keyframes gcpblink {50% {opacity:.4}}
#photobar .hd b {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#photobar .hd button {flex:0 0 auto}
#photobar .pmodes {display:flex;border:1px solid #cbd5e1;border-radius:9px;overflow:hidden;margin-bottom:7px}
#photobar .pmodes button {flex:1 1 0;border:0;border-radius:0;border-right:1px solid #cbd5e1;padding:6px 4px;white-space:nowrap}
#photobar .pmodes button:last-child {border-right:0}
#photobar .pop-op {display:flex;align-items:center;gap:8px;margin-bottom:7px;color:#444}
#photobar .pop-op input {flex:1;min-width:0}
#photobar .pop-op span {width:3.2em;text-align:right;color:#666}
#photobar .pacts {display:flex;flex-wrap:wrap;gap:5px;margin-bottom:7px}
#photobar .pacts button[hidden] {display:none}
#photobar .pmodes button.on {background:#0f766e;border-color:#0f766e;color:#fff}
.gcplist {margin-top:6px;display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center}
.gcplist .meta {flex:1 0 100%;color:#555;font-size:12px}
.gcpi {background:#f1f5f9;border-radius:6px;padding:1px 6px;font-size:12px}
.gcpi a, .gcplist a {color:#b91c1c;text-decoration:none}
.gcpdot.crop {background:#f59e0b;font-size:12px}
.leaflet-marker-icon .gcpdot.img, .leaflet-marker-icon .gcpdot.map, .leaflet-marker-icon .gcpdot.crop {cursor:grab}
.gcpdot.img {width:16px;height:16px;line-height:12px;font-size:9px;margin:3px}
/* лупы привязки по точкам (только мышь): скан и подложка под курсором */
#gcpLoupes {position:fixed;left:12px;bottom:34px;z-index:2150;display:none;gap:8px;pointer-events:none}
#gcpLoupes .lp {background:#fff;border-radius:10px;box-shadow:0 3px 14px #0005;padding:4px}
#gcpLoupes .lt {font-size:11px;color:#444;padding:0 2px 3px}
#gcpLoupes .lb {position:relative;width:220px;height:220px;overflow:hidden;border-radius:6px;background:#e5e7eb}
#gcpLoupes #lpScan img {position:absolute;max-width:none;image-rendering:auto}
#gcpLoupes .lb::before, #gcpLoupes .lb::after {content:'';position:absolute;z-index:500;background:#e11d48;pointer-events:none}
#gcpLoupes .lb::before {left:50%;top:0;bottom:0;width:1px}
#gcpLoupes .lb::after {top:50%;left:0;right:0;height:1px}
#gcpLoupes.pend #lpScan {outline:3px solid #2563eb;outline-offset:-3px}

/* ---- ТВ и широкие экраны: компактные панели (Стас, 26.11.2026) ------------
   65" телевизор: панель слоёв и блок «Включено» занимали треть ширины.
   Ужимаем шрифты и отступы, «Включено» по умолчанию свёрнуто (см. panel.js). */
@media (min-width:900px){
  #panel{width:252px}
  #panel .ph{padding:7px 9px;font-size:12.5px}
  #panel .ph button{padding:2px 9px;font-size:12px}
  #list{padding:0 5px 8px}
  .row:not(.on){padding:2px 2px}
  .row.on{padding:4px 2px}
  .row .nm{font-size:12px;gap:5px;line-height:1.2}
  .row .nm input{width:14px;height:14px;margin-top:2px}
  .row input[type=range]{height:14px;margin:3px 0 0 19px;width:calc(100% - 19px)}
  .row .wbsel{margin-left:19px;width:calc(100% - 19px);font-size:11px;padding:2px 3px}
  .row .photobtn,.row .photodel{margin-left:19px;font-size:11px;padding:3px 7px}
  .grp{margin:6px 1px 1px}
  .grph{font-size:10px;padding:4px 2px;letter-spacing:.03em}
  .psearch{padding:5px 0 4px}
  .psearch input{font-size:12px;padding:4px 8px}
  #onpanel{width:196px;right:262px;max-height:calc(100vh - 74px)}
  #onpanel .obh{font-size:10.5px;padding:7px 2px 4px}
  .obn{font-size:11.5px}
  .obr{padding:2px 3px 3px;margin:2px 0}
  .obs input{height:14px}
  .obs .pc{font-size:10px;width:28px}
  #panel.folded{width:auto}                 /* свернули — узкая плашка, а не колонка */
  #panel.folded .ph{font-size:12px;padding:6px 9px}
}

/* приставки с плотным экраном: WebView отдаёт 960 CSS px на 1080p — ужимаем ещё */
@media (min-resolution:1.5dppx) and (min-width:600px){
  #panel{width:210px}
  #onpanel{width:172px;right:220px}
  #panel .ph{padding:6px 8px;font-size:11.5px}
  .row .nm{font-size:11px}
  .row .nm input{width:13px;height:13px}
  .row input[type=range]{height:12px}
  .grph{font-size:9.5px;padding:3px 2px}
  #list{padding:0 3px 6px}
  .psearch input{font-size:11px;padding:3px 7px}
}
/* редактор трека (✂ в карточке трека): плашка как у привязки снимка */
.ptbar .trkedit {padding:6px 10px;font:inherit;font-size:13px;border:1px solid #cbd5e1;border-radius:7px;
  background:#f8fafc;cursor:pointer}
#trackbar {position:absolute;z-index:2200;left:50%;transform:translateX(-50%);top:64px;
  background:#fff;border-radius:12px;box-shadow:0 4px 18px #0004;padding:10px 12px;
  display:none;width:min(94vw,420px);font-size:13px;box-sizing:border-box}
#trackbar.on {display:block}
#trackbar .hd {display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:600;font-size:14px;margin-bottom:7px}
#trackbar .hd b {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#trackbar .hdb {display:flex;gap:5px;flex:0 0 auto}
#trackbar button {padding:5px 9px;font-size:12px;border-radius:8px;border:1px solid #cbd5e1;background:#f8fafc;cursor:pointer}
#trackbar button:disabled {opacity:.45;cursor:default}
#trackbar button.primary {background:#1a73e8;border-color:#1a73e8;color:#fff}
#trackbar .pmodes {display:flex;border:1px solid #cbd5e1;border-radius:9px;overflow:hidden;margin-bottom:7px}
#trackbar .pmodes button {flex:1 1 0;border:0;border-radius:0;border-right:1px solid #cbd5e1;padding:6px 4px;white-space:nowrap}
#trackbar .pmodes button:last-child {border-right:0}
#trackbar .pmodes button.on {background:#0f766e;color:#fff}
#trackbar .tparts {max-height:30vh;overflow:auto;margin-bottom:7px}
#trackbar .tp {display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:6px;cursor:pointer}
#trackbar .tp:hover {background:#f1f5f9}
#trackbar .tp .td {width:14px;height:4px;border-radius:2px;flex:0 0 auto}
#trackbar .tp .tk {margin-left:auto;color:#444;font-variant-numeric:tabular-nums}
#trackbar .tp .ts {color:#b91c1c;font-size:12px;width:7.5em;text-align:right}
#trackbar .tp.off {color:#888}
#trackbar .tp.off span:nth-child(2) {text-decoration:line-through}
#trackbar .tp.off .ts {color:#0f766e}
#trackbar .pacts {display:flex;flex-wrap:wrap;gap:5px;margin-bottom:6px}
#trackbar .hint {color:#555;font-size:12px}
body.trackediting #map {cursor:crosshair}
body.trackediting .leaflet-points-pane, body.trackediting .leaflet-points-pane * {pointer-events:none !important}
@media (max-width:700px){ #trackbar {top:auto;bottom:calc(56px + 6px)} }

/* ---- «✥» посередине снимка: тянешь — едет весь лист целиком (Стас, 26.11.2026) ---- */
.gcpdot.move {width:34px;height:34px;line-height:30px;font-size:16px;background:#0f766e;
      cursor:grab;box-shadow:0 2px 8px #0006}
.gcpdot.move.dragging {cursor:grabbing;background:#115e59}
.leaflet-marker-icon .gcpdot.move {cursor:grab}

/* ---- временные правки привязки: ничего не уходит на сервер, пока режим включён ---- */
#tempbar {position:absolute;z-index:2300;left:10px;bottom:52px;display:none;align-items:center;gap:6px;
      background:#fff;border-radius:10px;box-shadow:0 3px 14px #0003;padding:5px 7px;font-size:12px;color:#334155}
#tempbar.on {display:flex}
#tempbar button {padding:4px 9px;font-size:12px;border-radius:7px;border:1px solid #cbd5e1;background:#f8fafc;cursor:pointer}
#tempbar button.on {background:#b45309;border-color:#b45309;color:#fff}
#tempbar button[hidden] {display:none}
#tempbar .cnt {color:#b45309;font-weight:700}
@media (max-width:700px){ #tempbar {bottom:auto;top:8px;left:8px;right:auto;font-size:11px} }

/* ---- Панель привязки: узкая, слева сверху, таскается за заголовок и сворачивается (Стас, 28.11.2026) ---- */
#photobar {left:8px; top:54px; transform:none; width:min(92vw,330px); font-size:12px; padding:8px 10px}
#photobar .hd {cursor:move; touch-action:none}
#photobar .hd.dragging {cursor:grabbing}
#photobar .hdbtns {display:flex; gap:4px; flex:0 0 auto}
#photobar button.mini {padding:3px 7px; font-size:12px}
#photobar.folded {width:auto; max-width:min(92vw,330px); padding:5px 8px}
#photobar.folded .hd {margin-bottom:0}
#photobar.folded .pmodes, #photobar.folded .pop-op,
#photobar.folded .pacts, #photobar.folded .hint {display:none}
#photobar .pmodes button {padding:4px 6px; font-size:12px}
#photobar .pacts {display:flex; flex-wrap:wrap; gap:4px}
#photobar .pacts button {padding:4px 6px; font-size:11.5px}

/* ---- «⏱ Временно»: кнопка видна всегда, подробности раскрываются по ней ---- */
#tempbar {display:flex}
#tempbar .more {display:none; align-items:center; gap:6px}
#tempbar.on .more {display:inline-flex}

/* ---- режим «✥ Двигать»: тащим карту — едет весь лист (Стас, 28.11.2026) ---- */
.gcpdot.move {width:44px; height:44px; line-height:40px; font-size:18px}
body.photomoving #map, body.photomoving #map.movingSheet {cursor:move}
body.photomoving #photobar #photoMove {background:#0f766e; border-color:#0f766e; color:#fff}

/* свёрнутые слои — маленькая плашка, карта видна целиком */
#panel.folded {width:auto}
#panel.folded .ph span {display:none}
#panel.folded .ph {padding:8px 10px}
#panel.folded #list {display:none}
@media (max-width:700px){
  #panel.folded {left:auto;right:8px;bottom:8px;max-height:none;border-radius:12px;box-shadow:0 3px 14px #0004}
  #panel.folded .ph {border-radius:12px;padding:10px 14px}
  #panel.folded .ph::before {display:none}
}

/* кнопка «моё место»: слева по центру — не мешает ни панели, ни шторке, ни зуму */
#btnme {position:absolute;z-index:1200;left:10px;top:50%;transform:translateY(-50%);
        width:54px;height:54px;padding:0;border:1px solid #cbd5e1;border-radius:50%;background:#fff;
        font-size:23px;line-height:1;box-shadow:0 3px 12px #0003;cursor:pointer;
        display:flex;align-items:center;justify-content:center}
#btnme.on {background:#1a73e8;border-color:#1a73e8}
#btnme.wait {animation:mePulse 1.2s ease-in-out infinite}
@keyframes mePulse {0%,100%{box-shadow:0 3px 12px #0003} 50%{box-shadow:0 0 0 7px #1a73e533}}
@media (max-width:700px){ #btnme {width:48px;height:48px;font-size:21px;left:8px} }
/* номера дач на листе старой карты (sheet-pins.js): кольцо вокруг номера — номер под ним видно;
   наше прочтение — ярлычок справа сверху на выноске. Издалека (зум < 12) — только точки */
.scanpin {background:none;border:0}
.scanpin i {position:absolute;left:calc(15px - var(--ring,30px) / 2);top:calc(15px - var(--ring,30px) / 2);width:var(--ring,30px);height:var(--ring,30px);border-radius:50%;
  border:2px solid #b3261e;box-shadow:0 0 0 1px #fff,inset 0 0 0 1px #fff;box-sizing:border-box}
.scanpin:not(.onsheet) i {left:0;top:0;width:30px;height:30px}
.scanpin:not(.onsheet) b {left:26px;bottom:26px}
.scanpin b {position:absolute;left:calc(15px + var(--ring,30px) * .36);bottom:calc(15px + var(--ring,30px) * .36);font:700 12px/1 system-ui,sans-serif;color:#fff;background:#b3261e;
  padding:3px 5px;border-radius:6px;white-space:nowrap;box-shadow:0 1px 3px #0005}
.scanpin b::before {content:"";position:absolute;left:-9px;bottom:-3px;width:12px;border-top:2px solid #b3261e;transform:rotate(-40deg);transform-origin:right}
.scanpin.sign i {border-color:#6b3fa0;border-radius:6px}
.scanpin.sign b {background:#6b3fa0}.scanpin.sign b::before {border-color:#6b3fa0}
.scanpin.q0 i {border-style:dashed}
.scanpin.q0 b {background:#8a5a00}.scanpin.q0 b::before {border-color:#8a5a00}
.pinsfar .scanpin i, .pinsfar .scanpin:not(.onsheet) i {left:11px;top:11px;width:8px;height:8px;background:#b3261e;border-width:1px}
.pinsfar .scanpin.sign i {background:#6b3fa0}
.pinsfar .scanpin b {display:none}
.ptbar .sheetlink {display:inline-block;padding:6px 10px;font-size:13px;border:1px solid #cbd5e1;border-radius:7px;background:#f8fafc;color:inherit;text-decoration:none}
/* врезка «Увеличенные дачи»: синие кольца; вне снимка не показываются (у врезки нет места на местности).
   Открыта карточка — та же дача на листе и на врезке подсвечена жёлтым */
.scanpin.inset i {border-color:#1d4ed8}
.scanpin.inset b {background:#1d4ed8}.scanpin.inset b::before {border-color:#1d4ed8}
.scanpin.inset:not(.onsheet) {display:none}
.scanpin.twin i {border-color:#f59e0b;border-width:4px}
.scanpin.twin b {background:#f59e0b;color:#1b1f24}
.ptbar .twinlink {cursor:pointer;margin-left:4px}
