@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/brand/fonts/onest-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/brand/fonts/onest-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/brand/fonts/unbounded-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/brand/fonts/unbounded-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* ===== Ассистент · единая тёмная «стеклянная» дизайн-система ===== */
:root {
  color-scheme: dark;
  --bg-0: #07080d;
  --bg-1: #0d1020;
  --bg-2: #161a33;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.22);
  --text: #eef0f7;
  --muted: #9aa1b8;
  --faint: #6c7390;
  --accent: #dfe4ee;
  --accent-2: #9aa5bb;
  --tera: #ff9f43;
  --mira: #4cc3ff;
  --ok: #3ddc97;
  --warn: #ffcc4d;
  --bad: #ff5c7a;
  --off: #6c7390;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --radius-xl: 30px;
  --blur: 22px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px;
  --fs-s: 13.5px;
  --fs-m: 15px;
  --fs-l: 19px;
  --fs-xl: 26px;
  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --tabbar-h: 66px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; touch-action: manipulation; }

/* iOS: no double-tap zoom; scrolling and single taps stay */
button, a, input, select, textarea, label,
.btn, .icon-btn, .tab, .switch, .pin-key, .pin-pad, .seg-btn, .fchip, .acc-row,
[role="button"], [role="switch"], [role="tab"] {
  touch-action: manipulation;
}
input, select, textarea { font-size: 16px; }
body {
  font: 400 var(--fs-m)/1.45 var(--font);
  color: var(--text);
  background:
    radial-gradient(120% 60% at 10% -10%, rgba(205, 212, 228, 0.28), transparent 60%),
    radial-gradient(90% 50% at 110% 10%, rgba(150, 160, 182, 0.22), transparent 60%),
    radial-gradient(80% 60% at 50% 120%, rgba(170, 180, 200, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
.app-root { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); }
.app-root:has(.shell) { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); font-weight: 700; }
h2 { font-size: var(--fs-l); font-weight: 650; }
h3 { font-size: var(--fs-m); font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
code { font: 13px ui-monospace, Menlo, monospace; background: var(--glass-strong); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-s); }
.eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 2px; }
.empty { color: var(--faint); text-align: center; padding: var(--sp-5) var(--sp-3); font-size: var(--fs-s); }

