:root {
  color-scheme: dark;
  --bg: #050506;
  --fg: #f5f5f7;
  --fg-2: rgba(245, 245, 247, 0.64);
  --fg-3: rgba(245, 245, 247, 0.38);
  --line: rgba(255, 255, 255, 0.09);
  --danger: #ff6a60;
  --danger-soft: rgba(255, 98, 89, 0.16);
  --warn: #f5c76b;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(255, 255, 255, 0.25); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); background-clip: padding-box; border: 3px solid transparent; }

/* ---------- Фон ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: radial-gradient(1100px 640px at 50% -12%, #1c1c20 0%, var(--bg) 62%);
}
.backdrop i { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.backdrop i:nth-child(1) { width: 560px; height: 560px; left: 6%; top: 14%; background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%); animation: drift-a 30s ease-in-out infinite alternate; }
.backdrop i:nth-child(2) { width: 680px; height: 680px; right: -8%; top: 34%; background: radial-gradient(circle, rgba(205, 205, 215, 0.15), transparent 70%); animation: drift-b 38s ease-in-out infinite alternate; }
.backdrop i:nth-child(3) { width: 500px; height: 500px; left: 38%; bottom: -14%; background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%); animation: drift-c 34s ease-in-out infinite alternate; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  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 { to { transform: translate3d(140px, 90px, 0) scale(1.18); } }
@keyframes drift-b { to { transform: translate3d(-160px, -60px, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(-120px, -90px, 0) scale(1.15); } }

/* ---------- Стекло ---------- */
.glass {
  position: relative; isolation: isolate;
  --b1: rgba(255, 255, 255, 0.42);
  --b2: rgba(255, 255, 255, 0.05);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.115) 0%, rgba(255, 255, 255, 0.04) 48%, rgba(255, 255, 255, 0.075) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -18px rgba(0, 0, 0, 0.85);
}
.glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, var(--b1), var(--b2) 42%, var(--b2) 62%, var(--b1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass-hover::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.16), transparent 62%);
  transition: opacity 0.35s var(--ease);
}
.glass-hover:hover::after { opacity: 1; }

/* ---------- Навигация ---------- */
.topbar { position: fixed; top: 18px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; pointer-events: none; }
.nav { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; animation: drop-in 0.9s var(--ease) both; }
.nav .brand { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--fg); }
.tabs { position: relative; display: flex; }
.thumb {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 6px 16px -4px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s var(--spring), width 0.6s var(--spring);
}
.thumb.ready { opacity: 1; }
.tab { position: relative; z-index: 1; padding: 9px 24px; border-radius: 999px; color: var(--fg-2); font-weight: 500; letter-spacing: -0.01em; transition: color 0.3s; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); }
.nav .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px 0 8px; }

