/* Panda Player — Reseller Portal
   Violet and white. Daylight is the default; night is opt-in, remembered per
   device. Every colour is a token on :root, so the dark block only reassigns
   values — no rule below hard-codes a colour. */

:root {
  /* surfaces */
  --bg: #f7f7fb;
  --bg-accent: linear-gradient(180deg, #f3f0fe 0%, #f7f7fb 340px);
  --panel: #ffffff;
  --panel-2: #f5f4fb;
  --line: #e7e5f0;
  --line-strong: #d9d5e8;

  /* type */
  --text: #16121f;
  --text-2: #453d59;
  --muted: #736a86;

  /* brand */
  --violet: #6d3ce0;
  --violet-hover: #5c2fc9;
  --violet-soft: #f0eaff;
  --violet-line: #d9cdfb;
  --on-violet: #ffffff;

  /* state */
  --ok: #0f7a4a;      --ok-bg: #e7f6ee;   --ok-line: #bfe6d1;
  --warn: #8a5a00;    --warn-bg: #fdf3e0; --warn-line: #f0dcb4;
  --bad: #b62525;     --bad-bg: #fdeceb;  --bad-line: #f5cbc9;

  --shadow-sm: 0 1px 2px rgba(24, 16, 44, .05);
  --shadow: 0 1px 3px rgba(24, 16, 44, .06), 0 8px 24px -12px rgba(24, 16, 44, .14);
  --shadow-lg: 0 2px 6px rgba(24, 16, 44, .07), 0 24px 48px -20px rgba(72, 40, 160, .28);

  --radius: 14px;
  --radius-sm: 10px;
}

:root[data-theme="dark"] {
  --bg: #0c0a12;
  --bg-accent: linear-gradient(180deg, #171130 0%, #0c0a12 340px);
  --panel: #14111d;
  --panel-2: #1b1728;
  --line: #272134;
  --line-strong: #362e49;

  --text: #f1eefa;
  --text-2: #cec7e0;
  --muted: #948aab;

  --violet: #9b7bff;
  --violet-hover: #ae93ff;
  --violet-soft: #221a3d;
  --violet-line: #3a2f60;
  --on-violet: #14111d;

  --ok: #6fe3a6;      --ok-bg: rgba(46, 190, 122, .14);  --ok-line: rgba(46, 190, 122, .32);
  --warn: #f3c983;    --warn-bg: rgba(220, 150, 40, .14); --warn-line: rgba(220, 150, 40, .32);
  --bad: #ff9d9d;     --bad-bg: rgba(220, 70, 70, .14);   --bad-line: rgba(220, 70, 70, .34);

  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { background-image: var(--bg-accent); background-repeat: no-repeat; }
body[dir="rtl"] { direction: rtl; }

a { color: var(--violet); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ── Brand ──────────────────────────────────────────────────────── */

.brand {
  display: inline-flex; align-items: baseline; gap: .38em;
  font-weight: 800; font-size: 17px; letter-spacing: -.015em;
}
.brand b { font-weight: 800; color: var(--text); }
.brand em { font-style: normal; font-weight: 800; color: var(--violet); }
.brand .tag {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding-inline-start: .5em;
  border-inline-start: 1px solid var(--line-strong); margin-inline-start: .2em;
}

/* ── Theme toggle ───────────────────────────────────────────────── */

#themeToggle {
  position: fixed; top: 18px; inset-inline-end: 18px; z-index: 50;
  width: 38px; height: 38px; padding: 0;
  display: grid; place-items: center;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; font-size: 16px; line-height: 1;
  box-shadow: var(--shadow-sm); transition: color .15s, border-color .15s;
}
#themeToggle:hover { color: var(--violet); border-color: var(--violet-line); }
body.signed-in #themeToggle { position: static; box-shadow: none; }

/* ── Shell ──────────────────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 26px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .spacer { flex: 1; }

.balance-chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--violet-soft); border: 1px solid var(--violet-line);
  color: var(--violet);
  padding: 7px 15px; border-radius: 999px; font-weight: 600; font-size: 13px;
}
.balance-chip .n { font-size: 16px; font-weight: 800; }
.balance-chip.low { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

nav.tabs {
  display: flex; gap: 2px; padding: 0 26px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  background: none; border: 0; color: var(--muted);
  padding: 14px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s;
}
nav.tabs button:hover { color: var(--text); }
nav.tabs button.active { color: var(--violet); border-bottom-color: var(--violet); }

main { max-width: 1000px; margin: 0 auto; padding: 30px 26px 72px; }

/* ── Cards ──────────────────────────────────────────────────────── */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 5px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; max-width: 62ch; }

/* ── Auth ───────────────────────────────────────────────────────── */

.auth-wrap { max-width: 440px; margin: 7vh auto; padding: 0 20px 60px; }
.auth-wrap .logo { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-wrap .logo .brand { font-size: 23px; }
.auth-wrap .card { box-shadow: var(--shadow-lg); padding: 30px; }

/* ── Forms ──────────────────────────────────────────────────────── */

label { display: block; font-size: 13px; color: var(--text-2); margin: 16px 0 6px; font-weight: 600; }

input, select, textarea {
  width: 100%; padding: 11px 13px;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
/* Free text grows downward only: a box that widens breaks the two-across row. */
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

button.btn {
  width: 100%; margin-top: 22px; padding: 12px 18px;
  background: var(--violet); color: var(--on-violet); border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
button.btn:hover { background: var(--violet-hover); }
button.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--violet-soft); }
button.btn:disabled { opacity: .55; cursor: not-allowed; }
button.btn.ghost {
  background: var(--panel); border-color: var(--line-strong); color: var(--text);
}
button.btn.ghost:hover { background: var(--panel-2); }
button.btn.inline { width: auto; margin: 0; padding: 10px 18px; }
button.btn.small { width: auto; margin: 0; padding: 7px 14px; font-size: 13px; }
button.btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
button.btn.danger:hover { background: var(--bad-bg); }

.links { margin-top: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.links a { margin: 0 7px; }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 18px; color: var(--text-2); font-weight: 400; font-size: 14px;
}
.check input { width: auto; margin-top: 3px; }

/* ── Feedback ───────────────────────────────────────────────────── */

.msg {
  padding: 12px 14px; border-radius: var(--radius-sm); margin: 18px 0 0;
  font-size: 14px; line-height: 1.5;
}
.msg.err  { background: var(--bad-bg);  border: 1px solid var(--bad-line);  color: var(--bad); }
.msg.ok   { background: var(--ok-bg);   border: 1px solid var(--ok-line);   color: var(--ok); }
.msg.info { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); }

/* ── Stats ──────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow-sm);
}
.stat .k {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .09em; font-weight: 700;
}
.stat .v { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.stat.accent { background: var(--violet-soft); border-color: var(--violet-line); }
.stat.accent .k { color: var(--violet); opacity: .85; }
.stat.accent .v { color: var(--violet); }

/* ── Tables ─────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 -4px; }

/* An activation code is a credential. It is covered on the list and shown
   one row at a time, because this screen gets left open and shown to people. */
.code-reveal {
  font: inherit; font-size: 12.5px; font-family: inherit;
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
  color: var(--violet); background: var(--violet-soft);
  border: 1px solid var(--violet-line);
}
.code-reveal:hover { filter: brightness(.97); }
.code-reveal.shown {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em; color: var(--text);
  background: var(--panel-2); border-color: var(--line);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
th {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid transparent;
}
.pill.active  { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok); }
.pill.expired { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad); }
.pill.trial   { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.pill.banned  { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad); }
.pill.neutral { background: var(--panel-2); border-color: var(--line);      color: var(--muted); }

.delta-pos  { color: var(--ok);  font-weight: 700; }
.delta-neg  { color: var(--bad); font-weight: 700; }
.delta-zero { color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ── Lookup preview ─────────────────────────────────────────────── */

.preview {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-top: 20px;
}
.preview .kv {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.preview .kv:last-of-type { border-bottom: 0; }
.preview .kv .k { color: var(--muted); }
.preview .kv .v { font-weight: 600; text-align: end; }
.preview label:first-of-type { margin-top: 18px; }

.cost-line {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-strong);
  font-size: 14px; color: var(--muted);
}
.cost-line strong { font-size: 20px; color: var(--text); font-weight: 800; }

code.otp {
  display: block; background: var(--panel-2); border: 1px solid var(--line);
  padding: 13px; border-radius: var(--radius-sm); word-break: break-all;
  font-size: 12.5px; margin-top: 10px; letter-spacing: .04em;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 660px) {
  main { padding: 20px 14px 56px; }
  .card { padding: 18px; }
  .auth-wrap { margin: 3vh auto; }
  .auth-wrap .card { padding: 22px; }
  .row { flex-direction: column; gap: 0; }
  .topbar { padding: 12px 14px; gap: 8px; }
  .brand .tag { display: none; }
  nav.tabs { padding: 0 8px; }
  .stat .v { font-size: 25px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Panda backdrop — layered, fixed, and behind everything.

   Three layers, none of which the content has to work around:
     1. an aurora of violet glows that anchors the page in the brand
     2. a bamboo-leaf weave, the panda's own motif, at a whisper of opacity
     3. a single oversized panda mark bled off the corner as a watermark
   All inline SVG data URIs — the CSP here allows img-src 'self' data:.
   ═══════════════════════════════════════════════════════════════════ */

body::before {
  content: ''; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(58vw 58vw at 10% -10%, rgba(124, 58, 237, .20), transparent 62%),
    radial-gradient(46vw 46vw at 94% 2%,   rgba(167, 139, 250, .17), transparent 64%),
    radial-gradient(52vw 52vw at 52% 112%, rgba(109, 60, 224, .13), transparent 62%);
}
:root[data-theme="dark"] body::before,
html[data-theme="dark"] body::before {
  background:
    radial-gradient(58vw 58vw at 10% -10%, rgba(124, 58, 237, .30), transparent 62%),
    radial-gradient(46vw 46vw at 94% 2%,   rgba(88, 44, 190, .28), transparent 64%),
    radial-gradient(52vw 52vw at 52% 112%, rgba(60, 30, 130, .30), transparent 62%);
}

/* Media weave — the same motif family as the app: screens, remotes,
   reels, transport controls, and the wordmark. Applied as a mask so the tint
   follows the theme colour from one file instead of two. */
body::after {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-color: var(--violet);
  -webkit-mask-image: url('/img/pattern.svg');
          mask-image: url('/img/pattern.svg');
  -webkit-mask-size: 560px 560px;
          mask-size: 560px 560px;
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  opacity: .085;
}


/* Oversized panda watermark, bled off the trailing edge */
.pandamark {
  position: fixed; z-index: -1; pointer-events: none; user-select: none;
  inset-inline-end: -13vmin; bottom: -16vmin;
  width: 62vmin; height: 62vmin;
  opacity: .07; color: var(--violet);
}
:root[data-theme="dark"] .pandamark { opacity: .11; }
@media (max-width: 660px) { .pandamark { width: 78vmin; height: 78vmin; opacity: .05; } }

/* ── Hero band ──────────────────────────────────────────────────────
   Replaces the plain stat grid at the top of the dashboard: the balance
   is the number that matters, so it gets scale and the brand gradient,
   and the supporting counts sit beside it rather than in equal boxes. */

.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 28px 30px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #6d3ce0 0%, #8b5cf6 52%, #a78bfa 100%);
  color: #fff;
  box-shadow: 0 20px 44px -22px rgba(80, 40, 190, .65);
}
.hero::after {
  content: ''; position: absolute; inset-inline-end: -60px; top: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.20), transparent 68%);
}
.hero-grid {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
}
.hero .lede { font-size: 12px; letter-spacing: .13em; text-transform: uppercase; opacity: .8; font-weight: 700; }
.hero .big { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin-top: 8px; }
.hero .big small { font-size: 16px; font-weight: 600; opacity: .82; margin-inline-start: 8px; letter-spacing: 0; }
.hero-side { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-side div .k { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; opacity: .78; font-weight: 700; }
.hero-side div .v { font-size: 25px; font-weight: 800; margin-top: 5px; letter-spacing: -.02em; }
.hero .cta {
  margin-top: 22px; position: relative; z-index: 1;
  background: #fff; color: var(--violet); border: 0;
  padding: 11px 22px; border-radius: 999px;
  font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.35);
}
.hero .cta:hover { transform: translateY(-1px); }

/* Section heading used between blocks instead of another card chrome */
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 30px 2px 14px;
}
.section-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.section-head .hint { color: var(--muted); font-size: 13px; }

