/* پیام‌پار - UI hand-written, no CDN, works offline, RTL first.
   Identity: night-navy ink on a cool light ground, saffron for the one thing to
   press next, big rounded cards, big numbers. Persian type is bundled
   (Vazirmatn, SIL OFL) so it looks the same where Google Fonts is unreachable. */

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f2f4f9;
  --bg-soft: #e8ebf3;
  --panel: #ffffff;
  --panel-2: #f6f7fb;
  --line: #e2e6f0;
  --line-soft: #edf0f6;
  --fg: #0e1a3a;
  --fg-dim: #4a5679;
  --fg-faint: #8590ae;
  --ink: #0e1a3a;            /* the dark surfaces: hero, primary navigation */
  --on-ink: #ffffff;
  --brand: #ffb020;          /* saffron: the next thing to do */
  --brand-strong: #f29a00;
  --brand-soft: #fff2d6;
  --on-brand: #1b1300;
  --link: #2458e6;
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
  --ok: #0f9d68;
  --warn: #b86e00;
  --danger: #d6363f;
  --info: #2458e6;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 18px 44px rgba(14, 26, 58, .16);
  --shadow-sm: 0 1px 0 rgba(14, 26, 58, .04), 0 12px 32px rgba(14, 26, 58, .06);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --nav-h: 68px;
  --tab-h: 66px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a1126; --bg-soft: #111a36; --panel: #121c3a; --panel-2: #172245;
    --line: #26325a; --line-soft: #1d2850; --fg: #eef1fb; --fg-dim: #a6b0d0; --fg-faint: #6f7ca6;
    --ink: #060b1c; --on-ink: #ffffff;
    --brand: #ffbe3d; --brand-strong: #ffd070; --brand-soft: #3a2c0c; --on-brand: #1b1300;
    --link: #7fa4ff; --ok: #3fd49a; --warn: #f0b85a; --danger: #ff7e85; --info: #7fa4ff;
    --shadow: 0 18px 44px rgba(0, 0, 0, .5); --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1126; --bg-soft: #111a36; --panel: #121c3a; --panel-2: #172245;
  --line: #26325a; --line-soft: #1d2850; --fg: #eef1fb; --fg-dim: #a6b0d0; --fg-faint: #6f7ca6;
  --ink: #060b1c; --on-ink: #ffffff;
  --brand: #ffbe3d; --brand-strong: #ffd070; --brand-soft: #3a2c0c; --on-brand: #1b1300;
  --link: #7fa4ff; --ok: #3fd49a; --warn: #f0b85a; --danger: #ff7e85; --info: #7fa4ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, .5); --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.8; -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.4; font-weight: 800; text-wrap: balance; }
h1 { font-size: 1.85rem; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--fg-dim); font-size: .9rem; }
.faint { color: var(--fg-faint); font-size: .8rem; }
.mono { font-family: var(--mono); font-size: .85em; direction: ltr; display: inline-block; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grow { flex: 1 1 auto; min-width: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 70%, transparent); outline-offset: 2px; border-radius: 10px; }