/* ----- glass surface ----- */
.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0.045));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  backdrop-filter: blur(var(--blur)) saturate(150%);
}
.card { border-radius: var(--radius-l); padding: var(--sp-4); display: grid; gap: var(--sp-3); position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 46%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent);
  border-radius: inherit;
}
.card > * { position: relative; z-index: 1; }
.stack { display: grid; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.btn-row.tight { gap: 6px; flex-wrap: nowrap; }

/* ----- shell ----- */
.shell { min-height: 100dvh; padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 14px) calc(var(--tabbar-h) + var(--safe-b) + 52px) calc(var(--safe-l) + 14px); max-width: 760px; margin: 0 auto; }
.topbar {
  position: sticky; top: calc(var(--safe-t) + 6px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 10px 16px; border-radius: var(--radius-l); margin-bottom: var(--sp-3);
}
.topbar h1 { font-size: 22px; }
.content { display: grid; gap: var(--sp-3); }

/* ----- buttons ----- */
.btn {
  appearance: none; border: 1px solid var(--glass-border); color: var(--text);
  font: 600 var(--fs-m)/1 var(--font); min-height: var(--tap); padding: 0 16px; border-radius: 14px;
  background: var(--glass-strong); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; cursor: pointer; transition: transform 0.12s, background 0.2s, opacity 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn:active { transform: scale(0.97); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: var(--fs-s); border-radius: 11px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: rgba(255, 255, 255, 0.25); box-shadow: 0 6px 20px rgba(205, 212, 228, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.danger { background: linear-gradient(135deg, rgba(255, 92, 122, 0.85), rgba(255, 92, 122, 0.55)); border-color: rgba(255, 140, 160, 0.4); }
.btn.ghost { background: rgba(255, 255, 255, 0.05); }
.btn[disabled], button[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn {
  appearance: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass-strong); color: var(--text); display: grid; place-items: center; position: relative; font-size: 18px; cursor: pointer;
}
.icon-btn .ico { width: 22px; height: 22px; }
.icon-btn.spin { animation: spin 0.8s linear infinite; }
.link { appearance: none; background: none; border: 0; color: var(--accent); font: 600 var(--fs-s) var(--font); min-height: 32px; cursor: pointer; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ----- iOS switch ----- */
.switch {
  appearance: none; flex: none; position: relative; width: 54px; height: 32px; border-radius: 999px; padding: 0; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(120, 120, 140, 0.32);
  transition: background 0.25s, box-shadow 0.25s;
}
.switch.big { width: 66px; height: 38px; }
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); transition: transform 0.32s var(--spring); display: grid; place-items: center;
}
.switch.big .knob { width: 32px; height: 32px; }
.switch.on { background: linear-gradient(135deg, #34c77b, #3ddc97); box-shadow: 0 0 16px rgba(61, 220, 151, 0.45); }
.switch.on .knob { transform: translateX(22px); }
.switch.big.on .knob { transform: translateX(28px); }
.switch.pending { background: rgba(255, 204, 77, 0.45); box-shadow: 0 0 14px rgba(255, 204, 77, 0.35); opacity: 1; }
.switch[disabled] { pointer-events: none; }
.switch.pending[disabled] { opacity: 1; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.15); border-top-color: #b8860b; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- chips / status ----- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 650; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.chip.on, .chip.ok { color: #c9ffe6; background: rgba(61, 220, 151, 0.16); border-color: rgba(61, 220, 151, 0.35); box-shadow: 0 0 12px rgba(61, 220, 151, 0.25); }
.chip.work, .chip.wait, .chip.warn { color: #fff0c2; background: rgba(255, 204, 77, 0.14); border-color: rgba(255, 204, 77, 0.35); box-shadow: 0 0 12px rgba(255, 204, 77, 0.2); }
.chip.bad { color: #ffd0d9; background: rgba(255, 92, 122, 0.16); border-color: rgba(255, 92, 122, 0.4); box-shadow: 0 0 12px rgba(255, 92, 122, 0.25); }
.chip.done { color: #eef1f7; background: rgba(205, 212, 228, 0.16); border-color: rgba(205, 212, 228, 0.35); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: none; }
.dot.on, .dot.ok { background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: pulse 2s infinite; }
.dot.wait { background: var(--warn); }
.dot.bad { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.sdot.terapays { background: var(--tera); }
.sdot.mirapays { background: var(--mira); }

/* ----- home cards ----- */
.master h2 { font-size: 17px; }
.site-title { display: flex; align-items: center; gap: var(--sp-3); }
.site-title h2 { margin-bottom: 3px; }
.site.terapays { border-color: rgba(255, 159, 67, 0.28); }
.site.mirapays { border-color: rgba(76, 195, 255, 0.28); }
.site.terapays::after, .site.mirapays::after { content: ""; position: absolute; z-index: 0; top: -40px; right: -40px; width: 140px; height: 140px; border-radius: 50%; filter: blur(40px); opacity: 0.35; pointer-events: none; }
.site.terapays::after { background: var(--tera); }
.site.mirapays::after { background: var(--mira); }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.stats-row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--radius-m); padding: 10px; display: grid; gap: 2px; min-width: 0; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat strong { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn-line { font-size: var(--fs-s); color: #ffe7a3; background: rgba(255, 204, 77, 0.1); border: 1px solid rgba(255, 204, 77, 0.25); border-radius: var(--radius-s); padding: 8px 10px; }
.error { font-size: var(--fs-s); color: #ffd0d9; background: rgba(255, 92, 122, 0.12); border: 1px solid rgba(255, 92, 122, 0.3); border-radius: var(--radius-s); padding: 8px 10px; }

/* ----- toasts ----- */
.toast { border-radius: var(--radius-m); padding: 12px 14px; font-size: var(--fs-s); display: flex; justify-content: space-between; gap: 10px; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: rise 0.3s var(--spring); }
.toast.ok { background: rgba(61, 220, 151, 0.14); border: 1px solid rgba(61, 220, 151, 0.35); }
.toast.error { background: rgba(255, 92, 122, 0.16); border: 1px solid rgba(255, 92, 122, 0.4); cursor: pointer; }
.toast-x { opacity: 0.6; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ----- forms ----- */
.field { display: grid; gap: 6px; font-size: var(--fs-s); color: var(--muted); }
.field > span { color: var(--text); font-weight: 600; }
input, select, textarea {
  font: 400 16px/1.3 var(--font); color: var(--text); width: 100%; min-height: var(--tap); padding: 10px 14px;
  border-radius: 13px; border: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.28); outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); -webkit-appearance: none; appearance: none;
}
input:focus { border-color: rgba(205, 212, 228, 0.7); box-shadow: 0 0 0 3px rgba(205, 212, 228, 0.22); }
input::placeholder { color: var(--faint); font-size: 13px; opacity: 1; }
.search { min-height: 42px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); }
.fold summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; list-style: none; color: var(--muted); }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "›"; margin-left: auto; transition: transform 0.2s; font-size: 20px; }
.fold[open] summary::after { transform: rotate(90deg); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: var(--fs-s); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ----- segmented / filter chips ----- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 13px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.07); gap: 2px; }
.seg.compact { min-width: 190px; }
.seg-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font: 600 var(--fs-s) var(--font); min-height: 36px; border-radius: 10px; cursor: pointer; transition: background 0.25s, color 0.25s; }
.seg-btn.active { background: rgba(255, 255, 255, 0.14); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.fchip { appearance: none; flex: none; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.05); color: var(--muted); font: 600 var(--fs-s) var(--font); min-height: 36px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fchip .count { font-size: 11px; background: rgba(255, 255, 255, 0.1); padding: 1px 6px; border-radius: 999px; }
.fchip.active { color: var(--text); background: linear-gradient(135deg, rgba(205, 212, 228, 0.4), rgba(150, 160, 182, 0.3)); border-color: rgba(164, 140, 255, 0.55); box-shadow: 0 0 14px rgba(205, 212, 228, 0.3); }
.fchip.success.active { background: rgba(61, 220, 151, 0.22); border-color: rgba(61, 220, 151, 0.5); }
.fchip.error.active { background: rgba(255, 92, 122, 0.22); border-color: rgba(255, 92, 122, 0.5); }
.fchip.warning.active { background: rgba(255, 204, 77, 0.2); border-color: rgba(255, 204, 77, 0.5); }

/* ----- accounts ----- */
.acc-list { display: grid; gap: 6px; }
.acc-row { appearance: none; width: 100%; text-align: left; color: var(--text); font: inherit; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; min-height: 56px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.04); cursor: pointer; }
.acc-row:active { background: rgba(255, 255, 255, 0.09); }
.acc-main { display: grid; gap: 2px; min-width: 0; }
.acc-main strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }

/* ----- chart ----- */
.chart { width: 100%; height: auto; }
.chart .bar.terapays { fill: var(--tera); filter: drop-shadow(0 0 6px rgba(255, 159, 67, 0.5)); }
.chart .bar.mirapays { fill: var(--mira); filter: drop-shadow(0 0 6px rgba(76, 195, 255, 0.5)); }
.chart .bar.rejected { fill: var(--bad); opacity: 0.8; }
.chart text { fill: var(--faint); font: 10px var(--font); }
.chart text.val { fill: var(--text); font-weight: 700; }

/* ----- feed ----- */
.feed { display: grid; gap: 6px; max-height: calc(100dvh - 330px); min-height: 280px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.bubble { border-radius: 14px; padding: 9px 11px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.07); border-left: 3px solid var(--accent); }
.bubble header { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--faint); margin-bottom: 3px; }
.bubble p { font-size: 13.5px; overflow-wrap: anywhere; }
.bubble.success { border-left-color: var(--ok); }
.bubble.warning { border-left-color: var(--warn); }
.bubble.error { border-left-color: var(--bad); }
.line { display: grid; grid-template-columns: 58px 8px 1fr; gap: 8px; align-items: start; padding: 5px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-size: 13px; }
.line time { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.line .sdot { margin-top: 5px; }
.line p { overflow-wrap: anywhere; }
.line.success p { color: #c9ffe6; }
.line.warning p { color: #ffe7a3; }
.line.error p { color: #ffc2cf; }
.acc-group { border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.acc-group summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 9px 11px; align-items: center; }
.acc-group summary::-webkit-details-marker { display: none; }
.acc-title { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta { grid-column: 1 / -1; font-size: 11px; color: var(--faint); }
.acc-last { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-group[open] .acc-last { display: none; }
.acc-steps { display: grid; gap: 4px; padding: 0 8px 8px; }
.acc-group.ok { border-color: rgba(61, 220, 151, 0.3); }
.acc-group.bad { border-color: rgba(255, 92, 122, 0.35); }
.acc-group.work, .acc-group.wait { border-color: rgba(255, 204, 77, 0.3); }

/* ----- alerts / audit / push ----- */
.alert-row { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 9px 4px; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 13.5px; }
.alert-row.unread p { font-weight: 650; }
.alert-row.error p { color: #ffc2cf; }
.alert-row.warning p { color: #ffe7a3; }
.audit-row { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 13.5px; }
.audit-row.bad strong { color: var(--bad); }
.sub-row { display: grid; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); }
.type-grid { display: grid; gap: 4px; }
.type-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-s); min-height: 40px; }

/* ----- sheets (modals / confirms) ----- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(4, 5, 10, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
.sheet { width: min(560px, 100%); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 10px 18px calc(var(--safe-b) + 18px); display: grid; gap: var(--sp-3); background: linear-gradient(170deg, rgba(40, 44, 72, 0.92), rgba(16, 18, 34, 0.94)); animation: sheet-in 0.35s var(--spring); max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.sheet.tall { min-height: 40dvh; }
.sheet.dragging, .sheet.sheet-closing { animation: none; }
.sheet.dragging { overflow: hidden; touch-action: none; }
.sheet-drag {
  display: grid;
  gap: 8px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
  padding: 2px 0 2px;
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); margin: 0 auto; position: relative; }
.sheet-grip::before { content: ""; position: absolute; left: -28px; right: -28px; top: -18px; bottom: -14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-backdrop.dragging, .sheet-backdrop.sheet-closing { animation: none; }
.sheet-backdrop.sheet-closing { pointer-events: none; }
.sheet-actions { display: grid; gap: var(--sp-2); }
.sheet-actions .btn { min-height: 50px; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ----- login / gate ----- */
.gate-screen { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 20px); }
.login-card { width: min(380px, 100%); border-radius: var(--radius-xl); padding: 28px 22px; display: grid; gap: var(--sp-4); text-align: center; position: relative; overflow: hidden; }
.login-card .field { text-align: left; }
.mark { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto; box-shadow: 0 10px 30px rgba(205, 212, 228, 0.45); }

/* ----- floating glass pill tab bar ----- */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 10px); width: min(calc(100% - 20px - var(--safe-l) - var(--safe-r)), 560px); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px; border-radius: 999px;
  background: linear-gradient(160deg, rgba(40, 44, 72, 0.62), rgba(14, 16, 30, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%);
}
.tab-glow {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); border-radius: 999px;
  transform: translateX(0); transition: transform 0.5s var(--spring);
  background: linear-gradient(135deg, rgba(205, 212, 228, 0.42), rgba(150, 160, 182, 0.32));
  box-shadow: 0 0 18px rgba(205, 212, 228, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.tabbar.idx-1 .tab-glow { transform: translateX(100%); }
.tabbar.idx-2 .tab-glow { transform: translateX(200%); }
.tabbar.idx-3 .tab-glow { transform: translateX(300%); }
.tabbar.idx-4 .tab-glow { transform: translateX(400%); }
.tab {
  appearance: none; position: relative; border: 0; background: none; color: var(--muted); font: 600 10.5px/1 var(--font);
  display: grid; place-items: center; align-content: center; gap: 4px; border-radius: 999px; min-height: var(--tap); cursor: pointer;
  transition: color 0.25s, transform 0.15s;
}
.tab:active { transform: scale(0.9); }
.tab-icon { position: relative; display: grid; place-items: center; width: 30px; height: 26px; border-radius: 50%; }
.tab .ico { width: 23px; height: 23px; transition: transform 0.3s var(--spring), fill 0.25s; }
.tab.active { color: #fff; }
.tab.active .ico { transform: scale(1.08); fill: rgba(255, 255, 255, 0.18); }
.tab.terapays .ico { color: var(--tera); }
.tab.mirapays .ico { color: var(--mira); }
.tab.off .ico { color: var(--off); }
.tab.busy .tab-icon::after, .tab.live .tab-icon::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.tab.terapays.busy .tab-icon::after { color: var(--tera); animation: ring 1.6s infinite; }
.tab.mirapays.busy .tab-icon::after { color: var(--mira); animation: ring 1.6s infinite; }
.tab.terapays.live .tab-icon::after { color: var(--tera); opacity: 0.35; }
.tab.mirapays.live .tab-icon::after { color: var(--mira); opacity: 0.35; }
@keyframes ring { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-badge {
  position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font: 700 10px/18px var(--font);
  color: #fff; text-align: center; border: 1.5px solid rgba(14, 16, 30, 0.9);
}
.tab-badge.alert { background: var(--bad); box-shadow: 0 0 10px rgba(255, 92, 122, 0.6); }
.tab-badge.progress { background: linear-gradient(135deg, var(--accent), var(--accent-2)); right: -16px; }
.bell .tab-badge { top: -2px; right: -2px; }

/* ----- responsive ----- */
@media (min-width: 800px) {
  .shell { padding-top: 20px; }
  .tab { font-size: 11.5px; }
}
@media (max-width: 390px) {
  :root { --fs-m: 14.5px; }
  .stat strong { font-size: 19px; }
  .tab-label { font-size: 9.5px; }
  .card { padding: 14px; }
}
@media (hover: hover) {
  .btn:hover { background: rgba(255, 255, 255, 0.14); }
  .btn.primary:hover { filter: brightness(1.08); }
  .acc-row:hover { background: rgba(255, 255, 255, 0.07); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.setting-row { align-items: flex-start; }
.setting-text { display: grid; gap: 3px; font-size: var(--fs-s); }
.warn-text { color: #ffe7a3; font-size: 12px; }

/* ---------- branding: splash, login backdrop, header mark ---------- */
/* Splash motion lives here (not inline): CSP style-src is 'self' only. */
#splash { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; background: #000; overflow: hidden; display: grid; place-items: center; -webkit-user-select: none; user-select: none; pointer-events: none; }
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .4s ease, visibility .4s; }
#splash .splash-space { position: absolute; inset: 0; overflow: hidden; }
#splash .splash-circuit { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transform: scale(1); transform-origin: center center; will-change: transform; animation: splash-fly 1.55s cubic-bezier(.2,.7,.2,1) both; }
#splash .splash-glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle,rgba(220,228,245,.32) 0%,rgba(180,200,230,.08) 42%,transparent 70%); transform: scale(.85); will-change: transform, opacity; animation: splash-glow 1.55s ease-out both; }
#splash .splash-mark-wrap { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
#splash .splash-mark { width: 112px; height: 112px; border-radius: 28px; background: #000; display: block; transform: scale(.86); opacity: 0; will-change: transform, opacity; animation: splash-mark 1.55s cubic-bezier(.22,1,.36,1) both; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 10px 28px rgba(0,0,0,.45), 0 0 36px rgba(210,218,235,.4); }
@keyframes splash-fly { from { transform: scale(1); } to { transform: scale(1.16); } }
@keyframes splash-glow { 0% { opacity: 0; transform: scale(.7); } 40% { opacity: 1; transform: scale(1.12); } 100% { opacity: .65; transform: scale(1); } }
@keyframes splash-mark { 0% { opacity: 0; transform: scale(.86); } 38% { opacity: 1; transform: scale(1.05); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  #splash { transition: none; }
  #splash .splash-circuit, #splash .splash-glow, #splash .splash-mark { animation: none; opacity: 1; transform: none; }
  #splash.gone { transition: none; }
}

/* Фон входа: когда появится brand/login-bg.jpg, добавьте класс has-art к .gate-screen (см. app.js renderLogin) */
.gate-screen.has-art::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .72)), url(/brand/login-bg.jpg) center / cover no-repeat, #000; }
.gate-screen .login-card { background: rgba(10, 10, 12, .42); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; box-shadow: 0 0 16px rgba(205, 212, 228, .35); }
.topbar-title { display: flex; align-items: center; gap: 10px; }

/* ======================================================================
   Premium glass layer (v2): stronger frosted glass, light edges, sheen,
   noise, drifting red ambient glow. One blur per surface, no nesting.
   ====================================================================== */
:root {
  --blur: 34px;
  --glass-sat: 180%;
  --edge-hi: rgba(255, 255, 255, 0.42);
  --edge-lo: rgba(255, 255, 255, 0.05);
  --surface: rgba(14, 16, 28, 0.38);
  --sheen: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.055) 44%, transparent 58%);
  --depth: 0 1px 1px rgba(0, 0, 0, 0.25), 0 12px 28px rgba(0, 0, 0, 0.42), 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}

/* ambient red glow blobs (gradients only, no filter cost) + film noise */
body::before, body::after, html::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
body::before {
  width: 75vmax; height: 75vmax; left: -30vmax; top: -25vmax; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(205, 212, 228, 0.22), rgba(205, 212, 228, 0.07) 55%, transparent);
  animation: drift-a 26s ease-in-out infinite alternate; will-change: transform;
}
body::after {
  width: 65vmax; height: 65vmax; right: -28vmax; bottom: -22vmax; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(150, 160, 182, 0.16), rgba(170, 180, 200, 0.05) 60%, transparent);
  animation: drift-b 32s ease-in-out infinite alternate; will-change: transform;
}
html::after {
  inset: 0; z-index: -1; opacity: 0.08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(14vw, 10vh, 0) scale(1.12); } }
@keyframes drift-b { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-12vw, -12vh, 0) scale(0.95); } }

/* glass surfaces */
.glass {
  background:
    var(--sheen),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0.035)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.02), var(--depth);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--blur)) saturate(var(--glass-sat));
}
/* 1px light edge: bright on top, fading down (gradient border via mask) */
.card::before, .tabbar::before, .sheet::before, .login-card::before {
  content: ""; position: absolute; inset: 0; height: auto; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, var(--edge-hi), var(--edge-lo) 35%, transparent 65%, rgba(255, 255, 255, 0.10));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.tabbar::before, .sheet::before { z-index: 0; }