/* Panels sit on the backdrop, so they need a touch of translucency to let
   the aurora through rather than punching white holes in it. */
.card, .stat {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(6px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .card, .stat { background: var(--panel); }
}

/* Brand mark sits with the wordmark and inherits the violet. */
.brand .mark { width: 1.55em; height: 1.55em; color: var(--violet); align-self: center; flex: none; }
.auth-wrap .logo .brand .mark { width: 1.7em; height: 1.7em; }

/* A little more presence for the backdrop, and the toggle sized to sit in the
   top bar alongside the other controls once signed in. */
body::after { opacity: .55; }
:root[data-theme="dark"] body::after { opacity: .3; }
.pandamark { opacity: .10; }
:root[data-theme="dark"] .pandamark { opacity: .14; }
body.signed-in #themeToggle { width: 34px; height: 34px; flex: none; }
#themeToggle svg { display: block; }

:root[data-theme="dark"] body::after { opacity: .13; }
/* The later tuning block set a bamboo-era opacity; the media weave needs less. */
body::after { opacity: .085; }
:root[data-theme="dark"] body::after { opacity: .13; }

/* Official Panda mark replaces the drawn placeholder. */
.brand .mark { width: 1.85em; height: 1.85em; border-radius: 6px; }
.auth-wrap .logo .brand .mark { width: 2.1em; height: 2.1em; }
.pandamark {
  inset-inline-end: -10vmin; bottom: -12vmin;
  width: 54vmin; height: 54vmin; opacity: .09;
}
:root[data-theme="dark"] .pandamark { opacity: .13; }

/* ── Backdrop, final balance ────────────────────────────────────────
   The media weave is the identity here, so it stays even across the whole
   page rather than being washed out at the top by the glow. The aurora sits
   behind it as a soft tint, not as a competing subject. */
body { background-image: none; }

body::before {
  background:
    radial-gradient(70vw 52vw at 50% -14%, rgba(124, 58, 237, .16), transparent 68%),
    linear-gradient(180deg, rgba(124, 58, 237, .06) 0%, transparent 46%);
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(74vw 56vw at 50% -16%, rgba(124, 58, 237, .26), transparent 70%),
    linear-gradient(180deg, rgba(90, 50, 190, .16) 0%, transparent 52%);
}

body::after { opacity: .07; }
:root[data-theme="dark"] body::after { opacity: .11; }

/* Tile size follows the new 520px artwork. The layers are fixed to the
   viewport, so the weave stays put behind the top bar and the page end
   instead of scrolling away and leaving those bands bare. */
body::after {
  -webkit-mask-size: 520px 520px;
          mask-size: 520px 520px;
}

/* The top bar and the tab strip are opaque panels sitting on the backdrop,
   which is why the weave stopped at the header. Let it through. */
.topbar, nav.tabs {
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(10px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar, nav.tabs { background: var(--panel); }
}

/* The signed-in shell must not paint over the backdrop either. */
#appView { background: transparent; }

/* ═══ Backdrop, as a real element ═══════════════════════════════════
   body::before / ::after with negative z-index are fragile: the canvas
   background propagated from html paints over them in places, which is what
   made the weave vanish behind the header and below the fold. A dedicated
   fixed element at z-index 0, with the content lifted to z-index 1, removes
   the whole class of problem. */

body::before, body::after { content: none !important; }

.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70vw 52vw at 50% -14%, rgba(124, 58, 237, .16), transparent 68%),
    linear-gradient(180deg, rgba(124, 58, 237, .06) 0%, transparent 46%);
}
:root[data-theme="dark"] .backdrop {
  background:
    radial-gradient(74vw 56vw at 50% -16%, rgba(124, 58, 237, .26), transparent 70%),
    linear-gradient(180deg, rgba(90, 50, 190, .16) 0%, transparent 52%);
}