.ico { display: inline-flex; width: 1.25em; height: 1.25em; flex: 0 0 auto; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* -------------------------------------------------------------- shell */
.shell { min-height: 100vh; padding-bottom: 2rem; }
.topnav {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h);
  background: var(--ink); color: var(--on-ink);
  display: flex; align-items: center; gap: 1.2rem; padding: 0 max(1rem, calc((100vw - 1140px) / 2));
}
.brand { display: flex; align-items: center; gap: .65rem; flex: 0 0 auto; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 14px; background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; font-weight: 900; font-size: 1.15rem;
}
.brand-text { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.brand-text small { display: block; font-weight: 400; font-size: .72rem; opacity: .65; }
.nav-links { display: flex; gap: .25rem; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; padding: .2rem 0; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-item {
  display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border-radius: 999px;
  color: color-mix(in srgb, var(--on-ink) 72%, transparent); cursor: pointer; font-size: .92rem; font-weight: 500;
  white-space: nowrap; user-select: none; border: 1px solid transparent;
}
.nav-item:hover { background: color-mix(in srgb, var(--on-ink) 10%, transparent); color: var(--on-ink); text-decoration: none; }
.nav-item.active { background: var(--brand); color: var(--on-brand); font-weight: 800; }
.nav-item .badge { font-size: .68rem; padding: 0 .4rem; background: color-mix(in srgb, var(--on-ink) 14%, transparent); border-color: transparent; color: inherit; }
.nav-item.active .badge { background: color-mix(in srgb, var(--on-brand) 14%, transparent); }
.nav-tools { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; }
.nav-tools .icon-btn { color: color-mix(in srgb, var(--on-ink) 80%, transparent); }
.nav-tools .icon-btn:hover { background: color-mix(in srgb, var(--on-ink) 12%, transparent); color: var(--on-ink); }
.me { display: flex; align-items: center; gap: .55rem; padding-inline-start: .3rem; font-size: .85rem; }
.me small { display: block; font-size: .7rem; opacity: .6; }

.main { padding: 2rem max(1rem, calc((100vw - 1140px) / 2)) 4rem; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .1rem; }

.tabbar { display: none; }

/* -------------------------------------------------------------- cards */
.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: flex; gap: .9rem; align-items: center; box-shadow: var(--shadow-sm);
}
.stat-ico { width: 48px; height: 48px; border-radius: 16px; flex: 0 0 48px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.stat-ico .ico { width: 24px; height: 24px; }
.stat-ico.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.stat-ico.danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.stat-ico.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.stat-label { color: var(--fg-dim); font-size: .82rem; }
.stat-value { font-size: 1.55rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.3; }
.stat-value.sm { font-size: 1.15rem; }
.stat-sub { color: var(--fg-faint); font-size: .76rem; }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .7rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600; background: var(--bg-soft); color: var(--fg-dim); white-space: nowrap; border: 0;
}
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--brand) 22%, transparent); }
.badge.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.badge.info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 7px; }
.dot.live { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .62rem 1.25rem;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel); color: var(--fg);
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, transform .06s, box-shadow .14s;
}
.btn:hover:not(:disabled) { border-color: var(--fg); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
/* A disabled action must read as unavailable at a glance: the operator seeing
   a greyed-out "new campaign" is the whole point of the consent gate. */
.btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(1); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 800; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 40%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--fg); }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); border-color: transparent; }
.btn-sm { padding: .32rem .85rem; font-size: .82rem; }
.btn-lg { padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::before { content: ""; width: .9em; height: .9em; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { padding: .45rem; border-radius: 12px; background: transparent; border: 1px solid transparent; color: var(--fg-dim); cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--bg-soft); color: var(--fg); }

/* -------------------------------------------------------------- forms */
label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .85rem; color: var(--fg-dim); margin-bottom: .35rem; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  background: var(--panel-2); color: var(--fg); font: inherit; font-size: .95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
input[type="number"], input.ltr { direction: ltr; text-align: start; font-family: var(--mono); }
textarea { min-height: 110px; resize: vertical; line-height: 1.9; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; margin: .6rem 0; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .4rem; flex: 0 0 auto; accent-color: var(--brand-strong); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form label.field { margin-bottom: 0; flex: 1 1 150px; }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .8rem 1rem; text-align: start; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { background: var(--panel-2); color: var(--fg-dim); font-weight: 700; font-size: .78rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
td.num { font-family: var(--mono); direction: ltr; text-align: start; }

/* --------------------------------------------------------------- misc */
.notice { display: flex; gap: .7rem; align-items: flex-start; border-radius: var(--radius-sm); padding: .85rem 1.05rem; font-size: .9rem; background: var(--panel-2); margin-bottom: 1rem; }
.notice > .ico { margin-top: .22rem; }
.notice.warn { background: color-mix(in srgb, var(--brand) 20%, var(--panel)); }
.notice.danger { background: color-mix(in srgb, var(--danger) 11%, var(--panel)); color: var(--fg); }
.notice.danger > .ico { color: var(--danger); }
.notice.ok { background: color-mix(in srgb, var(--ok) 11%, var(--panel)); }
.notice.ok > .ico { color: var(--ok); }
.notice.info { background: color-mix(in srgb, var(--info) 9%, var(--panel)); }
.notice.info > .ico { color: var(--info); }

.bar { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .5s ease; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }

.consent-box { max-height: 320px; overflow-y: auto; border-radius: var(--radius-sm); padding: 1rem 1.2rem; background: var(--panel-2); font-size: .92rem; line-height: 2; }
.consent-box h2, .consent-box h3 { font-size: 1rem; margin-top: 1rem; }
.consent-box strong { color: var(--fg); }

.empty { text-align: center; padding: 2.6rem 1rem; color: var(--fg-dim); }
.empty .empty-ico { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 22px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; }
.empty .empty-ico .ico { width: 30px; height: 30px; }
.empty h3 { color: var(--fg); font-size: 1.2rem; }

/* --------------------------------------------------- wizard stepper */
.steps { display: flex; margin: .2rem 0 1.4rem; align-items: center; }
.step { display: flex; align-items: center; gap: .5rem; flex: 0 1 auto; font-size: .82rem; color: var(--fg-faint); font-weight: 600; }
.step::before { content: attr(data-n); width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--bg-soft); color: var(--fg-faint); }
.step span { white-space: nowrap; }
.step.active { color: var(--fg); font-weight: 800; }
.step.active::before { background: var(--brand); color: var(--on-brand); }
.step.done { color: var(--ok); }
.step.done::before { content: "✓"; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.steps .sep { flex: 1 1 14px; min-width: 14px; height: 2px; background: var(--line); margin: 0 .5rem; border-radius: 2px; }

/* ------------------------------------------------ guided setup (home) */
.hero {
  border-radius: 32px; padding: 2rem 2.2rem; margin-bottom: 1.2rem; color: var(--on-ink); position: relative; overflow: hidden;
  background: var(--ink);
}
.hero::before { content: ""; position: absolute; inset-inline-end: -70px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; background: var(--brand); opacity: .95; }
.hero::after { content: ""; position: absolute; inset-inline-end: 90px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 18px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: inherit; font-size: 2.1rem; margin-bottom: .4rem; max-width: 18ch; }
.hero p { color: inherit; opacity: .8; margin-bottom: 0; max-width: 50ch; }
.hero .btn-primary { box-shadow: none; }
.hero-actions { margin-top: 1.3rem; }
.hero .progress-label { font-size: .82rem; opacity: .75; margin-top: 1.4rem; }
.hero .bar { background: color-mix(in srgb, var(--on-ink) 18%, transparent); margin-top: .4rem; max-width: 320px; }

.setup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; align-items: stretch; }
.setup-step { display: flex; flex-direction: column; gap: .6rem; padding: 1.3rem; background: var(--panel); border: 2px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.setup-step.current { border-color: var(--brand); box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent), var(--shadow-sm); }
.setup-step.locked { opacity: .5; }
.setup-num { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-soft); color: var(--fg-dim); font-weight: 900; font-size: 1.15rem; }
.setup-step.current .setup-num { background: var(--brand); color: var(--on-brand); }
.setup-step.done .setup-num { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.setup-step h3 { margin: .2rem 0 0; font-size: 1.12rem; }
.setup-body { min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.setup-body p { margin: 0; }

.code-box { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-radius: 18px; background: var(--ink); color: var(--on-ink); margin: .6rem 0; }
.code-box .faint { color: color-mix(in srgb, var(--on-ink) 60%, transparent); }
.code-chars { font-family: var(--mono); font-size: 1.9rem; font-weight: 800; letter-spacing: .2em; color: var(--brand); direction: ltr; }
.copy-row { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem .8rem; border-radius: var(--radius-sm); background: var(--panel-2); margin: .35rem 0; }
.copy-row .mono { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; }
.phone-steps { margin: .5rem 0 0; padding-inline-start: 1.3rem; color: var(--fg-dim); font-size: .9rem; }
.phone-steps li { margin: .25rem 0; }

/* ------------------------------------------------ quick send + results */
.send-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.preview-bubble { background: var(--ink); color: var(--on-ink); border-radius: 22px 22px 22px 6px; padding: .9rem 1.15rem; white-space: pre-wrap; font-size: .93rem; min-height: 3.4rem; }
.result-row { display: flex; align-items: center; gap: .8rem; padding: .75rem .1rem; border-bottom: 1px solid var(--line-soft); }
.result-row:last-child { border-bottom: 0; }
.result-ico { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 38px; background: var(--bg-soft); color: var(--fg-dim); }
.result-ico.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.result-ico.bad { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.result-ico.wait { background: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--warn); }
.result-ico.wait .ico { animation: spin 1.2s linear infinite; }
.result-ico .ico { width: 20px; height: 20px; }
.explain { font-size: .82rem; color: var(--fg-dim); }
.explain b { color: var(--fg); }

/* ---------------------------------------------------- toasts, modals */
#toasts { position: fixed; inset-block-end: 1.2rem; inset-inline-start: 1.2rem; display: flex; flex-direction: column; gap: .5rem; z-index: 99; max-width: min(400px, calc(100vw - 2rem)); }
.toast { padding: .8rem 1.1rem; border-radius: 16px; background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); font-size: .92rem; animation: pop .2s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

.modal-back { position: fixed; inset: 0; background: rgba(8, 14, 36, .6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1rem; z-index: 60; animation: fade .15s ease-out; }
.modal { background: var(--panel); border-radius: 28px; box-shadow: var(--shadow); padding: 1.6rem; width: min(680px, 100%); max-height: 90vh; overflow-y: auto; animation: rise .22s ease-out; }
.modal > h2 { margin-bottom: 1rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px) scale(.985); opacity: 0; } }

/* ---------------------------------------------------------- auth page */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--ink); color: var(--on-ink); padding: 3rem; display: flex; flex-direction: column; justify-content: center; gap: 1.4rem; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset-inline-end: -90px; bottom: -110px; width: 320px; height: 320px; border-radius: 50%; background: var(--brand); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 2.1rem; line-height: 1.5; color: inherit; max-width: 16ch; }
.auth-side p { opacity: .78; max-width: 44ch; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.auth-side li { display: flex; gap: .7rem; align-items: flex-start; opacity: .92; }
.auth-side li .ico { margin-top: .25rem; color: var(--brand); }
.auth-form { display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(420px, 100%); }
.auth-card .brand { color: var(--fg); }
.tabs { display: flex; gap: .3rem; background: var(--bg-soft); padding: .3rem; border-radius: 999px; margin-bottom: 1.3rem; }
.tabs button { flex: 1; padding: .6rem; border: 0; background: transparent; color: var(--fg-dim); font: inherit; font-size: .92rem; font-weight: 600; border-radius: 999px; cursor: pointer; }
.tabs button.active { background: var(--panel); color: var(--fg); font-weight: 800; box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------- mock pay page */
.pay-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.pay-card { width: min(420px, 100%); background: var(--panel); border-radius: var(--radius); padding: 1.8rem; text-align: center; box-shadow: var(--shadow); }
.pay-brand { font-weight: 800; margin-bottom: .4rem; }
.pay-amount { font-size: 1.9rem; font-weight: 800; margin: 1rem 0 .2rem; font-family: var(--mono); direction: ltr; }
.pay-meta { color: var(--fg-faint); font-size: .78rem; font-family: var(--mono); direction: ltr; margin-bottom: 1.2rem; }
.pay-actions { display: flex; gap: .6rem; justify-content: center; }

/* ------------------------------------------------------- landing page */
.landing { display: flex; flex-direction: column; min-height: 100vh; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 max(1rem, calc((100vw - 1100px) / 2)); height: var(--nav-h); background: var(--ink); color: var(--on-ink); flex-wrap: wrap; }
.lp-nav .muted, .lp-nav .faint { color: color-mix(in srgb, var(--on-ink) 65%, transparent); }
.lp-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2.4rem 1.2rem 3rem; }
.lp-hero { padding: 1.5rem 0 2.4rem; }
.lp-hero h1 { font-size: 2.7rem; line-height: 1.45; margin-bottom: .8rem; max-width: 20ch; }
.lp-lead { color: var(--fg-dim); font-size: 1.1rem; max-width: 58ch; }
.lp-cta { margin-top: 1.6rem; }
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0 1.6rem; }
.lp-features .card { margin: 0; }
.lp-features .stat-ico { margin-bottom: .7rem; }
.lp-download { margin-top: 1.5rem; }
.lp-steps { margin: .4rem 0 0; padding-inline-start: 1.2rem; color: var(--fg-dim); font-size: .94rem; line-height: 2.1; }
.lp-legal { margin-top: 1.5rem; }
.lp-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem max(1rem, calc((100vw - 1100px) / 2)); border-top: 1px solid var(--line); }
[aria-disabled="true"] { pointer-events: none; opacity: .5; }

