/* ==========================================================================
   LinkTest — стиль в духе Apple (iOS / macOS): стекло, скругления, системный шрифт
   ========================================================================== */

/* токены цветов — в tokens.css */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--label-2); }
.ico { width: 20px; height: 20px; flex: none; display: block; }
[hidden] { display: none !important; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------------- карта ---------------- */
#map { position: fixed; inset: 0; z-index: 0; background: var(--bg-3); }
.leaflet-container { font-family: var(--font); background: var(--bg-3); outline: none; }
.dim-map[data-theme="dark"] .layer-dimmable .leaflet-layer.dimmable,
[data-theme="dark"].dim-map .layer-dimmable .leaflet-layer.dimmable {
  filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.88) saturate(0.6);
}
.leaflet-control-attribution {
  background: var(--glass) !important;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--label-2) !important;
  border-radius: 8px 0 0 0;
  font-size: 10px;
  padding: 1px 6px !important;
}
.leaflet-control-attribution a { color: var(--label-2) !important; }
.leaflet-bottom.leaflet-right { right: 0; }

.pin-wrap { background: none; border: 0; }
.pin {
  width: 36px; height: 36px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 0 0 2.5px #fff;
  transition: transform .15s;
}
.pin span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.pin-a { background: linear-gradient(135deg, #3aa0ff, #0a64ff); }
.pin-b { background: linear-gradient(135deg, #ffb340, #ff7a00); }
.leaflet-marker-dragging .pin, .leaflet-dragging .leaflet-marker-draggable .pin { transform: rotate(-45deg) scale(1.12); }
.link-line { transition: stroke .3s; }
.lp-tip { background: var(--glass-strong); color: var(--label); border: 0; border-radius: 8px; box-shadow: var(--shadow-sm); font-size: 12px; }
.lp-tip::before { display: none; }

/* ---------------- верхняя панель ---------------- */
.topbar {
  position: fixed; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px 0 7px; border-radius: 22px; font-weight: 650; letter-spacing: -0.01em; font-size: 16px; }
.logo { width: 30px; height: 30px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 0; padding: 0; color: var(--label); transition: transform .12s, background .2s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.plain { background: transparent; box-shadow: none; width: 34px; height: 34px; color: var(--label-2); }
.icon-btn.plain:hover { background: var(--fill); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.small .ico { width: 17px; height: 17px; }
.account-btn { height: 44px; min-width: 44px; border-radius: 22px; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 6px; border: 0; font-weight: 600; font-size: 14px; }
.account-btn .avatar { width: 32px; height: 32px; }
.account-btn.anon { padding: 0 16px; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--fill-2); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--label-2); overflow: hidden; }

.map-ctrl {
  position: fixed; right: 12px; z-index: 15; display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  top: calc(68px + var(--safe-t));
}
.ctrl-group { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; }
.ctrl-group button { width: 44px; height: 42px; border: 0; background: transparent; display: grid; place-items: center; color: var(--label); }
.ctrl-group button + button { border-top: 0.5px solid var(--sep); }
.ctrl-group button:active { background: var(--fill); }

/* ---------------- боковая панель (десктоп) ---------------- */
.panel {
  position: fixed; z-index: 10; top: calc(68px + var(--safe-t)); left: 12px; bottom: 12px; width: 380px;
  border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden;
}
.sheet-head { padding: 12px 12px 8px; flex: none; }
.sheet-grab { display: none; }
.panel-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tab { display: none; }
.tab.on { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.tab[data-tab="profile"] { display: none !important; }

/* ---------------- нижняя панель профиля (десктоп) ---------------- */
.dock {
  position: fixed; z-index: 9; left: 404px; right: 12px; bottom: 12px; height: 318px;
  border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden;
  transition: height .28s cubic-bezier(.3,.9,.3,1);
}
.dock.collapsed { height: 58px; }
.dock-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 4px 14px; min-height: 58px; }
.dock-head > div { flex: 1; min-width: 0; }
.dock-body { flex: 1; min-height: 0; padding: 0 10px 8px; display: flex; }
#chart-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#chart { flex: 1; min-height: 150px; position: relative; }
.map-ctrl { transition: bottom .28s; }

/* ---------------- сводка ---------------- */
.summary { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.summary::-webkit-scrollbar { display: none; }
.summary .status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; white-space: nowrap; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--fill); }
.summary .status i { width: 9px; height: 9px; border-radius: 50%; background: var(--label-3); flex: none; }
.summary .status.ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 70%, var(--label)); }
.summary .status.ok i { background: var(--green); }
.summary .status.warn { background: color-mix(in srgb, var(--orange) 18%, transparent); color: color-mix(in srgb, var(--orange) 70%, var(--label)); }
.summary .status.warn i { background: var(--orange); }
.summary .status.bad { background: color-mix(in srgb, var(--red) 15%, transparent); color: color-mix(in srgb, var(--red) 75%, var(--label)); }
.summary .status.bad i { background: var(--red); }
.chip { display: inline-flex; flex-direction: column; line-height: 1.15; padding: 0 8px; white-space: nowrap; }
.chip b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.chip small { font-size: 11px; color: var(--label-2); }
.chip.warn b { color: var(--orange); }
.chip.bad b { color: var(--red); }
.chip.good b { color: var(--green); }
.summary .hint { color: var(--label-2); font-size: 14px; white-space: normal; }

/* ---------------- график ---------------- */
.chart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.c-grid line { stroke: var(--sep); stroke-width: 0.5; }
.c-axis { fill: var(--label-2); font-size: 10.5px; font-family: var(--font); }
.c-axis.unit { fill: var(--label-3); }
.st-terrain-top { stop-color: var(--terrain-top); }
.st-terrain-bot { stop-color: var(--terrain-bot); stop-opacity: 0.55; }
.c-terrain { fill: url(#gTerrain); }
.c-terrain-line { fill: none; stroke: var(--terrain-line); stroke-width: 1.3; stroke-linejoin: round; }
.c-clutter { fill: var(--clutter); }
.c-curve { fill: none; stroke: var(--label-3); stroke-width: 1; stroke-dasharray: 2 3; }
.c-fresnel { fill: var(--fresnel); }
.c-f1 { fill: none; stroke: var(--tint); stroke-width: 1.2; opacity: 0.75; }
.c-f60 { fill: none; stroke: var(--tint); stroke-width: 1.2; stroke-dasharray: 5 4; }
.c-los { stroke: var(--los); stroke-width: 2; fill: none; }
.c-hit { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.c-hit.warn { stroke: var(--orange); }
.c-hit.bad { stroke: var(--red); }
.c-mast { stroke: var(--label-2); stroke-width: 2; }
.c-ant { stroke: #fff; stroke-width: 2; }
.c-ant.a { fill: #0a7aff; }
.c-ant.b { fill: #ff8a00; }
.c-worst { fill: #fff; stroke-width: 2.5; }
.c-worst.warn { stroke: var(--orange); }
.c-worst.bad { stroke: var(--red); }
.c-cursor-line { stroke: var(--label-2); stroke-width: 1; stroke-dasharray: 3 3; }
.c-cursor-g { fill: var(--terrain-line); stroke: #fff; stroke-width: 2; }
.c-cursor-l { fill: var(--los); stroke: #fff; stroke-width: 2; }
.chart-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 12px; box-shadow: var(--shadow-sm); padding: 8px 10px; font-size: 12px; min-width: 170px;
  border: 0.5px solid var(--glass-border);
}
.chart-tip b { display: block; font-size: 13px; margin-bottom: 3px; }
.chart-tip div { display: flex; justify-content: space-between; gap: 12px; }
.chart-tip span { color: var(--label-2); }
.chart-tip em { font-style: normal; font-weight: 600; }
.chart-tip em.ok, .chart-tip em.good { color: var(--green); }
.chart-tip em.warn { color: var(--orange); }
.chart-tip em.bad { color: var(--red); }
.chart-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--label-2); font-size: 14px; text-align: center; padding: 20px; z-index: 1; }
.chart.loading:not(.empty) .chart-msg { inset: auto 12px 12px auto; background: var(--glass-strong); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow-sm); font-size: 12.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 6px 0 46px; font-size: 11.5px; color: var(--label-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 0; border-top: 2px solid; display: inline-block; }
.legend i.box { height: 9px; border: 0; border-radius: 2px; }

/* ---------------- сегментированный контрол ---------------- */
.segmented { position: relative; display: flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 0; }
.segmented .seg { flex: 1; position: relative; z-index: 1; border: 0; background: transparent; padding: 6px 8px; font-size: 13px; font-weight: 500; border-radius: 8px; color: var(--label); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; }
.segmented .seg.on { font-weight: 600; }
.segmented .seg .ico { width: 16px; height: 16px; }
.seg-thumb { position: absolute; top: 2px; left: 2px; bottom: 2px; background: var(--card); border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); transition: transform .25s cubic-bezier(.3,.9,.3,1); }
[data-theme="dark"] .seg-thumb { background: #636366; }
.segmented.small .seg { font-size: 12.5px; padding: 4px 6px; min-height: 26px; }

/* ---------------- списки / карточки (inset grouped) ---------------- */
.section-title { font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; color: var(--label-2); margin: 18px 6px 6px; display: flex; align-items: center; justify-content: space-between; }
.section-title:first-child { margin-top: 6px; }
.group { background: var(--card); border-radius: var(--r-md); overflow: hidden; }
[data-theme="light"] .panel .group, [data-theme="light"] .modal .group { box-shadow: 0 0 0 0.5px rgba(0,0,0,0.04); }
.group + .group { margin-top: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 14px; position: relative; }
.row + .row::before, .row + .sub::before, .sub + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 0.5px solid var(--sep); }
.row-label { display: flex; flex-direction: column; min-width: 0; }
.row-label small { color: var(--label-2); font-size: 12px; }
.row-value { display: flex; align-items: center; gap: 4px; color: var(--label-2); flex: none; }
.row-value b { color: var(--label); font-weight: 500; }
.unit { color: var(--label-2); font-size: 14px; min-width: 24px; }
input.num { width: 76px; text-align: right; border: 0; background: transparent; padding: 4px 2px; font-size: 15px; color: var(--label); outline: none; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
input.num:focus { background: var(--fill); border-radius: 6px; }
input.num::-webkit-outer-spin-button, input.num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row.link-row { cursor: pointer; }
.row.link-row:active { background: var(--fill); }
.row .chev { color: var(--label-3); }
.row.danger { color: var(--red); justify-content: center; cursor: pointer; }
.row.action { color: var(--tint); cursor: pointer; justify-content: flex-start; gap: 10px; }
.row.action:active, .row.danger:active { background: var(--fill); }
.sub { padding: 8px 14px 12px; position: relative; }

.field { width: 100%; border: 0; background: var(--fill); border-radius: 10px; padding: 10px 12px; font-size: 16px; outline: none; }
.field:focus { box-shadow: 0 0 0 3px var(--tint-soft); }
select.field { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
select.inline-select { background-color: var(--fill); width: auto; max-width: 100%; font-size: 15px; font-weight: 500; padding: 7px 30px 7px 12px; color: var(--tint); text-overflow: ellipsis; }
textarea.field { resize: vertical; min-height: 70px; font-size: 14px; }
label.stack { display: block; margin-bottom: 10px; }
label.stack > span { display: block; font-size: 13px; color: var(--label-2); margin: 0 4px 5px; }

/* слайдер */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--tint) var(--p, 50%), var(--fill-2) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--tint); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; margin-top: -11px; box-shadow: 0 2px 6px rgba(0,0,0,.22), 0 0 0 0.5px rgba(0,0,0,.06); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.22); }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; }

/* переключатель */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background .2s; }
.switch-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.08); transition: transform .22s cubic-bezier(.3,.9,.3,1); }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }

/* кнопки */
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 15px; background: var(--fill); color: var(--tint); display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .1s, opacity .2s; min-height: 44px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--tint); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn-row.three { grid-template-columns: repeat(3, 1fr); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
a.btn { text-decoration: none; }
.btn.provider { width: 100%; background: var(--card); color: var(--label); box-shadow: 0 0 0 0.5px var(--sep); justify-content: flex-start; padding-left: 16px; font-weight: 500; }
.btn.provider + a.btn { text-decoration: none; }
.btn.provider { margin-top: 8px; }
.pmark { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; line-height: 1; flex: none; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.pmark svg { width: 16px; height: 16px; display: block; }
.row > span > .pmark { vertical-align: middle; }
.pmark.google { background: #fff; box-shadow: 0 0 0 0.5px var(--sep); }
.pmark.yandex { background: #fc3f1d; }
.pmark.vk { background: #0077ff; }
.pmark.dev { background: #8e8e93; }

/* ---------------- точки трассы ---------------- */
.point-card { background: var(--card); border-radius: var(--r-md); padding: 10px 12px 12px; position: relative; }
.point-card + .swap-wrap + .point-card { margin-top: 0; }
.point-head { display: flex; align-items: center; gap: 10px; }
.badge { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; flex: none; }
.badge.a { background: linear-gradient(135deg, #3aa0ff, #0a64ff); }
.badge.b { background: linear-gradient(135deg, #ffb340, #ff7a00); }
.point-name { flex: 1; min-width: 0; border: 0; background: transparent; font-weight: 600; font-size: 16px; padding: 4px 6px; border-radius: 8px; outline: none; }
.point-name:focus { background: var(--fill); }
.coords { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; }
.coords-text { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--fill); border: 0; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.coords-text.empty { font-family: var(--font); color: var(--label-2); }
.coords-text:hover { box-shadow: inset 0 0 0 1px var(--tint-soft); }
.coords-act:disabled { opacity: .35; }
.coords-text:active { background: var(--fill-2); }
.coords input.field { font-family: var(--mono); font-size: 14px; padding: 8px 10px; }
.point-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--label-2); margin: 6px 2px 2px; }
.point-meta b { color: var(--label); font-weight: 500; }
.height-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.height-row > span:first-child { font-size: 13px; color: var(--label-2); white-space: nowrap; }
.height-row input[type=range] { flex: 1; }
.height-row .num-wrap { display: flex; align-items: baseline; gap: 2px; background: var(--fill); border-radius: 8px; padding: 2px 8px 2px 2px; }
.height-row input.num { width: 54px; font-weight: 600; }
.preset-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: var(--fill); color: var(--tint); border-radius: 999px; padding: 5px 10px 5px 9px; font-size: 13px; font-weight: 500; }
.chip-btn .ico { width: 15px; height: 15px; }
.chip-btn .ico:last-child { width: 12px; height: 12px; opacity: .7; }
.chip-btn:active { background: var(--fill-2); }
.menu.scroll { max-height: min(70vh, 560px); overflow-y: auto; }
.menu.scroll .menu-header { position: sticky; top: -6px; background: var(--glass-strong); z-index: 1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; font-size: 11.5px; padding-top: 10px; }
.floors-result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 14px 2px 4px; padding: 14px 16px; border-radius: 14px; background: var(--tint-soft); }
.floors-result span { color: var(--label-2); font-size: 14px; }
.floors-result b { font-size: 26px; letter-spacing: -0.02em; color: var(--tint); }
.swap-wrap { display: flex; justify-content: center; margin: -8px 0; position: relative; z-index: 2; }
.swap-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--card); color: var(--tint); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--glass-strong), var(--shadow-sm); }
.swap-btn .ico { width: 17px; height: 17px; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.kv > div { display: contents; }
.kv span, .kv b { padding: 9px 14px; border-top: 0.5px solid var(--sep); font-size: 14px; }
.kv > div:first-child span, .kv > div:first-child b { border-top: 0; }
.kv span { color: var(--label-2); }
.kv b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.kv b.good { color: var(--green); } .kv b.warn { color: var(--orange); } .kv b.bad { color: var(--red); }

.budget { display: grid; grid-template-columns: 1fr 72px 72px; align-items: center; }
.budget > * { padding: 7px 0; border-top: 0.5px solid var(--sep); min-height: 40px; display: flex; align-items: center; }
.budget > .bh { border-top: 0; min-height: 30px; font-size: 12px; font-weight: 600; color: var(--label-2); justify-content: flex-end; padding-right: 4px; }
.budget > .bl { padding-left: 14px; font-size: 14px; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.2; }
.budget > .bl small { font-size: 11.5px; color: var(--label-2); }
.budget input.num { width: 100%; padding-right: 8px; }
.budget > .bh:first-child { justify-content: flex-start; padding-left: 14px; }

.note { font-size: 12.5px; color: var(--label-2); margin: 6px 6px 0; }
.note.warn { color: var(--orange); }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--card); font-size: 14px; align-items: flex-start; }
.callout .ico { color: var(--tint); margin-top: 1px; }
.callout.warn .ico { color: var(--orange); }
.empty-state { text-align: center; padding: 28px 16px; color: var(--label-2); }
.empty-state .ico { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--label-3); }
.empty-state b { display: block; color: var(--label); font-size: 17px; margin-bottom: 4px; }

details.disclosure > summary { list-style: none; cursor: pointer; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .ico { transition: transform .2s; width: 16px; height: 16px; }
details.disclosure[open] > summary .ico { transform: rotate(90deg); }

/* проекты */
.proj-head { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.proj-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { border: 0; background: none; color: var(--tint); display: inline-flex; align-items: center; gap: 2px; padding: 6px 4px; font-size: 16px; margin-left: -6px; }
.item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 12.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--label-3); flex: none; }
.dot.ok { background: var(--green); } .dot.warn { background: var(--orange); } .dot.bad { background: var(--red); }
.row.current { background: var(--tint-soft); }

/* ---------------- меню ---------------- */
.menu {
  position: fixed; z-index: 1000; min-width: 230px; max-width: 320px; padding: 6px 0;
  background: var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border-radius: 14px; box-shadow: 0 12px 50px rgba(0,0,0,.22), 0 0 0 0.5px var(--sep);
  opacity: 0; transform: scale(.96); transform-origin: top left; transition: opacity .14s, transform .14s;
}
.menu.in { opacity: 1; transform: none; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; border: 0; background: transparent; padding: 10px 16px; font-size: 15px; text-align: left; color: var(--label); }
.menu-item:hover { background: var(--fill); }
.menu-item.danger { color: var(--red); }
.menu-item .ico { width: 18px; height: 18px; color: var(--label-2); }
.menu-item.danger .ico { color: var(--red); }
.menu-item.on { color: var(--tint); font-weight: 600; }
.menu-sep { height: 0.5px; background: var(--sep); margin: 5px 0; }
.menu-header { padding: 6px 16px 8px; font-size: 12.5px; color: var(--label-2); border-bottom: 0.5px solid var(--sep); margin-bottom: 5px; }
.mh-coords { font-family: var(--mono); color: var(--label); font-size: 13px; }

.layer-pop { padding: 12px; min-width: 300px; }
.layer-pop h4 { margin: 4px 4px 8px; font-size: 12.5px; font-weight: 500; text-transform: uppercase; color: var(--label-2); letter-spacing: 0.02em; }
.layer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.layer-opt { border: 0; background: var(--fill); border-radius: 12px; padding: 10px 6px; font-size: 12.5px; font-weight: 500; min-height: 48px; line-height: 1.2; color: var(--label); }
.layer-opt.on { background: var(--tint); color: #fff; }
.layer-pop .row { padding: 6px 4px; }

/* ---------------- модальные окна ---------------- */
.modal-back { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .22s; padding: 20px; }
.modal-back.in { opacity: 1; }
.modal { width: 100%; max-width: 440px; max-height: min(86vh, 760px); display: flex; flex-direction: column; background: var(--bg); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.3); transform: scale(.96) translateY(10px); transition: transform .26s cubic-bezier(.3,.9,.3,1); overflow: hidden; }
[data-theme="dark"] .modal { background: #1c1c1e; }
[data-theme="dark"] .modal .group, [data-theme="dark"] .modal .point-card { background: #2c2c2e; }
.modal.wide { max-width: 560px; }
.modal-back.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 6px 20px; }
.modal-title { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-body { padding: 8px 18px 16px; overflow-y: auto; }
.modal-body p { margin: 4px 2px 10px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px calc(16px + var(--safe-b)); }
.modal-foot .btn { flex: 1; }
.calc-out { margin-top: 10px; }
.calc-out .kv b { font-weight: 600; }
.calc-desc { font-size: 13.5px; color: var(--label-2); margin: 0 4px 12px; }
.calc-formula { font-family: var(--mono); font-size: 12.5px; color: var(--label-2); background: var(--fill); padding: 8px 10px; border-radius: 10px; margin: 12px 0 0; white-space: pre-wrap; }

/* ---------------- тосты ---------------- */
.toasts { position: fixed; z-index: 1100; left: 50%; top: calc(66px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; opacity: 0; transform: translateY(-8px) scale(.98); transition: all .25s cubic-bezier(.3,.9,.3,1); max-width: 100%; }
.toast.in { opacity: 1; transform: none; }
.toast .ico { width: 18px; height: 18px; }
.toast.ok .ico { color: var(--green); }
.toast.error .ico { color: var(--red); }
.toast span { overflow: hidden; text-overflow: ellipsis; }

.cursor-hint { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; background: var(--glass-strong); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 10px; padding: 5px 9px; font-size: 12px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; border: 0.5px solid var(--glass-border); }
.cursor-hint b { font-family: var(--mono); font-weight: 500; font-size: 11.5px; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill-2); border-top-color: var(--label-2); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.acc-head { display: flex; align-items: center; gap: 14px; padding: 6px 4px 14px; }
.acc-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.acc-head b { font-size: 18px; display: block; }

/* ==========================================================================
   Телефон: панель превращается в шторку снизу
   ========================================================================== */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand-name { display: none; }
  .brand { padding: 0 7px; }
  .topbar { left: 10px; right: 10px; top: calc(10px + var(--safe-t)); }
  .map-ctrl { right: 10px; top: calc(62px + var(--safe-t)); }
  .dock { display: none; }
  .tab[data-tab="profile"] { display: none !important; }
  .tab[data-tab="profile"].on { display: block !important; }

  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: calc(100dvh - 56px - var(--safe-t));
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% - var(--sheet-h, 170px)));
    z-index: 18;
    transition: transform .34s cubic-bezier(.25,.9,.3,1);
    will-change: transform;
    padding-bottom: var(--safe-b);
    border-bottom: 0;
  }
  .panel.dragging { transition: none; }
  .sheet-head { padding: 0 12px 8px; touch-action: none; cursor: grab; }
  .sheet-grab { display: flex; justify-content: center; padding: 7px 0 7px; }
  .sheet-grab span { width: 38px; height: 5px; border-radius: 3px; background: var(--label-3); }
  #summary-mobile-slot { margin: 2px 0 10px; }
  .segmented .seg { font-size: 13px; padding: 6px 4px; }
  .panel-scroll { padding-bottom: calc(24px + var(--safe-b)); }
  #tab-profile #chart-wrap { height: 300px; }
  #tab-profile #chart { min-height: 240px; }
  .legend { padding-left: 4px; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; border-radius: 20px 20px 0 0; max-height: 92dvh; transform: translateY(40px); }
  .toasts { top: auto; bottom: calc(var(--sheet-h, 170px) + 12px); }
  .row { min-height: 48px; }
  .layer-pop { min-width: 0; width: calc(100vw - 20px); }
  .leaflet-bottom { bottom: var(--sheet-h, 170px); transition: bottom .34s cubic-bezier(.25,.9,.3,1); }
  .leaflet-control-attribution { font-size: 9px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Режим «Спутник»
   ========================================================================== */
.topbar { gap: 8px; }
.mode-switch { border-radius: 22px; padding: 4px; height: 44px; display: flex; align-items: center; margin-right: auto; }
.mode-switch .segmented { background: transparent; }
.mode-switch .seg { min-height: 34px; padding: 4px 14px; font-size: 14px; border-radius: 18px; }
.mode-switch .seg-thumb { border-radius: 18px; }
.mode-switch .seg .ico { width: 17px; height: 17px; }
body.mode-sat #chart-wrap, body.mode-link #sat-chart-wrap, body:not(.mode-sat) #sat-chart-wrap { display: none; }
#sat-chart-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#sat-chart { flex: 1; min-height: 150px; position: relative; }
.c-gridline { stroke: var(--sep); stroke-width: 0.5; }
.c-sat { stroke: var(--tint); stroke-width: 2; stroke-dasharray: 7 4; }
.c-sat.bad { stroke: var(--red); }
.c-label { fill: var(--tint); font-size: 11px; font-weight: 600; }
.pin-sat { background: linear-gradient(135deg, #bf5af2, #7d3cff); }
.pin-sat span { display: grid; place-items: center; }
.pin-sat .ico { width: 18px; height: 18px; color: #fff; }
.badge.sat { background: linear-gradient(135deg, #bf5af2, #7d3cff); }
.badge.sat .ico { width: 16px; height: 16px; }
.sat-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sat-title b { font-size: 18px; letter-spacing: -0.01em; }
.sat-title span { color: var(--tint); font-weight: 600; white-space: nowrap; }
.sat-sub { font-size: 12.5px; color: var(--label-2); margin-top: 2px; }
.el-badge { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--label)); flex: none; }
.el-badge.warn { background: color-mix(in srgb, var(--orange) 18%, transparent); color: color-mix(in srgb, var(--orange) 75%, var(--label)); }
.el-badge.bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: color-mix(in srgb, var(--red) 75%, var(--label)); }
.list-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--label-2); padding: 10px 14px 4px; background: var(--fill); }
.sat-list .row.link-row { min-height: 50px; }
a.row { color: var(--tint); text-decoration: none; }
.band-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.band-tag { background: var(--tint); color: #fff; font-weight: 700; font-size: 12px; border-radius: 6px; padding: 2px 7px; }
.band-row { display: grid; grid-template-columns: 118px 1fr; gap: 8px; font-size: 13.5px; padding: 3px 0; }
.band-row > span { color: var(--label-2); }
.dish-table .dt-head, .dish-table .dt-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; padding: 7px 14px; font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
.dish-table .dt-head > :first-child, .dish-table .dt-row > :first-child { text-align: left; }
.dish-table .dt-head { color: var(--label-2); font-size: 12px; font-weight: 600; }
.dish-table .dt-row { border-top: 0.5px solid var(--sep); }
.dish-table .dt-row.no { color: var(--label-3); }
.dish-table .dt-row.rec { background: color-mix(in srgb, var(--green) 14%, transparent); font-weight: 600; }
.dish-table .note { margin: 0; }
@media (max-width: 760px) {
  .mode-switch { height: 44px; }
  .mode-switch .seg { padding: 4px 11px; font-size: 13px; }
  .mode-switch .seg .ico { display: none; }
  .top-actions { gap: 6px; }
  .account-btn .acc-name { display: none; }
  .account-btn, .account-btn.anon { padding: 0; width: 44px; justify-content: center; }
  #tab-profile #sat-chart-wrap { height: 300px; }
  #tab-profile #sat-chart { min-height: 240px; }
}

/* транспондеры */
.tp-ctl { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tp-table { max-height: 360px; overflow-y: auto; }
.tp-table .tp-head, .tp-table .tp-row { display: grid; grid-template-columns: 1.35fr .5fr .9fr 1.7fr .8fr; gap: 6px; padding: 6px 14px; font-size: 13px; font-variant-numeric: tabular-nums; align-items: baseline; }
.tp-table .tp-head { color: var(--label-2); font-size: 12px; font-weight: 600; position: sticky; top: 0; background: var(--card); z-index: 1; }
.tp-table .tp-row { border-top: 0.5px solid var(--sep); }
.tp-table .tp-row > :nth-child(3), .tp-table .tp-row > :nth-child(5), .tp-table .tp-head > :nth-child(3), .tp-table .tp-head > :nth-child(5) { text-align: right; }
.tp-table .tp-row.ref { background: color-mix(in srgb, var(--tint) 12%, transparent); font-weight: 600; }
.tp-table .tp-row i { display: block; font-style: normal; font-weight: 500; font-size: 11px; color: var(--tint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* условия, участки, сценарии */
.callout.ok .ico { color: var(--green); }
.kv span small { display: block; font-size: 12px; color: var(--label-3); margin-top: 1px; }
.kv > div.worst span, .kv > div.worst b { background: color-mix(in srgb, var(--orange) 9%, transparent); }
.segs { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.segs > .btn { align-self: flex-start; }
.seg-card { background: var(--card); border-radius: var(--r-md); padding: 8px 10px 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.seg-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.seg-line input.num { width: 58px; background: var(--fill); border-radius: 7px; padding: 4px 6px; font-weight: 600; }
.seg-line .icon-btn { margin-left: auto; }
.seg-line select { flex: 1 1 0; min-width: 0; }
.seg-line { flex-wrap: nowrap; }
.seg-dsm { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-2); }
.seg-dsm input { width: 16px; height: 16px; accent-color: var(--tint); }
.c-clutter.veg { fill: var(--clutter); }
.c-clutter.hard { fill: var(--clutter-hard, rgba(142, 142, 147, .45)); }
.c-veg-ray { stroke: var(--green); stroke-width: 3; stroke-dasharray: 2 3; fill: none; opacity: .9; }

/* кабель, сложность трассы */
.cable-box + .cable-box { border-top: 0.5px solid var(--sep); }
.cable-body { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.cable-body .seg-line select { flex: 1 1 0; }
.cable-out { color: var(--label-2); font-size: 12.5px; line-height: 1.35; }
.cable-out b { color: var(--label); }
.budget input.num:disabled { color: var(--label-3); background: transparent; }
.section-sub { font-size: 12px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; margin: 14px 4px 6px; }
.kv b b { font-weight: 600; }
.kv b b.warn { color: var(--orange); }
.kv b small { display: block; }
/* градиент уровня в легенде профиля */
.legend i.box.grad, i.box.grad { width: 34px; background: linear-gradient(90deg, hsl(0 80% 44%), hsl(34 80% 44%), hsl(68 80% 44%), hsl(101 80% 44%), hsl(135 80% 44%)); }
.kv.wide { grid-template-columns: minmax(84px, 30%) 1fr; }
.kv.wide b small { color: var(--label-3); font-weight: 400; font-size: 12px; margin-top: 2px; }
.dish-table .dt-row.mine { outline: 1.5px solid var(--tint); outline-offset: -1.5px; border-radius: 6px; }
b.point-name { padding: 4px 6px; }
.gap-row { margin-top: 4px; }
.gap-row .gap-l { flex: none; width: 16px; font-weight: 700; font-size: 13px; color: var(--label-2); }
.gap-row .num { width: 52px; }

/* аватар */
.avatar.av-ini, .avatar.av-preset { color: #fff; font-weight: 600; letter-spacing: .02em; }
.avatar.av-preset svg { width: 58%; height: 58%; stroke: #fff; }
.av-edit { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; flex: none; }
.av-edit .av-badge { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-elev, var(--card)); }
.av-edit .av-badge svg { width: 13px; height: 13px; }
.av-preview { display: grid; place-items: center; padding: 4px 0 14px; }
.avatar.av-big { width: 96px; height: 96px; font-size: 34px; }
.avatar.av-mini { width: 28px; height: 28px; font-size: 11px; flex: none; }
.row.action .avatar.av-mini { margin-right: 2px; }
.av-pick { padding: 12px 14px; }
.av-colors { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.av-dot { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.0); }
.av-dot.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--tint); }
.av-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.av-ico { aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; }
.av-ico svg { width: 55%; height: 55%; stroke: #fff; }
.av-ico:hover { filter: brightness(1.08); }

/* плашка «Вышла новая версия» */
.toast.update-toast { pointer-events: auto; padding: 6px 6px 6px 16px; gap: 10px; }
.toast.update-toast .btn.small { width: auto; flex: none; }
.toast.update-toast .icon-btn { width: 28px; height: 28px; font-size: 18px; line-height: 1; flex: none; }

/* логотип — ссылка на главную */
a.brand { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.brand:hover .brand-name { color: var(--tint); }

/* разделы сайта внизу панели (на всех вкладках) */
.panel-scroll { display: flex; flex-direction: column; }
.panel-scroll > .tab { flex: none; }
.panel-foot { margin-top: auto; padding: 18px 4px 2px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12.5px; }
.panel-foot a { color: var(--label-3); text-decoration: none; }
.panel-foot a:hover { color: var(--tint); }
a.row.page-link { color: inherit; text-decoration: none; }

/* комплект точки (антенна / оборудование из пресетов) */
.point-kit { font-size: 12.5px; color: var(--label-2); margin-top: 6px; line-height: 1.35; }
.point-kit[hidden] { display: none; }
.kit-out:empty { display: none; }
.kit-out .callout { margin-top: 10px; }
.kit-out .btn.small { width: auto; }
.note.disclaimer { margin-top: 12px; font-size: 12px; }
input.num.invalid { color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); border-radius: 6px; }

/* ---------- лес и постройки на профиле ---------- */
.chart-tools { position: absolute; left: 50px; top: 6px; display: flex; gap: 6px; align-items: center; z-index: 3; flex-wrap: wrap; pointer-events: none; }
.chart-tool { pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 13px; border: 0.5px solid var(--sep); background: var(--glass-strong); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--label-2); font-size: 12.5px; font-weight: 600; }
.chart-tool .ico { width: 15px; height: 15px; }
.chart-tool:hover { color: var(--label); }
.chart-tool.on { background: var(--tint); border-color: var(--tint); color: #fff; }
.chart-tool-hint { font-size: 12px; color: var(--label-2); background: var(--glass-strong); padding: 3px 8px; border-radius: 8px; }
.chart-svg.drawing { cursor: crosshair; touch-action: none; }
.c-obj { fill: transparent; stroke: none; cursor: pointer; }
.c-obj.forest { stroke: rgba(40, 167, 69, .55); stroke-width: 1; stroke-dasharray: 3 3; }
.c-obj.urban { stroke: rgba(142, 142, 147, .8); stroke-width: 1; stroke-dasharray: 3 3; }
.c-obj.sel { stroke-width: 2; stroke-dasharray: none; cursor: grab; touch-action: none; }
.c-obj.sel.forest { stroke: #28a745; fill: rgba(40, 167, 69, .12); }
.c-obj.sel.urban { stroke: #8e8e93; fill: rgba(142, 142, 147, .15); }
.c-obj.live.forest { fill: rgba(40, 167, 69, .3); stroke: #28a745; }
.c-obj.live.urban { fill: rgba(142, 142, 147, .35); stroke: #8e8e93; }
.c-h { fill: transparent; touch-action: none; }
.c-h.ew { cursor: ew-resize; }
.c-h.ns { cursor: ns-resize; }
.c-h-edge { stroke: var(--tint); stroke-width: 2; pointer-events: none; }
.c-h-grip { fill: #fff; stroke: var(--tint); stroke-width: 1.5; pointer-events: none; }
.c-h-dot { fill: var(--tint); stroke: #fff; stroke-width: 2; pointer-events: none; }
.chart-obj { position: absolute; top: 4px; right: 14px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 12px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); border: 0.5px solid var(--sep); font-size: 13px; white-space: nowrap; }
.chart-obj[hidden] { display: none; }
.chart-obj-types { display: inline-flex; background: var(--fill); border-radius: 8px; padding: 2px; }
.chart-obj-types button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; border-radius: 6px; padding: 3px 8px; font-size: 12.5px; font-weight: 600; color: var(--label-2); }
.chart-obj-types button.on { background: var(--bg-elev, #fff); color: var(--label); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.chart-obj-types .ico { width: 14px; height: 14px; }
.chart-obj-h input { width: 42px; text-align: right; }
.chart-obj-range { color: var(--label-2); font-variant-numeric: tabular-nums; }
.chart-obj-del, .chart-obj-x { border: 0; background: none; width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--label-2); padding: 0; }
.chart-obj-del:hover { color: var(--red); background: var(--fill); }
.chart-obj-x:hover { background: var(--fill); }
.chart-obj-del .ico, .chart-obj-x .ico { width: 16px; height: 16px; }
.seg-card.forest { border-left: 3px solid rgba(40, 167, 69, .7); }
.seg-card.urban { border-left: 3px solid rgba(142, 142, 147, .8); }
.seg-add { margin-top: 8px; }
.seg-add { flex-wrap: nowrap; gap: 6px; }
.seg-add .btn { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; }
.seg-species { margin-left: auto; max-width: 150px; }
.chip-btn.small { padding: 2px 4px; min-height: 0; }

.c-cursor, .c-cursor * { pointer-events: none; }
.chart-tools[hidden] { display: none; }
@media (max-width: 760px) {
  .chart-obj { left: 6px; right: 6px; top: 2px; flex-wrap: wrap; white-space: normal; justify-content: space-between; }
  .chart-tools { left: 40px; }
}
@media (max-width: 760px) { .chart-obj-range { display: none; } .chart-obj { flex-wrap: nowrap; } }

/* подписи леса и построек на карте */
.seg-pill-wrap { background: none; border: 0; }
.seg-pill { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 5px; border-radius: 10px; font: 700 11.5px/1.2 var(--font); color: #fff; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; border: 1.5px solid #fff; }
.seg-pill .ico { width: 13px; height: 13px; }
.seg-pill.forest { background: #0d5c2e; }
.seg-pill.urban { background: #4a4a52; }

/* шапка графика: «+ Объект» / свойства объекта слева, данные точки справа */
.chart-head { position: absolute; left: 0; right: 0; top: 0; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 2px 8px 2px 44px; z-index: 3; }
.chart.has-head .chart-svg { inset: auto 0 0 0; }
.ch-left { display: flex; align-items: center; gap: 8px; flex: none; }
.ch-info { flex: 1; min-width: 0; display: flex; gap: 4px 12px; justify-content: flex-end; align-items: baseline; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--label-2); mask-image: linear-gradient(90deg, transparent 0, #000 16px); -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px); }
.ch-info .ci { display: inline-flex; gap: 4px; align-items: baseline; }
.ch-info .ci i { font-style: normal; color: var(--label-3); }
.ch-info .ci b { font-weight: 650; color: var(--label); font-variant-numeric: tabular-nums; }
.ch-info .ci b.bad { color: var(--red); } .ch-info .ci b.warn { color: var(--orange, #f08c00); } .ch-info .ci b.ok { color: var(--green); }
.ch-info .ci.km b { color: var(--tint); }
.ch-info .ci.idle { color: var(--label-3); }
.ch-add { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px 0 8px; border-radius: 14px; border: 0; background: var(--tint); color: #fff; font-size: 13px; font-weight: 600; }
.ch-add .ico { width: 16px; height: 16px; }
.ch-types { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.ch-types button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; border-radius: 7px; padding: 3px 9px; font-size: 12.5px; font-weight: 600; color: var(--label-2); }
.ch-types button .ico { width: 14px; height: 14px; }
.ch-types button.forest.on { background: #28a745; color: #fff; }
.ch-types button.urban.on { background: #6b6b75; color: #fff; }
.ch-h { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--label-2); }
.ch-h input { width: 44px; text-align: right; background: var(--fill); border: 0; border-radius: 7px; padding: 4px 6px; font-weight: 600; color: var(--label); }
.ch-range { font-size: 12px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.ch-icon { border: 0; background: none; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--label-2); padding: 0; }
.ch-icon .ico { width: 17px; height: 17px; }
.ch-icon.del:hover { color: var(--red); background: var(--fill); }
.ch-done { border: 0; background: var(--fill); color: var(--tint); font-weight: 600; font-size: 12.5px; border-radius: 8px; height: 28px; padding: 0 10px; }
.chart-tip { display: none !important; }
.seg-add-forest { color: #1f8f3a !important; }
.seg-add-urban { color: var(--label-2) !important; }
@media (max-width: 760px) {
  .chart-head { flex-wrap: wrap; padding-left: 8px; row-gap: 2px; }
  .ch-left { flex-wrap: wrap; }
  .ch-info { flex-basis: 100%; justify-content: flex-start; font-size: 11.5px; mask-image: none; -webkit-mask-image: none; }
  .ch-range { display: none; }
}