.backdrop::after {
  content: ''; position: absolute; inset: 0;
  background-color: var(--violet);
  opacity: .075;
  -webkit-mask-image: url('/img/pattern.svg'); mask-image: url('/img/pattern.svg');
  -webkit-mask-size: 520px 520px;            mask-size: 520px 520px;
  -webkit-mask-repeat: repeat;               mask-repeat: repeat;
}
:root[data-theme="dark"] .backdrop::after { opacity: .12; }

/* Everything the reseller interacts with sits above the backdrop. */
#authView, #appView, #themeToggle { position: relative; z-index: 1; }
#themeToggle { position: fixed; z-index: 50; }
body.signed-in #themeToggle { position: static; }

/* ── Credit packages ────────────────────────────────────────────────
   Priced options read better as a row of cards than as a select, because the
   value per credit is the thing being compared. */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.pkg {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 18px; background: var(--panel); text-align: start;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.pkg:hover { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); transform: translateY(-1px); }
.pkg[aria-pressed="true"] { border-color: var(--violet); background: var(--violet-soft); box-shadow: 0 0 0 3px var(--violet-soft); }
.pkg .n { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pkg .c { font-size: 27px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.02em; }
.pkg .c span { font-size: 13px; font-weight: 600; color: var(--muted); margin-inline-start: 5px; }
.pkg .p { font-size: 15px; font-weight: 700; color: var(--violet); }
.pkg .u { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pay-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
/* ═══════════════════════════════════════════════════════════════════
   Signed-in shell: sidebar plus content column.
   The old top-tab strip made the page read as a form rather than a
   product. A persistent sidebar gives the sections a home, and each card
   leads with a gradient icon tile so a glance tells you what it is.
   ═══════════════════════════════════════════════════════════════════ */

#appView { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 244px; flex: none; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  border-inline-end: 1px solid var(--line);
  padding: 20px 14px;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .sidebar { background: var(--panel); }
}

.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.side-brand img { border-radius: 9px; }
.side-brand span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 800; font-size: 16px; letter-spacing: -.015em; }
.side-brand b { color: var(--text); }
.side-brand em { font-style: normal; color: var(--violet); }
.side-brand small {
  font-size: 10px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin-top: 3px;
}

