/* Палитра и шрифты — как в кабинете UTOPAY (assets/css/app.css) */
:root {
  --bg: oklch(0.16 0.012 255);
  --surface: oklch(0.19 0.014 255);
  --surface-2: oklch(0.22 0.016 255);
  --border: oklch(0.28 0.02 255);
  --border-2: oklch(0.34 0.025 255);
  --text: oklch(0.95 0.004 255);
  --text-2: oklch(0.80 0.008 255);
  --muted: oklch(0.64 0.015 255);
  --accent: oklch(0.70 0.14 235);
  --accent-hi: oklch(0.78 0.13 235);
  --accent-soft: oklch(0.70 0.14 235 / 0.14);
  --violet: oklch(0.70 0.14 300);
  --green: oklch(0.72 0.16 155);
  --red: oklch(0.68 0.17 25);
  --amber: oklch(0.78 0.15 75);
  --amber-soft: oklch(0.78 0.15 75 / 0.12);
  --on-accent: oklch(0.14 0.01 255);
  --grad: linear-gradient(135deg, #38bdf8, #d946ef);
  --grad-soft: linear-gradient(135deg, oklch(0.70 0.14 235 / 0.16), oklch(0.70 0.14 300 / 0.16));
  --radius: 14px;
  --font-head: 'Manrope', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: oklch(0.975 0.004 255);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.965 0.005 255);
  --border: oklch(0.90 0.008 255);
  --border-2: oklch(0.84 0.01 255);
  --text: oklch(0.20 0.015 255);
  --text-2: oklch(0.34 0.015 255);
  --muted: oklch(0.48 0.015 255);
  --accent: oklch(0.55 0.15 245);
  --accent-hi: oklch(0.50 0.15 245);
  --accent-soft: oklch(0.55 0.15 245 / 0.10);
  --violet: oklch(0.52 0.16 300);
  --green: oklch(0.55 0.14 155);
  --red: oklch(0.56 0.19 25);
  --amber: oklch(0.62 0.14 70);
  --amber-soft: oklch(0.62 0.14 70 / 0.10);
  --on-accent: #fff;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--font-body); min-height: 100vh; -webkit-font-smoothing: antialiased; }
main { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: var(--text); }
code, .mono { font-family: var(--mono); word-break: break-all; }
.hl { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2, .title, .num, .big, .amount { font-family: var(--font-head); }
h1 { font-size: 22px; font-weight: 800; margin: 4px 0 14px; text-align: center; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; margin: 18px 0 10px; }

.loader { width: 36px; height: 36px; margin: 40vh auto 0; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 8px; font: 800 17px var(--font-head); letter-spacing: .02em; }
.logo-mark { width: 30px; height: 30px; background: url(/img/logo-mark.png) center/contain no-repeat; flex-shrink: 0; }
.logo sup { font-size: .6em; font-weight: 700; margin-left: 2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 0; }
.lang { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--surface); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1; min-width: 0; }
.icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 20px; font-weight: 700; }
.tile { width: 100%; text-align: left; }
.tile .title { font-weight: 700; }
.tile .sub { color: var(--accent); font-size: 13px; }
.chev { color: var(--muted); font-size: 20px; }
.info { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); font-size: 14px; }

.hero-card { background: var(--grad-soft), var(--surface); border-color: var(--border-2); }
.balance { display: flex; justify-content: space-between; align-items: baseline; }
.balance .num { font-size: 32px; font-weight: 800; }
.balance .num.low { color: var(--red); }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; padding: 6px 0; color: var(--text-2); }
.actions .ic { font-size: 20px; color: var(--accent); }