/* ------------------------------------------------- date/time picker */
.picker { display: flex; flex-direction: column; gap: .8rem; }
.segmented { display: inline-flex; background: var(--bg-soft); padding: .3rem; border-radius: 999px; gap: .2rem; align-self: flex-start; }
.seg { border: 0; background: transparent; color: var(--fg-dim); font: inherit; font-size: .88rem; font-weight: 600; padding: .45rem 1.1rem; border-radius: 999px; cursor: pointer; }
.seg.active { background: var(--ink); color: var(--on-ink); font-weight: 800; }
.picker-fields { display: flex; flex-direction: column; gap: .55rem; }
.picker-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.picker-row > .faint { width: 3rem; }
.picker-row select { width: auto; min-width: 5.4rem; flex: 0 1 auto; }
.picker-summary { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .92rem; min-height: 1.6rem; }
.picker-bad { color: var(--danger); }

/* ------------------------------------------------ phones, SIMs, accounts */
.sim-tree { display: flex; flex-direction: column; gap: .7rem; margin-top: .7rem; }
.sim { border-radius: 20px; background: var(--panel-2); padding: .85rem 1rem; }
.sim-head { display: flex; align-items: center; gap: .8rem; }
.sim-chip { width: 38px; height: 38px; border-radius: 13px; flex: 0 0 38px; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font-weight: 800; }
.sim-accounts { margin-top: .6rem; display: flex; flex-direction: column; gap: .35rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.sim-account { display: flex; align-items: center; gap: .6rem; font-size: .92rem; padding: .25rem .1rem; }
.platform-chip { font-size: .75rem; font-weight: 800; padding: .12rem .65rem; border-radius: 999px; background: var(--brand-soft); color: var(--fg); }
.diag-body { background: var(--ink); color: color-mix(in srgb, var(--on-ink) 88%, transparent); border-radius: 14px; padding: .8rem 1rem; font-family: var(--mono); font-size: .75rem; line-height: 1.6; direction: ltr; text-align: left; overflow: auto; max-height: 260px; white-space: pre; margin: .4rem 0; }

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

/* ------------------------------------------------------------- phones */
@media (max-width: 900px) {
  :root { --nav-h: 60px; }
  .topnav { padding: 0 1rem; gap: .6rem; }
  .nav-links, .me { display: none; }
  .main { padding: 1.2rem 1rem calc(var(--tab-h) + 2rem); }
  h1 { font-size: 1.55rem; }
  .setup { grid-template-columns: 1fr; }
  .send-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .hero { padding: 1.5rem 1.3rem; border-radius: 26px; }
  .hero h1 { font-size: 1.7rem; }
  .code-chars { font-size: 1.4rem; }
  .lp-hero h1 { font-size: 1.9rem; }
  .modal { padding: 1.2rem; border-radius: 24px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    height: var(--tab-h); background: var(--panel); border-top: 1px solid var(--line); padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 30px rgba(14, 26, 58, .08);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; font-size: .68rem; color: var(--fg-faint); border-radius: 16px; cursor: pointer; position: relative; font-weight: 600; }
  .tab .ico { width: 1.45rem; height: 1.45rem; }
  .tab.active { color: var(--fg); }
  .tab.active .ico { color: var(--on-brand); background: var(--brand); border-radius: 12px; width: 2.6rem; height: 1.9rem; padding: .25rem .6rem; box-sizing: border-box; }
  .tab .badge { position: absolute; top: .1rem; inset-inline-end: 22%; font-size: .6rem; padding: 0 .35rem; }
  .sheet-back { position: fixed; inset: 0; background: rgba(8, 14, 36, .5); z-index: 45; }
  .sheet {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 50; background: var(--panel); border-radius: 28px 28px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; animation: rise .2s ease-out;
  }
  .sheet .nav-item { color: var(--fg); background: var(--panel-2); border-radius: 18px; padding: .85rem 1rem; }
  .sheet .nav-item.active { background: var(--brand); color: var(--on-brand); }
}
