/* =========================================================
   Reseller panel — pastel sky blue + mint on white.
   Mobile-first. Phone: drawer sidebar. Laptop (>=960px): fixed sidebar.
   ========================================================= */
:root {
  --page: #f6f9fe;
  --surface: #ffffff;
  --side: #eef5ff;
  --border: #dbe7f6;
  --border-strong: #c3d7ef;

  --sky: #b9dcff;          /* primary buttons */
  --sky-hover: #a3d0ff;
  --on-sky: #12345a;       /* navy text on sky (8.8:1) */
  --sky-50: #f2f8ff;
  --sky-100: #e4f0fe;
  --sky-200: #cfe3fb;
  --sky-line: #93c3f3;     /* decorative edges */

  --mint: #9fe3c6;
  --mint-hover: #86d9b6;
  --on-mint: #0f3a2e;
  --mint-50: #ecfaf3;
  --mint-100: #d9f4e8;
  --mint-line: #b5e6cf;

  --link: #1f5f9e;
  --ink: #18263a;
  --muted: #526178;        /* 5.9:1 on page */
  --focus: #2f6fb3;        /* 4.9:1 on white */

  --ok: #157a4f;  --ok-bg: #e3f7ec;  --ok-line: #b5e0cb;
  --warn: #7a4b00; --warn-bg: #fff3d6; --warn-line: #f1d7a3;
  --bad: #b42318; --bad-bg: #fdecea; --bad-line: #f4bdb7;
  --info: #1f4f82; --info-bg: #e4f0fe; --info-line: #c5dcf7;
  --neutral: #47566b; --neutral-bg: #eef2f7; --neutral-line: #d8e0ea;

  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 38, 58, .05), 0 4px 14px rgba(31, 95, 158, .06);
  --shadow-lg: 0 2px 6px rgba(24, 38, 58, .06), 0 22px 48px rgba(31, 95, 158, .18);

  /* icon-square tints in the sidebar (ink on tint >= 4.5:1) */
  --t-sky: #dcebfd;   --t-sky-ink: #1f5f9e;
  --t-mint: #d5f2e5;  --t-mint-ink: #17694a;
  --t-sand: #fbebc8;  --t-sand-ink: #7a4b00;
  --t-lilac: #e9e4fb; --t-lilac-ink: #553f9e;
  --t-slate: #e3e9f1; --t-slate-ink: #3d4f68;

  --top-h: 56px;
  --side-w: 232px;
  --gutter: 16px;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1280px) { :root { --gutter: 28px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; letter-spacing: -.012em; margin: 0; }
p { margin: 0 0 .8em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 650; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
code, kbd, pre { font-family: var(--mono); }
code {
  font-size: .88em; color: var(--on-sky); background: var(--sky-50);
  border: 1px solid var(--sky-200); padding: .05em .4em; border-radius: 6px;
  overflow-wrap: anywhere;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.plus { color: var(--ok); font-weight: 650; }
.minus { color: var(--bad); font-weight: 650; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 300;
  background: var(--sky); color: var(--on-sky); padding: 10px 16px; border-radius: 10px;
  font-weight: 650; text-decoration: none;
}
.skip:focus { top: 10px; }

.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--on-sky);
  font-weight: 650; font-size: .97rem; line-height: 1.2; text-decoration: none; text-align: center;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover { background: var(--sky-50); border-color: var(--sky-line); text-decoration: none; }
.btn .ico { width: 18px; height: 18px; }
.btn.primary { background: var(--sky); border-color: #9ccbf6; color: var(--on-sky); box-shadow: 0 1px 2px rgba(31, 95, 158, .16); }
.btn.primary:hover { background: var(--sky-hover); border-color: #86bdf2; }
.btn.mint { background: var(--mint); border-color: var(--mint-hover); color: var(--on-mint); box-shadow: 0 1px 2px rgba(21, 122, 79, .14); }
.btn.mint:hover { background: var(--mint-hover); }
.btn.danger { background: var(--surface); border-color: var(--bad-line); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger.solid { background: var(--bad-bg); border-color: #eaa59d; }
.btn.danger.solid:hover { background: #fbdcd8; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--sky-100); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2.5px solid rgba(18, 52, 90, .25); border-top-color: var(--on-sky);
  animation: spin .7s linear infinite;
}
@media (hover: hover) {
  .btn.primary:not(:disabled):hover, .btn.mint:not(:disabled):hover { transform: translateY(-1px); }
}
@media (max-width: 767.98px), (pointer: coarse) {
  .btn.sm { min-height: 44px; padding: 0 14px; }
}
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--on-sky);
}
.icon-btn:hover { background: var(--sky-100); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; min-height: 44px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  height: var(--top-h); padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
}
.menu-btn { margin-left: -6px; }
.menu-btn:hover { background: var(--sky-100); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; min-width: 0; margin-right: auto;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: -.01em;
}
.brand:hover { color: var(--ink); }
.brand img { width: 28px; height: 28px; max-width: none; border-radius: 8px; box-shadow: 0 1px 3px rgba(31, 95, 158, .25); flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.balance-pill {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--mint-50); border: 1px solid var(--mint-line); color: var(--on-mint);
  font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums;
  text-decoration: none; white-space: nowrap;
}
.balance-pill:hover { background: var(--mint-100); color: var(--on-mint); text-decoration: none; }
.balance-pill .ico { width: 18px; height: 18px; }
.balance-pill.low { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.balance-pill.low:hover { background: #ffeac0; }
.balance-pill .low-tag {
  display: none; padding: 1px 7px; border-radius: 999px; background: #ffe1a1; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
.balance-pill.low .low-tag { display: inline-block; }
.top-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: var(--on-sky); font-weight: 650; font-size: .92rem; text-decoration: none; white-space: nowrap;
}
.top-btn:hover { background: var(--sky-100); text-decoration: none; }
.top-btn[aria-current="page"] { background: var(--sky-100); }
.top-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 519.98px) {
  .topbar .brand-name { display: none; }
  .balance-pill .low-tag { display: none !important; }
  .balance-pill { padding: 0 10px 0 8px; gap: 5px; font-size: .9rem; }
}
@media (min-width: 768px) {
  .top-btn { padding: 0 12px; }
  .top-btn .lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
/* mouse + wide screen: denser top bar controls */
@media (min-width: 960px) and (pointer: fine) {
  .balance-pill, .top-btn { min-height: 36px; }
  .top-btn .ico, .balance-pill .ico { width: 17px; height: 17px; }
}
@media (min-width: 960px) {
  .menu-btn { display: none; }
  /* the brand sits over the sidebar column, so the sidebar reads as one full-height panel */
  .topbar { padding-left: 0; }
  .topbar > .brand {
    align-self: stretch; flex: none; width: var(--side-w); padding: 0 16px; margin-right: auto;
    background: var(--side); border-right: 1px solid var(--border);
  }
}

/* ---------- layout + sidebar ---------- */
.shell { display: block; }
.layout { display: block; }
.sidebar {
  background: var(--side);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  font-size: .9rem;
}
.side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: var(--top-h); padding: 0 6px 0 14px; border-bottom: 1px solid var(--border);
}
.side-head .brand { margin: 0; min-width: 0; }
.nav { display: grid; gap: 12px; padding: 12px 8px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 0 8px 0 6px; border-radius: 8px;
  color: #26364d; font-weight: 560; text-decoration: none; line-height: 1.25;
  transition: background-color .12s ease, color .12s ease;
}
.nav a:hover { background: #e1edfc; color: var(--ink); text-decoration: none; }
.nav-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-ico {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--t-sky); color: var(--t-sky-ink);
  transition: background-color .12s ease, color .12s ease;
}
.nav-ico .ico { width: 15px; height: 15px; }
.nav-ico.t-mint { background: var(--t-mint); color: var(--t-mint-ink); }
.nav-ico.t-sand { background: var(--t-sand); color: var(--t-sand-ink); }
.nav-ico.t-lilac { background: var(--t-lilac); color: var(--t-lilac-ink); }
.nav-ico.t-slate { background: var(--t-slate); color: var(--t-slate-ink); }
.nav a[aria-current="page"] {
  background: var(--surface); color: var(--on-sky); font-weight: 680;
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(24, 38, 58, .06);
}
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #3f8ad6;
}
.nav a[aria-current="page"] .nav-ico { background: var(--sky); color: var(--on-sky); }
.nav a[aria-current="page"] .nav-ico.t-mint { background: var(--mint); color: var(--on-mint); }
.nav a[aria-current="page"] .nav-ico.t-sand { background: #f6d58f; color: #4d3000; }
.nav a[aria-current="page"] .nav-ico.t-lilac { background: #d3c9f6; color: #35237a; }
.nav a[aria-current="page"] .nav-ico.t-slate { background: #cbd6e4; color: #22324a; }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn);
  font-size: .72rem; font-weight: 800; text-align: center; line-height: 1.55;
}
/* foldable group label */
.nav-group {
  display: flex; align-items: center; gap: 6px; width: 100%;
  min-height: 28px; margin: 0 0 2px; padding: 0 8px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; text-align: left;
}
.nav-group:hover { color: var(--ink); background: #e1edfc; }
.nav-group-t { flex: 1 1 auto; min-width: 0; }
.nav-n {
  padding: 0 6px; border-radius: 999px; background: rgba(82, 97, 120, .1); color: var(--muted);
  font-size: .68rem; letter-spacing: 0; line-height: 1.6;
}
.nav-group[aria-expanded="true"] .nav-n { display: none; }
.nav-group .chev { width: 14px; height: 14px; transition: transform .15s ease; }
.nav-group[aria-expanded="false"] .chev { transform: rotate(-90deg); }
/* a folded admin group still shows that something is waiting */
.nav-sec:has(.count:not([hidden])) .nav-group[aria-expanded="false"] .nav-n { background: var(--warn-bg); color: var(--warn); box-shadow: 0 0 0 1px var(--warn-line); }
.nav-sec.admin { padding-top: 12px; border-top: 1px solid var(--border-strong); }

/* bottom: setup-guide link + account mini-card */
.side-foot {
  position: sticky; bottom: 0; margin-top: auto; display: grid; gap: 4px; padding: 8px;
  border-top: 1px solid var(--border); background: var(--side);
}
.side-link {
  display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border-radius: 8px;
  color: var(--link); font-weight: 600; font-size: .84rem; text-decoration: none;
}
.side-link:hover { background: #e1edfc; text-decoration: none; }
.side-link .ico { width: 15px; height: 15px; }
.side-link .ext { width: 13px; height: 13px; margin-left: auto; opacity: .7; }
.me-card {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); text-decoration: none;
}
.me-card:hover { border-color: var(--sky-line); text-decoration: none; color: var(--ink); }
.me-av {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(140deg, var(--sky) 0%, var(--mint) 100%); color: var(--on-sky);
  font-weight: 800; font-size: .9rem; text-transform: uppercase;
}
.me-txt { display: grid; min-width: 0; flex: 1 1 auto; line-height: 1.3; }
.me-name { font-weight: 650; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub b { color: var(--ok); font-weight: 700; font-variant-numeric: tabular-nums; }
.me-card.low .me-sub b { color: var(--warn); }
.me-card .chev { width: 15px; height: 15px; color: var(--muted); }
.scrim { display: none; }

/* touch screens (and small phones): 44 px rows */
@media (pointer: coarse), (max-width: 599.98px) {
  .nav a { min-height: 44px; }
  .nav-group { min-height: 44px; margin: 0; }
  .side-link { min-height: 44px; }
  .me-card { min-height: 52px; }
}

@media (max-width: 959.98px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 90;
    width: min(80vw, 288px); height: 100%; height: 100dvh;
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-102%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: 12px 0 32px rgba(18, 38, 64, .16);
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform .22s ease; }
  .side-foot { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .scrim.on { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(18, 38, 64, .4); }
  html.drawer-open, html.drawer-open body { overflow: hidden; }
}
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: var(--top-h); align-self: start;
    height: calc(100vh - var(--top-h)); overflow-y: auto; scrollbar-width: thin;
  }
  .side-head { display: none; }
}

main { display: block; min-width: 0; padding: 20px var(--gutter) 64px; }
main:focus { outline: none; }
.view { max-width: 1400px; margin: 0 auto; min-width: 0; }
@media (min-width: 960px) { main { padding-top: 24px; } }

/* boot splash */
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.booting .shell { display: none; }
body:not(.booting) .boot { display: none; }

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 0 0 20px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head h1 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); letter-spacing: -.02em; margin: 0 0 4px; }
.page-head h1:focus { outline: none; }
.page-head .lead { margin: 0; color: var(--muted); max-width: 64ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--link); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -8px 0 6px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 599.98px) {
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
}

.section { margin: 0 0 22px; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 30px 0 12px; }
.section-title h2 { font-size: 1.2rem; }

/* ---------- cards & grids ---------- */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
@media (min-width: 768px) { .card { padding: 22px; } }
.card + .card { margin-top: 18px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 0 0 14px; }
.card-head h2, .card h2 { font-size: 1.14rem; margin: 0; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.card-head > div { min-width: 0; }
.card.flat { box-shadow: none; }
.card.tint { background: linear-gradient(135deg, #f2f8ff 0%, #effaf5 100%); border-color: var(--sky-200); }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid > .card + .card, .products > .card + .card { margin-top: 0; }
.stack { display: grid; gap: 18px; }
.stack > .card + .card { margin-top: 0; }

/* stat tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin: 0 0 22px; }
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
a.tile:hover { border-color: var(--sky-line); text-decoration: none; color: var(--ink); }
.tile .k { font-size: .76rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.tile .s { font-size: .86rem; color: var(--muted); }
.tile.sky { background: linear-gradient(140deg, #eaf4ff, #ffffff 70%); border-color: var(--sky-200); }
.tile.mint { background: linear-gradient(140deg, #e7f8f0, #ffffff 70%); border-color: #c9ecdc; }
.tile.warn { background: linear-gradient(140deg, #fff3d6, #ffffff 75%); border-color: var(--warn-line); }
.tile .tile-ico { position: absolute; right: 14px; top: 14px; color: #6d93bd; }
.tile:has(> .tile-ico) .k { padding-right: 26px; }
@media (max-width: 380px) { .tile { padding: 12px; } .tile .tile-ico { display: none; } }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  padding: 1px 10px; border-radius: 999px; border: 1px solid var(--neutral-line);
  background: var(--neutral-bg); color: var(--neutral);
  font-size: .78rem; font-weight: 700; line-height: 1.7; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.chip.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.chip.mint { background: var(--mint-50); color: var(--on-mint); border-color: var(--mint-line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.model-chip {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 2px 10px; border-radius: 999px; background: var(--sky-50); border: 1px solid var(--sky-200);
  color: var(--on-sky); font-family: var(--mono); font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere;
}
.model-chip.all { font-family: var(--font); font-weight: 700; background: var(--mint-50); border-color: var(--mint-line); color: var(--on-mint); }

/* segmented filters */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .92rem;
}
.seg button:hover { border-color: var(--sky-line); background: var(--sky-50); }
.seg button[aria-pressed="true"] { background: var(--sky); border-color: #9ccbf6; color: var(--on-sky); }
@media (max-width: 767.98px), (pointer: coarse) { .seg button { min-height: 44px; } }

/* toolbar above lists */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 0 0 14px; }
.toolbar .field { margin: 0; flex: 1 1 220px; min-width: 0; }
.toolbar .field.narrow { flex: 0 1 200px; }
.toolbar .seg { flex: 1 1 100%; }
@media (min-width: 900px) { .toolbar .seg { flex: 0 1 auto; } }
.search { position: relative; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.search input { padding-left: 40px; }

/* ---------- forms ---------- */
label, .label { display: block; margin: 0 0 6px; font-weight: 650; font-size: .94rem; color: var(--ink); }
.field { margin: 0 0 16px; min-width: 0; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
.opt { font-weight: 500; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; min-width: 0;
  min-height: 46px; padding: 10px 13px;
  font-size: 16px; line-height: 1.4;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #5f6e84; }
input:hover, select:hover, textarea:hover { border-color: var(--sky-line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px rgba(47, 111, 179, .18); }
input[readonly] { background: var(--sky-50); }
input[type="file"] { padding: 9px; min-height: 46px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; display: inline-block; accent-color: #2f6fb3; margin: 0; flex: none; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2312345a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 13px center / 16px no-repeat;
  text-overflow: ellipsis;
}
textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
@media (max-width: 599.98px) { .form-actions .btn { flex: 1 1 auto; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; margin: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.radio-cards label {
  display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; padding: 0 14px;
  border: 1.5px solid var(--border-strong); border-radius: 12px; cursor: pointer; font-weight: 650;
}
.radio-cards label:has(input:checked) { border-color: var(--focus); background: var(--sky-50); }
.radio-cards label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.money-input { position: relative; }
.money-input > span {
  position: absolute; left: 1px; top: 1px; bottom: 1px; width: 38px; display: grid; place-items: center;
  color: var(--muted); font-weight: 700; pointer-events: none; border-radius: 11px 0 0 11px;
}
.money-input input { padding-left: 34px; font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 8px; }
.stepper button {
  min-height: 46px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--surface);
  font-size: 1.3rem; font-weight: 700; color: var(--on-sky); line-height: 1;
}
.stepper button:hover { background: var(--sky-50); }
.stepper input { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-error {
  margin: 4px 0 14px; padding: 11px 14px; border-radius: 12px;
  background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); font-weight: 600;
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 82px; }
.pw-wrap button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--sky-50);
  color: var(--on-sky); font-weight: 650; font-size: .86rem;
}
@media (pointer: coarse), (max-width: 767.98px) { .pw-wrap button { min-height: 44px; right: 1px; } .pw-wrap input { min-height: 48px; } }

/* switch */
.switch {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px 0 0; margin: 0;
  border: 0; background: none; color: var(--ink); font-weight: 650; font-size: .92rem; text-align: left;
  border-radius: 999px;
}
.switch .track {
  position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px;
  background: #7b8ca5; transition: background-color .18s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(18, 38, 64, .3); transition: transform .18s ease;
}
.switch[aria-checked="true"] .track { background: #2b8a63; }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }
.switch:disabled { opacity: .6; cursor: progress; }
.switch:focus-visible { outline-offset: 3px; }
.switch .state { font-weight: 600; color: var(--muted); font-size: .86rem; }

/* ---------- notes / banners ---------- */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 18px; padding: 13px 16px;
  background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: var(--radius-sm);
  color: var(--ink);
}
.note > .ico { margin-top: 2px; color: var(--focus); }
.note > div { min-width: 0; flex: 1; }
.note p { margin: 0; }
.note p + p { margin-top: 6px; }
.note .btn { margin-top: 10px; }
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.note.warn > .ico { color: var(--warn); }
.note.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.note.ok > .ico { color: var(--ok); }
.note.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.note.bad > .ico { color: var(--bad); }
.note.mint { background: var(--mint-50); border-color: var(--mint-line); }
.note.mint > .ico { color: var(--ok); }
@media (min-width: 640px) { .note.row > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; } .note.row .btn { margin-top: 0; flex: none; } }

/* ---------- states ---------- */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 18px; color: var(--muted); }
.state h3, .state h1 { font-size: 1.08rem; color: var(--ink); margin: 6px 0 0; }
.state p { margin: 0; max-width: 46ch; }
.state .btn { margin-top: 10px; }
.state.loading { flex-direction: row; justify-content: center; gap: 12px; font-weight: 600; }
.state.compact { padding: 22px 12px; }
.state-art {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px;
  background: linear-gradient(140deg, var(--sky-100), var(--mint-100)); color: var(--focus);
}
.state-art .ico { width: 28px; height: 28px; }
.state-art.bad { background: var(--bad-bg); color: var(--bad); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--sky-200); border-top-color: var(--focus); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, #eaf2fc 0%, #f5f9fe 50%, #eaf2fc 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; min-height: 18px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- tables ---------- */
.table-wrap {
  position: relative; /* keeps absolutely-positioned sr-only text inside the scroll box */
  overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  max-width: 100%;
}
.card > .table-wrap { margin: 0 -1px; }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
.t th {
  background: #f1f6fd; color: #2c4a6e; text-align: left;
  font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fafcff; }
.t .r { text-align: right; }
.t td.r .c { justify-content: flex-end; }
.t .c { min-width: 0; }
.t .sub { display: block; color: var(--muted); font-size: .84rem; }
.t td .btn-row { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.t a.rowlink { font-weight: 650; text-decoration: none; }
.t a.rowlink:hover { text-decoration: underline; }
@media (max-width: 899.98px) {
  .table-wrap.rt-wrap { overflow: visible; border: 0; background: none; }
  .t.rt { display: block; }
  .t.rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .t.rt tbody { display: grid; gap: 12px; }
  .t.rt tr {
    display: block; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); box-shadow: 0 2px 8px rgba(31, 95, 158, .05);
  }
  .t.rt td { display: grid; grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 0; border: 0; text-align: left; }
  .t.rt td + td { border-top: 1px dashed var(--border); }
  .t.rt td::before {
    content: attr(data-label); font-size: .74rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted); padding-top: 3px;
  }
  .t.rt td.r { text-align: left; }
  .t.rt td.r .c { justify-content: flex-start; }
  .t.rt td.full { grid-template-columns: minmax(0, 1fr); }
  .t.rt td.full::before { display: none; }
  .t.rt td .btn-row { flex-wrap: wrap; justify-content: flex-start; }
  .t.rt tbody tr:hover td { background: none; }
  .t.rt td.head-cell { font-size: 1rem; }
}
@media (min-width: 640px) and (max-width: 899.98px) {
  .t.rt tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: .92rem; }

/* ---------- dialogs ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(18, 38, 64, .45); }
dialog.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-inner { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 14px 8px 20px; }
.modal-head h2 { flex: 1; font-size: 1.2rem; margin-top: 10px; }
.modal-body { padding: 6px 20px 10px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.modal-body > p:first-child { color: var(--muted); }
.modal-foot { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--border); background: #fbfdff; }
.modal-head .icon-btn { flex: none; }
@media (max-width: 599.98px) {
  dialog.modal, dialog.modal.wide {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 14px 14px 0 0;
    max-height: 92vh; max-height: 92dvh; border-bottom: 0;
  }
  dialog.modal[open] { animation: sheet .22s ease-out; }
  .modal-foot { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 140px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.summary { margin: 4px 0 16px; padding: 4px 16px; border: 1px solid var(--sky-200); border-radius: 14px; background: var(--sky-50); }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; }
.summary div + div { border-top: 1px solid var(--sky-200); }
.summary dt { color: var(--muted); font-weight: 600; }
.summary dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.summary .big dd { font-size: 1.15rem; color: var(--on-sky); }
.summary .bad dd { color: var(--bad); }

/* secret shown once */
.secret-box {
  display: grid; gap: 10px; padding: 14px; margin: 0 0 14px;
  border: 1.5px dashed #8fc0f2; border-radius: 14px; background: #f5faff;
}
.secret-box .lbl { font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.secret-box code { display: block; padding: 0; border: 0; background: none; font-size: .98rem; color: var(--ink); word-break: break-all; line-height: 1.5; user-select: all; }
@media (min-width: 600px) { .secret-box.row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .secret-box.row .lbl { grid-column: 1 / -1; } }
.success-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ok); color: #fff; box-shadow: 0 0 0 7px var(--ok-bg); margin: 6px 0 16px 6px; }
.success-mark .ico { width: 26px; height: 26px; }

/* copy rows (url + copy button) */
.copy-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); min-width: 0; }
.copy-row code { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font-size: .92rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.copy-row code::-webkit-scrollbar { display: none; }
.copy-btn.done { background: var(--ok-bg) !important; border-color: var(--ok-line) !important; color: var(--ok) !important; }
.kv { display: grid; gap: 4px; margin: 0 0 14px; }
.kv > span { font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.msg-preview { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--page); border: 1px solid var(--border); white-space: pre-wrap; font-family: var(--mono); font-size: .84rem; overflow-wrap: anywhere; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 400; left: 50%; bottom: 16px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: 14px; background: #18263a; color: #fff;
  box-shadow: 0 14px 32px rgba(18, 38, 64, .28); font-weight: 600; font-size: .95rem;
  animation: toastIn .2s ease-out;
}
.toast.ok { background: #0f5a3b; }
.toast.bad { background: #8f1c13; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- product cards ---------- */
.products { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.product { display: flex; flex-direction: column; gap: 12px; }
.product h3 { font-size: 1.12rem; }
.product .desc { color: var(--muted); margin: 0; font-size: .95rem; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.price strong { font-size: 1.55rem; font-weight: 780; letter-spacing: -.02em; color: var(--on-sky); font-variant-numeric: tabular-nums; }
.price span { color: var(--muted); font-weight: 600; }
.product .facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.product .facts li { display: flex; gap: 8px; align-items: center; }
.product .facts .ico { width: 16px; height: 16px; color: var(--ok); }
.product .btn { margin-top: auto; }
.product .models { max-height: 128px; overflow-y: auto; padding: 2px; }
.cat-badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(140deg, var(--sky-100), var(--mint-100)); color: var(--on-sky); flex: none; }
.how { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; counter-reset: how; }
.how li { counter-increment: how; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: .94rem; }
.how li::before { content: counter(how); display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: var(--on-mint); font-weight: 800; font-size: .88rem; }
@media (min-width: 720px) { .how { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- token pages: catalog grouped by provider ---------- */
.tk-how { display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 16px; color: var(--muted); font-size: .9rem; }
.tk-how .ico { width: 16px; height: 16px; margin-top: 3px; color: var(--focus); }
.tk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.tk-search { flex: 1 1 240px; max-width: 440px; min-width: 0; }
.tk-count { margin: 0; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-fold { margin-left: auto; }
.tk-chips {
  display: flex; gap: 6px; margin: 0 0 12px; padding: 2px 0 4px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
@media (min-width: 700px) { .tk-chips { flex-wrap: wrap; overflow: visible; } }
.tk-chips button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-size: .86rem; font-weight: 600; white-space: nowrap;
}
.tk-chips button:hover { border-color: var(--sky-line); background: var(--sky-50); }
.tk-chips button[aria-pressed="true"] { background: var(--sky); border-color: #6aa8e6; color: var(--on-sky); }
.tk-chips .n { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-chips button[aria-pressed="true"] .n { color: var(--on-sky); }

.tk-groups { display: grid; gap: 12px; }
.tk-group { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tk-ghead { margin: 0; font-size: 1rem; }
.tk-ghead button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 16px 0 12px;
  border: 0; background: #f7faff; color: var(--ink); text-align: left; font-weight: 700; font-size: .95rem;
}
.tk-ghead button:hover { background: var(--sky-50); }
.tk-ghead button[aria-expanded="true"] { border-bottom: 1px solid var(--border); }
.tk-ghead .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s ease; }
.tk-ghead button[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.tk-gname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-gn, .tk-from { color: var(--muted); font-weight: 600; font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-from { margin-left: auto; }
.tk-list { list-style: none; margin: 0; padding: 0; }
.tk-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main price" "main act";
  gap: 6px 12px; align-items: start; padding: 12px 14px;
}
.tk-row:not([hidden]) ~ .tk-row { border-top: 1px solid var(--border); }
/* name on its own line; model id(s) and detail tags share the next line and wrap */
.tk-main { grid-area: main; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.tk-name, .tk-desc { flex: 1 0 100%; }
.tk-name { margin: 0; font-size: .97rem; font-weight: 680; line-height: 1.3; letter-spacing: -.005em; overflow-wrap: anywhere; }
.tk-id { max-width: 100%; padding: 0 6px; border-radius: 5px; font-size: .78rem; line-height: 1.7; }
.tk-ids { gap: 4px; align-items: center; }
.tk-ids .model-chip { padding: 0 7px; border-radius: 5px; font-size: .76rem; line-height: 1.7; }
.tk-more {
  min-height: 24px; padding: 0 8px; border: 1px dashed var(--sky-line); border-radius: 5px;
  background: none; color: var(--link); font-size: .78rem; font-weight: 650;
}
.tk-more:hover { background: var(--sky-50); }
.tk-desc { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.tk-meta li { padding: 0 7px; border-radius: 5px; background: var(--neutral-bg); color: var(--neutral); font-size: .75rem; font-weight: 650; line-height: 1.75; }
.tk-meta .tk-ctx { background: var(--mint-50); color: var(--on-mint); box-shadow: inset 0 0 0 1px var(--mint-line); }
.tk-price { grid-area: price; display: grid; justify-items: end; text-align: right; line-height: 1.25; min-width: 0; }
.tk-amt { font-size: 1.05rem; font-weight: 750; color: var(--on-sky); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tk-per { color: var(--muted); font-size: .8rem; }
.tk-packs { display: none; margin-top: 2px; color: var(--muted); font-size: .76rem; }
.tk-act { grid-area: act; display: flex; justify-content: flex-end; align-self: end; }
.tk-act .btn { gap: 4px; padding: 0 12px 0 9px; }
.tk-act .btn .ico { width: 16px; height: 16px; }
.tk-empty { margin-top: 12px; }
@media (min-width: 760px) {
  .tk-row { grid-template-columns: minmax(0, 1fr) 200px 92px; grid-template-areas: "main price act"; align-items: center; gap: 16px; padding: 10px 16px; }
  .tk-packs { display: block; }
  .tk-act { align-self: center; }
  .tk-act .btn { width: 100%; }
}
@media (max-width: 599.98px) { .tk-search { flex-basis: 100%; max-width: none; } }
@media (pointer: fine) { .tk-search input { min-height: 40px; } }
@media (pointer: coarse) {
  .tk-chips { scrollbar-width: none; }
  .tk-chips::-webkit-scrollbar { display: none; }
  .tk-chips button { min-height: 44px; }
  .tk-more { min-height: 44px; }
}

/* buy dialog: pack-size picker (segmented radios) */
.pack-pick { border: 0; padding: 0; min-width: 0; }
.pack-pick legend { padding: 0; }
.pack-opts {
  display: flex; flex-wrap: wrap; gap: 1px; overflow: hidden;
  background: var(--border-strong); border: 1px solid var(--border-strong); border-radius: 10px;
}
.pack-opt {
  position: relative; flex: 1 1 92px; display: grid; gap: 2px; align-content: center; justify-items: center;
  min-height: 60px; margin: 0; padding: 8px 6px; background: var(--surface); cursor: pointer; text-align: center;
}
.pack-opt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pack-opt:hover { background: var(--sky-50); }
.pack-opt:has(input:checked) { background: var(--sky-100); box-shadow: inset 0 0 0 2px var(--focus); }
.pack-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -5px; }
.po-size { font-size: .92rem; font-weight: 700; color: var(--ink); line-height: 1.25; }
.po-price { font-size: .84rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.pack-opt:has(input:checked) .po-price { color: var(--on-sky); }

/* reselling: become-a-reseller tiers */
.tiers-sec {
  display: grid; gap: 14px; margin: 0 0 28px; padding: 16px;
  border: 1px solid var(--sky-200); border-radius: var(--radius); background: linear-gradient(180deg, var(--sky-50) 0%, var(--surface) 80%);
}
.tiers-intro h2 { font-size: 1.12rem; margin: 0 0 4px; }
.tiers-intro p { margin: 0; color: var(--muted); font-size: .93rem; max-width: 52ch; }
.tiers { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.tier {
  display: grid; gap: 8px; align-content: start; min-width: 0; padding: 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.tier.featured { border-color: #8cbdec; box-shadow: 0 0 0 1px #8cbdec, var(--shadow); }
.tier-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tier h3 { font-size: 1rem; }
.tier-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; }
.tier-price strong { font-size: 1.6rem; font-weight: 780; letter-spacing: -.02em; color: var(--on-sky); font-variant-numeric: tabular-nums; line-height: 1.15; }
.tier-price span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.tier-perk { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: 600; font-size: .94rem; }
.tier-perk .ico { width: 16px; height: 16px; color: var(--ok); }
@media (min-width: 600px) { .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .tiers-sec { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 24px; padding: 20px 20px 20px 24px; }
}
.rs-keys-t { font-size: 1.2rem; margin: 0 0 12px; }

/* quick category links */
.cats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.cat-link {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 650;
}
.cat-link:hover { border-color: var(--sky-line); background: var(--sky-50); text-decoration: none; color: var(--ink); }
.cat-link small { display: block; color: var(--muted); font-weight: 500; font-size: .84rem; }

/* ---------- key list (reselling) ---------- */
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.keyrow {
  display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr);
  padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.keyrow.off { background: #fbfcfe; }
.kr-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.kr-title strong { font-size: 1.04rem; overflow-wrap: anywhere; }
.kr-sub { color: var(--muted); font-size: .9rem; margin-top: 2px; overflow-wrap: anywhere; }
.kr-sub code { font-size: .82rem; }
.kr-usage { display: grid; gap: 6px; min-width: 0; }
.kr-usage-text { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kr-usage-text b { color: var(--ink); }
.kr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kr-actions .switch { margin-right: auto; }
@media (min-width: 760px) {
  .keyrow { grid-template-columns: minmax(0, 1.3fr) minmax(200px, 1fr); align-items: center; gap: 14px 24px; }
  .kr-actions { grid-column: 1 / -1; padding-top: 10px; border-top: 1px dashed var(--border); }
}
@media (min-width: 1440px) {
  .keyrow { grid-template-columns: minmax(0, 1.25fr) minmax(220px, 1fr) auto; }
  .kr-actions { grid-column: auto; padding-top: 0; border-top: 0; flex-wrap: nowrap; }
  .kr-actions .switch { margin-right: 4px; }
}
progress.bar {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 10px; border: 0; border-radius: 999px; background: #e3ecf8; overflow: hidden; color: #5aaee8;
}
progress.bar::-webkit-progress-bar { background: #e3ecf8; border-radius: 999px; }
progress.bar::-webkit-progress-value { background: linear-gradient(90deg, #6db7ef, #4fc797); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: linear-gradient(90deg, #6db7ef, #4fc797); border-radius: 999px; }
progress.bar.warn::-webkit-progress-value { background: #e9a53b; }
progress.bar.warn::-moz-progress-bar { background: #e9a53b; }
progress.bar.full::-webkit-progress-value { background: #d9534a; }
progress.bar.full::-moz-progress-bar { background: #d9534a; }

/* ---------- tickets ---------- */
.ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticket-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); text-decoration: none; box-shadow: 0 2px 8px rgba(31, 95, 158, .05);
}
.ticket-item:hover { border-color: var(--sky-line); text-decoration: none; color: var(--ink); }
.ticket-item .subj { font-weight: 650; overflow-wrap: anywhere; }
.ticket-item .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .86rem; align-items: center; }
.ticket-item .ico { color: var(--muted); }
.thread { display: grid; gap: 14px; margin: 0 0 22px; }
.msg { max-width: min(720px, 94%); padding: 12px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(31, 95, 158, .05); }
.msg.me { justify-self: end; background: #eaf4ff; border-color: var(--sky-200); border-bottom-right-radius: 6px; }
.msg.staff { justify-self: start; background: #eaf8f1; border-color: #c4ebd8; border-bottom-left-radius: 6px; }
.msg.other { justify-self: start; border-bottom-left-radius: 6px; }
.msg .who { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.msg .who b { color: var(--ink); font-size: .88rem; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- code blocks (API page) ---------- */
.endpoint { padding: 18px 0; border-top: 1px solid var(--border); }
.endpoint:first-of-type { border-top: 0; padding-top: 4px; }
.ep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 6px; }
.ep-head code { font-size: .95rem; background: none; border: 0; padding: 0; color: var(--ink); font-weight: 650; }
.ep-head h3 { font-size: 1rem; }
.method { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 7px; font-family: var(--mono); font-size: .76rem; font-weight: 800; letter-spacing: .04em; background: var(--sky-100); color: var(--on-sky); border: 1px solid var(--sky-200); }
.method.post { background: var(--mint-50); color: var(--on-mint); border-color: var(--mint-line); }
.method.patch { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.method.delete { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.code { margin: 10px 0 0; border: 1px solid var(--border); border-radius: 14px; background: #f7faff; overflow: hidden; min-width: 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 4px 6px 4px 14px; background: #ebf3fd; border-bottom: 1px solid var(--border); font-size: .84rem; font-weight: 700; color: #2c4a6e; }
.code-head .btn { min-height: 36px; }
@media (max-width: 767.98px), (pointer: coarse) { .code-head .btn { min-height: 44px; } }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: .84rem; line-height: 1.6; color: var(--ink); tab-size: 2; scrollbar-width: thin; }
details.more { margin-top: 10px; }
details.more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font-weight: 650; color: var(--link); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; transition: transform .15s ease; }
details.more[open] > summary::before { transform: rotate(90deg); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  position: relative; flex: none; min-height: 46px; padding: 0 14px; border: 0; background: none;
  color: var(--muted); font-weight: 650; font-size: .95rem; border-radius: 10px 10px 0 0;
}
.tabs [role="tab"]:hover { color: var(--ink); background: var(--sky-50); }
.tabs [role="tab"][aria-selected="true"] { color: var(--on-sky); }
.tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: #4f9be0; }
.tabs .n { display: inline-block; min-width: 22px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral); font-size: .76rem; line-height: 1.6; }

/* ---------- profile header (admin customer) ---------- */
.profile { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(140deg, var(--sky), var(--mint)); color: var(--on-sky); font-weight: 800; font-size: 1.3rem; flex: none; text-transform: uppercase; }
.profile .who { min-width: 0; flex: 1 1 220px; }
.profile h1 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.8rem); overflow-wrap: anywhere; }
.profile .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .92rem; margin-top: 4px; align-items: center; }
.profile .bal { text-align: right; }
.profile .bal .v { font-size: 1.6rem; font-weight: 780; font-variant-numeric: tabular-nums; }
@media (max-width: 599.98px) { .profile .bal { text-align: left; width: 100%; } }
.dl { display: grid; gap: 0; margin: 0; }
.dl div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.dl div:first-child { border-top: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }

/* products admin */
.prod-row { padding: 14px 0; border-top: 1px solid var(--border); }
.prod-row:first-child { border-top: 0; padding-top: 0; }
.prod-line { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: center; }
.prod-line .name { font-weight: 700; overflow-wrap: anywhere; }
.prod-line .meta { color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.prod-line .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (min-width: 900px) { .prod-line { grid-template-columns: minmax(0, 1fr) auto; } }
.prod-edit { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--sky-50); border: 1px solid var(--sky-200); }
.qr-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 12px; }
.qr-preview img { width: 132px; height: 132px; object-fit: contain; border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 6px; }
.qr-box { display: grid; place-items: center; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--border); width: max-content; max-width: 100%; }
.qr-box img { width: 220px; height: 220px; max-width: 100%; object-fit: contain; display: block; }
.pay-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: ps; }
.pay-steps > li { counter-increment: ps; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.pay-steps > li::before { content: counter(ps); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sky); color: var(--on-sky); font-weight: 800; font-size: .88rem; }
.pay-steps h3 { font-size: 1rem; margin: 4px 0 8px; }
.method-card .card-head { margin-bottom: 10px; }

/* ---------- login page ---------- */
body.auth {
  min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at 10% -10%, #dcecff 0%, rgba(220, 236, 255, 0) 60%),
    radial-gradient(800px 520px at 100% 110%, #d9f4e8 0%, rgba(217, 244, 232, 0) 60%),
    var(--page);
}
.auth-main { flex: 1; display: grid; place-items: center; padding: 28px var(--gutter) 40px; }
.auth-shell { width: 100%; max-width: 1000px; display: grid; gap: 28px; align-items: center; }
.auth-aside { display: none; }
@media (min-width: 960px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; }
  .auth-aside { display: block; }
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-weight: 750; font-size: 1.15rem; }
.auth-brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 16px rgba(31, 95, 158, .22); }
.auth-aside h1 { font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 14px; }
.auth-aside .lead { color: var(--muted); font-size: 1.08rem; max-width: 34em; }
.auth-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.auth-points .dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--surface); border: 1px solid var(--sky-200); color: var(--on-sky); box-shadow: var(--shadow); flex: none; }
.auth-card { padding: 22px; box-shadow: var(--shadow-lg); }
@media (min-width: 600px) { .auth-card { padding: 30px; } }
.auth-card .auth-brand { margin-bottom: 16px; }
@media (min-width: 960px) { .auth-card .auth-brand { display: none; } }
.auth-card h2 { font-size: 1.4rem; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); margin: 0 0 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 20px; border-radius: 14px; background: var(--sky-50); border: 1px solid var(--sky-200); }
.auth-tabs button { min-height: 44px; border: 0; border-radius: 10px; background: none; font-weight: 650; color: var(--muted); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--on-sky); box-shadow: 0 2px 8px rgba(31, 95, 158, .12); }
.auth-foot { text-align: center; color: var(--muted); font-size: .86rem; padding: 0 16px 20px; }

/* ---------- misc ---------- */
.inline-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.kbd-hint { font-size: .84rem; color: var(--muted); }
.divider-text { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .86rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.amount-chips button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 650; color: var(--on-sky); font-variant-numeric: tabular-nums; }
.amount-chips button:hover { background: var(--sky-50); border-color: var(--sky-line); }
@media (pointer: coarse), (max-width: 767.98px) { .amount-chips button { min-height: 44px; } }
.balance-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.balance-hero .v { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--on-sky); line-height: 1.1; }
.balance-hero .k { font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- utilities ---------- */
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mb-10 { margin-bottom: 10px; }
.pre { white-space: pre-wrap; }
.h2like { font-size: 1.14rem; margin: 0; }
.card-head .switch { flex: none; }
@media (min-width: 1100px) {
  .grid:not(.grid-2) > .method-card .pay-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
}
@media (max-width: 599.98px) {
  .copy-row { flex-wrap: wrap; padding: 10px 10px 10px 14px; }
  .copy-row code { flex: 1 1 100%; white-space: normal; word-break: break-all; overflow: visible; }
  .note > .ico { display: none; }
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; border-radius: 0; overflow-wrap: normal; white-space: pre; }
.narrow-form { max-width: 860px; }