.sidebar nav.tabs {
  display: flex; flex-direction: column; gap: 3px;
  background: none; border: 0; padding: 0; overflow: visible;
}
.sidebar nav.tabs button {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 11px 12px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: start; transition: background .14s, color .14s;
}
.sidebar nav.tabs button svg {
  width: 19px; height: 19px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; opacity: .8;
}
.sidebar nav.tabs button:hover { background: var(--panel-2); color: var(--text); }
.sidebar nav.tabs button.active {
  background: var(--violet); color: var(--on-violet);
  box-shadow: 0 8px 20px -10px var(--violet);
}
.sidebar nav.tabs button.active svg { opacity: 1; }

.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.side-foot a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.side-foot a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side-foot a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.side-foot p { margin: 10px 12px 0; font-size: 11.5px; color: var(--muted); opacity: .75; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { gap: 14px; padding: 14px 26px; }
.page-head h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.who { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6d3ce0, #a78bfa);
  color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.who-name { font-size: 13.5px; font-weight: 600; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  color: var(--muted); cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.only-mobile { display: none; }

/* Every page fills the shell.

   `.shell` is a column flex container, so main stretches across it - but only
   as long as it has no auto margin in the cross axis. `margin: 0 auto` quietly
   cancels the stretch, leaving each page as wide as its own widest element.
   That is how Activate device came out at 1045px and My devices at 569px in
   the same 1277px shell. Width is a decision about the page, not an accident
   of what is inside it. */
main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px 30px 70px;
}

/* ── Welcome band ───────────────────────────────────────────────── */

.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--violet-soft), transparent);
  border: 1px solid var(--violet-line); border-radius: 18px;
  padding: 22px 26px; margin-bottom: 20px;
}
.welcome .eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--violet);
}
.welcome h2 { margin: 7px 0 3px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.welcome p { margin: 0; color: var(--muted); font-size: 14px; }
.welcome .btn { display: inline-flex; align-items: center; gap: 9px; }
.welcome .btn .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ── Stat cards with icon tiles ─────────────────────────────────── */

.stats { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .k { font-size: 11px; }
.stat .v { font-size: 26px; margin-top: 3px; }
.stat .v small { font-size: 12px; font-weight: 600; color: var(--muted); margin-inline-start: 5px; }

.tile {
  width: 44px; height: 44px; flex: none; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 18px -10px rgba(24, 16, 44, .55);
}
.tile svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile.v1 { background: linear-gradient(135deg, #6d3ce0, #a78bfa); }
.tile.v2 { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.tile.v3 { background: linear-gradient(135deg, #0d9488, #34d399); }
.tile.v4 { background: linear-gradient(135deg, #c2410c, #fb923c); }

/* ── Card heads ─────────────────────────────────────────────────── */

.card-head { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 18px; }
.card-head h2 { margin: 0 0 4px; }
.card-head .sub { margin: 0; }
.card.flush { padding: 6px 8px; }
.card.flush .count { margin: 6px 12px 10px; color: var(--muted); font-size: 13px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { flex: 1; min-width: 150px; }
.opt { opacity: .6; font-weight: 400; }

/* ── Payment methods as branded cards ───────────────────────────── */

.pay-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 18px; }
.pay {
  display: flex; align-items: center; gap: 13px; text-align: start;
  padding: 15px 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel);
  font: inherit; color: var(--text); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.pay:hover:not(:disabled) { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); transform: translateY(-1px); }
.pay:disabled { opacity: .45; cursor: not-allowed; }
/* One chip, one size, whatever the artwork inside wants to be. A row of
   marks at their natural widths is what made this look unfinished. */
.pay { justify-content: space-between; }
.pay-text { display: flex; flex-direction: column; }
.pay-marks { display: flex; gap: 6px; flex: none; }
.pay-marks .mark {
  width: 42px; height: 27px; border-radius: 6px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid #e7e5f0;
}
.pay-marks .mark svg { width: 34px; height: 20px; display: block; }

.tos-links {
  margin: 8px 2px 0; font-size: 12.5px; display: flex; gap: 8px; align-items: center;
}
.tos-links a { color: var(--violet); }
.tos-links span { color: var(--muted); }
.tos-gate + .tos-gate { margin-top: 8px; }
.pay .t { font-weight: 700; font-size: 14.5px; }
.pay .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.tos-gate {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 18px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--text-2);
}
.tos-gate input { width: auto; margin-top: 3px; flex: none; }

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .only-mobile { display: grid; }
  .sidebar {
    position: fixed; inset-inline-start: 0; top: 0; z-index: 40;
    transform: translateX(-105%); transition: transform .2s;
    box-shadow: var(--shadow-lg);
  }
  body[dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: none; }
  .page-head p { display: none; }
  .who-name { display: none; }
  main { padding: 18px 14px 60px; }
}

/* ══ Support ═══════════════════════════════════════════════════════════
   A thread reads as a conversation, but it is a record: nothing here is
   ever edited, so the layout leans on timestamps and clear authorship
   rather than on chat-app affordances like editing or deleting. */

.ticket-list { display: flex; flex-direction: column; gap: 8px; }

.ticket-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ticket-row:hover {
  border-color: var(--violet-line);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.ticket-row .tk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ticket-row .tk-subject {
  font-weight: 650; color: var(--text); font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticket-row .tk-sub { font-size: 12.5px; color: var(--muted); }

/* An unanswered reply earns a violet edge, and nothing louder. */
.ticket-row.unread { border-left: 3px solid var(--violet); background: var(--violet-soft); }
.ticket-row.unread .tk-subject::after {
  content: 'new'; margin-inline-start: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--on-violet); background: var(--violet);
  padding: 2px 6px; border-radius: 999px; vertical-align: middle;
}

/* The sidebar marker, so an answer is visible from any tab. */
nav.tabs button .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--violet); margin-inline-start: auto; flex: none;
}

.thread {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 46vh; overflow-y: auto;
  padding: 4px 2px 14px;
}
.bubble { max-width: 78%; }
.bubble.me  { align-self: flex-end; }
.bubble.them { align-self: flex-start; }

.bub-who {
  font-size: 11.5px; font-weight: 650; color: var(--muted);
  margin-bottom: 5px; display: flex; gap: 8px; align-items: baseline;
}
.bub-who span { font-weight: 400; opacity: .75; }
.bubble.me .bub-who { justify-content: flex-end; }

.bub-body {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.55; word-break: break-word;
  border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
}
.bubble.me .bub-body {
  background: var(--violet); border-color: transparent; color: var(--on-violet);
}

.empty-state { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--text); }
.empty-state p + p { margin-top: 6px; font-size: 13.5px; max-width: 46ch; margin-inline: auto; }

#th-replyBox { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }

@media (max-width: 640px) {
  .bubble { max-width: 92%; }
  .thread { max-height: none; }
}

/* ══ Signed-out header controls ════════════════════════════════════════
   The language picker sits beside the day/night switch, reachable before
   there is any account to remember a preference on. */

.top-controls {
  position: fixed; top: 16px; inset-inline-end: 16px; z-index: 3;
  display: flex; gap: 8px; align-items: center;
}
.top-controls #themeToggle { position: static; }

#langPicker {
  width: auto; padding: 8px 12px; font-size: 13px; font-weight: 600;
  border-radius: 999px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
#langPicker:hover { border-color: var(--violet-line); color: var(--violet); }

/* The dialling code needs only enough room for the flag and the code, so the
   phone number keeps the width it actually needs. */
.phone-row .dial { flex: 0 0 43%; min-width: 130px; }

.field-hint {
  margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5;
}

/* Right to left is the whole page, not a translated label inside a
   left-to-right layout. */
[dir="rtl"] .row { flex-direction: row; }
[dir="rtl"] .check { text-align: start; }

/* A label that wraps to two lines must not push its input out of line with
   the one beside it, so the pair align on the inputs rather than the tops. */
.row { align-items: end; }
.row > div { display: flex; flex-direction: column; }
.row > div > label { margin-top: auto; }

/* A select and a text input do not agree on their natural height, which is
   enough to knock a two-across row out of line. Pin them to the same value. */
input:not([type="checkbox"]), select { min-height: 46px; }

/* ══ Playlists ═════════════════════════════════════════════════════════
   One row per line on the device, with what it holds visible without
   opening anything: a reseller answering "my channels are gone" needs the
   channel count and the last load time at a glance. */

.pl-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pl-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.pl-name { font-weight: 650; color: var(--text); font-size: 14.5px; }
.pl-sub {
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch;
}

.row-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}

/* Only the fields the chosen line type needs are on screen, so the form
   never asks for a username on an M3U link. */
.pl-fields { margin: 0; }

#pl-form {
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--line);
}

button.btn.small.danger {
  background: transparent; border-color: var(--bad-line); color: var(--bad);
}
button.btn.small.danger:hover { background: var(--bad-bg); }

/* ══ Phones ════════════════════════════════════════════════════════════
   Measured on a 375px viewport, not guessed. The rule that matters most is
   the last one: nothing may make the page wider than the screen, because a
   form you have to scroll sideways to fill is a form people abandon. */

@media (max-width: 720px) {
  /* Three across becomes one down. The reading order was already
     top-to-bottom, so nothing moves out of sequence. */

  body.on-register .auth-wrap { max-width: 100%; }
  .auth-wrap { padding-inline: 14px; }

  /* The header controls sit above the card rather than floating over it,
     where they used to cover the corner of the form. */
  .top-controls {
    position: static; display: flex; justify-content: flex-end;
    gap: 8px; padding: 12px 14px 0; margin: 0;
  }
  #langPicker { padding: 7px 10px; font-size: 12.5px; max-width: 46vw; }

  /* A phone keyboard covers half the screen, so a two-across row would
     leave each field too narrow to read what was typed. */
  .row { flex-direction: column; gap: 0; align-items: stretch; }
  .phone-row .dial { flex: 1 1 auto; min-width: 0; }

  /* Tables scroll inside their own box; the page itself never does. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }

  .ticket-row { align-items: flex-start; }
  .pl-row { align-items: flex-start; }
  .pl-sub { white-space: normal; max-width: none; }
  .row-actions { width: 100%; }

  .card-head { flex-wrap: wrap; }
  .card-head .btn { width: 100%; margin-top: 8px; }

  .bubble { max-width: 100%; }
  .bubble.me .bub-body, .bubble.them .bub-body { word-break: break-word; }
}

/* Nothing at all may exceed the viewport. A single long URL in a playlist
   row was enough to push the whole page sideways. */
html, body { max-width: 100%; overflow-x: hidden; }
.backdrop { inset: 0; width: 100%; max-width: 100vw; }
input, select, textarea, table, pre, code { max-width: 100%; }
.mono { overflow-wrap: anywhere; }

/* The table is allowed to be wider than the phone, but only inside its own
   scroller. Without these it stretches its card, the card stretches main,
   and the filter row above it inherits a width no phone has. */
.table-wrap { max-width: 100%; min-width: 0; }
main, main > section, .card { min-width: 0; max-width: 100%; }

@media (max-width: 720px) {
  /* The top bar carries a title, a balance, an identity and a sign-out.
     On a phone the title and the balance are what matter; the rest shrinks
     to fit rather than sliding off the edge. */
  .topbar { padding: 12px 14px; gap: 8px; flex-wrap: nowrap; }
  .topbar .page-head { min-width: 0; flex: 1; }
  .topbar .page-head h1 {
    font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar .spacer { display: none; }
  .balance-chip { flex: none; padding: 6px 10px; font-size: 12.5px; }
  .who { flex: none; }
  #btnLogout {
    flex: none; padding: 7px 10px; font-size: 0;
    width: 36px; height: 36px; display: grid; place-items: center;
  }
  /* The word is gone at this size, so the button says what it does with a
     glyph instead of an unlabelled box. */
  #btnLogout::after { content: '⏻'; font-size: 15px; line-height: 1; }

  /* Search, status and button each take the full width in turn. */
  .filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters input, .filters select, .filters .btn { width: 100%; min-width: 0; margin: 0; }
}

/* ══ The reseller pitch ════════════════════════════════════════════════
   A column beside the form rather than inside it. Squeezed into the form's
   width the same three points were a hundred pixels wide and eleven lines
   tall, which reads as filler; given their own column they read as an
   argument.

   The panel is for someone deciding whether to apply. On a phone that
   decision has already been made - they came to fill the form - so it is
   left out entirely rather than pushed above and scrolled past. */

body.on-register .auth-wrap {
  max-width: 1020px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 38px;
  align-items: start;
}
/* The logo spans both columns and stays centred over them. */
body.on-register .auth-wrap .logo { grid-column: 1 / -1; }

.pitch { position: relative; padding-top: 6px; }

.pitch-eyebrow {
  display: inline-block; margin-bottom: 12px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--violet);
  background: var(--violet-soft); border: 1px solid var(--violet-line);
}

.pitch-head {
  margin: 0 0 26px; font-size: 30px; line-height: 1.2; font-weight: 800;
  letter-spacing: -.02em; color: var(--text); max-width: 15ch;
}

.pitch-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
}

