/* Общие элементы из приложения (инструменты, карта, досье) — в панели перекрашены её токенами.
   Сгенерировано из style.css; стили самой панели — в panel.css. */
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sig); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.cap { font: 700 10.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }
::selection { background: rgba(var(--sig-rgb), .4); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(var(--ok-rgb), .7); animation: blink 2s ease-in-out infinite; }
.dot.err { background: var(--threat); }
.dot.warn { background: var(--warn); }
@keyframes blink { 50% { opacity: .35; } }
/* ---------- карточки и элементы ---------- */
.card { background: linear-gradient(180deg, var(--card), #27282d); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .04); }
.card.flat { background: var(--bg2); box-shadow: none; }
.card.threat { background: linear-gradient(180deg, #3a2027, #2a2024); border-color: rgba(var(--threat-rgb), .5); }
.card.sig { background: rgba(var(--sig-rgb), .08); border-color: rgba(var(--sig-rgb), .4); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 20px 2px 10px; }
.section-title h2 { font: 700 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.section-title h2::before { content: ''; width: 14px; height: 3px; background: var(--sig); border-radius: 2px; }
.section-title .cap { color: var(--sig); text-decoration: none; }

/* сетка показателей */
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.kv > div { background: var(--card); padding: 10px 12px; min-width: 0; }
.kv small { display: block; font: 700 9.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.kv b { display: block; font: 800 24px var(--display); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.kv .small { font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
  border: 1px solid var(--line2); background: var(--card2); border-radius: 12px; padding: 10px 16px; cursor: pointer;
  font: 700 14px var(--display); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; color: var(--text); white-space: nowrap;
  transition: transform .12s var(--ease), background .2s, border-color .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--sig); color: var(--sig-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(var(--sig-rgb), .35); }
.btn.danger { color: var(--threat); border-color: rgba(var(--threat-rgb), .4); background: transparent; }
.btn.danger-fill { background: var(--threat); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line2); background: var(--card); border-radius: 9px; padding: 7px 13px; font: 700 13px var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: pointer; transition: all .2s; }
.chip.on { color: var(--sig-ink); background: var(--sig); border-color: transparent; }

input.f, select.f, textarea.f {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 13px; outline: none; transition: border-color .2s, box-shadow .2s;
  font: 15px var(--sans); color: var(--text);
}
input.f::placeholder, textarea.f::placeholder { color: var(--dim); }
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--sig); box-shadow: 0 0 0 3px rgba(var(--sig-rgb), .18); }
label.lbl { display: block; font: 700 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line2); border-radius: 99px; transition: .2s; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9c6bf; transition: .22s var(--ease); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.switch input:checked + i { background: var(--sig); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3), 0 0 12px rgba(var(--sig-rgb), .4); }
.switch input:checked + i::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--sig); outline-offset: 2px; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); min-height: 52px; }
.item:first-child { border-top: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--muted); }
.item.tap { cursor: pointer; transition: background .15s; }
.item.tap:active { background: var(--card2); }
.ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--card2); color: var(--muted); flex: none; font-size: 17px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.amber, .ico.sig { background: rgba(var(--sig-rgb), .14); color: var(--sig); }
.ico.red { background: rgba(var(--threat-rgb), .14); color: var(--threat); }
.ico.green { background: rgba(var(--ok-rgb), .12); color: var(--ok); }
.ico.blue { background: rgba(158, 195, 255, .14); color: var(--info); }
.ico.warn { background: rgba(var(--warn-rgb), .14); color: var(--warn); }
.badge { font: 700 10.5px var(--mono); letter-spacing: .1em; padding: 3px 8px; border-radius: 5px; background: var(--card2); color: var(--muted); white-space: nowrap; text-transform: uppercase; }
.badge.on { background: rgba(var(--ok-rgb), .14); color: var(--ok); }
.badge.red { background: var(--threat); color: #fff; animation: blink 1.2s steps(2) infinite; }
.badge.amber, .badge.warn { background: rgba(var(--warn-rgb), .16); color: var(--warn); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--sig); font-size: 22px; }
.empty .big svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--sig); display: grid; place-items: center; font: 700 13px var(--display); color: var(--sig); }

