/* KennySMS interface. Light theme, system fonts, one brand colour. */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --sunken: #f9fafb;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #d9480f;
  --brand-hover: #bf3f0b;
  --brand-tint: #fff1ea;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --side: #0f172a;
  --side-text: #cbd5e1;
  --side-muted: #64748b;
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-active: rgba(255, 255, 255, 0.12);
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 264px;
  color-scheme: light;
}

.admin { --side: #1e1b4b; --side-muted: #818cf8; --brand: #4338ca; --brand-hover: #3730a3; --brand-tint: #eef2ff; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.625rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; color: var(--ink); }
h2 { font-size: 1.0625rem; font-weight: 650; color: var(--ink); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon { flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ─── Brand ─── */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; flex: none; }
.brand b { color: var(--brand); font-weight: 700; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--sunken); border-color: var(--muted); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--bad); border-color: #fca5a5; }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: 0.55; pointer-events: none; }

/* ─── Forms ─── */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.hint { font-size: 0.8125rem; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 0 14px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 1rem;
}
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input.is-invalid { border-color: var(--bad); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field-error { font-size: 0.8125rem; color: var(--bad); font-weight: 500; }
.input-group { position: relative; }
.input-group .input { padding-right: 48px; }
.input-group .peek { position: absolute; right: 2px; top: 2px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); }
.input-group .peek:hover { color: var(--ink); }
.search { position: relative; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { flex: none; width: 42px; height: 24px; margin-top: 1px; background: var(--line-strong); border-radius: 12px; position: relative; transition: background 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 0.15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch .switch-text { display: grid; gap: 2px; }
.switch .switch-text strong { font-weight: 600; font-size: 0.9375rem; color: var(--ink); }

/* ─── Notices ─── */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 0.9375rem; }
.notice-error { background: var(--bad-bg); border-color: #fecaca; color: var(--bad); }
.notice-success { background: var(--ok-bg); border-color: #bbf7d0; color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }
.notice-info { background: var(--info-bg); border-color: #bfdbfe; color: var(--info); }
.notice a { font-weight: 600; }

/* ─── Cards ─── */
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; }
.panel-body { padding: 20px; }
.stack { display: grid; gap: 20px; }
.stack-sm { display: grid; gap: 12px; }

/* ─── Copyable value ─── */
.copyrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.copyrow-main { display: grid; gap: 2px; min-width: 0; }
.copyrow-value { font-size: 1.0625rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.copyrow-big { font-size: clamp(1.15rem, 5vw, 2rem); letter-spacing: 0.02em; font-weight: 700; white-space: nowrap; }
.copyable { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.copyable .value { font-size: 0.9375rem; overflow-wrap: anywhere; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.8125rem; font-weight: 600; cursor: pointer; flex: none; }
.copy-btn:hover { border-color: var(--brand); color: var(--brand); }
.copy-btn.is-copied { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; padding: 11px 16px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #f3f4f6; color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }
.amt-in { color: var(--ok); font-weight: 600; }
.amt-out { color: var(--bad); font-weight: 600; }

/* ─── App shell: sidebar + main ─── */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sidebar-w); max-width: 86vw;
  display: flex; flex-direction: column; background: var(--side); color: var(--side-text);
  transform: translateX(-100%); transition: transform 0.2s ease-out; overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 16px; }
.sidebar .brand { color: #fff; }
.sidebar .brand b { color: #fb923c; }
.admin .sidebar .brand b { color: #a5b4fc; }
.admin-tag { margin-left: 4px; padding: 2px 7px; border-radius: 6px; background: rgba(165, 180, 252, 0.2); color: #c7d2fe; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; }
.sidebar-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--side-text); cursor: pointer; }
.sidebar-close:hover { background: var(--side-hover); }
.nav { display: grid; gap: 2px; padding: 4px 12px 16px; }
.nav-label { padding: 16px 12px 6px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 550; font-size: 0.9375rem; text-decoration: none; position: relative; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #fb923c; }
.admin .nav a[aria-current="page"]::before { background: #a5b4fc; }
.nav .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f97316; color: #fff; font-size: 0.75rem; font-weight: 700; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 4px; }
.me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: #fff; }
a.me:hover { background: var(--side-hover); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; flex: none; }
.me-text { display: grid; min-width: 0; line-height: 1.25; }
.me-name { font-weight: 600; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 0.75rem; color: var(--side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .logout { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--side-text); font-weight: 550; cursor: pointer; }
.sidebar-foot .logout:hover { background: var(--side-hover); color: #fff; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
body.nav-open .sidebar { transform: none; }
body.nav-open .scrim { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; overflow-x: clip; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; }
.topbar .brand { font-size: 1.05rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-weight: 650; font-size: 0.9375rem; text-decoration: none; color: var(--ink); }
.pill:hover { border-color: var(--brand); }
.pill .icon { color: var(--brand); }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 96px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; flex: 1; }
.content > * { min-width: 0; }
.page-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head { display: grid; gap: 4px; }
.page-head p { color: var(--muted); }
.crumbs { font-size: 0.875rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

@media (min-width: 960px) {
  .sidebar { transform: none; }
  .sidebar-close, .menu-btn, .scrim, .topbar .brand { display: none; }
  .main { margin-left: var(--sidebar-w); }
  .topbar { padding: 12px 32px; justify-content: flex-end; }
  .content { padding: 32px 32px 64px; }
}

/* ─── Auth ─── */
.auth { min-height: 100vh; display: grid; background: var(--surface); }
.auth-art { display: none; }
.auth-main { display: grid; place-items: center; padding: 28px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; display: grid; gap: 24px; padding: 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.auth-head { display: grid; gap: 6px; }
.auth-foot { font-size: 0.9375rem; color: var(--muted); }
.auth-foot a { color: var(--brand); font-weight: 600; }
@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(420px, 5fr) 6fr; }
  .auth-art { display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px; background: var(--side); color: #fff; }
  .auth-art .brand { color: #fff; }
  .auth-art .brand b { color: #fb923c; }
  .art-title { font-size: 2.4rem; line-height: 1.12; letter-spacing: -0.025em; font-weight: 750; max-width: 14em; }
  .art-title span { color: #fb923c; }
  .art-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; color: var(--side-text); }
  .art-list li { display: flex; gap: 12px; align-items: flex-start; }
  .art-list .icon { color: #fb923c; margin-top: 2px; }
  .art-note { font-size: 0.875rem; color: var(--side-muted); }
  .admin .auth-art .brand b, .admin .art-title span, .admin .art-list .icon { color: #a5b4fc; }
  .auth-main { padding: 40px; }
  .auth-card { padding: 36px 32px; }
  .auth-card > .brand { display: none; }
}

/* ─── Site (landing, errors) ─── */
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1160px; margin: 0 auto; padding: 16px; }
.site-nav-links { display: flex; align-items: center; gap: 8px; }
.hero { max-width: 1160px; margin: 0 auto; padding: 36px 16px 56px; display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 4vw, 3.9rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; }
.hero h1 span { color: var(--brand); }
.hero-copy { display: grid; gap: 20px; max-width: 36rem; }
.hero-copy p { font-size: 1.125rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sample { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.1); overflow: hidden; }
.sample-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--sunken); }
.sample-body { padding: 22px 18px; display: grid; gap: 20px; }
.sample-number { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.sample-code { display: flex; gap: 6px; }
.sample-code span { flex: 1; max-width: 52px; aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--brand-tint); border: 1px solid #fed7aa; border-radius: 8px; font-size: 1.6rem; font-weight: 700; color: var(--brand); }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 0.9fr; padding-top: 72px; padding-bottom: 88px; } }
.steps { max-width: 1160px; margin: 0 auto; padding: 0 16px 72px; display: grid; gap: 16px; }
.step { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; }
.step .step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 700; margin-bottom: 6px; }
.step p { color: var(--muted); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.site-foot { max-width: 1160px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.875rem; border-top: 1px solid var(--line-strong); }
.center-page { min-height: 70vh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.center-page > div { display: grid; gap: 14px; justify-items: center; max-width: 420px; }
.big-code { font-size: clamp(4rem, 3rem + 8vw, 7rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--brand); }
@media (max-width: 480px) { .hide-xs { display: none !important; } .site-nav-links { gap: 6px; } }

/* ─── Dashboard widgets ─── */
.hero-card { display: grid; gap: 16px; padding: 24px; background: var(--side); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card .eyebrow { color: var(--side-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-card-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hero-amount { font-size: clamp(2.1rem, 1.4rem + 3vw, 3rem); font-weight: 750; line-height: 1; letter-spacing: -0.02em; }
.hero-card .btn { border-color: transparent; }
.hero-card .btn-light { background: #fff; color: var(--ink); }
.hero-card .btn-light:hover { background: #f3f4f6; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 8px; }
.stat-value { font-size: clamp(1.05rem, 5vw, 1.6rem); font-weight: 750; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.stat-sub { font-size: 0.8125rem; color: var(--muted); }
.kv { display: grid; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.grid-2 > * { min-width: 0; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .grid-2-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.list { display: grid; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list-main { display: grid; min-width: 0; }
.list-main strong { color: var(--ink); font-weight: 600; }
.list-main span { font-size: 0.8125rem; color: var(--muted); }
.quick { display: grid; gap: 12px; }
@media (min-width: 640px) { .quick { grid-template-columns: repeat(3, 1fr); } }
.quick a { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); }
.quick a:hover { border-color: var(--brand); }
.quick .q-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); flex: none; }
.quick strong { display: block; color: var(--ink); }
.quick span { font-size: 0.8125rem; color: var(--muted); }
.signout-row { display: flex; }

/* ─── Wallet ─── */
.tabs { display: flex; width: 100%; gap: 4px; padding: 4px; background: #e5e7eb; border-radius: 10px; max-width: 100%; overflow-x: auto; }
.tabs [role="tab"] { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 8px; white-space: normal; line-height: 1.2; text-align: center; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 0.9375rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pay-amount { font-size: clamp(1.8rem, 1.2rem + 3vw, 2.5rem); font-weight: 750; letter-spacing: -0.02em; color: var(--ink); }
.pay-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--brand-tint); border-radius: var(--radius-sm); font-size: 0.9375rem; color: var(--ink); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.pay-result { justify-items: start; padding: 8px 0; }
.pay-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--sunken); border: 1px solid var(--line); }
.pay-icon.ok { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 0.875rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn.is-active, .chip-btn:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-btn:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Admin bits ─── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.toolbar form { display: flex; gap: 8px; flex: 1 1 260px; max-width: 460px; }
.settings-grid { display: grid; gap: 24px; max-width: 860px; }
.test-row { display: grid; gap: 10px; padding: 16px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.test-row .test-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.test-row .test-controls .input { flex: 1 1 220px; }
.test-result { font-size: 0.9rem; min-height: 1.4em; overflow-wrap: anywhere; }
.test-result.ok { color: var(--ok); }
.test-result.bad { color: var(--bad); }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(rgba(243, 244, 246, 0), var(--bg) 40%); display: flex; justify-content: flex-end; }


/* ─── Buy number (stepped cards) ─── */
.buy { display: grid; gap: 16px; width: 100%; max-width: 760px; }
.step-card { display: grid; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); scroll-margin-top: 84px; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.8125rem; font-weight: 700; flex: none; }
.step-title { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.step-title strong { color: var(--brand); }
.link-btn { margin-left: auto; border: 0; background: none; padding: 6px 4px; font-size: 0.875rem; color: var(--muted); cursor: pointer; }
.link-btn:hover { color: var(--brand); }
.step-card .search .input { border-radius: 14px; background: var(--sunken); }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
@media (min-width: 640px) { .tile-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .tile-grid { grid-template-columns: repeat(5, 1fr); } }
.tile { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 12px 4px; min-width: 0; min-height: 108px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; text-align: center; }
.tile:hover { border-color: var(--brand); }
.tile[aria-selected="true"] { border-color: var(--brand); background: var(--brand-tint); }
.tile-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--sunken); overflow: hidden; }
.tile-icon img { width: 56px; height: 56px; object-fit: contain; }
.tile-icon.is-letter { background: var(--brand-tint); color: var(--brand); font-size: 1.4rem; font-weight: 700; text-transform: uppercase; }
.tile-name { font-size: 0.8125rem; font-weight: 600; line-height: 1.25; color: var(--ink); overflow-wrap: break-word; word-break: normal; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-empty { grid-column: 1 / -1; }
.country-list { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; padding: 2px; }
.country-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer; }
.country-row:hover { border-color: var(--brand); }
.country-row[aria-selected="true"] { border-color: var(--brand); background: var(--brand-tint); }
.flag { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--sunken); font-size: 1.5rem; line-height: 1; flex: none; }
.country-name { font-weight: 650; color: var(--ink); }
.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.price-line strong { font-size: 2rem; font-weight: 800; color: var(--ink); }
.btn-lg { min-height: 52px; font-size: 1rem; }
.recent { max-width: 760px; }
.num-link { text-decoration: none; }
.num-link:hover strong { color: var(--brand); }

/* ─── Telegram widget ─── */
.tg-fab { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #229ed9; color: #fff; box-shadow: 0 6px 18px rgba(34, 158, 217, 0.45); transition: transform 0.15s; }
.tg-fab:hover { transform: scale(1.06); }
.tg-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px #229ed9; }
body.nav-open .tg-fab { display: none; }

/* ─── Admin catalog ─── */
.cat-name { display: inline-flex; align-items: center; gap: 10px; }
.svc-img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: var(--sunken); flex: none; }
.svc-letter { display: inline-grid; place-items: center; background: var(--brand-tint); color: var(--brand); font-weight: 700; text-transform: uppercase; }
.cat-name .flag { width: 36px; height: 36px; font-size: 1.3rem; }
.icon-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-actions .btn { cursor: pointer; }

/* ─── Order view ─── */
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.order-grid > * { min-width: 0; }
@media (min-width: 960px) { .order-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.badge-lg { padding: 6px 14px; font-size: 0.875rem; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; min-height: 96px; padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--sunken); }
.code-box.is-ready { border: 2px solid var(--ok); background: var(--ok-bg); }
.code-wait { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; }
.code-value { font-size: clamp(2.4rem, 1.6rem + 4vw, 3.5rem); font-weight: 800; letter-spacing: 0.14em; color: var(--ink); line-height: 1; overflow-wrap: anywhere; }

.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.input-sm { min-height: 36px; width: 130px; font-size: 0.875rem; padding: 0 10px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.resolve { display: grid; gap: 8px; min-width: 230px; margin-top: 8px; }
.resolve .input { min-height: 38px; font-size: 0.875rem; }
.resolve-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a[role="tab"] { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; min-height: 44px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 0.9375rem; color: var(--muted); text-decoration: none; }
.tabs a[role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ─── Tables on phones: each row becomes a card, every value keeps its label ─── */
@media (max-width: 719px) {
  .table.is-cards, .table.is-cards tbody { display: block; }
  .table.is-cards thead { display: none; }
  .table.is-cards tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.is-cards tr:last-child { border-bottom: 0; }
  .table.is-cards td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0; border: 0; text-align: right; }
  .table.is-cards td::before { content: attr(data-label); flex: none; max-width: 42%; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .table.is-cards .cell-v { min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .table.is-cards td[data-label=""] { display: block; text-align: left; padding-top: 10px; }
  .table.is-cards td[data-label=""] .cell-v { text-align: left; }
  .table.is-cards td[data-label=""]::before { display: none; }
  .table.is-cards .num { text-align: right; }
  .table.is-cards .resolve { min-width: 0; width: 100%; }
  .table.is-cards .icon-actions, .table.is-cards .inline-form { justify-content: flex-end; }
  .pager { flex-wrap: wrap; gap: 10px; }
  .toolbar form { max-width: none; }
  .inline-form { flex-wrap: wrap; }
}

@media (min-width: 640px) { .tabs { display: inline-flex; width: auto; } .tabs [role="tab"], .tabs a[role="tab"] { flex: 0 0 auto; padding: 0 20px; white-space: nowrap; } }
@media (max-width: 359px) { .copyrow-big { font-size: 1.05rem; letter-spacing: 0; } .copyrow { gap: 8px; padding: 10px; } .copy-btn { padding: 0 8px; } }
/* top bar on very small screens: logo mark only, so the balance always fits */
@media (max-width: 479px) { .topbar .brand > span:last-child { display: none; } .topbar { gap: 10px; padding: 10px 12px; } }

.rates-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.rates-link:hover { text-decoration: underline; }
.cat-title { display: flex; align-items: center; gap: 12px; }

.checks .check { flex-wrap: wrap; }
.checks .check.is-bad { background: #fff7f7; }
.check-rows { flex-basis: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