/* A single line threading the three steps, so they read as a sequence
   rather than as three unrelated boxes. */
.pitch-steps::before {
  content: ''; position: absolute;
  inset-inline-start: 19px; top: 26px; bottom: 26px; width: 2px;
  background: linear-gradient(180deg, var(--violet-line), transparent);
}

.pitch-step {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 40px 1fr; gap: 16px;
  align-items: start;
  padding: 16px 18px 16px 0;
  border-radius: var(--radius);
  transition: transform .18s, background .18s;
}
.pitch-step:hover { transform: translateX(3px); background: var(--violet-soft); }
[dir=rtl] .pitch-step:hover { transform: translateX(-3px); }

.pitch-num {
  grid-row: 1; grid-column: 1;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  font-size: 14px; font-weight: 800;
  color: var(--on-violet);
  background: linear-gradient(135deg, var(--violet), #a855f7);
  box-shadow: 0 6px 16px -6px rgba(109, 60, 224, .7);
}

/* The glyph rides the corner of the number, so each step has a face of its
   own without a second column of icons to scan past. */
.pitch-icon {
  position: absolute; inset-inline-start: 26px; top: 30px;
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 8px;
  color: var(--violet);
  background: var(--panel); border: 1px solid var(--violet-line);
}
.pitch-icon svg {
  width: 13px; height: 13px; fill: none;
  stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.pitch-step h3 {
  margin: 4px 0 6px; font-size: 15.5px; font-weight: 700;
  color: var(--text); line-height: 1.35;
}
.pitch-step p {
  margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--muted);
  max-width: 42ch;
}

@media (max-width: 900px) {
  body.on-register .auth-wrap {
    display: block; max-width: 560px;
  }
  /* Left out on phones on purpose: whoever opened this page has already
     decided to apply, and the form is the only thing they came for. */
  .pitch { display: none; }
}

/* ══ The MAC verdict ═══════════════════════════════════════════════════
   Two different judgements share this line, so it has to be unmistakable
   which one is speaking: the shape, decided here, or the device, decided
   by the server. Colour carries the difference and the words carry the
   reason - neither alone is enough. */

.verdict {
  margin-top: 8px;
  font-size: 13px; line-height: 1.55; font-weight: 600;
  display: flex; align-items: flex-start; gap: 7px;
}
/* The space is held from the start. A message that appears and pushes the
   rest of the form down moves the field the reseller is still typing in. */
.verdict { min-height: 60px; }
.verdict::before { flex: none; font-weight: 700; }

.verdict.good    { color: var(--ok); }
.verdict.good::before    { content: '✓'; }
.verdict.bad     { color: var(--bad); font-weight: 500; }
.verdict.bad::before     { content: '✕'; font-weight: 700; }
.verdict.waiting { color: var(--muted); font-weight: 500; }
.verdict.waiting::before { content: '…'; }

/* The package select is dead until the server has approved the MAC, and it
   should look dead rather than merely refuse to work. */
#ac-plan:disabled {
  background: var(--panel-2); color: var(--muted); cursor: not-allowed;
}

