/* ================= FunPay Radar — оформление ================= */
:root {
  --bg-0: #050f0a;
  --bg-1: #08170f;
  --bg-2: #0c2116;
  --panel: rgba(11, 30, 20, 0.55);
  --panel-2: rgba(18, 44, 30, 0.7);
  --border: rgba(163, 230, 53, 0.18);
  --border-2: rgba(163, 230, 53, 0.34);
  --text: #f3fbf6;
  --muted: #aecbb8;
  --muted-2: #83a18c;
  --acc1: #34d399;   /* изумруд */
  --acc2: #a3e635;   /* лайм */
  --acc3: #f5c451;   /* золото — второй цвет, читается на зелёном */
  --ok: #34d399;
  --warn: #f5c451;
  --err: #ff6b6b;
  --grad: linear-gradient(120deg, #34d399 0%, #a3e635 100%);
  --grad-soft: linear-gradient(120deg, rgba(52, 211, 153, 0.22), rgba(163, 230, 53, 0.22));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --radius: 20px;
  --radius-sm: 13px;
  --sidebar-w: 268px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

html[data-theme="light"] {
  --bg-0: #e7f3ea;
  --bg-1: #f2faf4;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-2: rgba(255, 255, 255, 0.95);
  --border: rgba(16, 60, 36, 0.12);
  --border-2: rgba(16, 60, 36, 0.24);
  --text: #0c2117;
  --muted: #43604f;
  --muted-2: #6e8a79;
  --acc1: #128a4b;
  --acc2: #5a8f0f;
  --acc3: #b7791f;
  --ok: #128a4b;
  --warn: #b7791f;
  --err: #c0392b;
  --grad: linear-gradient(120deg, #128a4b 0%, #5a8f0f 100%);
  --grad-soft: linear-gradient(120deg, rgba(18, 138, 75, 0.16), rgba(90, 143, 15, 0.16));
  --shadow: 0 18px 50px rgba(20, 60, 40, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; }

.hidden { display: none !important; }

/* ------------------------------- фон ------------------------------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(120% 120% at 20% 0%, var(--bg-2) 0%, var(--bg-0) 55%); }
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.3; mix-blend-mode: screen; }
html[data-theme="light"] .orb { mix-blend-mode: normal; opacity: 0.33; }
.orb-1 { width: 520px; height: 520px; background: #34d399; top: -140px; left: -80px; animation: float1 22s ease-in-out infinite; }
.orb-2 { width: 460px; height: 460px; background: #a3e635; bottom: -160px; right: -60px; animation: float2 26s ease-in-out infinite; }
.orb-3 { width: 380px; height: 380px; background: #f5c451; top: 40%; left: 55%; opacity: 0.35; animation: float3 30s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(80px,60px) scale(1.1); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px,-50px) scale(1.12); } }
@keyframes float3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,70px) scale(0.92); } }

.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 85%);
}
html[data-theme="light"] .grid-overlay { background-image: linear-gradient(rgba(30,50,100,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(30,50,100,0.05) 1px, transparent 1px); }
.noise { position: absolute; inset: 0; opacity: 0.035; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* --------------------------- экран загрузки --------------------------- */
.boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg-0); transition: opacity .5s ease, visibility .5s; }
.boot.gone { opacity: 0; visibility: hidden; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.radar { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.radar-ring { position: absolute; border: 1px solid rgba(52, 211, 153, 0.5); border-radius: 50%; }
.radar-ring.r1 { width: 150px; height: 150px; }
.radar-ring.r2 { width: 100px; height: 100px; border-color: rgba(163, 230, 53, 0.5); }
.radar-ring.r3 { width: 50px; height: 50px; border-color: rgba(255, 255, 255, 0.25); }
.radar-sweep { position: absolute; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(52,211,153,0.55), transparent 28%); animation: sweep 2.1s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--acc2); box-shadow: 0 0 14px var(--acc2); top: 34px; left: 104px; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.radar-core { position: relative; z-index: 2; font-weight: 800; font-size: 22px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.boot-title { font-size: 26px; letter-spacing: .5px; }
.boot-title b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-sub { color: var(--muted); font-size: 14px; }
.boot-bar { width: 240px; height: 5px; border-radius: 20px; background: rgba(255,255,255,.08); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 8%; background: var(--grad); border-radius: 20px; transition: width .5s ease; }

/* ------------------------------ каркас ------------------------------ */
.app { position: relative; z-index: 2; height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; overflow: hidden; }
.app.enter { animation: appIn .5s ease both; }
@keyframes appIn { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------ сайдбар ------------------------------ */
.sidebar {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 20px 16px; margin: 14px 0 14px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 14px; }
.brand-mark { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--grad); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.brand-ico { color: #fff; font-size: 18px; }
.brand-pulse { position: absolute; inset: 0; border-radius: 12px; border: 2px solid rgba(52,211,153,.35); animation: brandPulse 2.4s ease-out infinite; }
@keyframes brandPulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
.brand-text { display: flex; flex-direction: column; font-size: 16px; font-weight: 700; line-height: 1.15; }
.brand-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { color: var(--muted-2); font-weight: 500; font-size: 11px; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .22s ease; position: relative; text-align: left;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); transform: translateX(3px); }
.nav-item.active { background: var(--grad-soft); color: var(--text); border-color: var(--border-2); box-shadow: inset 0 0 0 1px rgba(52,211,153,.12); }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; border-radius: 4px; background: var(--grad); }
.ni-ico { font-size: 16px; width: 20px; text-align: center; }
.ni-label { flex: 1; }
.ni-badge { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.ni-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); box-shadow: 0 0 10px var(--err); animation: blink 1.4s infinite; }

.side-stats { margin-top: auto; padding: 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); }
.ss-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ss-row b { color: var(--text); font-size: 14px; }
.ss-progress { height: 6px; border-radius: 20px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.ss-progress span { display: block; height: 100%; width: 0%; background: var(--grad); border-radius: 20px; transition: width .6s cubic-bezier(.2,.8,.2,1); }

.side-profile { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .2s; }
.side-profile:hover { background: var(--panel-2); }
.sp-info { display: flex; flex-direction: column; overflow: hidden; }
.sp-info b { font-size: 13px; }
.sp-info small { color: var(--muted-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------ topbar ------------------------------ */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 14px 18px 0 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 8px 18px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: .2px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.searchbox { display: flex; align-items: center; gap: 9px; width: 320px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(16px); transition: all .25s ease; }
.searchbox:focus-within { border-color: var(--acc1); box-shadow: 0 0 0 4px rgba(52,211,153,.16); width: 360px; }
.searchbox input { flex: 1; background: none; border: none; outline: none; color: var(--text); font: inherit; font-size: 13.5px; }
.searchbox input::placeholder { color: var(--muted-2); }
.searchbox kbd { font-size: 10px; color: var(--muted-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.sb-ico { opacity: .7; font-size: 13px; }

.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 16px; cursor: pointer; backdrop-filter: blur(16px); transition: all .22s ease; }
.icon-btn:hover { background: var(--panel-2); transform: translateY(-2px); border-color: var(--border-2); }
.icon-btn:active { transform: translateY(0) scale(.96); }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 20px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 12px rgba(239,68,68,.7); animation: pop .3s ease; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--grad-soft); border: 1px solid var(--border-2); font-size: 18px; }
.avatar.sm { width: 38px; height: 38px; font-size: 16px; }
.avatar-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--grad-soft); font-size: 18px; cursor: pointer; transition: all .22s ease; }
.avatar-btn:hover { transform: translateY(-2px) rotate(-4deg); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }

/* ------------------------------ страницы ------------------------------ */
.pages { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 32px; }
.page { display: none; }
.page.active { display: block; animation: fadeUp .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.page-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.spacer { flex: 1; }

/* ------------------------------ кнопки ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; transition: all .2s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: 0 10px 24px rgba(0,0,0,.28); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--grad); border: none; color: #05221a; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32); }
.btn.primary:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb4b4; border-color: rgba(239,68,68,.35); }
.btn.danger:hover { background: rgba(239,68,68,.12); }
.btn.sm { padding: 8px 13px; font-size: 12.5px; border-radius: 11px; }
.btn.icon { padding: 9px; width: 38px; height: 38px; }

/* ------------------------------ поля ------------------------------ */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--muted); letter-spacing: .2px; }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.input, .select, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font: inherit; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus, .select:focus { border-color: var(--acc1); box-shadow: 0 0 0 4px rgba(52,211,153,.16); background: var(--panel-2); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* переключатель */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13.5px; }
.switch input { display: none; }
.switch .track { width: 46px; height: 26px; border-radius: 20px; background: rgba(255,255,255,.14); position: relative; transition: background .25s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.2,.9,.3,1.3); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* сегменты */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--panel); border: 1px solid var(--border); }
.seg button { border: none; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; padding: 8px 14px; border-radius: 10px; cursor: pointer; transition: all .2s; }
.seg button.active { background: var(--grad); color: #05221a; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }

/* теги */
.tag-input { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 11px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel); min-height: 48px; transition: border-color .2s, box-shadow .2s; }
.tag-input:focus-within { border-color: var(--acc1); box-shadow: 0 0 0 4px rgba(52,211,153,.16); }
.tag-input input { flex: 1; min-width: 120px; background: none; border: none; outline: none; color: var(--text); font: inherit; font-size: 13.5px; }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 9px; background: var(--grad-soft); border: 1px solid var(--border-2); font-size: 12.5px; animation: pop .2s ease; }
.tag button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.tag button:hover { color: var(--err); }

