/* Метромапия: тёмный тоннель, жёлтый свет натриевых ламп, белые таблички. */
:root {
  --bg: #161B26;        /* тоннель */
  --panel: #1F2533;     /* щиты */
  --panel-2: #283043;
  --line: #343D52;      /* кабельные лотки */
  --ink: #E8E4D8;       /* табличка */
  --ink-2: #A9AFBE;
  --ink-3: #757D90;
  --amber: #F0A830;     /* лампа */
  --amber-dim: #8A6420;
  --ok: #3FB37F;
  --bad: #E5484D;
  --r-s: 6px; --r-m: 12px; --r-l: 20px;
  --f-ui: "Onest", system-ui, sans-serif;
  --f-disp: "Tektur", "Onest", sans-serif;
  --shadow: 0 18px 50px -12px rgba(5, 8, 14, .7);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-disp); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }

/* ---------- карта ---------- */
#map { position: fixed; inset: 0; background: #12161F; }
.leaflet-container { font: inherit; background: #12161F; }
.leaflet-tile-pane { filter: saturate(.6) brightness(.85) contrast(1.05); }
/* Спутник: снимок притушен, у линий светлая обводка — читаются на любой застройке */
.sat .leaflet-tile-pane { filter: saturate(.75) brightness(.7); }
.sat path.casing { stroke: #F4F1E8; stroke-width: 9px; stroke-opacity: .95; }
.basesw { display: flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.basesw button { border: 0; background: none; color: var(--ink-2); font: 600 13px var(--f-ui); padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease), transform .15s var(--ease); }
.basesw button:active { transform: scale(.95); }
.basesw button[aria-pressed="true"] { background: var(--amber); color: #14171F; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; margin-bottom: 52px !important; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(22, 27, 38, .75) !important; color: var(--ink-3) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-tooltip { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow); font-size: 13px; }
.leaflet-tooltip-top:before, .leaflet-tooltip-bottom:before, .leaflet-tooltip-left:before, .leaflet-tooltip-right:before { display: none; }
.leaflet-popup-content-wrapper { background: var(--panel); color: var(--ink); border-radius: var(--r-m); box-shadow: var(--shadow); border: 1px solid var(--line); }
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { margin: 14px 16px; font-size: 14px; line-height: 1.45; max-height: 50vh; overflow: auto; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-3); }

/* первая загрузка: линии прокладываются */
.draw-in { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.st-label { color: var(--ink); font-size: 11.5px; font-weight: 500; white-space: nowrap; text-shadow: 0 0 3px #12161F, 0 0 3px #12161F, 0 0 6px #12161F; pointer-events: none; transform: translate(8px, -8px); }

.uo { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--bg); border: 3px solid var(--amber); box-shadow: 0 0 0 4px rgba(240, 168, 48, .18), 0 0 18px rgba(240, 168, 48, .45); }
.uo.restricted { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(229, 72, 77, .18); }
.bunker { width: 22px; height: 22px; margin: -11px 0 0 -11px; display: grid; place-items: center; background: var(--ink); color: var(--bg); border-radius: 5px; font: 800 11px var(--f-disp); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--ink); }
.rp { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--c, #8a93a3); border: 1.5px solid #12161F; }
.rp.yes { background: #e8590c; } .rp.unknown { background: #8a93a3; } .rp.no { background: #5d6577; }
.rp.sq { border-radius: 2px; }
.rp b { position: absolute; left: 12px; top: -4px; font: 600 10px var(--f-ui); color: var(--ink-2); white-space: nowrap; text-shadow: 0 0 3px #12161F; }
.pick { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px dashed var(--amber); background: rgba(240, 168, 48, .15); }

.card h3 { font-size: 16px; margin-bottom: .3em; }
.card p { margin: .35em 0; color: var(--ink-2); }
.card .tag { display: inline-block; font-size: 12px; color: var(--ink-3); }
.card img { width: 100%; border-radius: var(--r-s); margin: 6px 0; display: block; aspect-ratio: 3/2; object-fit: cover; }
.card .links a { margin-right: 8px; font-size: 13px; }
.card .warn { color: #ffb4b4; }

/* ---------- верхняя панель ---------- */
.bar { position: fixed; z-index: 1000; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--amber); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.brand svg circle { fill: var(--ink); stroke: none; }
.brand span { font: 800 18px var(--f-disp); letter-spacing: .02em; }
.search { position: relative; flex: 0 1 360px; }
.search input { width: 100%; padding: 11px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); }
.search input::placeholder { color: var(--ink-3); }
#results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
#results li { padding: 8px 10px; border-radius: var(--r-s); cursor: pointer; display: flex; gap: 10px; align-items: center; }
#results li[aria-selected="true"], #results li:hover { background: var(--panel-2); }
#results small { color: var(--ink-3); margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--amber)); }
.actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); color: #1A1406; border-color: var(--amber); }
.btn.primary:hover { background: #F5BA52; }
.btn.danger { color: #ffb4b4; border-color: #5a2a2d; }
.btn.ok { color: #9be3c1; border-color: #24533f; }
.btn.small { padding: 6px 10px; font-size: 13px; box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: progress; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.role { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--panel-2); color: var(--ink-2); font-weight: 600; }
.role.admin, .role.moderator { color: var(--amber); }
.role.special { color: #ffb4b4; }

/* ---------- боковая панель / шторка ---------- */
.panel { position: fixed; z-index: 1100; top: 76px; right: 12px; bottom: 12px; width: min(420px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide-in .28s var(--ease); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.panel-body { overflow: auto; padding: 22px 22px 26px; flex: 1; }
.panel h2 { font-size: 22px; padding-right: 30px; }
.close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; }
.close:hover { color: var(--ink); }
.muted { color: var(--ink-3); }
.lead { color: var(--ink-2); }

/* слои */
.layers h3 { font-size: 14px; color: var(--ink-2); margin: 18px 0 8px; font-family: var(--f-ui); font-weight: 600; }
.layers label { display: flex; align-items: center; gap: 10px; padding: 7px 4px; cursor: pointer; border-radius: var(--r-s); }
.layers label:hover { background: var(--panel-2); }
.layers input { accent-color: var(--amber); width: 16px; height: 16px; }
.sw { width: 22px; height: 4px; border-radius: 2px; background: var(--c); flex: none; }
.sw.dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 9px); }
.sw.pt { width: 10px; height: 10px; border-radius: 50%; margin: 0 6px; }
.restricted-box { margin-top: 18px; padding: 12px 14px 8px; border: 1px solid #5a2a2d; border-radius: var(--r-m); background: rgba(229, 72, 77, .06); }
.restricted-box > p { margin: 0 0 6px; font-size: 13px; color: #ffb4b4; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
details p, details li { font-size: 13px; color: var(--ink-2); }
.lines-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.lines-legend button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px; cursor: pointer; text-align: left; font-size: 13px; color: var(--ink-2); border-radius: var(--r-s); }
.lines-legend button:hover { background: var(--panel-2); color: var(--ink); }
/* пиктограмма линии в духе навигации метро (Студия Лебедева): кружок цвета линии, белая цифра гротеском; Moscow Sans не берём: права на веб-раздачу
   не подтверждены, вместо него открытый гротеск Onest (уже грузим) */
.ln { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff;
  font: 700 11px/1 var(--f-ui); letter-spacing: -.02em; box-shadow: 0 0 0 1px rgba(0,0,0,.25); vertical-align: -5px; margin-right: 6px; }
.lines-legend .ln { margin: 0; }
/* выход: скруглённый квадрат, белая цифра, графит как на указателях «Выход N» */
.exit { min-width: 18px; height: 18px; padding: 0 3px; margin: -9px 0 0 -9px; box-sizing: border-box; display: grid; place-items: center; border-radius: 4px;
  background: #2E333D; color: #fff; font: 700 11px/1 var(--f-ui); box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); cursor: pointer; }
.exit.w { margin-left: -12px; }
.exit.inl { display: inline-grid; margin: 0 4px 0 0; vertical-align: 2px; box-shadow: none; }
.sw.exit-sw { width: 12px; height: 12px; margin: 0 5px; background: #2E333D; border-radius: 3px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }

/* формы */
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--ink-3); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search]:not(#q), select, textarea {
  width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); }
input:focus, select:focus, textarea:focus { border-color: var(--amber-dim); outline: none; box-shadow: 0 0 0 3px rgba(240, 168, 48, .15); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.md { min-height: 220px; font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { margin-top: 3px; accent-color: var(--amber); width: 16px; height: 16px; flex: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--bg); border-radius: var(--r-m); border: 1px solid var(--line); }
.seg button { padding: 9px; border: 0; border-radius: var(--r-s); background: none; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--amber); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.err { color: #ffb4b4; font-size: 14px; min-height: 0; margin: 0; }
.err:empty { display: none; }
.hint { padding: 10px 12px; border-radius: var(--r-s); background: rgba(240, 168, 48, .08); border: 1px solid rgba(240, 168, 48, .25); font-size: 13px; color: var(--ink-2); margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.thumbs figure { margin: 0; position: relative; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); display: block; }
.thumbs button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
.thumbs figure.gone img { opacity: .25; }

/* капча */
.cap { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-s); font-size: 13px; color: var(--ink-3); }
.cap i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; }
.cap.work i { border-color: var(--amber) transparent var(--amber) transparent; animation: spin .8s linear infinite; }
.cap.done { color: var(--ok); border-color: #24533f; }
.cap.done i { border-color: var(--ok); background: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- страница поверх карты ---------- */
.page { position: fixed; inset: 0; z-index: 1200; overflow: auto; background: var(--bg); animation: rise .32s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.page-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(22, 27, 38, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.page-top .brand { box-shadow: none; padding: 6px 10px 6px 6px; }
.page-top .sp { flex: 1; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px 80px; }

.hero { position: relative; margin: 0 -20px; height: clamp(220px, 34vw, 360px); overflow: hidden; border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 40px, #131823; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(19, 24, 35, .92) 80%); pointer-events: none; }
.hero svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .ln { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.hero .obj { fill: none; stroke: var(--amber); stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(240, 168, 48, .7)); }
.hero .st circle { fill: #131823; stroke: var(--ink); stroke-width: 2.5; }
.hero .st text { fill: var(--ink-2); font: 500 15px var(--f-ui); paint-order: stroke; stroke: #131823; stroke-width: 5px; }
.hero .pin circle { fill: none; stroke: var(--amber); }
.hero .pin .core { fill: var(--amber); stroke: none; }
.hero .ring { animation: ring 2.6s var(--ease) infinite; transform-origin: center; transform-box: fill-box; }
@keyframes ring { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.2); } }

.obj-head { padding: 28px 0 8px; }
.obj-head h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; margin-bottom: 12px; text-wrap: balance; }
.kind { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel-2); }
.badge.pending { color: var(--amber); } .badge.rejected { color: var(--bad); } .badge.restricted { color: #ffb4b4; background: rgba(229, 72, 77, .12); }
.credit { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 20px 0 6px; padding: 16px 18px; background: var(--panel); border-left: 3px solid var(--amber); border-radius: 0 var(--r-m) var(--r-m) 0; font-size: 14px; }
.credit dt { color: var(--ink-3); }
.credit dd { margin: 0; color: var(--ink); }
.article { font-size: 17px; line-height: 1.68; max-width: 68ch; margin: 28px 0; }
.article h1, .article h2, .article h3 { margin: 1.4em 0 .5em; }
.article h2 { font-size: 24px; } .article h3 { font-size: 19px; }
.article img { max-width: 100%; border-radius: var(--r-m); }
.article blockquote { margin: 1em 0; padding: 4px 18px; border-left: 3px solid var(--line); color: var(--ink-2); }
.article code { background: var(--panel); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.article pre { background: var(--panel); padding: 14px; border-radius: var(--r-m); overflow: auto; }
.article table { border-collapse: collapse; } .article td, .article th { border: 1px solid var(--line); padding: 6px 10px; }
.sect { margin: 40px 0 14px; font-size: 22px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--r-m); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.gallery button:hover img { transform: scale(1.04); }
.videos { display: grid; gap: 12px; }
.videos video, .videos iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r-m); background: #000; }
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sources a { display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.sources a:hover { border-color: var(--amber-dim); }
.sources .fav { grid-row: span 2; width: 34px; height: 34px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; font: 700 14px var(--f-disp); color: var(--amber); }
.sources small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px; margin: 18px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); }
.modbar .muted { font-size: 13px; flex-basis: 100%; }
.comments { display: grid; gap: 12px; }
.cmt { padding: 14px 16px; background: var(--panel); border-radius: var(--r-m); }
.cmt.hidden { opacity: .55; border: 1px dashed #5a2a2d; }
.cmt header { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.cmt header b { color: var(--ink); font-weight: 600; }
.cmt header .row { margin-left: auto; }
.cmt p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 10, 15, .94); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .2s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-s); }
@keyframes fade { from { opacity: 0; } }

/* модерация и правила */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.tabs a { padding: 8px 14px; border-radius: 99px; background: var(--panel); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--amber); color: #1A1406; }
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 16px; background: var(--panel); border-radius: var(--r-m); border: 1px solid var(--line); }
.item h3 { font-size: 16px; margin: 0; font-family: var(--f-ui); }
.item h3 a { color: var(--ink); text-decoration: none; }
.item p { margin: 0; color: var(--ink-2); font-size: 14px; grid-column: 1; }
.item .row { grid-row: span 2; grid-column: 2; justify-content: flex-end; }
.empty { padding: 30px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--r-m); }
.doc { font-size: 16px; line-height: 1.7; max-width: 72ch; }
.doc h2 { font-size: 26px; margin-top: 1.8em; scroll-margin-top: 80px; }
.doc h3 { font-size: 18px; margin-top: 1.4em; }
.doc li { margin: .3em 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.toc a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.page h1.title { font-size: clamp(28px, 5vw, 40px); margin: 30px 0 6px; }

/* подвал */
.foot { position: fixed; z-index: 900; left: 12px; bottom: 10px; display: flex; gap: 14px; font-size: 12px; padding: 6px 12px; background: rgba(22, 27, 38, .78); border-radius: var(--r-s); backdrop-filter: blur(6px); }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

#toast { position: fixed; z-index: 3000; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 12px 18px; background: var(--ink); color: var(--bg); border-radius: var(--r-m); font-weight: 600; box-shadow: var(--shadow); animation: rise .25s var(--ease); max-width: calc(100vw - 32px); }
#toast.bad { background: var(--bad); color: #fff; }

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  .bar { top: 8px; left: 8px; right: 8px; flex-wrap: wrap; gap: 8px; }
  .brand span { display: none; }
  .brand { padding: 8px; }
  .search { flex: 1 1 0; min-width: 0; }
  .actions { margin-left: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; }
  .actions .btn { padding: 9px 10px; }
  .who .name { display: none; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 78vh; border-radius: var(--r-l) var(--r-l) 0 0; border-bottom: 0; animation: sheet .3s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .panel::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .panel-body { padding: 22px 16px 22px; }
  .foot { left: 8px; bottom: 6px; gap: 10px; font-size: 11px; }
  .foot a:nth-child(2) { display: none; }
  /* атрибуция во всю ширину внизу, подвал над ней слева, переключатель подложки выше подвала */
  .leaflet-control-attribution { max-width: calc(100vw - 16px); line-height: 1.4; }
  .foot { bottom: 36px; }
  .basesw { margin-bottom: 40px !important; }
  .leaflet-control-zoom { display: none; }
  .wrap { padding: 0 16px 60px; }
  .hero { margin: 0 -16px; }
  .row2 { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; }
  .item .row { grid-row: auto; grid-column: 1; justify-content: flex-start; }
  .article { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .draw-in { stroke-dashoffset: 0; }
}
.rp b { display: none; }
.z15 .rp b { display: block; }
form.dropping { outline: 2px dashed var(--amber); outline-offset: 4px; }
/* ---------- контекстное меню ---------- */
.ctx { position: fixed; z-index: 2000; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 6px; background: rgba(31, 37, 51, .96); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow);
  opacity: 0; transform: scale(.92) translateY(-4px); transition: opacity .14s var(--ease), transform .18s var(--ease); }
.ctx.open { opacity: 1; transform: none; }
.ctx-h { padding: 6px 10px 8px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ctx button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink); font: 500 14px var(--f-ui); cursor: pointer; }
.ctx button:hover, .ctx button:focus-visible { background: var(--panel-2); outline: none; box-shadow: inset 2px 0 0 var(--amber); }
.ctx button.bad { color: var(--bad); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.pick.here { animation: ring-in .4s var(--ease); }
@keyframes ring-in { from { transform: scale(2.4); opacity: 0; } }
/* ---------- вики ---------- */
.wtabs { margin: 18px 0 10px; }
.tabs small { opacity: .7; font-size: 12px; margin-left: 2px; }
.wmeta { font-size: 13px; margin: 0 0 18px; }
.wedit .md { min-height: 260px; font: 14px/1.55 ui-monospace, monospace; }
.wedit .preview { min-height: 260px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-s); }
.seg.small { display: inline-flex; padding: 2px; } .seg.small button { padding: 4px 10px; font-size: 13px; }
.hist .diff { margin-top: 10px; grid-column: 1 / -1; font: 12.5px/1.5 ui-monospace, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 0; overflow-x: auto; animation: fade .2s; }
.diff .d { padding: 0 10px; white-space: pre-wrap; word-break: break-word; }
.diff .d b { display: inline-block; width: 1.2em; color: var(--ink-3); }
.diff .add { background: rgba(63, 179, 127, .14); } .diff .del { background: rgba(229, 72, 77, .14); text-decoration: line-through; text-decoration-color: rgba(229, 72, 77, .5); }
.diff .gap { color: var(--ink-3); }
.upl { display: grid; gap: 12px; margin-top: 14px; }
.drop { display: grid; gap: 4px; place-items: center; text-align: center; padding: 22px; border: 2px dashed var(--line); border-radius: var(--r-m); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--amber-dim); background: rgba(240, 168, 48, .05); }
.drop span { font-weight: 600; } .drop small { color: var(--ink-3); }
.upl-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--panel-2); font-size: 13px; animation: rise .2s var(--ease); }
.chip button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.gallery figure { margin: 0; } .gallery figcaption, .videos figcaption { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
/* ---------- правка положения ---------- */
.geom-bar { position: fixed; z-index: 1500; left: 50%; bottom: 20px; width: min(520px, calc(100vw - 32px)); padding: 14px 16px; display: grid; gap: 8px; background: rgba(31, 37, 51, .97); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow);
  transform: translate(-50%, 30px); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
.geom-bar.open { transform: translate(-50%, 0); opacity: 1; }
.geom-bar p { margin: 0; font-size: 13px; }
.vx { width: 18px; height: 18px; border-radius: 50%; background: var(--amber); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--amber); cursor: grab; transition: transform .12s; }
.vx:hover { transform: scale(1.25); } .vx.mid { background: var(--bg); border-color: var(--amber); opacity: .75; transform: scale(.7); }
/* ---------- схема путей ---------- */
.layout-box { margin: 10px 0 12px; padding: 12px; background: #11151F; border: 1px solid var(--line); border-radius: var(--r-m); overflow-x: auto; }
.layout-box.editing { touch-action: none; cursor: crosshair; }
.layout { display: block; width: 100%; min-width: 480px; height: auto; }
.layout .lt { fill: none; stroke-width: .35; stroke-linecap: round; stroke-linejoin: round; }
.layout .lt.side { stroke-dasharray: .6 .4; stroke-width: .28; }
.layout .lp { fill: #3a4357; stroke: #8a93a3; stroke-width: .08; }
.layout .ls circle { fill: #11151F; stroke: var(--ink); stroke-width: .12; } .layout .ls path { stroke: var(--ink); stroke-width: .12; }
.layout .le path { stroke: var(--bad); stroke-width: .3; stroke-linecap: round; }
.layout .lx { fill: var(--ink-2); font: 600 1.1px var(--f-ui); }
.layout-box.editing [data-i]:hover { filter: drop-shadow(0 0 .3px var(--amber)); }
.pop-layout .layout { min-width: 0; margin: 6px 0; background: #11151F; border-radius: var(--r-s); }
.lay-tools { display: flex; flex-wrap: wrap; } .lay-opts { margin: 8px 0; gap: 10px; font-size: 13px; } .lay-opts input { width: 70px; }
.lay-hint { font-size: 13px; margin: 0 0 8px; }
@media (max-width: 760px) { .geom-bar { bottom: 10px; } .ctx button { padding: 12px; } }
.here-list a.item { text-decoration: none; color: var(--ink); display: block; } .here-list a.item h3 { display: flex; align-items: center; gap: 8px; color: var(--ink); } .here-list a.item:hover { border-color: var(--amber-dim); }
