/* Light green & white theme (light is the default; dark only when toggled) */
:root {
  --bg: #f3faf6;
  --surface: #ffffff;
  --surface-2: #f2f8f4;
  --border: #dcefe3;
  --text: #11261b;
  --muted: #5f7a6b;
  --primary: #16a34a;
  --primary-2: #34d399;
  --primary-soft: #e3f6ea;
  --ok: #059669;
  --ok-soft: #dcf5ea;
  --warn: #b77905;
  --warn-soft: #fff4d8;
  --bad: #dc3a4f;
  --bad-soft: #fde8eb;
  --shadow: 0 1px 2px rgba(16, 80, 45, .04), 0 6px 24px rgba(16, 80, 45, .07);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1510; --surface: #111e17; --surface-2: #16261d; --border: #213529; --text: #e8f5ed; --muted: #8fae9c;
  --primary: #22c55e; --primary-2: #4ade80; --primary-soft: #143222; --ok: #34d399; --ok-soft: #10301f;
  --warn: #f0b429; --warn-soft: #3a2e10; --bad: #ff6b81; --bad-soft: #3d1a24;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(900px 380px at 85% -80px, color-mix(in srgb, var(--primary-2) 16%, transparent), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 1px 0 var(--border), 0 4px 18px rgba(16, 80, 45, .04);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--text); }
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}
.nav { display: flex; gap: 2px; margin-inline-start: 10px; }
.nav a { padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.spacer { flex: 1; }
.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600; white-space: nowrap;
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-h h3 { margin: 0; font-size: 15px; }
.card-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.page-title h2, .page-title h1 { margin: 0; font-size: 20px; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .06s, background .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary-2) 70%, var(--primary))); color: #fff; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--primary) 60%, transparent); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary-2) 70%, var(--primary))); filter: brightness(1.06); }
.btn-ok { background: var(--ok-soft); color: var(--ok); }
.btn-bad { background: var(--bad-soft); color: var(--bad); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { position: relative; }
.search .input { padding-inline-start: 34px; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-pri { background: var(--primary-soft); color: var(--primary); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pulse .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* ---------- shop ---------- */
.hero {
  border-radius: 20px; padding: 26px 26px; margin-bottom: 18px; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 8% 120%, rgba(255,255,255,.22) 0 120px, transparent 121px),
    radial-gradient(circle at 30% -40%, rgba(255,255,255,.14) 0 160px, transparent 161px),
    linear-gradient(135deg, #15803d, #16a34a 45%, #34d399);
  box-shadow: 0 12px 32px -12px rgba(22, 163, 74, .55);
}
.hero .stats > div { background: rgba(255,255,255,.16); padding: 8px 14px; border-radius: 12px; backdrop-filter: blur(4px); }
.hero h1 { margin: 0 0 6px; font-size: 23px; }
.hero p { margin: 0; opacity: .88; }
.hero .stats { display: flex; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.hero .stats b { font-size: 18px; display: block; }
.hero .stats span { opacity: .8; font-size: 12px; }
.hero-art { position: absolute; inset-inline-end: 22px; top: 50%; transform: translateY(-50%); opacity: .22; }

.shop { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.svc-list { max-height: 560px; overflow-y: auto; padding: 6px; }
.svc {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
}
.svc:hover { background: var(--surface-2); }
.svc.active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.svc .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ava {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none;
  color: #fff; text-transform: uppercase; letter-spacing: -.5px;
  position: relative; overflow: hidden;
}
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.ava img.si { object-fit: contain; padding: 6px; box-shadow: inset 0 0 0 1px var(--border); border-radius: inherit; }
.fav { color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px 0; }
.chip .ava { width: 18px; height: 18px; border-radius: 5px; font-size: 8px; }
.chip .ava img.si { padding: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12.5px; }
.chip:hover, .chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.ctry-list { max-height: 560px; overflow-y: auto; }
.ctry { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ctry:last-child { border-bottom: 0; }
.ctry:hover { background: var(--surface-2); }
.flag { width: 28px; height: 20px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border); }
.flag-ph { width: 28px; height: 20px; border-radius: 4px; flex: none; display: grid; place-items: center; font-size: 10px; background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 1px var(--border); }
.ctry .name { flex: 1; min-width: 0; font-weight: 500; }
.ctry .count { color: var(--muted); font-size: 12px; min-width: 80px; }
.ctry .price { font-weight: 700; min-width: 110px; text-align: end; }

/* active order cards */
.orders-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ocard { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ocard .top { display: flex; align-items: center; gap: 10px; }
.ocard .phone { font-size: 19px; font-weight: 800; letter-spacing: .3px; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.code-box {
  border-radius: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border);
  display: flex; align-items: center; gap: 10px; min-height: 52px;
}
.code-box.got { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.code-box .code { font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--ok); cursor: pointer; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width 1s linear; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* wallet */
.balance-card { padding: 22px; color: #fff; border: 0; background: radial-gradient(circle at 10% 130%, rgba(255,255,255,.2) 0 90px, transparent 91px), linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 12px 30px -12px rgba(22, 163, 74, .55); }
.balance-card .amt { font-size: 28px; font-weight: 800; margin: 6px 0 0; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }

/* code block */
pre.code {
  direction: ltr; text-align: left; background: #0f2419; color: #d4f5e2; padding: 14px; border-radius: 12px; overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.7; margin: 0;
}
code.k { direction: ltr; font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; }

/* API docs */
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.kv > span { color: var(--muted); font-size: 12.5px; }
.flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.flow > div { flex: 1; min-width: 140px; background: var(--primary-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.flow > div b { color: var(--primary); }
.flow > div span { font-size: 12px; color: var(--muted); direction: ltr; text-align: right; }
.flow > i { align-self: center; color: var(--muted); font-style: normal; }
.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-nav { position: sticky; top: 74px; padding: 10px; max-height: calc(100vh - 90px); overflow-y: auto; }
.doc-nav .doc-g { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 10px 8px 4px; }
.doc-nav a { display: block; padding: 4px 8px; border-radius: 8px; color: var(--text); font-size: 13px; }
.doc-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.doc-nav code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.doc-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.method { scroll-margin-top: 80px; }
.method .sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.method pre.code { white-space: pre-wrap; word-break: break-all; }
.resp { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.resp .badge { align-self: flex-start; }
.ptable { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ptable td { white-space: normal; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; } .doc-nav { position: static; max-height: none; } }

/* pricing editors */
.input.changed { border-color: var(--warn); background: var(--warn-soft); }
tr.row-changed td { background: color-mix(in srgb, var(--warn-soft) 70%, transparent) !important; }

/* help */
.hstep { display: flex; gap: 12px; margin-bottom: 14px; }
.hstep > span { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--primary); font-weight: 800; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { color: var(--muted); padding: 0 0 12px; line-height: 2; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 40, 22, .35); backdrop-filter: blur(4px); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 400px; padding: 22px; animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.tabs { display: flex; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* toast */
#toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: pop .2s; max-width: 360px; }
.toast.err { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* admin */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .brand { padding: 4px 8px 16px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.active { background: var(--primary-soft); color: var(--primary); }
.side svg { flex: none; }
.main { padding: 22px 24px 60px; min-width: 0; }
.stat { padding: 16px; }
.stat .lbl { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 22px; font-weight: 800; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); }
.chart { width: 100%; height: 220px; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hbar .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 8px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 24px; cursor: pointer; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; right: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { right: 21px; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.notice { padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.notice.info { background: var(--primary-soft); color: var(--primary); }

@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; }
  .svc-list { max-height: 260px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; }
  .side .brand, .side .side-foot { display: none; }
  .side a { white-space: nowrap; }
  .main { padding: 16px; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .mobile-nav { display: flex !important; }
  .hero-art { display: none; }
  .ctry .count { display: none; }
  .ctry .price { min-width: 0; }
  .presets { grid-template-columns: repeat(2, 1fr); }
}
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border);
  justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 10px; border-radius: 10px; }
.mobile-nav a.active { color: var(--primary); }
@media (max-width: 640px) { .container { padding-bottom: 90px; } #toasts { bottom: 80px; } }

/* =====================================================================
   Responsive v2 — header, shop layout, phone tweaks, admin collapse
   ===================================================================== */
.container, .topbar-in { max-width: 1240px; }
.topbar-in { height: 62px; padding-top: 0; padding-bottom: 0; }
.brand-name { white-space: nowrap; }
.user-area { display: flex; align-items: center; gap: 8px; position: relative; flex: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.bal-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding-inline: 12px 5px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.bal-pill b { font-weight: 800; }
.bal-pill small { font-size: 11px; opacity: .8; }
.bal-plus { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 700; line-height: 1; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-weight: 800; font-size: 15px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); display: grid; place-items: center; flex: none; box-shadow: 0 3px 10px -3px color-mix(in srgb, var(--primary) 60%, transparent); }
.menu { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 270px; padding: 6px; z-index: 60; animation: pop .14s ease-out; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; color: var(--text); background: none; border: 0; cursor: pointer; font: inherit; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu svg { color: var(--muted); flex: none; }
.menu .danger, .menu .danger svg { color: var(--bad); }

.mobile-nav a { flex: 1; padding: 6px 2px; gap: 3px; font-weight: 500; }
.mobile-nav a svg { width: 21px; height: 21px; }
.mobile-nav a.active { color: var(--primary); }
.mobile-nav a.active span { background: var(--primary-soft); border-radius: 999px; padding: 2px 14px; }
.mobile-nav a span { display: grid; place-items: center; padding: 2px 14px; transition: background .15s; }

/* shop: desktop = sticky service column, single page scroll for countries */
@media (min-width: 721px) {
  .shop { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) !important; }
  .shop > .card:first-child { position: sticky; top: 78px; }
  .svc-list { max-height: calc(100vh - 250px); }
  .ctry-list { max-height: none; overflow: visible; }
  .shop > .card:last-child > .card-h { position: sticky; top: 62px; z-index: 5; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
}
@media (min-width: 1100px) { .shop { grid-template-columns: 340px minmax(0, 1fr) !important; } }
@media (max-width: 720px) {
  .ctry-list { max-height: none; overflow: visible; }
  .svc-list { max-height: 210px; }
}

/* tablet & phone: bottom tab bar replaces the top nav */
@media (max-width: 1023px) {
  .nav { display: none; }
  .mobile-nav { display: flex !important; }
  .container { padding-bottom: 100px; }
  #toasts { bottom: 86px; }
}
@media (max-width: 640px) {
  .topbar-in { height: 58px; padding: 0 12px; gap: 8px; }
  .brand { gap: 7px; font-size: 15px; }
  .brand-logo { width: 32px; height: 32px; }
  .bal-pill small { display: none; }
  .bal-pill { height: 36px; padding-inline: 10px 4px; }
  .avatar-btn, .icon-btn { width: 36px; height: 36px; }
  .hide-sm { display: none; }
  .menu { position: fixed; top: 64px; left: 10px; right: 10px; width: auto; }
  .container { padding: 14px 12px 100px; }
  .hero { padding: 18px 16px; border-radius: 16px; margin-bottom: 14px; }
  .hero h1 { font-size: 18px; line-height: 1.6; }
  .hero p { font-size: 12.5px; line-height: 1.9; }
  .hero .stats { gap: 8px; margin-top: 12px; }
  .hero .stats > div { flex: 1; text-align: center; padding: 6px 4px; }
  .hero .stats b { font-size: 15px; }
  .page-title { margin-bottom: 12px; flex-wrap: wrap; }
  .page-title h2, .page-title h1 { font-size: 18px; }
  .card-h { padding: 12px; flex-wrap: wrap; }
  .card-b { padding: 14px; }
  .shop .card-h .search { width: 100% !important; }
  .chips { padding: 8px 10px 0; }
  .ctry { padding: 10px 12px; gap: 10px; }
  .ctry .price { font-size: 13.5px; min-width: 0; }
  .ctry .price .muted { display: none; }
  .orders-live { grid-template-columns: 1fr; gap: 10px; }
  .ocard .phone { font-size: 17px; }
  .modal { padding: 18px; }
  .presets { grid-template-columns: repeat(3, 1fr); }
  .presets .btn { padding: 8px 4px; justify-content: center; font-size: 13px; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .flow > i { display: none; }
  .flow > div { min-width: 46%; }
  /* stacked tables */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .rtable tr:last-child { border-bottom: 0; }
  .rtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; white-space: normal; text-align: end; }
  .rtable td::before { content: attr(data-l); color: var(--muted); font-size: 12px; flex: none; text-align: start; }
  .rtable td[data-l=""]::before { content: none; }
  .rtable tbody tr:hover td { background: none; }
}
@media (max-width: 360px) { .brand-name { display: none; } }

/* admin collapse */
@media (max-width: 900px) {
  .main .grid { grid-template-columns: minmax(0, 1fr) !important; }
  .main .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .side { position: sticky; top: 0; z-index: 30; gap: 4px; align-items: center; border-inline-end: 0; border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side a { padding: 7px 12px; flex: none; font-size: 13px; }
  .side > .spacer { display: none; }
  .side .side-foot { display: flex !important; flex: none; padding: 0 4px; gap: 4px; flex-wrap: nowrap; }
  .side .side-foot a { display: none; }
  .main { padding: 14px 12px 40px; }
  .main .page-title { flex-wrap: wrap; }
  .stat .val { font-size: 18px; }
}

.input { min-width: 0; }
.row > div[style*="flex:1"] { min-width: 0; }
.grid > *, .docs > *, .shop > * { min-width: 0; }
@media (max-width: 900px) { .docs { grid-template-columns: minmax(0, 1fr); } }

/* ================= SEO content & footer ================= */
#view { padding-bottom: 8px !important; }
.seo { padding-top: 8px !important; padding-bottom: 24px !important; }
.seo:empty { display: none; }
.seo-article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.seo-article > * { min-width: 0; }
.seo-article section { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.seo-article h2 { font-size: 17px; margin: 0 0 10px; }
.seo-article p { margin: 0 0 8px; line-height: 2; color: var(--text); }
.seo-article p:last-child { margin-bottom: 0; }
.crumbs { font-size: 13px; color: var(--muted); }
.seo-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seo-links a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); font-size: 13px; font-weight: 500; }
.seo-links a:hover { filter: brightness(.96); }
.seo-feat { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.seo-feat li { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 3px; }
.seo-feat li b { color: var(--primary); }
.seo-feat li span { color: var(--muted); font-size: 13px; }
.seo-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.9; }
.seo-faq details { border-bottom: 1px dashed var(--border); padding: 10px 0; }
.seo-faq details:last-child { border-bottom: 0; }
.seo-faq summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
.seo-faq details p { margin: 8px 0 0; color: var(--muted); }
.seo-table-wrap { overflow-x: auto; }
.seo-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.seo-table caption { text-align: start; color: var(--muted); font-size: 13px; padding-bottom: 8px; }
.seo-table th, .seo-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: start; }
.seo-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.seo-table td:nth-child(2) { font-weight: 700; color: var(--primary); white-space: nowrap; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 8px; }
.site-footer .container { padding-top: 22px !important; padding-bottom: 10px !important; }
.foot-in { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr; gap: 22px; }
.foot-in > * { min-width: 0; }
.foot-col > b { display: block; margin-bottom: 10px; font-size: 14px; }
.foot-brand { color: var(--primary); font-size: 17px !important; }
.foot-about p { color: var(--muted); font-size: 13px; line-height: 1.9; margin: 0; }
.foot-col .seo-links a { background: transparent; border: 1px solid var(--border); padding: 4px 10px; font-size: 12px; }
.foot-copy { color: var(--muted); font-size: 12px; text-align: center; padding-top: 4px !important; padding-bottom: 18px !important; }
@media (max-width: 900px) { .foot-in { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) { body { padding-bottom: 72px; } .site-footer .container, .seo { padding-bottom: 16px !important; } }
@media (max-width: 640px) { .seo-article section { padding: 14px; } .seo-article h2 { font-size: 16px; } }
.seo[hidden] { display: none !important; }

.install-btn[hidden] { display: none !important; }
.install-btn { white-space: nowrap; }
@media (display-mode: standalone) { .install-btn { display: none !important; } }
