/* Реселлер-панель (/panel/) и админка (/admin/): общее оформление в стиле сайта — тёмный фон, синие акценты,
   шрифты Manrope и Unbounded (css/fonts.css). Слева меню разделов, на телефоне оно сверху лентой. */
:root {
  --bg: #0a0c14;
  --card: #10131d;
  --card-2: #151a27;
  --card-3: #1a2031;
  --line: #1b2030;
  --line-2: #262d40;
  --text: #f3f5fb;
  --muted: #99a1b4;
  --dim: #646c80;
  --blue: #3d7bff;
  --blue-hi: #7aa6ff;
  --green: #33d17a;
  --amber: #f5b142;
  --red: #ff5d6c;
  --display: "Unbounded", "Unbounded Fallback", "Arial Black", sans-serif;
  --ui: "Manrope", "Manrope Fallback", "Manrope Fallback Arial", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }
body { font-family: var(--ui); font-size: 15px; line-height: 1.45; color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh;
  background: radial-gradient(120% 50% at 50% -10%, rgba(61, 123, 255, .1), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--blue-hi); text-decoration: none; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img { display: block; max-width: 100%; }
.i { width: 18px; height: 18px; flex: none; }
::selection { background: rgba(61, 123, 255, .45); }

/* ---------- каркас: меню слева, содержимое справа ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; background: rgba(16, 19, 29, .85);
  border-right: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--text); }
.logo img { width: 32px; height: 32px; }
.logo span { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .03em; }
.logo b { color: var(--blue); }
.logo small { display: block; margin-top: 2px; font-family: var(--ui); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px; border-radius: 11px; color: var(--muted); font-weight: 700; font-size: 14.5px;
  transition: background .15s, color .15s; }
.nav a:hover { color: #fff; background: var(--card-2); }
.nav a[aria-current="page"] { color: #fff; background: linear-gradient(180deg, rgba(75, 135, 255, .22), rgba(49, 112, 245, .14)); box-shadow: inset 0 0 0 1px rgba(75, 135, 255, .35); }
.nav a .cnt { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber); color: #1a1205; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.side-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-user b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--dim); font-size: 12px; }
.ava { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, #2a3d6e, #1b2440); color: #cfe0ff; }
.side-links { display: flex; gap: 8px; }
.side-links a, .side-links button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2);
  color: var(--muted); font-size: 12.5px; font-weight: 700; }
.side-links a:hover, .side-links button:hover { color: #fff; border-color: #3a4772; }
.side-links .i { width: 15px; height: 15px; }

.main { min-width: 0; padding: 34px 40px 80px; }
.main-in { max-width: 1180px; margin: 0 auto; }
/* баланс справа сверху: виден при прокрутке и в любом разделе панели */
.topbar { position: sticky; top: 14px; z-index: 40; display: flex; justify-content: flex-end; max-width: 1180px; height: 0; margin: -14px auto 14px; pointer-events: none; }
.top-bal { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 12px; border-radius: 12px; background: rgba(16, 19, 29, .92); border: 1px solid var(--line); color: #fff; font-weight: 800; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); }
.top-bal:hover { border-color: #3a4772; }
.top-bal .i { width: 16px; height: 16px; color: var(--blue-hi, #7aa5ff); }
.top-add { display: grid; place-items: center; width: 22px; height: 22px; margin-right: -5px; border-radius: 8px; background: linear-gradient(180deg, #4b87ff, #3170f5); color: #fff; font-size: 15px; line-height: 1; }
.has-top .page-hd { padding-right: 190px; }
/* способы пополнения реселлера */
.pms { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pm { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-align: left; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); color: inherit; cursor: pointer; }
.pm img { flex: none; display: block; }
.pm span { display: grid; gap: 3px; min-width: 0; }
.pm b { font-size: 14.5px; }
.pm small { color: var(--dim); font-size: 12.5px; line-height: 1.4; }
.pm:hover { border-color: #3a4772; }
.pm[aria-pressed="true"] { border-color: var(--blue, #3d7bff); box-shadow: 0 0 0 3px rgba(61, 123, 255, .16); }
.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-hd h1 { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
.page-hd p { margin-top: 6px; color: var(--muted); }
.page-acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 14px;
  white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, opacity .15s; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-blue { color: #fff; background: linear-gradient(180deg, #4b87ff, #3170f5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 20px -10px rgba(61, 123, 255, .8); }
.btn-blue:hover:not(:disabled) { color: #fff; background: linear-gradient(180deg, #5a91ff, #3a78fb); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 3px rgba(61, 123, 255, .22); }
.btn-dark { color: var(--text); background: var(--card-2); border: 1px solid var(--line-2); }
.btn-dark:hover:not(:disabled) { color: #fff; border-color: #3a4772; }
.btn-red { color: #ffd9dd; background: rgba(255, 93, 108, .12); border: 1px solid rgba(255, 93, 108, .35); }
.btn-red:hover:not(:disabled) { color: #fff; background: rgba(255, 93, 108, .22); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-ico { width: 34px; padding: 0; }
.link-btn { color: var(--blue-hi); font-weight: 700; }
.link-btn:hover { color: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.field small { color: var(--dim); font-size: 12.5px; }
.inp, .sel, .ta { width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2); background: #0d1019; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s; }
.ta { height: auto; min-height: 120px; padding: 11px 13px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.inp:focus, .sel:focus, .ta:focus { border-color: #4b87ff; box-shadow: 0 0 0 3px rgba(61, 123, 255, .2); }
.inp::placeholder, .ta::placeholder { color: #4d5568; }
.sel { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.inp-sm { height: 34px; border-radius: 9px; font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; color: var(--muted); user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 180px; }
.err-text { color: #ff9aa4; font-size: 13px; font-weight: 600; }

/* ---------- карточки и цифры ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-hd h2 { font-size: 17px; font-weight: 800; }
.card-hd p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.stat-l { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat-v { margin-top: 8px; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat-s { margin-top: 6px; color: var(--dim); font-size: 13px; }
.hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #16224a, #10162b 55%, #0e1222); border-color: #26345c; }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(61, 123, 255, .35), transparent 70%); pointer-events: none; }
.hero-card .stat-v { font-size: 38px; }
.hero-card .btn { margin-top: 18px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

/* уровень: три ступени и полоса до следующей */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tier { padding: 12px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--card-2); }
.tier b { display: block; font-family: var(--display); font-size: 15px; }
.tier span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tier.on { border-color: rgba(75, 135, 255, .6); background: linear-gradient(180deg, rgba(75, 135, 255, .18), rgba(49, 112, 245, .06)); }
.bar { height: 8px; border-radius: 6px; background: var(--card-3); overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3170f5, #7aa6ff); width: 0; transition: width .6s ease; }

/* ---------- значки статусов ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 800; white-space: nowrap;
  color: var(--muted); background: var(--card-3); border: 1px solid var(--line-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: #8ff0b6; background: rgba(51, 209, 122, .1); border-color: rgba(51, 209, 122, .3); }
.badge.wait { color: #ffd38c; background: rgba(245, 177, 66, .1); border-color: rgba(245, 177, 66, .3); }
.badge.part { color: #a9c6ff; background: rgba(61, 123, 255, .12); border-color: rgba(61, 123, 255, .35); }
.badge.bad { color: #ffb3ba; background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .3); }
.badge.plain::before { display: none; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); padding: 0 12px 10px; white-space: nowrap; }
.tbl td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(255, 255, 255, .02); }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .sub { display: block; color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.more { display: flex; justify-content: center; margin-top: 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .inp { flex: 1 1 220px; max-width: 340px; }
.toolbar .sel { width: auto; min-width: 160px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line-2); gap: 2px; flex-wrap: wrap; }
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { color: #fff; background: var(--card-3); box-shadow: inset 0 0 0 1px #34406a; }

/* ---------- товары ---------- */
.games { display: flex; flex-direction: column; gap: 22px; }
.game-hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.game-hd h3 { font-family: var(--display); font-size: 16px; font-weight: 700; }
.game-hd span { color: var(--dim); font-size: 13px; }
.prod { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 14px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); }
.prod + .prod { margin-top: 10px; }
.prod-img { width: 92px; height: 58px; border-radius: 10px; object-fit: cover; background: var(--card-3); }
.prod-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prod-top b { font-size: 15.5px; }
.prod-top .dim { font-size: 12.5px; }
.prod-top a { font-size: 12.5px; }
.plans { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.plan { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line-2); min-width: 0; }
.plan-l { font-weight: 700; font-size: 13.5px; }
.plan-p { display: flex; flex-direction: column; line-height: 1.15; }
.plan-p b { font-size: 15px; font-variant-numeric: tabular-nums; }
.plan-p s { color: var(--dim); font-size: 12px; }
.stock { font-size: 11.5px; font-weight: 800; }
.stock.in { color: #8ff0b6; }
.stock.out { color: #ffd38c; }
.stock.man { color: #a9b6d6; }

/* выбор игры: плитки с картинкой игры, как в каталоге сайта */
.gtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gtile { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 15px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line);
  color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s; }
.gtile:hover { color: #fff; transform: translateY(-2px); border-color: #3a4772; box-shadow: 0 14px 30px -18px rgba(61, 123, 255, .9); }
.gtile img, .gtile-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gtile-ph { background: linear-gradient(135deg, #1b2440, #10141f); }
.gtile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 12, 20, 0) 35%, rgba(10, 12, 20, .92) 100%); }
.gtile-b { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
.gtile-b b { font-size: 15px; line-height: 1.2; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.gtile-b span { font-size: 12px; font-weight: 700; color: #b9c3da; }
.back-link { display: inline-block; margin-bottom: 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.back-link:hover { color: #fff; }
.game-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.game-bar img { width: 112px; height: 63px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line-2); }
.game-bar h1 { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; }
.game-bar p { margin-top: 4px; color: var(--muted); }

/* скидки читов в админке: поле в процентах, под ним цена реселлера; своя скидка — синим, по умолчанию — серое число в поле */
.dtbl td { vertical-align: top; }
.dwrap { display: inline-flex; align-items: center; gap: 5px; }
.dinp { width: 64px; padding: 0 9px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.dinp::placeholder { color: #565f75; font-weight: 600; }
.dinp.own { border-color: rgba(75, 135, 255, .7); background: rgba(61, 123, 255, .1); color: #fff; }
.dinp.bad { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 93, 108, .18); }
.dsuf { color: var(--dim); font-weight: 800; font-size: 13px; }
.dlbl { color: var(--muted); font-weight: 700; font-size: 12.5px; margin-right: 2px; }
.dprev { display: block; margin-top: 5px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line-2); }
.savebar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px;
  padding: 12px 16px; border-radius: 14px; background: #182037; border: 1px solid #34406a; box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .85); font-weight: 700; }

/* инструкция товара */
.ins-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.ins-btn .i { width: 14px; height: 14px; }
.ins { padding: 14px 16px; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line-2); }
.ins-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--blue-hi); }
.ins-hd b { color: var(--text); font-size: 15px; }
.ins-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; color: #d5dcec; max-height: 60vh; overflow-y: auto; }
.disc { font-size: 11.5px; font-weight: 800; color: #a9c6ff; }
.plan-sub { display: flex; align-items: center; gap: 6px; }
.badge.src { height: 20px; margin-left: 8px; padding: 0 7px; font-size: 11px; vertical-align: 1px; }

/* скидки по уровням (панель реселлера): столбец своего уровня подсвечен, следующие сроки того же чита — без линии */
.ltbl th.on, .ltbl td.on { background: rgba(61, 123, 255, .08); }
.ltbl th.on { color: var(--blue-hi); }
.ltbl tr.cont td { border-top-color: transparent; padding-top: 2px; }
.ltbl td b { font-variant-numeric: tabular-nums; }

/* цены тарифов в админке: кнопка в таблице читов и поля своей цены */
.price-btn { display: inline-flex; flex-direction: column; align-items: flex-start; color: var(--text); font-weight: 700; }
.price-btn .sub { color: var(--blue-hi); font-size: 12px; font-weight: 700; }
.price-btn.own .sub { color: #8ff0b6; }
.pinp { width: 104px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pinp::placeholder { color: #565f75; font-weight: 600; }
.pinp.own { border-color: rgba(75, 135, 255, .7); background: rgba(61, 123, 255, .1); color: #fff; }
.pinp.bad { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 93, 108, .18); }
.pinp.set { border-color: rgba(143, 240, 182, .5); }
.ptbl td { vertical-align: middle; }
.ptbl .pname { min-width: 170px; vertical-align: top; }
.ptbl tr.pfirst td { border-top: 1px solid var(--line-2, rgba(255, 255, 255, .12)); }
.badge.ref { cursor: pointer; }
.badge.ref:hover { color: #fff; border-color: rgba(61, 123, 255, .7); }

/* ключи автовыдачи: выдаются сверху вниз, порядок — перетаскиванием за ручку или стрелками */
.klist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.krow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px 6px 10px; border-radius: 10px; background: #0d1019; border: 1px solid var(--line-2); }
.krow.drag { opacity: .45; }
.krow.over { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(61, 123, 255, .25); }
.krow input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
.kn { min-width: 30px; color: var(--dim); font-size: 12px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.grip { display: inline-flex; padding: 3px; border-radius: 6px; color: var(--dim); cursor: grab; }
.grip:hover { color: #fff; background: var(--card-3); }
.krow code { flex: 1 1 220px; min-width: 0; font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; }
.kdate { font-size: 12px; }
.kacts { display: inline-flex; gap: 4px; margin-left: auto; }
.btn-xs.btn-ico { width: 28px; padding: 0; }
.btn-xs .i { width: 15px; height: 15px; }

/* уведомления в Telegram: события столбиком, выбранный чат подсвечен */
.tg-events { display: flex; flex-direction: column; gap: 8px; }
.chip.on { color: #fff; border-color: rgba(75, 135, 255, .7); background: rgba(61, 123, 255, .14); }

/* заказ: блок для спора с банком */
details > summary.evid-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: pointer; }

/* ключи */
.keys { display: flex; flex-direction: column; gap: 8px; }
.key { display: flex; align-items: center; gap: 10px; padding: 9px 9px 9px 13px; border-radius: 10px; background: #0d1019; border: 1px solid var(--line-2); }
.key code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; user-select: all; }
.code-box { position: relative; padding: 14px 16px; border-radius: 12px; background: #0b0e16; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere; color: #d7e2ff; }
.code-box .btn { position: absolute; top: 8px; right: 8px; }
.note { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; background: rgba(61, 123, 255, .08); border: 1px solid rgba(61, 123, 255, .25); color: #c9d8ff; }
.note.warn { background: rgba(245, 177, 66, .08); border-color: rgba(245, 177, 66, .3); color: #ffe2b0; }
.note.bad { background: rgba(255, 93, 108, .08); border-color: rgba(255, 93, 108, .3); color: #ffc7cd; }
.note b { color: #fff; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; overflow-wrap: anywhere; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); font-weight: 700; font-size: 13.5px; color: var(--muted); }
.chip:hover { color: #fff; border-color: #3a4772; }

/* ---------- окно и уведомления ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; overflow-y: auto;
  background: rgba(5, 7, 13, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .15s ease; }
.modal { width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.modal-hd h2 { font-size: 19px; font-weight: 800; line-height: 1.25; }
.modal-hd p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.modal-x { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line-2); }
.modal-x:hover { color: #fff; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 13px; background: #182037; border: 1px solid #2c3a63; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .8); font-weight: 600; font-size: 14px; animation: pop .18s ease; }
.toast.ok { border-color: rgba(51, 209, 122, .45); }
.toast.bad { border-color: rgba(255, 93, 108, .5); background: #2a1520; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; }
.qty button { width: 40px; height: 40px; font-size: 18px; font-weight: 700; color: var(--muted); background: var(--card-2); }
.qty button:hover { color: #fff; }
.qty input { width: 64px; height: 40px; text-align: center; border: 0; background: #0d1019; outline: none; font-weight: 800; }
.sum { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.sum b { font-variant-numeric: tabular-nums; }
.sum.big b { font-family: var(--display); font-size: 20px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 12px; color: var(--muted); }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(122, 166, 255, .25); border-top-color: var(--blue-hi); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* экран без доступа / вход */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .card { width: 100%; max-width: 460px; text-align: center; padding: 34px 28px; }
.gate h1 { font-family: var(--display); font-size: 22px; margin: 16px 0 8px; }
.gate p { color: var(--muted); }
.gate .btn { margin-top: 20px; }
.gate form { margin-top: 18px; text-align: left; display: flex; flex-direction: column; gap: 12px; }

/* документация API */
.doc h3 { font-size: 15.5px; font-weight: 800; margin: 22px 0 8px; }
.doc h3:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--muted); font-size: 14px; }
.doc ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.doc code { font-family: var(--mono); font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: var(--card-3); color: #d7e2ff; }
.doc .code-box code { padding: 0; background: none; }
.ep { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.ep b { font-family: var(--mono); font-size: 12px; padding: 3px 7px; border-radius: 6px; background: rgba(51, 209, 122, .14); color: #8ff0b6; }
.ep b.post { background: rgba(61, 123, 255, .16); color: #a9c6ff; }
.ep code { font-size: 13.5px; }

/* ---------- телефон и планшет ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 60; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--line); }
  .logo small { display: none; }
  .nav { order: 3; flex-direction: row; width: 100%; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; height: 36px; font-size: 13.5px; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; border: 0; background: none; }
  .side-user small, .side-user b { display: none; }
  .side-links a span, .side-links button span { display: none; }
  .side-links a, .side-links button { width: 34px; flex: none; }
  .main { padding: 22px 16px 60px; }
  /* на телефоне и планшете шапка панели сверху: баланс — в ней, справа, рядом с кнопками (значок аккаунта уступает ему место) */
  .topbar { position: fixed; top: 10px; right: 100px; z-index: 70; height: auto; margin: 0; max-width: none; }
  .top-bal { height: 34px; padding: 0 10px 0 9px; font-size: 13.5px; border-radius: 9px; gap: 6px; }
  .top-add { display: none; }
  .has-top .side-user { display: none; }
  .has-top .page-hd { padding-right: 0; }
}
@media (max-width: 520px) {
  .has-top .side .logo span { display: none; }
}
@media (max-width: 900px) {
  .page-hd h1 { font-size: 22px; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; border-radius: 16px; }
  .tbl-wrap { margin: 0 -18px; padding: 0 18px; }
  .prod { grid-template-columns: minmax(0, 1fr); }
  .prod-img { width: 100%; height: 120px; }
  .gtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gtile-b b { font-size: 13.5px; }
  .game-bar img { width: 84px; height: 48px; }
  .game-bar h1 { font-size: 21px; }
  .plan { width: 100%; justify-content: space-between; }
  .modal { padding: 18px; border-radius: 16px; }
  .hero-card .stat-v { font-size: 30px; }
}