main { max-width: 1480px; margin: 0 auto; padding: 112px 32px 90px; }
.page { animation: page-in 0.7s var(--ease) both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.page-title { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.page-sub { color: var(--fg-2); margin-top: 6px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.3s var(--ease), background 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.btn:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn.small { height: 30px; padding: 0 13px; font-size: 13px; gap: 6px; }
.btn.small svg { width: 14px; height: 14px; }
.btn-primary {
  color: #0a0a0b; font-weight: 600; background: linear-gradient(180deg, #ffffff, #cfcfd6);
  box-shadow: 0 10px 26px -10px rgba(255, 255, 255, 0.55), inset 0 1px 0 #fff;
}
.btn-primary:hover { background: linear-gradient(180deg, #ffffff, #dedee4); box-shadow: 0 14px 32px -10px rgba(255, 255, 255, 0.7), inset 0 1px 0 #fff; }
.btn-danger { background: linear-gradient(180deg, #ff7a70, #e23a2f); color: #fff; font-weight: 600; box-shadow: 0 10px 26px -10px rgba(255, 80, 70, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-danger:hover { background: linear-gradient(180deg, #ff877d, #ec4439); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg); background: rgba(255, 255, 255, 0.08); }
.btn.wide { width: 100%; height: 46px; font-size: 15px; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-2);
  background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.3s var(--spring), background 0.3s, color 0.3s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--fg); background: rgba(255, 255, 255, 0.18); transform: scale(1.1); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.plain { background: none; box-shadow: none; width: 40px; height: 40px; }
.icon-btn.plain svg { width: 18px; height: 18px; }

.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; opacity: 0.8; }

/* ---------- Разделы и карточки ---------- */
.section { margin-top: 38px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.count { min-width: 30px; height: 26px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg-2); letter-spacing: 0; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); font-variant-numeric: tabular-nums; }

.dropzone {
  margin: -12px; padding: 12px; min-height: 124px; border-radius: 34px;
  outline: 1.5px dashed transparent; outline-offset: -2px;
  transition: background 0.35s var(--ease), outline-color 0.35s, box-shadow 0.35s;
}
body.dragging-bot .dropzone { outline-color: rgba(255, 255, 255, 0.16); }
.dropzone.over { background: rgba(255, 255, 255, 0.055); outline-color: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 70px rgba(255, 255, 255, 0.06); }
.dropzone.over-file { background: rgba(255, 255, 255, 0.07); outline-color: rgba(255, 255, 255, 0.75); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.empty {
  display: grid; place-items: center; min-height: 100px; border-radius: 22px; color: var(--fg-3); text-align: center; padding: 0 20px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
}
.grid:not(:empty) + .empty { display: none; }

.bot {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 92px; padding: 16px 16px 12px;
  border-radius: 22px; cursor: grab; -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  transition: transform 0.5s var(--ease), opacity 0.3s, box-shadow 0.4s, background 0.4s;
}
.bot:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.05), 0 26px 46px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04); }
.bot:active { cursor: grabbing; }
.bot.dragging { opacity: 0.32; transform: scale(0.97); }
.bot.enter { animation: card-in 0.7s var(--ease) backwards; }

.bot-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 22px; }
.bot-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bot-login { font-weight: 600; font-size: 15px; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-balance { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bot-balance.dim { color: var(--fg-3); }
.bot-balance svg { width: 14px; height: 14px; color: var(--warn); }
.bot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.bot-proxy { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--fg-2); font-family: var(--mono); }
.bot-proxy svg { width: 13px; height: 13px; flex: none; opacity: 0.7; }
.bot-proxy .flag { font-size: 14px; }
.bot-proxy .px-warn { display: grid; color: var(--warn); }
.bot-proxy .px-warn svg { opacity: 1; }
.bot-proxy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-actions { display: flex; flex: none; gap: 6px; margin-left: auto; opacity: 0; transform: translateY(5px); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.bot:hover .bot-actions, .bot:focus-within .bot-actions { opacity: 1; transform: none; }
@media (hover: none) { .bot-actions { opacity: 1; transform: none; } }

.bot.no-proxy { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 40px -18px rgba(0, 0, 0, 0.85); outline: 1px dashed rgba(255, 255, 255, 0.3); outline-offset: -1px; }
.bot.no-proxy::before { opacity: 0.35; }
.bot.no-proxy .badge-noproxy { display: grid; }
.badge-noproxy { display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--fg-2); background: rgba(255, 255, 255, 0.1); flex: none; }
.badge-noproxy svg { width: 12px; height: 12px; }

.bot.lost {
  --b1: rgba(255, 130, 120, 0.7); --b2: rgba(255, 98, 89, 0.1);
  background: linear-gradient(150deg, rgba(255, 98, 89, 0.24), rgba(255, 98, 89, 0.07) 55%, rgba(255, 98, 89, 0.14));
}
.bot.lost .bot-actions { position: absolute; top: 12px; right: 12px; }
.lost-label { display: flex; align-items: center; gap: 8px; color: #ff9a92; font-size: 13px; font-weight: 500; min-width: 0; }
.lost-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex: none; animation: pulse 2s ease-in-out infinite; }
.lost-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-light { background: rgba(255, 255, 255, 0.92); color: #0a0a0b; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(255, 255, 255, 0.4); }
.btn-light:hover { background: #fff; }

.skeleton { display: inline-block; width: 64px; height: 14px; border-radius: 7px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }

/* Флаги: Twemoji Country Flags (CC-BY 4.0, Twitter, Inc.); шрифт подключается только для региональных символов */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("/static/fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  font-display: swap;
}
.flag { font-family: "Twemoji Country Flags", "Segoe UI Emoji", sans-serif; font-size: 15px; line-height: 1; flex: none; }

.px-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--fg-2); animation: step-in 0.35s var(--ease) both; }
.px-line:empty { display: none; }
.px-line svg { width: 14px; height: 14px; flex: none; }
.px-line.ok .px-ip { font-family: var(--mono); color: var(--fg); }
.px-line.bad { color: var(--danger); }
.px-ms { color: var(--fg-3); }
.px-ms::before { content: "· "; }
.px-now { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row .px-line { grid-column: 1 / -1; margin: -2px 0 2px 4px; }

/* ---------- Модальные окна ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade-in 0.35s var(--ease) both; }
.overlay.closing { animation: fade-out 0.24s ease both; }
.sheet { width: min(540px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 34px; padding: 30px; background-color: rgba(18, 18, 20, 0.55); animation: sheet-in 0.55s var(--spring) both; }
.sheet.wide { width: min(780px, 100%); }
.overlay.closing .sheet { animation: sheet-out 0.24s ease both; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sheet h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.sheet .sub { color: var(--fg-2); margin-top: 4px; font-size: 14px; }
.sheet-body { margin-top: 22px; }
.step-in { animation: step-in 0.45s var(--ease) both; }

.form { display: grid; gap: 14px; }
.label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--fg-3); }
.hint { font-size: 12.5px; color: var(--fg-3); margin-top: 6px; line-height: 1.4; }
.field {
  width: 100%; height: 46px; padding: 0 16px; border-radius: 16px; outline: 0; font-size: 15px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field::placeholder { color: var(--fg-3); }
.field:hover { background: rgba(255, 255, 255, 0.08); }
.field:focus { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.09); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.3); }
.field.code { text-align: center; font-family: var(--mono); font-size: 24px; letter-spacing: 0.35em; height: 58px; text-transform: uppercase; }
.field.compact { height: 36px; border-radius: 12px; font-size: 13px; padding: 0 12px; }
.form-error { min-height: 0; color: var(--danger); font-size: 13.5px; }
.form-error:not(:empty) { animation: shake 0.45s; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.note { padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); color: var(--fg-2); font-size: 13.5px; line-height: 1.5; }

.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.seg-wrap { margin-bottom: 20px; }
.seg .thumb { top: 4px; bottom: 4px; }
.seg button { position: relative; z-index: 1; padding: 7px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--fg-2); transition: color 0.3s; }
.seg button.active, .seg button:hover { color: var(--fg); }

.filedrop {
  display: grid; justify-items: center; gap: 4px; padding: 34px 20px; border-radius: 26px; text-align: center; cursor: pointer; color: var(--fg-2);
  border: 1.5px dashed rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
}
.filedrop:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.05); }
.filedrop.over { border-color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.1); transform: scale(1.015); }
.filedrop svg { width: 30px; height: 30px; color: var(--fg); margin-bottom: 6px; }
.filedrop strong { color: var(--fg); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.filedrop.compact { padding: 16px; grid-auto-flow: column; justify-content: center; gap: 10px; }
.filedrop.compact svg { margin: 0; width: 18px; height: 18px; }

.rows { display: grid; gap: 8px; max-height: 300px; overflow: auto; padding-right: 4px; }
.rows-head, .row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.2fr) 30px; gap: 8px; align-items: center; }
.rows-head { padding: 0 4px 6px; font-size: 12px; color: var(--fg-3); }
.row { animation: row-in 0.45s var(--ease) both; }
.row .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.row.bad .name { color: var(--danger); }
.row .err { grid-column: 1 / -1; font-size: 12.5px; color: var(--danger); padding-left: 4px; margin-top: -2px; }
.shared { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- Пул прокси ---------- */
.proxy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.proxy-actions a { text-decoration: none; }
.proxy-section-head { flex-wrap: wrap; gap: 16px; }
.proxy-progress { display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: 13px; margin-left: auto; }
.proxy-stats { display: flex; flex-wrap: wrap; gap: 18px; color: var(--fg-3); font-size: 13px; margin-bottom: 14px; }
.proxy-stat { display: inline-flex; align-items: center; gap: 7px; }
.proxy-stat i, .proxy-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); }
.proxy-stat.ok { color: #93d9ac; }
.proxy-stat.fail { color: var(--danger); }
.proxy-stat i { background: currentColor; }
.proxy-dot.ok { background: #93d9ac; }
.proxy-dot.fail { background: var(--danger); }
.proxy-dot.checking { background: var(--warn); }
.proxy-list { border-radius: 24px; overflow: hidden; }
.proxy-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(180px, 0.8fr) 30px; gap: 18px; align-items: center; padding: 18px 22px; border-top: 1px solid var(--line); }
.proxy-row:first-child { border-top: 0; }
.proxy-row.russian { background: rgba(255, 106, 96, 0.035); }
.proxy-row.russian .proxy-address, .proxy-select.russian, .proxy-option.russian .proxy-option-text, .proxy-option.russian small, .bot-proxy.russian, .px-line.russian .px-ip { color: var(--danger); }
.proxy-country-warning { display: inline-block; color: var(--danger); font-size: 11px; margin-top: 6px; padding: 3px 8px; border-radius: 999px; background: var(--danger-soft); }
.proxy-remove:disabled { opacity: 0.35; cursor: default; }
.proxy-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.proxy-identity > svg { width: 18px; height: 18px; flex: none; color: var(--fg-3); }
.proxy-identity > div { min-width: 0; }
.proxy-address { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.proxy-users { color: var(--fg-2); font-size: 13px; overflow-wrap: anywhere; }
.proxy-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.proxy-state.ok { color: #93d9ac; }
.proxy-state.fail, .proxy-error { color: var(--danger); }
.proxy-result time { display: block; }
.proxy-textarea { height: 240px; min-height: 140px; resize: vertical; padding: 16px; font-family: var(--mono); line-height: 1.6; }
.proxy-import-errors { white-space: pre-wrap; max-height: 180px; overflow: auto; }
.proxy-picker { min-width: 0; display: grid; gap: 8px; }
.proxy-select-wrap { position: relative; min-width: 0; }
.proxy-select { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; }
.proxy-select > span { display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proxy-select > svg { flex: none; width: 14px; height: 14px; color: var(--fg-3); }
.proxy-menu { position: relative; z-index: 5; margin-top: 6px; width: 100%; padding: 10px; border-radius: 16px; background-color: #202023; }
.proxy-options { max-height: 220px; overflow: auto; margin-top: 8px; }
.proxy-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; text-align: left; border-radius: 10px; font-size: 13px; }
.proxy-option:hover, .proxy-option:focus-visible, .proxy-option[aria-selected=true] { background: rgba(255, 255, 255, 0.1); }
.proxy-option > svg { width: 15px; height: 15px; flex: none; }
.proxy-option-text { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.proxy-option small { display: block; margin-top: 4px; color: var(--fg-3); font-size: 11px; }
.check-label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--fg-2); line-height: 1.45; }
.check-input { appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 6px; background: rgba(255, 255, 255, 0.06); cursor: pointer; display: grid; place-items: center; transition: background 0.2s, border-color 0.2s; }
.check-input:checked { background: #eeeef2; border-color: #eeeef2; }
.check-input:checked::after { content: ''; width: 5px; height: 9px; border: solid #141417; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check-input:focus-visible { outline: 2px solid #b7b7c5; outline-offset: 3px; }
.row { align-items: start; }
@media (max-width: 900px) {
  .proxy-row { grid-template-columns: minmax(0, 1fr) minmax(140px, 0.7fr) 30px; gap: 12px; }
  .proxy-users { grid-column: 1; grid-row: 2; }
  .proxy-result { grid-column: 2; grid-row: 1 / 3; }
  .proxy-remove { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 580px) {
  .proxy-page-head { flex-wrap: wrap; gap: 16px; }
  .proxy-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .proxy-result, .proxy-users { grid-column: 1; grid-row: auto; }
  .proxy-remove { grid-column: 2; grid-row: 1 / 4; }
  .proxy-progress { margin-left: 0; }
}

/* ---------- Тосты и подсказки ---------- */
#toasts { position: fixed; bottom: 28px; left: 0; right: 0; z-index: 200; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; animation: toast-in 0.6s var(--spring) both; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.7); }
.toast.error::before { background: var(--danger); box-shadow: 0 0 10px rgba(255, 98, 89, 0.7); }
.toast.leaving { animation: toast-out 0.35s ease forwards; }

#tooltip {
  position: fixed; z-index: 300; left: 0; top: 0; max-width: 270px; padding: 9px 13px; border-radius: 14px; pointer-events: none;
  font-size: 12.5px; line-height: 1.4; text-align: center; background: rgba(34, 34, 38, 0.72); border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 30px -10px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translateY(5px) scale(0.96); transition: opacity 0.2s, transform 0.3s var(--ease);
}
#tooltip.show { opacity: 1; transform: none; }

/* ---------- Логи ---------- */
.funding-table-wrap { margin-top: 18px; border-radius: 24px; overflow-x: auto; }
.funding-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.funding-table th { color: var(--fg-3); font-size: 12px; font-weight: 500; }
.funding-table th, .funding-table td { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.funding-table th button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; color: inherit; padding: 5px 0; transition: color 0.2s; }
.funding-table th button:hover, .funding-table th[aria-sort=ascending], .funding-table th[aria-sort=descending] { color: var(--fg); }
.funding-table th button:focus-visible { outline: 2px solid var(--fg-2); outline-offset: 5px; border-radius: 4px; }
.funding-sort-arrow { margin-left: auto; opacity: 0.5; }
.funding-table th[aria-sort=ascending] .funding-sort-arrow, .funding-table th[aria-sort=descending] .funding-sort-arrow { opacity: 1; }
.funding-table tr:last-child td { border-bottom: 0; }
.funding-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.funding-id, .funding-bot { font-family: var(--mono); font-size: 12.5px; }
.funding-id { color: var(--fg-2); }
.funding-client { overflow-wrap: anywhere; min-width: 100px; max-width: 320px; }
.funding-sum { color: #93d9ac; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.funding-table time { white-space: nowrap; color: var(--fg-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.funding-table .funding-empty { padding: 56px 22px; text-align: center; color: var(--fg-3); }
.funding-pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.funding-page-status { color: var(--fg-3); font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin: 26px 0 16px; flex-wrap: wrap; }
.search { position: relative; margin-left: auto; width: min(320px, 100%); }
.search svg { position: absolute; left: 14px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--fg-3); pointer-events: none; }
.search .field { height: 40px; border-radius: 999px; padding-left: 38px; font-size: 14px; }
.log-panel { border-radius: 28px; overflow: hidden; -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
.log-row { display: grid; grid-template-columns: 138px 78px 170px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 12px 22px; border-top: 1px solid var(--line); font-size: 14px; }
.log-row:first-child { border-top: 0; }
.log-row.fresh { animation: log-in 0.6s var(--ease) backwards; }
.log-time { font-family: var(--mono); font-size: 12px; color: var(--fg-3); }
.log-lvl { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--fg-2); }
.log-lvl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.log-lvl.warn { color: var(--warn); }
.log-lvl.warn::before { background: var(--warn); }
.log-lvl.error { color: var(--danger); }
.log-lvl.error::before { background: var(--danger); }
.log-bot { font-family: var(--mono); font-size: 12.5px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-msg { color: var(--fg); overflow-wrap: anywhere; }
.log-empty { padding: 56px 20px; text-align: center; color: var(--fg-3); }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(410px, 100%); padding: 44px 34px 34px; border-radius: 40px; text-align: center; background-color: rgba(18, 18, 20, 0.5); animation: sheet-in 0.9s var(--ease) both; }
.login-card.shake { animation: shake 0.5s; }
.login-mark { width: 64px; height: 64px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; }
.login-mark svg { width: 26px; height: 26px; }
.login-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.035em; }
.login-card p { color: var(--fg-2); margin: 6px 0 26px; font-size: 14px; }
.login-card .field { text-align: center; margin-bottom: 14px; }
.login-card .form-error { margin: -2px 0 12px; }

/* ---------- Анимации ---------- */
@keyframes drop-in { from { opacity: 0; transform: translateY(-24px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(22px) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes step-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes log-in { from { opacity: 0; transform: translateY(-10px); background: rgba(255, 255, 255, 0.1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.95); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

/* ---------- Адаптив ---------- */
@media (max-width: 1240px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  main { padding: 104px 18px 70px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { font-size: 34px; }
  .log-row { grid-template-columns: 1fr; gap: 4px; }
  .rows-head { display: none; }
  .row { grid-template-columns: 1fr 1fr 30px; }
  .row .name { grid-column: 1 / -1; }
}
@media (max-width: 580px) {
  .nav { max-width: calc(100vw - 20px); padding: 6px; gap: 0; }
  .nav .brand { display: none; }
  .nav .tab { padding: 9px 10px; font-size: 13px; }
  .nav .sep { margin: 0 5px; }
  .nav .icon-btn.plain { width: 32px; flex-shrink: 0; }
  .grid { grid-template-columns: 1fr; }
  .shared { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
