@font-face { font-family: 'Inter'; src: url(/fonts/inter-cyrillic-wght-normal.woff2) format('woff2'); font-weight: 100 900; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; }
@font-face { font-family: 'JBM'; src: url(/fonts/jetbrains-mono-cyrillic-500-normal.woff2) format('woff2'); font-weight: 500; unicode-range: U+0400-045F; }
@font-face { font-family: 'JBM'; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); font-weight: 500; }

:root {
  --bg: #000; --panel: #060606; --field: #0e0e0e; --field2: #141414;
  --tx: #ededed; --tx2: #b5b5b5; --mut: #8a8a8a; --dim: #545454;
  --acc: #c6f43a; --err: #ff5a4f; --warn: #ffb547;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --safe-t: var(--tg-safe-area-inset-top, 0px); --safe-b: var(--tg-safe-area-inset-bottom, 0px);
  --csafe-t: var(--tg-content-safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body {
  min-width: 320px; max-width: 480px; margin: 0 auto;
  padding: calc(var(--sp-2) + var(--safe-t) + var(--csafe-t)) max(var(--sp-2), env(safe-area-inset-right)) calc(72px + var(--safe-b) + env(safe-area-inset-bottom)) max(var(--sp-2), env(safe-area-inset-left));
  font-family: 'Inter', system-ui, sans-serif; font-size: 14px; font-weight: 500; font-feature-settings: 'cv11', 'ss01', 'tnum';
  font-variant-numeric: tabular-nums; color: var(--tx); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
#app { display: flex; flex-direction: column; gap: var(--sp-2); }
button { font: inherit; color: inherit; background: none; border: 0; text-align: left; cursor: pointer; }

.p { background: var(--panel); border-radius: 14px; padding: var(--sp-3) var(--sp-4); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sp { flex: 1; }
.nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.mono { font-family: 'JBM', ui-monospace, monospace; font-size: 12px; font-weight: 500; color: var(--tx2); white-space: nowrap; }
.lbl { font-size: 12px; font-weight: 600; color: var(--mut); }
.sub { font-size: 12px; font-weight: 500; color: var(--tx2); }
.mid { font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.stat { font-size: 14px; font-weight: 650; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); flex: none; }
.dot.err { background: var(--err); }
.dot.off { background: var(--dim); }
.dot.run { box-shadow: 0 0 8px var(--acc); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

.warn { background: rgba(255,181,71,.12); color: var(--warn); border-radius: 14px; padding: var(--sp-3) var(--sp-4); font-size: 13px; font-weight: 600; }
.warn.soft { background: var(--panel); color: var(--tx2); font-weight: 500; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.tile { background: var(--panel); border-radius: 14px; padding: 14px var(--sp-3); display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.list { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); }
.list > .lbl { padding: 2px var(--sp-1) var(--sp-1); }
.ph { background: var(--field); border-radius: 9px; }
.ph > button { width: 100%; min-height: 44px; padding: 0 var(--sp-3); display: flex; align-items: center; gap: 10px; border-radius: 9px; }
.ph .w { margin-left: auto; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--tx2); }
.ph .w.err { color: var(--err); }
.ph .w.off { color: var(--mut); }
.ph .w.ok { color: var(--acc); }
.more { display: flex; flex-direction: column; gap: var(--sp-1); padding: 2px var(--sp-3) var(--sp-3) 29px; }
.more[hidden] { display: none; }
.more .kv { display: flex; gap: var(--sp-3); justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--tx2); }
.more .kv b { color: var(--tx); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.more .why { font-size: 13px; font-weight: 600; color: var(--err); overflow-wrap: anywhere; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 84px; margin-top: 10px; }
.bars i { flex: 1; background: var(--acc); border-radius: 3px 3px 1px 1px; min-height: 2px; transform-origin: bottom; animation: grow .3s var(--ease-out) both; }
.bars i.z { background: var(--field2); }
@keyframes grow { from { opacity: 0; transform: scaleY(.92); } to { opacity: 1; transform: scaleY(1); } }
.ticks { display: flex; justify-content: space-between; margin-top: var(--sp-2); }
.ticks span { font-family: 'JBM', monospace; font-size: 12px; color: var(--mut); }

.empty { padding: 28px var(--sp-4); text-align: center; display: flex; flex-direction: column; gap: var(--sp-2); }
.empty .stat { font-size: 15px; }
.empty .sub { color: var(--mut); }
.bar { height: 3px; border-radius: 3px; background: var(--field2); overflow: hidden; width: 96px; margin: var(--sp-2) auto 0; }
.bar i { display: block; height: 100%; width: 40%; background: var(--acc); border-radius: 3px; animation: slide 1.2s var(--ease-out) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.fade { animation: fade .2s var(--ease-out) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

button:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
  .dot.run, .bars i, .bar i, .fade { animation: none; }
  .bar i { width: 100%; opacity: .6; }
}

.mk { display: flex; }
.pn { font-weight: 650; }
.ind { padding: 0 var(--sp-3) 10px 29px; }
.why { font-size: 13px; font-weight: 600; color: var(--err); overflow-wrap: anywhere; }
.more { padding-top: 2px; }
.stat.nm { white-space: normal; overflow-wrap: anywhere; }
.tile { justify-content: space-between; }

.dot.wait { background: var(--warn); }
.hd { min-height: 44px; }
.bk { width: 44px; height: 44px; margin: -10px 0 -10px -14px; border-radius: 50%; text-align: center; font-size: 20px; color: var(--tx); flex: none; }
.row.wrap { flex-wrap: wrap; }

.btn { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--sp-4); border-radius: 999px; background: var(--field2); color: var(--tx); font-size: 14px; font-weight: 650; text-align: center; line-height: 1.2; transition: transform .12s var(--ease-out), opacity .12s var(--ease-out); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.pri { background: var(--acc); color: #0a0a0a; }
.btn.pri.wh { background: #f2f0eb; }
.btn.sec { background: var(--field2); }
.btn.dng { color: var(--err); }
.btn.sm { min-height: 36px; padding: 0 var(--sp-3); font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn[aria-busy] { opacity: .7; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.btns .wide { grid-column: 1 / -1; }

.act { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3) var(--sp-3); }
.act[hidden] { display: none; }
.act .why { padding: 0; }
.note { font-size: 13px; font-weight: 500; color: var(--tx2); overflow-wrap: anywhere; line-height: 1.4; }
.note.err { color: var(--err); border-left: 2px solid var(--err); padding-left: var(--sp-2); font-weight: 600; }
.note.ok { color: var(--acc); border-left: 2px solid var(--acc); padding-left: var(--sp-2); }
.dimr { color: var(--mut); overflow-wrap: anywhere; }

.form { display: flex; flex-direction: column; gap: var(--sp-3); }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.inp { width: 100%; min-height: 44px; padding: 10px var(--sp-3); border: 0; border-radius: 9px; background: var(--field); color: var(--tx); font: inherit; font-size: 16px; font-weight: 500; outline: 0; resize: none; appearance: none; }
select.inp { background-image: none; }
.inp:focus-visible { outline: 2px solid var(--acc); outline-offset: 0; }
textarea.inp { line-height: 1.4; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.li { display: flex; flex-direction: column; gap: 6px; }
.cnt { font-variant-numeric: tabular-nums; }
.shot { display: block; width: 100%; max-width: 270px; height: auto; margin: 0 auto; border-radius: 12px; background: var(--field); }

.item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px var(--sp-3); background: var(--field); border-radius: 9px; }
.item.flat { cursor: default; }
.item.sel { background: var(--field2); box-shadow: inset 0 0 0 1.5px var(--acc); }
.item .itl { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.item .w { margin-left: auto; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--tx2); }
.item.sel .w { color: var(--acc); }

.prog { height: 6px; border-radius: 6px; background: var(--field2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--acc); border-radius: 6px; }

#tabs { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); background: var(--panel); padding-bottom: calc(var(--safe-b) + env(safe-area-inset-bottom)); border-top: 1px solid var(--field2); z-index: 5; }
.tb { min-height: 56px; padding: 0 2px; text-align: center; font-size: 12px; font-weight: 600; color: var(--mut); position: relative; letter-spacing: -.01em; }
.tb.on { color: var(--tx); font-weight: 700; }
.tb.on::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 2px; border-radius: 2px; background: var(--acc); }

#sheet { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; }
#sheet[hidden] { display: none; }
#sheet .bg { position: absolute; inset: 0; background: rgba(0,0,0,.62); }
#sheet .box { position: relative; max-width: 480px; width: 100%; margin: 0 auto; background: var(--field); border-radius: 18px 18px 0 0; padding: var(--sp-4) var(--sp-4) calc(var(--sp-4) + var(--safe-b) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--sp-2); box-shadow: 0 -8px 32px rgba(0,0,0,.5), 0 -1px 0 var(--field2); animation: rise .2s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { #sheet .box { animation: none; } .btn { transition: none; } }