.cost-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--text-2);
}
.cost-line strong { color: var(--text); }

/* A note is the reseller's own shorthand, so it is shown quietly and
   truncated rather than allowed to push the table around. */
.dev-note {
  display: block; max-width: 26ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: var(--muted);
}

/* The hidden attribute means hidden. A display rule further up the file
   silently overrides it, which left a stale price sitting under a MAC that
   had just been refused - the worst possible place for a wrong number. */
[hidden] { display: none !important; }

/* An optional step, marked as optional by how it sits: set apart from the
   required fields above it, and folded away until it is asked for. */
.opt-block {
  margin-top: 22px; padding: 16px 18px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.opt-block .check { margin: 0; align-items: flex-start; }
.opt-block .check span { line-height: 1.6; }
#ac-plFields { margin-top: 4px; }
#ac-plFields.hidden { display: none; }

/* A third verdict: the address is fine and free, but Panda Player has never
   seen it. Perfectly normal for a new sale, and also exactly what a typo
   looks like, so it is neither a tick nor a cross. */
.verdict.warn { color: var(--warn); font-weight: 500; }
.verdict.warn::before { content: '!'; font-weight: 800; }

/* The card no longer grows under the reseller's hands. Everything is on the
   page from the start and simply inert until the MAC has been checked -
   a form that changes height while you type it is a form that loses your
   place. */
.opt-block.inert { opacity: .45; pointer-events: none; }
#ac-costLine { min-height: 44px; }
#ac-costText:empty::before {
  content: 'Enter a MAC to see what a package costs';
  color: var(--muted);
}