.sheet { position: relative; }

/* inner tiles: translucent, no blur (avoid stacked blurs) */
.stat, .bubble, .acc-row, .alert-row {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* buttons */
.btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 14px rgba(0, 0, 0, 0.3);
}
.btn.ghost { background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)); }
.btn.primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 24px rgba(205, 212, 228, 0.38);
}
.icon-btn { background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3); }

/* glass toggles with glossy knobs */
.switch {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.10);
}
.switch .knob {
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #f4f4f8 38%, #cfd0da 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 -2px 3px rgba(0, 0, 0, 0.14);
}
.switch.on {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, #2fbf75, #45e3a0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(61, 220, 151, 0.45);
}
.switch.pending { background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%), rgba(255, 204, 77, 0.5); }

/* tab bar: deeper frost + sheen */
.tabbar {
  background: var(--sheen), linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)), rgba(14, 16, 30, 0.5);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 30px rgba(205, 212, 228, 0.10);
  -webkit-backdrop-filter: blur(38px) saturate(190%); backdrop-filter: blur(38px) saturate(190%);
}
.tab-glow { background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 60%), linear-gradient(135deg, rgba(205, 212, 228, 0.5), rgba(150, 160, 182, 0.36)); }

/* sheets / modals */
.sheet-backdrop { background: rgba(3, 2, 4, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet {
  background: var(--sheen), linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 30%), rgba(18, 20, 36, 0.74);
  -webkit-backdrop-filter: blur(36px) saturate(180%); backdrop-filter: blur(36px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 -20px 60px rgba(0, 0, 0, 0.55);
}
.sheet > * { position: relative; z-index: 1; }

/* inputs */
input, select, textarea { background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.04)); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4); }