.strip { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; color: var(--text); text-decoration: none; cursor: pointer; }
.strip.threat { background: rgba(var(--threat-rgb), .08); border-color: rgba(var(--threat-rgb), .4); }
.strip .tag { font: 700 10.5px var(--mono); letter-spacing: .1em; padding: 3px 7px; border-radius: 5px; flex: none; }
.strip.threat .tag { background: var(--threat); color: #fff; }
.strip .tag.sig { border: 1px solid rgba(var(--sig-rgb), .5); color: var(--sig); }
.strip .tag.warn { border: 1px solid rgba(var(--warn-rgb), .5); color: var(--warn); }
.strip .grow { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.strip .grow .s { font-weight: 400; color: var(--muted); font-size: 13px; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--sig); border-radius: 3px; animation: fill 1s var(--ease); position: relative; overflow: hidden; }
.meter i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent); animation: shimmer 2.4s linear infinite; }
.meter i.warn { background: var(--warn); }
.meter i.threat { background: var(--threat); }
@keyframes fill { from { width: 0 !important; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- кольцо активности (досье) ---------- */
.clock { position: relative; width: 250px; height: 250px; margin: 10px auto 6px; }
.clock svg { width: 100%; height: 100%; }
.clock .h { position: absolute; font: 500 10px var(--mono); color: var(--muted); }
.clock .mid { position: absolute; inset: 70px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.clock .mid b { font: 800 28px var(--display); }
.overlap { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; padding: 4px 0; }
.overlap .meter i { background: var(--threat); }

/* ---------- карта ---------- */
.map-wrap { position: fixed; inset: 0; top: 64px; bottom: 0; overflow: hidden; background: #202125; touch-action: none; }
.map-wrap::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px rgba(0, 0, 0, .55); }
.map-content { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-content img { display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; filter: saturate(.75) contrast(1.05); }
.map-layer { position: absolute; inset: 0; pointer-events: none; }
.mk { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); pointer-events: auto; cursor: pointer; }
.mk-player { width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(var(--ok-rgb), .6); animation: ring 2.2s ease-out infinite; }
.mk-player.off { background: var(--dim); animation: none; border-color: var(--line2); }
.mk-player.dead { background: var(--threat); animation: none; }
.mk-player.me { background: var(--sig); box-shadow: 0 0 0 0 rgba(var(--sig-rgb), .6); }
@keyframes ring { 70% { box-shadow: 0 0 0 11px rgba(var(--ok-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--ok-rgb), 0); } }
.mk-label { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; white-space: nowrap; font: 700 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; pointer-events: none; }
.mk-mon { font: 700 10px var(--display); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; pointer-events: none; opacity: .85; }
.mk-ev { height: 26px; padding: 0 8px; border-radius: 8px; display: flex; align-items: center; gap: 5px; font: 700 10px var(--mono); background: rgba(32, 33, 36, .92); border: 1px solid var(--line2); color: var(--text); white-space: nowrap; }
.mk-ev svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.mk-ev.red { border-color: var(--threat); color: var(--threat); }
.mk-ev.blue { border-color: var(--info); color: var(--info); }
.mk-ev.warn { border-color: var(--warn); color: var(--warn); }
.mk-vend { width: 16px; height: 16px; border-radius: 5px; background: var(--violet); border: 2px solid var(--bg); }
.mk-vend.out { background: var(--dim); }
.mk-note { width: 14px; height: 14px; transform: translate(-50%, -50%) rotate(45deg) scale(var(--inv, 1)); background: var(--warn); border: 2px solid var(--bg); }
.map-hud { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud-box { pointer-events: auto; background: rgba(32, 33, 36, .92); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 13px; }
.hud-box b { font-family: var(--mono); }
.map-tools { position: absolute; right: 12px; bottom: calc(var(--dock-h) + 30px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.map-tools button { width: 44px; height: 44px; border-radius: 12px; background: rgba(32, 33, 36, .94); border: 1px solid var(--line2); font-size: 18px; cursor: pointer; color: var(--text); display: grid; place-items: center; transition: transform .12s; }
.map-tools button:active { transform: scale(.92); }
.map-tools button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.layers { position: absolute; left: 12px; bottom: calc(var(--dock-h) + 30px + var(--safe-b)); display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 6px; max-width: calc(100% - 80px); }
.layers #layList { display: flex; flex-wrap: wrap; gap: 6px; }
.layers .chip { background: rgba(32, 33, 36, .94); padding: 6px 11px; font-size: 12px; }
.layers .chip.on { background: var(--sig); color: var(--sig-ink); }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
/* ---------- чат ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding: 4px 2px; }
.msg { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 11px; max-width: 88%; animation: fadeUp .3s var(--ease); }
.msg.me { align-self: flex-end; background: rgba(var(--sig-rgb), .1); border-color: rgba(var(--sig-rgb), .35); }
.msg.bot { border-style: dashed; }
.msg b { font-size: 12px; color: var(--sig); }
.msg time { font-size: 11px; color: var(--dim); margin-left: 6px; font-family: var(--mono); }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- трекер ---------- */
.days { display: grid; gap: 4px; margin-top: 8px; }
.day { display: grid; grid-template-columns: 54px 1fr 46px; align-items: center; gap: 8px; font: 500 11.5px var(--mono); color: var(--muted); }
.bar { position: relative; height: 14px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--bg2) 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); border: 1px solid var(--line); overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; background: var(--sig); border-radius: 2px; opacity: .85; }
.bar i.open { background: var(--warn); }
.target { display: flex; align-items: center; gap: 12px; }
.target .sig-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.target .sig-bars i { width: 4px; border-radius: 1px; background: var(--line2); }
.target .sig-bars i.on { background: var(--ok); }

/* ---------- нижний лист (модальный) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: var(--bg2); border-top: 1px solid var(--line2); border-radius: 22px 22px 0 0; padding: 8px 16px calc(24px + var(--safe-b)); animation: up .3s var(--ease); max-width: 760px; margin: 0 auto; box-shadow: 0 -14px 40px rgba(0, 0, 0, .5); }
.grab { width: 44px; height: 4px; border-radius: 2px; background: var(--line2); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-x { position: absolute; top: -2px; right: 0; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); color: var(--muted); font-size: 14px; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.sheet-x + *:not(.sheet-x), .sheet-x + .cap + * { padding-right: 44px; }
#sheetBody { position: relative; }

.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 20px + var(--safe-b)); transform: translateX(-50%); z-index: 60; background: var(--text); color: #111; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: 90vw; text-align: center; animation: up .25s var(--ease); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

/* ---------- «Ещё» ---------- */
.hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub a { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; min-height: 112px; border-radius: 16px; background: linear-gradient(180deg, var(--card), #27282d); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s var(--ease), border-color .2s; animation: fadeUp .4s var(--ease) both; }
.hub a:nth-child(2) { animation-delay: .04s; } .hub a:nth-child(3) { animation-delay: .08s; } .hub a:nth-child(4) { animation-delay: .12s; } .hub a:nth-child(5) { animation-delay: .16s; } .hub a:nth-child(6) { animation-delay: .2s; } .hub a:nth-child(7) { animation-delay: .24s; } .hub a:nth-child(8) { animation-delay: .28s; }
.hub a:active { transform: scale(.97); border-color: var(--sig); }
.hub a .ico { width: 42px; height: 42px; }
.hub a b { font: 800 17px var(--display); text-transform: uppercase; letter-spacing: .02em; }
.hub a span { font-size: 12.5px; color: var(--muted); }
.wipe-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.wipe-hero b { font: 800 40px var(--display); line-height: 1; letter-spacing: .01em; }

/* ---------- инструменты ---------- */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; margin-top: 10px; }
.code { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; cursor: pointer; text-align: left; }
.code b { font-family: var(--mono); font-size: 13px; color: var(--sig); display: block; word-break: break-all; }
.code span { font-size: 12px; color: var(--muted); }
.code:active { border-color: var(--sig); }
.genes { display: inline-flex; gap: 3px; }
.gene { width: 22px; height: 24px; border-radius: 6px; display: grid; place-items: center; font: 700 13px var(--mono); }
.gene.G, .gene.Y, .gene.H { background: rgba(var(--ok-rgb), .16); color: var(--ok); }
.gene.W, .gene.X { background: rgba(var(--threat-rgb), .16); color: var(--threat); }
.gene.Q { background: var(--card2); color: var(--warn); }
input.f.qty { width: 74px; flex: none; text-align: right; }
.hero { background: var(--card); }
.plan { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 8px; background: var(--bg2); }
.plan.best { border-color: var(--sig); box-shadow: 0 0 0 1px rgba(var(--sig-rgb), .3); }
.price { font-family: var(--display); font-weight: 800; font-size: 20px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--sig); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- владелец ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-grid > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat-grid small { display: block; font: 700 9.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat-grid b { font-family: var(--display); font-weight: 800; font-size: 24px; }
.inv-code { font-family: var(--mono); font-weight: 600; letter-spacing: .08em; color: var(--sig); }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.row-wrap > * { flex: 1 1 120px; }
#redeemCode::placeholder { text-transform: none; }
/* ---------- камеры ---------- */
.cam-box { background: #000; border: 1px solid var(--line); border-radius: 12px; min-height: 180px; display: grid; place-items: center; overflow: hidden; margin: 10px 0; }
.cam-img { width: 100%; display: block; image-rendering: pixelated; }
.cam-pad { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; }
.cam-pad button { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); font-size: 18px; cursor: pointer; }
/* ---------- ресурсы и прогноз ---------- */
.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.res-grid > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; min-width: 0; }
.res-grid small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-grid b { font-family: var(--display); font-size: 18px; }
.fc { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.fc i { flex: 1; background: var(--sig); border-radius: 2px 2px 0 0; opacity: .85; }
.fc i.low { background: var(--line2); opacity: 1; }
.fc-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim); margin-top: 4px; }
@keyframes alarmGlow { 50% { box-shadow: 0 0 0 5px rgba(var(--threat-rgb), .22); } }