/* ══ The account menu ══════════════════════════════════════════════════
   The name is the control. Everything that answers this is me lives
   behind it: the account, the language, the way to security, and signing
   out - which sits last, separated, so it is never the accidental click. */

.account { position: relative; flex: none; }

button.who {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  background: transparent; border: 1px solid transparent;
  color: var(--text); font: inherit; cursor: pointer;
  transition: background .15s, border-color .15s;
}
button.who:hover { background: var(--panel-2); border-color: var(--line); }
button.who[aria-expanded=true] { background: var(--panel-2); border-color: var(--violet-line); }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: var(--panel-2);
}
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar.lg { width: 52px; height: 52px; }

button.who .caret {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.account-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60;
  width: 290px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

.am-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--line);
}
.am-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.am-id b { font-size: 14.5px; color: var(--text); }
.am-id span {
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.am-credits { color: var(--violet) !important; font-weight: 600; }

.am-section { padding: 12px; border-bottom: 1px solid var(--line); }
.am-section label { margin: 0 0 6px; font-size: 12px; }
.am-section select { min-height: 38px; padding: 8px 11px; font-size: 13.5px; }
.am-hint { margin: 7px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

.am-links { padding: 6px 0; border-bottom: 1px solid var(--line); }

.am-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text-2); text-align: start;
}
.am-item:hover { background: var(--panel-2); color: var(--text); }
.am-item svg {
  width: 17px; height: 17px; flex: none; fill: none;
  stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.am-item.danger { color: var(--bad); margin-top: 4px; }
.am-item.danger:hover { background: var(--bad-bg); color: var(--bad); }

@media (max-width: 720px) {
  button.who .who-name { display: none; }
  .account-menu { width: min(300px, calc(100vw - 28px)); }
}

/* ══ The device filters ════════════════════════════════════════════════
   Five separate questions, so they are laid out as fields rather than as
   one row of controls. They narrow together: filling two means both have
   to match, which is what a labelled field promises. */

.filter-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
}
.filter-grid label { margin: 0 0 6px; }
.filter-grid > div { min-width: 0; }
.filter-actions { display: flex; gap: 8px; align-items: end; }
.filter-actions .btn { margin: 0; }