/* login card on the comic backdrop */
.gate-screen .login-card {
  background: var(--sheen), linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)), rgba(8, 6, 8, 0.45);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(205, 212, 228, 0.12);
}
.login-card > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}
/* weaker GPUs / low-power: drop the noise layer */
@media (prefers-reduced-transparency: reduce) {
  html::after { display: none; }
  .glass, .tabbar, .sheet { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: rgba(14, 16, 28, 0.92); }
}
#splash[hidden] { display: none !important; }

/* ---------- chrome / silver accent + brand assets ---------- */
.btn.primary { color: #0c0e14; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 52%), linear-gradient(135deg, #f4f6fa, #b9c2d3 55%, #8d97ab);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 8px 24px rgba(200, 210, 230, 0.22); }
.tab-glow { background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 60%), linear-gradient(135deg, rgba(225, 230, 240, 0.30), rgba(150, 160, 182, 0.22));
  box-shadow: 0 0 18px rgba(210, 218, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.tab-badge.progress { color: #0c0e14; }
.mark { box-shadow: 0 10px 30px rgba(210, 218, 235, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.12); background: #000; }
.brand-mark { background: #000; box-shadow: 0 0 14px rgba(210, 218, 235, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.12); }
.gate-screen.has-art::before { background: linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .7)), url(/brand/login-bg.jpg?v=20261113p) center 30% / cover no-repeat, #000; }


/* full-bleed background: paint on the canvas (html), cover safe areas; no fixed attachment (iOS ignores it) */
html {
  min-height: 100%; height: -webkit-fill-available; background-color: var(--bg-0);
  background-image:
    radial-gradient(120% 60% at 10% -10%, rgba(205, 212, 228, 0.28), transparent 60%),
    radial-gradient(90% 50% at 110% 10%, rgba(150, 160, 182, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
  background-repeat: no-repeat; background-size: 100% 100lvh;
}
body { background: transparent; min-height: 100vh; min-height: 100lvh; }
.app-root { min-height: 100vh; min-height: 100lvh; }
.app-root:empty { background: #000; }
.gate-screen { min-height: 100vh; min-height: 100lvh; }
.gate-screen.has-art::before { inset: 0; bottom: calc(-1 * env(safe-area-inset-bottom, 0px)); top: calc(-1 * env(safe-area-inset-top, 0px)); }


/* ---------- typography: Unbounded (headings) + Onest (text) ---------- */
:root {
  --font: 'Onest', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-display: 'Unbounded', 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
}
body, button, input, select, textarea { font-family: var(--font); }
h1, h2, h3, .login-card h1, .topbar h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; }
.topbar h1 { font-size: 20px; }
h1 { font-size: 23px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; font-weight: 600; }
.login-card h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffffff, #c4cad6 60%, #8f98aa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow, .stat-label { font-family: var(--font); font-weight: 600; }
.stat strong { font-family: var(--font-display); font-weight: 600; font-size: 21px; }
.stat strong, .tab-badge, .chart, .line time, .bubble time, .acc-row, .audit-row, .stat-sub { font-variant-numeric: tabular-nums; }
.tab-label, .tab span { font-family: var(--font); font-weight: 600; }


/* PIN keypad — Nexus neon glass (style В) */
.gate-screen.pin-gate {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.gate-screen.pin-gate.has-art::before {
  background:
    radial-gradient(70% 46% at 50% 0%, rgba(210, 218, 235, 0.18), transparent 72%),
    linear-gradient(180deg, rgba(6, 8, 16, 0.5), rgba(4, 5, 12, 0.84)),
    url(/brand/login-bg.jpg) center 30% / cover no-repeat, #07080d;
}
.gate-screen.pin-gate::after {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(36% 28% at 50% 18%, rgba(220, 228, 245, 0.22), transparent 70%),
    radial-gradient(30% 24% at 16% 82%, rgba(76, 195, 255, 0.12), transparent 70%),
    radial-gradient(28% 22% at 88% 74%, rgba(255, 159, 67, 0.1), transparent 70%);
  animation: pin-ambient 9s ease-in-out infinite alternate;
}
@keyframes pin-ambient {
  from { opacity: 0.72; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 1; transform: translate3d(0, -2%, 0) scale(1.06); }
}
.gate-screen.pin-gate > * { position: relative; z-index: 1; }
.gate-screen.pin-ok {
  animation: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}
.pin-card {
  text-align: center;
  width: min(400px, 100%);
  padding: 32px 22px 28px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 36%),
    rgba(12, 14, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(190, 205, 230, 0.12);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  backdrop-filter: blur(36px) saturate(180%);
}
.pin-card .mark {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  margin: 0 auto 8px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(210, 218, 235, 0.35);
}
.pin-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.02em;
  margin: 2px 0 4px;
  background: linear-gradient(180deg, #ffffff, #c4cad6 58%, #8f98aa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pin-dots { display: flex; justify-content: center; gap: 20px; margin: 16px 0 8px; }
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(210, 218, 235, 0.42);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 0 rgba(210, 218, 235, 0);
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s var(--spring);
}
.pin-dot.on {
  background: radial-gradient(circle at 40% 32%, #fff, #dfe4ee 55%, #9aa5bb);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 10px rgba(220, 228, 245, 0.95), 0 0 24px rgba(180, 200, 255, 0.5);
  transform: scale(1.12);
}
.pin-dots.err { animation: pin-shake 0.42s var(--spring); }
.pin-dots.err .pin-dot {
  border-color: #ff6b86;
  box-shadow: 0 0 10px rgba(255, 92, 122, 0.55);
}
.pin-dots.err .pin-dot.on {
  background: radial-gradient(circle at 40% 32%, #ffd4dc, #ff5c7a);
  box-shadow: 0 0 14px rgba(255, 92, 122, 0.95), 0 0 28px rgba(255, 92, 122, 0.4);
}
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.pin-card .pin-alert {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: #ff8da0;
  margin: 0 0 2px;
  text-shadow: 0 0 12px rgba(255, 92, 122, 0.45);
}
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 14px 18px; margin-top: 16px; }
.pin-key {
  appearance: none;
  position: relative;
  overflow: hidden;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 46%, rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 10px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.28s var(--spring), background 0.2s, box-shadow 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pin-key.del { font-size: 20px; }
.pin-key.spacer { visibility: hidden; pointer-events: none; border: 0; background: none; box-shadow: none; }
.pin-key.is-down, .pin-key:active {
  transform: scale(0.9);
  border-color: rgba(255, 255, 255, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 18px rgba(210, 218, 235, 0.28);
}
.pin-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), rgba(210, 218, 235, 0.15) 60%, transparent 70%);
  pointer-events: none;
  animation: pin-ripple 0.46s ease-out forwards;
}
@keyframes pin-ripple {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(16); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-screen.pin-gate::after, .pin-ripple, .pin-dots.err, .gate-screen.pin-ok { animation: none; }
  .gate-screen.pin-ok { opacity: 0; transition: none; }
}

/* haptics / spring press — transform only, no layout jank */
.btn, .icon-btn, .tab, .switch, .seg-btn { transition: transform 0.28s var(--spring), background 0.25s, box-shadow 0.25s, opacity 0.2s, color 0.2s, border-color 0.2s; -webkit-tap-highlight-color: transparent; }
.btn.is-down, .btn:active { transform: scale(0.96); }
.icon-btn.is-down, .icon-btn:active { transform: scale(0.9); }
.switch.is-down { transform: scale(0.94); }
.switch .knob { transition: transform 0.36s var(--spring); }
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn, .tab, .switch, .seg-btn, .pin-key, .switch .knob, .pin-dot { transition: none; animation: none; }
  .btn.is-down, .btn:active, .icon-btn.is-down, .icon-btn:active, .switch.is-down, .pin-key.is-down, .pin-key:active { transform: none; }
}

/* home RuCaptcha + summary — compact single-surface cards */
.home-stack { gap: 10px; }
.rucap-card { padding: 10px 14px; gap: 0; }
.rucap-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rucap-left, .rucap-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rucap-right { flex: none; align-items: baseline; gap: 8px; }
.rucap-ico { width: 20px; height: 20px; color: var(--accent); }
.rucap-name { font-family: var(--font); font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: 0; text-transform: none; }
.rucap-bal { font-family: var(--font-display); font-weight: 600; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; }
.rucap-bal.low { color: var(--warn); }
.rucap-pill { font-family: var(--font); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--muted); white-space: nowrap; }
.rucap-card.low { box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px rgba(255, 204, 77, 0.28), 0 10px 30px rgba(0, 0, 0, 0.35); }

.summary-card { display: grid; gap: 8px; padding: 12px 14px; }
.summary-card .seg { margin-left: auto; min-width: 186px; }
.summary-card .seg-btn { min-height: 30px; font-size: 12.5px; }
.summary-row { display: grid; gap: 5px; }
.summary-head { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.summary-head .ico { width: 16px; height: 16px; }
.summary-head .ico.terapays, .site-ico.terapays { color: var(--tera); }
.summary-head .ico.mirapays, .site-ico.mirapays { color: var(--mira); }
.summary-head .ico.captcha, .site-ico.captcha { color: var(--accent); }
.summary-name { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; }
.mini-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mini-tile {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 7px 8px 6px;
  display: grid;
  gap: 1px;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.mini-tile strong { font-family: var(--font-display); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.15; }
.mini-label { font-family: var(--font); font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }

/* quiet hours */
.quiet-row { display: grid; gap: 10px; padding-top: 4px; }
.quiet-zone { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.quiet-times { display: flex; align-items: center; gap: 10px; }
.quiet-times input[type=time] { flex: 1; min-height: var(--tap); }


/* ----- home dashboard ----- */
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-title h1 { margin: 0; }

.health-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.health-line { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.health-site { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.health-site .dot { width: 7px; height: 7px; animation: none; }
.health-sep { color: var(--faint); }
.health-up { color: var(--muted); }
.count-chip {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  white-space: nowrap;
}
.count-chip.now { color: var(--warn); border-color: rgba(255,204,77,0.35); }

.rucap-card { padding: 12px 14px; gap: 10px; }
.rucap-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.forecast-tile.pending strong { font-size: 12.5px; letter-spacing: -0.02em; color: var(--muted); font-family: var(--font); font-weight: 600; }

.events-card { gap: 8px; padding: 12px 14px; }
.home-alert { align-items: flex-start; }
.home-alert-body { min-width: 0; }
.home-alert-body p { line-height: 1.35; }

/* neon status glow — subtle, like mockup V */
.card.site.glow-ok, .site-chip.glow-ok {
  border-color: rgba(61,220,151,0.55);
  box-shadow:
    inset 0 1px 0 rgba(180,255,220,0.28),
    0 0 0 1px rgba(61,220,151,0.18),
    0 0 22px rgba(61,220,151,0.28),
    0 8px 24px rgba(0,0,0,0.35);
}
.card.site.glow-ok::after, .site-chip.glow-ok::after { background: #3ddc97; opacity: 0.38; filter: blur(28px); }
.card.site.glow-bad, .site-chip.glow-bad {
  border-color: rgba(255,70,110,0.8);
  box-shadow:
    inset 0 1px 0 rgba(255,180,200,0.28),
    0 0 0 1px rgba(255,80,120,0.28),
    0 0 24px rgba(255,70,110,0.42),
    0 8px 24px rgba(0,0,0,0.35);
}
.card.site.glow-bad::after, .site-chip.glow-bad::after { background: #ff3b6b; opacity: 0.5; filter: blur(28px); }
.card.site.glow-ok .dot.on, .card.site.glow-ok .dot.wait, .site-chip.glow-ok .dot.on, .site-chip.glow-ok .dot.wait { box-shadow: 0 0 8px #3ddc97, 0 0 0 3px rgba(61,220,151,0.18); }
.card.site.glow-bad .dot.bad, .site-chip.glow-bad .dot.bad { box-shadow: 0 0 8px #ff5c7a, 0 0 0 3px rgba(255,92,122,0.22); }

.site-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button.site-chip {
  display: flex; align-items: center; gap: 8px;
  width: 100%; margin: 0; padding: 12px;
  text-align: left; cursor: pointer;
  color: inherit; font: inherit;
  appearance: none; -webkit-appearance: none;
  min-height: 56px;
}
button.site-chip:hover, button.site-chip:focus-visible { outline: none; }
.site-chip .chip-name { font-weight: 700; font-size: 13.5px; letter-spacing: -0.02em; min-width: 0; }
.site-chip .chip-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; flex: none; }
.site-chip .chip-count { font-size: 14px; font-weight: 700; }
.site-chip .chip-next { color: var(--muted); font-size: 11px; white-space: nowrap; }
.site-chip.terapays::after, .site-chip.mirapays::after {
  content: ""; position: absolute; z-index: 0; top: -30px; right: -30px;
  width: 90px; height: 90px; border-radius: 50%; filter: blur(28px); opacity: 0.35; pointer-events: none;
}
.site-chip.terapays::after { background: var(--tera); }
.site-chip.mirapays::after { background: var(--mira); }

/* A7A5 wallet tile (style B neon glass) */
.wallet-card { padding: 14px 16px 16px; gap: 8px; }
.wallet-head { display: flex; align-items: center; gap: 8px; }
.wallet-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); box-shadow: none; flex: none; }
.wallet-dot.live { background: #6cffc0; box-shadow: 0 0 10px rgba(108, 255, 192, 0.85), 0 0 18px rgba(108, 255, 192, 0.35); animation: wallet-pulse 1.8s ease-in-out infinite; }
@keyframes wallet-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.18); }
}
.wallet-name { font-family: var(--font); font-weight: 600; font-size: 15px; letter-spacing: 0.04em; color: var(--text); }
.wallet-bal { font-family: var(--font-display); font-weight: 600; font-size: 32px; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1.05; text-shadow: 0 0 22px rgba(210, 218, 235, 0.28); }
.wallet-trx { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) {
  .wallet-dot.live { animation: none; }
}

/* ----- month report ----- */
.report-link { margin-left: auto; min-height: 32px; }
.summary-card .report-link { justify-self: start; }
.report-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-nav h3 { font-family: var(--font-display); font-size: 16px; text-transform: lowercase; letter-spacing: -0.02em; }
.report-table { display: grid; gap: 4px; }
.report-row { display: grid; grid-template-columns: 44px 1fr 1fr 58px; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)); border: 1px solid rgba(255, 255, 255, 0.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.report-row.head { background: transparent; border: 0; box-shadow: none; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 10px; }
.report-row.totals { border-color: rgba(210, 218, 235, 0.22); background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)); }
.report-row.partial { border-style: dashed; }
.report-day { font-family: var(--font-display); font-weight: 600; }
.report-site { color: var(--text); white-space: nowrap; }
.report-site b { font-family: var(--font-display); font-weight: 600; }
.report-drop { color: var(--muted); }
.report-18.ok { color: var(--ok); }
.report-18.bad { color: var(--bad); }
.report-cap { text-align: right; font-variant-numeric: tabular-nums; }
.report-need {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600; letter-spacing: -0.02em;
  padding: 12px 14px; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(210, 218, 235, 0.22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 18px rgba(205, 212, 228, 0.12);
}

/* ----- neon glass consistency across feed, settings, sheets ----- */
.line, .sub-row, .acc-group, .quiet-row, .fold {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.line { border-radius: 12px; border-bottom: 0; margin: 0; padding: 8px 10px; }
.feed.compact .line { border-radius: 10px; }
.sub-row, .acc-group, .quiet-row, .fold { border-radius: 14px; }
.fold { padding: 0 12px; }
.quiet-row { padding: 12px; display: grid; gap: 8px; }
.quiet-times { display: flex; align-items: center; gap: 8px; }
.quiet-times input { min-height: 42px; }
.settings-tab .card, .feed-card, .site .card { }
.acc-row, .type-row { font-family: var(--font); }
.sheet h3, .sheet-head h3 { font-family: var(--font-display); }
.type-row { padding: 2px 0; }
body.shot-safe { --safe-t: 54px; --safe-b: 34px; }