/* --------------------------- карточки, панели --------------------------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(20px); box-shadow: var(--shadow); padding: 22px; }
.card-title { font-size: 15px; font-weight: 750; margin-bottom: 4px; }
.card-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.section-gap { margin-bottom: 20px; }

/* --------------------------- мониторы (сетка) --------------------------- */
.grid.monitors { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.mcard { position: relative; overflow: hidden; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(20px); box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s; animation: fadeUp .4s ease both; }
.mcard::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: radial-gradient(600px 120px at var(--mx, 50%) var(--my, 0%), rgba(52,211,153,.16), transparent 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.mcard:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 26px 56px rgba(0,0,0,.45); }
.mcard:hover::after { opacity: 1; }
.mcard.off { opacity: .62; }
.mcard-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.mcard-titlewrap { flex: 1; min-width: 0; }
.mcard-title { font-size: 15.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard-sub { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted-2); }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status-dot.error { background: var(--err); box-shadow: 0 0 10px var(--err); }
.status-dot.idle { background: var(--muted-2); }
.status-dot.checking { background: var(--warn); animation: blink 1s infinite; }
.mcard-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; min-height: 28px; }
.pill { font-size: 11.5px; padding: 5px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.pill.kw { color: var(--text); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.12); }
.pill.price { color: #ffd08a; border-color: rgba(245,196,81,.35); background: rgba(245,196,81,.1); }
.pill.online { color: #8ef0c0; border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.1); }
.mcard-meta { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); margin-bottom: 14px; }
.mm { display: flex; flex-direction: column; gap: 2px; }
.mm b { font-size: 16px; }
.mm span { font-size: 11px; color: var(--muted-2); }
.mcard-actions { display: flex; gap: 8px; min-width: 0; }
.mcard-actions .btn { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; justify-content: center; text-align: center; padding-left: 10px; padding-right: 10px; }
.mcard-count { position: absolute; top: 14px; right: 16px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 20px; }

/* --------------------------- пустые состояния --------------------------- */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); animation: fadeUp .5s ease both; }
.empty .e-ico { font-size: 54px; margin-bottom: 16px; filter: grayscale(.2); animation: floaty 3.5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.empty h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; margin-bottom: 20px; }