/* The device was last seen minutes ago, so it is on. */
.dot-on {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ok);
}
.dot-on::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg);
}
td .dim { font-size: 12.5px; color: var(--muted); }

@media (max-width: 720px) {
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-actions .btn { width: 100%; }
}

/* The header picker belongs to the signed-out screens, where an applicant
   has no saved language for us to read. Once there is an account the choice
   lives in the profile, and two pickers for one setting is one too many. */
body.signed-in #langPicker { display: none; }


/* ══ Arabic ════════════════════════════════════════════════════════════
   Inter carries no Arabic, so Arabic was falling back to whatever the
   device had - Tahoma on Windows, which reads like a system dialog. Cairo
   is self-hosted: the CSP here is font-src 'self', and opening it to a
   third party so a page can look right would tell that third party who
   uses the reseller portal and when. */

@font-face {
  font-family: 'Cairo';
  src: url('/fonts/cairo-arabic.woff2') format('woff2');
  font-weight: 200 1000; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo';
  src: url('/fonts/cairo-latin.woff2') format('woff2');
  font-weight: 200 1000; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2074, U+20AC;
}

/* Only when the page is actually in Arabic. Latin keeps Inter, which it
   sets better than Cairo does. */
html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea,
html[lang="ar"] button {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* A MAC and a URL stay monospaced whatever the language: they are read
   character by character, and Cairo does not align them. */
html[lang="ar"] .mono,
html[lang="ar"] td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* The language picker inside the account menu. It sits with the links rather
   than in its own section: it is one more thing you can reach from here, not
   a settings panel. */
.am-lang {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 10px;
}
.am-lang svg {
  width: 17px; height: 17px; flex: none; fill: none;
  stroke: var(--text-2); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.am-lang select {
  flex: 1; min-height: 34px; padding: 6px 10px;
  font-size: 13px; border-radius: var(--radius-sm);
}

    .pitch-sub{margin:6px 0 0;font-size:17px;font-weight:600;color:rgba(255,255,255,.72);}
    .pitch-guide{display:inline-block;margin-top:18px;font-size:14px;font-weight:800;
      color:#c9b6ff;text-decoration:none;border-bottom:1px solid rgba(201,182,255,.38);
      padding-bottom:2px;transition:.18s ease;}
    .pitch-guide:hover{color:#fff;border-bottom-color:#fff;}
  

/* Welcome Offer */
.offer { display: flex; align-items: center; gap: 20px 28px; flex-wrap: wrap; margin: 0 0 18px; padding: 20px 24px; border-radius: var(--radius); color: #fff; background: linear-gradient(120deg, #4f25c9, #7c3cf0 60%, #b03ae0); box-shadow: var(--shadow-lg); }
.offer-main { flex: 1 1 260px; min-width: 0; }
.offer-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .88; }
.offer-title { margin: 5px 0 3px; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.offer-sub { margin: 0; font-size: 13.5px; opacity: .9; }
.offer-ends { margin-bottom: 7px; font-size: 12px; font-weight: 700; opacity: .9; }
.offer-boxes { display: flex; gap: 7px; direction: ltr; }
[dir="rtl"] .offer-boxes { flex-direction: row-reverse; justify-content: flex-end; }
.offer-box { min-width: 54px; padding: 8px 5px 7px; border-radius: 10px; text-align: center; background: rgba(255, 255, 255, .17); }
.offer-n { display: block; font-size: 21px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.offer-u { display: block; margin-top: 2px; font-size: 10.5px; opacity: .88; }
.offer-cta { flex: 0 0 auto; height: 44px; padding: 0 20px; border: 0; border-radius: 11px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; color: #4f25c9; background: #fff; }
.offer-cta:hover { transform: translateY(-1px); }
@media (max-width: 640px) { .offer { padding: 18px; } .offer-title { font-size: 21px; } .offer-clock, .offer-cta { width: 100%; } .offer-box { flex: 1 1 0; min-width: 0; } }
.pkg { position: relative; }
.pkg-badge { position: absolute; top: 10px; inset-inline-end: 10px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff; background: #e5372f; }
.pkg .was { margin-top: 5px; font-size: 13px; color: var(--muted); text-decoration: line-through; }
.pkg .d { margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); }