.wallet { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.wallet:first-child { border-top: 0; }
.wallet .grow { min-width: 0; flex: 1; }
.wallet .addr { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 9px; }
.dot.active { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.paused { background: var(--amber); }

.btn { display: block; width: 100%; padding: 13px; border-radius: 12px; text-align: center; font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-hi); }
.btn-line { border: 1px solid var(--accent); color: var(--accent); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn-sm { display: inline-block; width: auto; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn + .btn, .card + .btn { margin-top: 10px; }

.pkg { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.pkg .title { flex: 1; text-align: left; font-weight: 700; }
.pkg .price { font-weight: 700; text-align: right; font-family: var(--font-head); }
.pkg .per { color: var(--muted); font-size: 12px; font-weight: 400; font-family: var(--font-body); }
.pkg.sel { border-color: var(--accent); background: var(--accent-soft); }
.pkg .bolt { color: var(--accent); }

/* Кнопка оплаты всегда видна внизу экрана, пока список тарифов длиннее экрана */
.paybar { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.paybar .btn { box-shadow: 0 6px 20px oklch(0 0 0 / .25); }

.seg {display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { padding: 9px 0; border-radius: 9px; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.qr { background: #fff; border-radius: 14px; padding: 12px; width: 200px; margin: 0 auto 10px; border: 1px solid var(--border); }
.qr img, .qr canvas { display: block; width: 100% !important; height: auto !important; }
.copy { display: flex; align-items: center; gap: 8px; justify-content: center; width: 100%; color: var(--muted); font-size: 13px; padding: 6px; }
.price-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.price-line .grow { flex: 1; }
.price-line .big { font-size: 22px; font-weight: 800; color: var(--accent); text-align: right; white-space: nowrap; }
.price-line s { color: var(--muted); font-size: 13px; display: block; text-align: right; }

.amount { font-size: 26px; font-weight: 800; text-align: center; margin: 6px 0; }
.status { text-align: center; padding: 10px; border-radius: 12px; background: var(--surface-2); margin: 10px 0; color: var(--text-2); }
.status.ok { color: var(--green); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); outline: none; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--amber); border-radius: 12px; background: var(--amber-soft); font-size: 13px; margin-bottom: 12px; }
.note .hl { color: var(--amber); font-weight: 700; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 36px; margin-bottom: 12px; color: var(--text-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }

.hist { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.hist:first-child { border-top: 0; }
.plus { color: var(--green); font-weight: 700; }
.minus { color: var(--red); font-weight: 700; }

details { border-top: 1px solid var(--border); padding: 12px 0; }
details:first-child { border-top: 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '⌄'; color: var(--muted); }
details[open] summary { color: var(--accent); }
details p { color: var(--text-2); font-size: 14px; margin: 10px 0 0; white-space: pre-line; }

.back { color: var(--muted); padding: 6px 0; margin-bottom: 6px; }

.langs button { display: flex; justify-content: space-between; width: 100%; padding: 13px 4px; border-top: 1px solid var(--border); }
.langs button:first-child { border-top: 0; }
.langs button.on { color: var(--accent); font-weight: 700; }

.sheet { position: fixed; inset: 0; background: oklch(0 0 0 / .55); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); border: 1px solid var(--border); }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats3 .card { padding: 12px 10px; margin-bottom: 12px; }
.stats3 .num { font: 800 18px var(--font-head); margin-top: 2px; }

/* Кошелёк: имя и адрес — кнопка состояния */
.wallet-info { text-align: left; min-width: 0; padding: 0; }

/* Выбор языка при первом входе */
.onboard { max-width: 420px; margin: 6vh auto 0; }
.onboard-logo { display: grid; place-items: center; margin-bottom: 16px; }
.onboard-logo .logo-mark { width: 64px; height: 64px; }
.onboard .langs { padding: 4px 14px; margin-bottom: 14px; }

/* Главная: на широком экране — две колонки */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
.wallets-h { margin-top: 18px; }

/* Кабинет на сайте: на весь экран, боковое меню */
body.web main { max-width: none; padding: 0; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px; border-right: 1px solid var(--border); background: var(--surface); }
.side .logo { font-size: 18px; }
.side-bal { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: var(--grad-soft), var(--surface-2); }
.side-bal b { font: 800 22px var(--font-head); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav button { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text-2); text-align: left; font-size: 15px; }
.side-nav button .ic { width: 20px; text-align: center; color: var(--muted); }
.side-nav button:hover { background: var(--surface-2); }
.side-nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-nav button.on .ic { color: var(--accent); }
.side-foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 32px 40px 60px; max-width: 1100px; width: 100%; }
.content h1 { text-align: left; font-size: 28px; margin: 0 0 18px; }
.content-topup, .content-hourly, .content-invoice, .content-partner, .content-faq { max-width: 720px; }
body.web .paybar { margin: 0; padding-left: 0; padding-right: 0; }
@media (min-width: 900px) {
  body.web .home-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  body.web .wallets-h { margin-top: 0; }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 8; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-bal { padding: 6px 10px; gap: 8px; margin-left: auto; }
  .side-bal b { font-size: 16px; }
  .side-bal .muted { display: none; }
  .side-nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side-nav button { white-space: nowrap; padding: 8px 10px; font-size: 14px; }
  .side-foot { margin: 0; }
  .content { padding: 18px 16px 40px; }
}
