/* © 2026 VanlifeFabrika, ALT
   SPDX-License-Identifier: AGPL-3.0-or-later
   ALT 1.34: «ALT Поле» — режим штаба в браузере (field.js). Цвета — токены style.css (День/Ночь), карта всегда светлая. */
.fldchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 9px; border-radius: var(--pill); background: var(--ok-soft);
  color: var(--ok); font-weight: 700; font-size: 13px; margin-right: 2px; white-space: nowrap; }
.fldchip .ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linejoin: round; }
.fldchip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: fldpulse 2s infinite; }
@keyframes fldpulse { 50% { opacity: .35; } }

.fldhq { position: fixed; inset: 0; z-index: 80; background: var(--bg); color: var(--text); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.fldhq .ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fhd { display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(8px) max(12px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--border); min-width: 0; }
.fht { display: flex; flex-direction: column; min-width: 140px; flex: 1 1 auto; margin-right: auto; }
.fht b { font-size: 18px; line-height: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fht small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fldhq.closed .fht b::after { content: 'архив'; margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: var(--pill); background: var(--surface3); color: var(--text2); vertical-align: 2px; }
.ftools { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
.ftools::-webkit-scrollbar { display: none; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--r12); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; transition: background .15s; }
.fbtn:hover { background: var(--surface2); }
.fbtn.on { background: var(--accent-soft); color: var(--accent); }
.fbtn.tog.on { background: var(--ok-soft); color: var(--ok); }
.fbtn.acc { background: var(--accent-fill); color: var(--on-accent); }
.fbtn[disabled] { opacity: .45; pointer-events: none; }
.fbtn.ficon { width: 40px; padding: 0; justify-content: center; }
.fsep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; flex: none; }
.fldhq.ro #fbsector, .fldhq.ro #fbcell, .fldhq.ro #fbtask { display: none; }
.fldhq.closed #fbmark { display: none; }

.fbody { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.fmapw { position: relative; min-height: 0; }
.fmap { position: absolute; inset: 0; }
.fmap .tmap { min-height: 0; }
.fside { overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 6px; }
.fsec { display: flex; flex-direction: column; gap: 6px; }
.fsh { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 8px 4px 2px; }
.fgrp { border: 1px solid var(--border); border-radius: var(--r16); padding: 8px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.fgh { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.fgh > i { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.fgh b { font-size: 15px; } .fgh small { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.fgl, .fmt { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--pill); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fgl.ok, .fmt.ok { color: var(--ok); background: var(--ok-soft); }
.fgl.late, .fmt.late { color: #8A5A00; background: rgba(245, 158, 11, .22); }
.fgl.lost, .fmt.lost { color: var(--on-danger); background: var(--danger-fill); }
.fgl.none, .fmt.none { color: var(--muted); background: var(--surface2); }
[data-theme="dark"] .fgl.late, [data-theme="dark"] .fmt.late { color: #FBBF24; }
.fgt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); padding: 0 4px 4px; }
.fgt span { flex: 1; min-width: 0; }
.fgb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 0 4px 4px; } .fgb .ic { width: 16px; height: 16px; }
.fmem, .ftask { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 8px; border-radius: var(--r12); background: transparent; color: var(--text); }
.fmem:hover, .ftask:hover { background: var(--surface2); }
.fmem.sel { background: var(--accent-soft); }
.fmn { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fmn b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmn small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmedit { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; font-size: 15px; }
.fmedit:hover { background: var(--surface3); color: var(--text); }
.ftask { border: 1px solid var(--border); }
.ftask.st-done { opacity: .72; } .ftask.st-aborted { opacity: .55; text-decoration: line-through; }
.fpct { position: relative; width: 74px; height: 22px; border-radius: var(--pill); background: var(--surface2); overflow: hidden; flex: none; display: grid; place-items: center; }
.fpct i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok-soft); }
.fpct.lo i { background: var(--danger-soft); } .fpct.mid i { background: rgba(245, 158, 11, .25); } .fpct.hi i { background: rgba(21, 128, 61, .25); }
.fpct b { position: relative; font-size: 12px; font-variant-numeric: tabular-nums; }
.falert { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: var(--r16); width: 100%; }
.falert b { font-size: 14.5px; } .falert small { font-size: 12.5px; opacity: .9; }
.falert.late { background: rgba(245, 158, 11, .2); color: #6B4500; }
[data-theme="dark"] .falert.late { color: #FCD34D; }
.falert.lost { background: var(--danger-fill); color: var(--on-danger); }
.falert.found { background: #16A34A; color: #fff; animation: fldpulse 1.6s infinite; }

.flog { background: var(--surface); border-top: 1px solid var(--border); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 196px; transition: height .2s; }
.fldhq.logmin .flog { height: 46px; } .fldhq.logmin .flist, .fldhq.logmin .fsay { display: none; }
.flhd { display: flex; align-items: center; gap: 6px; padding: 6px 12px; }
.flhd b { font-size: 14px; margin-right: 6px; } .flsp { flex: 1; }
.fchip { height: 30px; padding: 0 12px; border-radius: var(--pill); background: var(--surface2); color: var(--text2); font-size: 13px; font-weight: 600; }
.fchip.on { background: var(--accent-soft); color: var(--accent); }
.flist { overflow-y: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.fle { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 19px; padding: 2px 0; }
.fle time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; font-size: 12.5px; }
.fle b { flex: none; font-weight: 700; }
.fle span { min-width: 0; overflow-wrap: anywhere; }
.fle.msg span { background: var(--accent-soft); padding: 1px 8px; border-radius: 10px; }
.fle.alarm { color: var(--danger); font-weight: 600; }
.fempty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.fsay { display: flex; gap: 8px; padding: 6px 12px max(8px, env(safe-area-inset-bottom)); }
.fsay input { flex: 1; min-width: 0; height: 40px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface2); color: var(--text); padding: 0 16px; font-size: 15px; outline: 0; }
.fsay input:focus { border-color: var(--accent); }
.fsend { width: 40px; padding: 0; justify-content: center; background: var(--accent-fill); color: var(--on-accent); border-radius: 50%; }
.fsend:hover { background: var(--accent-fill); filter: brightness(1.08); }

/* слои карты — пилюли справа сверху */
.flays { position: absolute; right: 12px; top: 10px; z-index: 4; display: flex; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--surface); box-shadow: var(--shadow-2); }
.flays .fbtn { height: 34px; border-radius: var(--pill); font-size: 13px; padding: 0 12px 0 10px; color: var(--text2); }
.flays .fbtn .ic { width: 18px; height: 18px; }
.flays .fbtn.tog.on { background: var(--ok-soft); color: var(--ok); }
/* панель рисования — над картой */
.fdraw { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border-radius: var(--r16); box-shadow: var(--shadow-2); padding: 6px 6px 6px 14px; width: max-content; max-width: calc(100% - 24px); }
.fdt { font-size: 14px; font-weight: 600; margin-right: 4px; }
.flegend { position: absolute; left: 10px; top: 10px; z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.flegend .lg { font-size: 12px; font-weight: 700; padding: 3px 9px 3px 7px; border-radius: var(--pill); background: rgba(255, 255, 255, .92); color: #101A2C; box-shadow: 0 1px 3px rgba(16, 26, 44, .25); display: inline-flex; align-items: center; gap: 5px; }
.flegend .lg::before { content: ''; width: 12px; height: 12px; border-radius: 3px; }
.flegend .c1::before { background: rgba(229, 36, 59, .35); } .flegend .c2::before { background: rgba(22, 163, 74, .45); } .flegend .c3::before { background: rgba(21, 101, 52, .75); }
.flegend .gap::before { background: none; border: 2px dashed #64748B; border-radius: 2px; width: 9px; height: 9px; }

/* карта операции */
.fldhq .tm-pg.fld-c1 { fill: #E5243B; fill-opacity: .18; } .fldhq .tm-pg.fld-c2 { fill: #16A34A; fill-opacity: .34; } .fldhq .tm-pg.fld-c3 { fill: #15653A; fill-opacity: .55; }
.fldhq .tm-pg.fld-zone { fill: #2B5FE0; fill-opacity: .05; } .fldhq .tm-pg.fld-zone.done { fill: #16A34A; fill-opacity: .2; } .fldhq .tm-pg.fld-zone.undone { fill: #64748B; fill-opacity: .25; }
.fldhq .tm-pg.fld-task { fill: #F59E0B; fill-opacity: .06; } .fldhq .tm-pg.fld-task.st-done { fill: #16A34A; fill-opacity: .08; }
.fldhq .tm-pg.fld-draft { fill: #F59E0B; fill-opacity: .2; }
.fldhq .tm-ln.fld-grid { stroke: #1E293B; stroke-width: 1; stroke-dasharray: none; opacity: .28; }
.fldhq .tm-ln.fld-zl { stroke: #2B5FE0; stroke-width: 2.5; stroke-dasharray: none; } .fldhq .tm-ln.fld-zl.done { stroke: #16A34A; stroke-dasharray: 5 4; } .fldhq .tm-ln.fld-zl.undone { stroke: #64748B; stroke-dasharray: 3 4; }
.fldhq .tm-ln.fld-tl { stroke: #D97706; stroke-width: 3; stroke-dasharray: 10 5; } .fldhq .tm-ln.fld-tl.st-active { stroke-dasharray: none; } .fldhq .tm-ln.fld-tl.st-done { stroke: #16A34A; stroke-dasharray: none; opacity: .7; }
.fldhq .tm-ln.fld-trk { stroke-dasharray: none; stroke-linecap: round; opacity: .85; } .fldhq .tm-ln.fld-trk.gap { stroke-dasharray: 2 7; opacity: .6; stroke-width: 2px !important; }
.fldhq .tm-ln.fld-dl { stroke: #D97706; stroke-width: 3; stroke-dasharray: none; } .fldhq .tm-ln.fld-dl.close { stroke-dasharray: 6 6; }
.fldhq .tm-m.fld-p { width: 30px; height: 30px; margin: -15px 0 0 -15px; font-size: 11px; font-weight: 800; letter-spacing: -.02em; }
.fldhq .tm-m.fld-p.uns { border-style: dashed; }
.fldhq .tm-m.fld-p.old { opacity: .55; } .fldhq .tm-m.fld-p.last { opacity: .4; filter: grayscale(.8); }
.fldhq .tm-m.fld-p.sel { box-shadow: 0 0 0 5px rgba(43, 95, 224, .35), 0 2px 6px rgba(0, 0, 0, .5); z-index: 2; }
.fldhq .tm-m.fld-mk { border-radius: 8px 8px 8px 2px; width: 26px; height: 26px; margin: -26px 0 0 -2px; font-size: 14px; font-weight: 800; }
.fldhq .tm-m.fld-mk.ok::after { content: '✓'; position: absolute; right: -7px; top: -7px; width: 15px; height: 15px; border-radius: 50%; background: #16A34A; color: #fff; font-size: 10px; display: grid; place-items: center; border: 1.5px solid #fff; }
.fldhq .tm-m.fld-mk.found { width: 34px; height: 34px; margin: -34px 0 0 -2px; font-size: 18px; animation: fldpulse 1.6s infinite; }
.fldhq .tm-m.fld-v { width: 24px; height: 24px; margin: -12px 0 0 -12px; background: #F59E0B; color: #1C1200; font-weight: 800; font-size: 12px; }
.fldhq .tm-m.fld-pct { width: auto; height: 24px; margin: -12px 0 0 -24px; padding: 0 8px; border-radius: var(--pill); background: rgba(255, 255, 255, .94); color: #101A2C; border: 0;
  font-size: 12.5px; font-weight: 800; pointer-events: none; min-width: 48px; box-shadow: 0 1px 4px rgba(16, 26, 44, .3); }

/* шторки «Поля» */
.fldsheet .fform { padding-bottom: 6px; }
.fform .ffld { display: flex; flex-direction: column; gap: 4px; padding: 6px 16px; flex: 1; min-width: 0; }
.fform .ffld small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fform .ffld input, .fform .ffld select { height: 44px; border-radius: var(--r12); border: 1px solid var(--border); background: var(--surface2); color: var(--text); padding: 0 12px; font-size: 15px; width: 100%; outline: 0; }
.fform .ffld input:focus, .fform .ffld select:focus { border-color: var(--accent); }
.fform .f2 { display: flex; gap: 0; } .fform .f2 .ffld + .ffld { padding-left: 0; }
.fform .fbtns { display: flex; gap: 8px; padding: 12px 16px 4px; flex-wrap: wrap; }
.fform .fbtns .btn { flex: 1 1 auto; background: var(--accent-fill); color: var(--on-accent); }
.fform .fbtns .btn.sec { background: var(--surface2); color: var(--text); }
.fform .fbtns .btn.ghost { background: var(--surface2); color: var(--danger, #DC2626); }
/* 1.35: «Компактный эфир» и «+ Рация без телефона» */
.fform .fchk { display: flex; gap: 10px; align-items: flex-start; padding: 8px 16px; font-size: 13.5px; color: var(--text2); line-height: 1.35; }
.fform .fchk input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.fsec .fadd { width: 100%; margin-top: 6px; border: 1px dashed var(--border); border-radius: var(--r12); padding: 8px; font-weight: 600; }
.fkinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 16px; }
.fkind { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--r12); background: var(--surface2); color: var(--text); font-weight: 600; font-size: 14px; border: 2px solid transparent; }
.fkind i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--kc); color: #fff; font-style: normal; font-weight: 800; flex: none; }
.fkind.on { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 12%, var(--surface)); }
.fcoord { padding: 4px 16px 8px; display: flex; flex-direction: column; } .fcoord b { font-size: 20px; font-variant-numeric: tabular-nums; } .fcoord small { color: var(--muted); }
.fphoto { margin: 4px 16px; border-radius: var(--r12); max-height: 240px; object-fit: cover; }
.fqr { display: grid; place-items: center; padding: 8px; } .fqr svg { width: 240px; height: 240px; background: #fff; padding: 10px; border-radius: var(--r16); }
.fcode { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 2px; } .fcode small { color: var(--muted); font-size: 12.5px; }
.fcode b { font-size: 15px; overflow-wrap: anywhere; } .fcode code { font: 600 13px/1.4 Consolas, monospace; overflow-wrap: anywhere; }
.fldnew { margin: 8px 16px 4px; padding: 12px; border-radius: var(--r16); background: var(--surface2); display: flex; flex-direction: column; gap: 6px; }
.fldnew small { color: var(--muted); font-size: 13px; }
.fldnew .fldrow { display: flex; gap: 8px; } .fldnew input { flex: 1; min-width: 0; height: 44px; border-radius: var(--r12); border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 12px; font-size: 15px; }

/* планшет поуже и телефон */
@media (max-width: 1180px) { .ftools .fbtn:not(.ficon) span { display: none; } .ftools .fbtn:not(.ficon) { padding: 0 10px; } }
@media (max-width: 860px) {
  .fbody { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 36%); }
  .fside { border-left: 0; border-top: 1px solid var(--border); }
  .flog { height: 150px; }
  .fht b { font-size: 16px; }
}
@media (max-width: 700px) { .flays .fbtn span { display: none; } .flays .fbtn { width: 34px; padding: 0; justify-content: center; } }
@media (max-width: 560px) { .fhd { flex-wrap: wrap; } .ftools { order: 3; width: 100%; } .fkinds { grid-template-columns: repeat(2, 1fr); } }