/* --------------------------- каталог --------------------------- */
.catalog-list { display: flex; flex-direction: column; gap: 12px; }
.acc { border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--border); overflow: hidden; transition: border-color .2s; }
.acc.open { border-color: var(--border-2); }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; transition: background .2s; }
.acc-head:hover { background: var(--panel-2); }
.acc-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); font-size: 16px; flex: none; }
.acc-name { flex: 1; font-weight: 700; font-size: 14.5px; }
.acc-count { font-size: 11.5px; color: var(--muted); padding: 4px 10px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--border); }
.acc-caret { color: var(--muted); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.acc.open .acc-caret { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .38s cubic-bezier(.2,.8,.2,1); }
.acc.open .acc-body { max-height: 900px; }
.acc-subs { padding: 4px 16px 16px; display: flex; flex-wrap: wrap; gap: 9px; }
.subchip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; cursor: pointer; transition: all .2s; }
.subchip:hover { border-color: var(--acc1); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.subchip .kind { font-size: 10px; color: var(--muted-2); }
.subchip .go { color: var(--acc2); font-weight: 700; }

/* компактный список игр в форме */
#gameResults { max-height: 300px; overflow-y: auto; padding-right: 4px; }
#gameResults .acc { border-radius: 11px; }
#gameResults .acc-head { padding: 9px 12px; }
#gameResults .acc-ico { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
#gameResults .acc-name { font-size: 13.5px; }
#gameResults .acc-count { font-size: 11px; padding: 3px 9px; }
#gameResults::-webkit-scrollbar { width: 8px; }

/* --------------------------- уведомления --------------------------- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-day { font-size: 12px; color: var(--muted-2); font-weight: 700; letter-spacing: .4px; margin: 12px 4px 2px; text-transform: uppercase; }
.feed-item { display: flex; align-items: center; gap: 14px; padding: 15px 17px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(16px); transition: all .22s; animation: slideInRight .4s cubic-bezier(.2,.8,.2,1) both; }
.feed-item:hover { transform: translateX(4px); border-color: var(--border-2); }
.feed-item.unread { border-left: 3px solid var(--acc1); background: var(--grad-soft); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.fi-price { min-width: 96px; text-align: center; font-weight: 800; font-size: 15px; color: var(--acc3); background: rgba(245,196,81,.1); border: 1px solid rgba(245,196,81,.28); border-radius: 11px; padding: 8px 10px; }
.fi-main { flex: 1; min-width: 0; }
.fi-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fi-sub .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.fi-tag { font-size: 11px; color: var(--acc2); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: blink 1.6s infinite; }

/* --------------------------- настройки / профиль --------------------------- */
.profile-hero { display: flex; align-items: center; gap: 18px; }
.big-avatar { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 40px; background: var(--grad-soft); border: 1px solid var(--border-2); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); overflow: hidden; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-picker button { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--panel-2); font-size: 18px; cursor: pointer; transition: all .18s; }
.emoji-picker button:hover { transform: translateY(-2px) scale(1.08); border-color: var(--acc1); }
.emoji-picker button.active { border-color: var(--acc1); box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row .sr-info b { display: block; font-size: 14px; font-weight: 650; }
.set-row .sr-info small { color: var(--muted); font-size: 12px; }
.sr-ctrl { display: flex; align-items: center; gap: 10px; flex: none; }

/* --------------------------- тосты --------------------------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 410; display: flex; flex-direction: column; gap: 12px; width: 380px; max-width: calc(100vw - 36px); pointer-events: none; }
.toast { pointer-events: auto; position: relative; overflow: hidden; display: flex; gap: 13px; padding: 15px 16px; border-radius: 16px; background: rgba(18,24,40,.86); border: 1px solid var(--border-2); backdrop-filter: blur(24px); box-shadow: 0 20px 50px rgba(0,0,0,.55); animation: toastIn .45s cubic-bezier(.2,.9,.3,1.2) both; }
html[data-theme="light"] .toast { background: rgba(255,255,255,.92); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(120%) scale(.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(120%) scale(.9); } }
.toast-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--grad); flex: none; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; color: var(--muted); margin-bottom: 3px; display: flex; justify-content: space-between; gap: 8px; }
.toast-title b { color: var(--acc3); }
.toast-msg { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; }
.toast-actions { display: flex; gap: 8px; margin-top: 10px; }
.toast-close { position: absolute; top: 8px; right: 10px; border: none; background: none; color: var(--muted-2); cursor: pointer; font-size: 15px; }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); animation: tprog 8s linear forwards; }
@keyframes tprog { from { width: 100%; } to { width: 0%; } }

/* --------------------------- оверлей/диалог --------------------------- */
.overlay { position: fixed; inset: 0; z-index: 400; background: rgba(3, 8, 5, 0.62); backdrop-filter: blur(6px); display: grid; place-items: center; animation: appIn .25s ease both; }
.dialog { width: 440px; max-width: calc(100vw - 40px); padding: 26px; border-radius: var(--radius); background: var(--bg-1); border: 1px solid var(--border-2); box-shadow: 0 30px 70px rgba(0,0,0,.6); animation: dlgIn .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes dlgIn { from { opacity: 0; transform: scale(.9) translateY(14px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.dialog h3 { font-size: 18px; margin-bottom: 8px; }
.dialog p { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* --------------------------- прочее --------------------------- */
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 168px; }
.loading-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--acc2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.badge-soft { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.warn-text { color: var(--warn); font-size: 12.5px; }
.err-text { color: #ff9a9a; font-size: 12.5px; }
.grow { flex: 1; }

@media (max-width: 1080px) {
  .searchbox { width: 200px; }
  .searchbox:focus-within { width: 240px; }
}

/* ================= Найденные лоты ================= */
.feed-item.new { border-left: 3px solid var(--acc2); background: linear-gradient(90deg, rgba(163, 230, 53, 0.10), transparent 45%); }
.feed-item.fav { box-shadow: inset 0 0 0 1px rgba(245, 196, 81, 0.35); }
.found-fav { border: none; background: none; cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted-2); transition: transform .15s ease, color .2s; padding: 4px; }
.found-fav:hover { transform: scale(1.2); }
.found-fav.on { color: var(--acc3); }
.fnew { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: #04222b; background: var(--acc2); border-radius: 6px; padding: 2px 7px; }
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filterbar .input, .filterbar .select { width: auto; }
.filterbar .select { min-width: 190px; }
.mini-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); }
.mini-seg button { border: none; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 650; padding: 7px 12px; border-radius: 9px; cursor: pointer; transition: all .2s; }
.mini-seg button.active { background: var(--grad); color: #fff; }

/* ================= Обучение (интерактивный тур) ================= */
.tour-root { position: fixed; inset: 0; z-index: 200; }
.tour-catch { position: fixed; inset: 0; cursor: pointer; }
.tour-root.dim .tour-catch { background: rgba(4, 7, 14, 0.62); }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(4, 7, 14, 0.76), 0 0 0 2px rgba(52, 211, 153, 0.95) inset; transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.tour-hole::after { content: ""; position: absolute; inset: -8px; border-radius: 20px; border: 2px solid rgba(52, 211, 153, 0.85); animation: tourPulse 1.6s ease-out infinite; }
@keyframes tourPulse { 0% { transform: scale(0.97); opacity: .95; } 100% { transform: scale(1.09); opacity: 0; } }
.tour-tip { position: fixed; width: 350px; max-width: calc(100vw - 32px); padding: 20px; border-radius: 18px; background: var(--bg-1); border: 1px solid var(--border-2); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65); animation: dlgIn .32s cubic-bezier(.2,.9,.3,1.2) both; z-index: 202; }
.tour-tip h4 { font-size: 16px; margin-bottom: 8px; }
.tour-tip p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tour-step { font-size: 11.5px; font-weight: 700; color: var(--acc2); letter-spacing: .5px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); transition: all .25s; }
.tour-dots i.on { width: 20px; border-radius: 6px; background: var(--grad); border: none; }
.tour-actions { display: flex; gap: 8px; align-items: center; }
.tour-skip { margin-left: auto; background: none; border: none; color: var(--muted-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.tour-skip:hover { color: var(--text); }

/* ================= Исправление карточки монитора (переключатель не перекрывает) ================= */
.mcard-head { padding-right: 86px; }
.mcard-actions { align-items: center; flex-wrap: nowrap; }
.mcard-actions .switch { flex: none; margin-right: 2px; }
.switch.mini .track { width: 42px; height: 24px; }
.switch.mini .track::after { width: 18px; height: 18px; }
.switch.mini input:checked + .track::after { transform: translateX(18px); }
.mcard-actions .btn { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; justify-content: center; text-align: center; padding-left: 10px; padding-right: 10px; }
.mcard-actions .btn.icon { flex: none; min-width: 38px; }
.runstate { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-right: 6px; flex: none; white-space: nowrap; }
@media (max-width: 520px) {
  .mcard-actions { flex-wrap: wrap; }
  .mcard-actions .runstate { width: 100%; margin-right: 0; margin-bottom: 2px; }
}

/* рыночная статистика (мин/средняя цены) */
.mstats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mstats .pill { padding: 4px 9px; }
.mstats .pill b { color: var(--acc3); }

/* сводка по найденным */
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-chip { padding: 10px 14px; border-radius: 13px; background: var(--panel); border: 1px solid var(--border); min-width: 92px; }
.stat-chip span { display: block; font-size: 11px; color: var(--muted-2); margin-bottom: 3px; }
.stat-chip b { font-size: 16px; }
.stat-chip.gold b { color: var(--acc3); }

/* ================= Экран входа / регистрации ================= */
.auth-screen { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 430px; max-width: calc(100vw - 32px); padding: 30px; border-radius: 24px; background: color-mix(in srgb, var(--bg-1) 92%, transparent); border: 1px solid var(--border-2); backdrop-filter: blur(24px); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6); animation: dlgIn .45s cubic-bezier(.2,.9,.3,1.2) both; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo .brand-mark { width: 46px; height: 46px; }
.auth-title { font-size: 22px; font-weight: 800; }
.auth-title b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.auth-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 13px; background: var(--panel); border: 1px solid var(--border); margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; padding: 10px; border-radius: 10px; cursor: pointer; transition: all .2s; }
.auth-tabs button.active { background: var(--grad); color: #fff; }
.auth-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.auth-actions .btn { width: 100%; padding: 13px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--muted-2); }
.auth-foot a { color: var(--acc2); cursor: pointer; }
.auth-foot a:hover { text-decoration: underline; }
.auth-hint { font-size: 11.5px; color: var(--muted-2); text-align: center; }
.checkline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.checkline input { width: 18px; height: 18px; accent-color: var(--acc1); }

/* ================= График истории цен ================= */
.spark-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.spark-wrap .hint { font-size: 10.5px; color: var(--muted-2); }
.spark { display: block; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.history-btn { margin-left: auto; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* избранные продавцы */
.fav-sellers .tag { background: linear-gradient(120deg, rgba(245, 196, 81, 0.18), rgba(163, 230, 53, 0.18)); }
.fav-sellers .tag::before { content: "★ "; color: var(--acc3); }

/* ================= Сворачиваемое меню (sidebar) ================= */
@property --sidebar-w {
  syntax: '<length>';
  inherits: true;
  initial-value: 268px;
}
.app {
  transition: --sidebar-w .38s cubic-bezier(.22, .61, .36, 1),
              grid-template-columns .38s cubic-bezier(.22, .61, .36, 1);
}
.sidebar { z-index: 5; }

.side-toggle {
  align-self: flex-end;
  width: 38px; height: 34px; margin: -2px 0 8px;
  display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 15px; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.side-toggle:hover { background: var(--grad-soft); border-color: var(--border-2); transform: translateY(-1px); }
.side-toggle .st-ico { display: block; transition: transform .38s cubic-bezier(.22, .61, .36, 1); }
.app.collapsed .side-toggle .st-ico { transform: rotate(90deg); }

/* подписи гаснут, а их ширина меняется вместе с шириной панели — без рывков */
.ni-label, .brand-text, .sp-info {
  overflow: hidden; white-space: nowrap; min-width: 0;
  transition: opacity .2s ease;
}
.ni-label, .brand-text, .sp-info { flex: 1 1 auto; }
.app.collapsed { --sidebar-w: 84px; }
.app.collapsed .ni-label,
.app.collapsed .brand-text,
.app.collapsed .sp-info { opacity: 0; pointer-events: none; }

.side-stats {
  transition: opacity .24s ease;
}
.app.collapsed .side-stats { opacity: 0; pointer-events: none; }

/* иконка не «прыгает»: плавно смещается к центру узкой панели */
.app.collapsed .nav-item { gap: 0; }
.ni-ico { transition: transform .38s cubic-bezier(.22, .61, .36, 1); }
.app.collapsed .ni-ico { transform: translateX(-7px); }
.app.collapsed .brand { padding-left: 0; padding-right: 0; }
.brand-mark, .avatar { flex: none; }
.side-profile .avatar { transition: transform .38s cubic-bezier(.22, .61, .36, 1); }
.app.collapsed .side-profile .avatar { transform: translateX(-11px); }
.app.collapsed .ni-badge { position: absolute; top: 0; right: 0; padding: 1px 5px; font-size: 10px; line-height: 1.4; transform: translate(34%, -34%); }
.app.collapsed .ni-dot { position: absolute; top: 4px; right: 4px; }

/* всплывающие подсказки в свёрнутом виде */
.app.collapsed .nav-item,
.app.collapsed .side-profile { position: relative; overflow: visible; }
.app.collapsed .nav-item::after,
.app.collapsed .side-profile::after {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) scale(.92);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border-2);
  padding: 7px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  z-index: 30; box-shadow: var(--shadow);
}
.app.collapsed .nav-item::after { content: attr(data-tip); }
.app.collapsed .side-profile::after { content: "Профиль"; }
.app.collapsed .nav-item:hover::after,
.app.collapsed .side-profile:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }

/* ================= SVG-иконки и фото профиля ================= */
.ni-ico svg { width: 20px; height: 20px; display: block; }
.icon-btn svg { width: 19px; height: 19px; display: block; margin: 0 auto; }
.side-toggle svg { width: 18px; height: 18px; display: block; }
.btn svg { width: 16px; height: 16px; display: block; flex: none; }
.mcard-actions .btn svg, .history-btn svg { width: 15px; height: 15px; }
.btn.icon svg { width: 17px; height: 17px; }
.found-fav { display: grid; place-items: center; }
.found-fav svg { width: 18px; height: 18px; }
.avatar img, .big-avatar img, .avatar-btn img, .avatar.sm img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar.sm, .avatar-btn { overflow: hidden; }
.avatar-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.avatar-btn { display: grid; place-items: center; }
#topAvatar { display: block; width: 100%; height: 100%; }
#topAvatar img { width: 100%; height: 100%; object-fit: cover; }

/* настройки: две колонки → одна на узких экранах */
@media (max-width: 900px) {
  #page-settings > div[style] { grid-template-columns: 1fr !important; }
}
