/* ==========================================================================
   HLC Retix — design system
   Manrope (UI) + Sora (numbers & titles) · Noto Naskh / Nastaliq for Urdu. All bundled for offline use.
   Two themes: html[data-theme="dark"] (default) and html[data-theme="light"].
   ========================================================================== */
@font-face { font-family: "Manrope"; src: url("fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Sora"; src: url("fonts/sora.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Naskh"; src: url("fonts/naskh.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Nastaliq"; src: url("fonts/nastaliq-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nastaliq"; src: url("fonts/nastaliq-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --accent: #1fe3a0;
  --on-accent: #04120c;
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;   /* display: big numbers, titles */
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --urdu: "Naskh", "Manrope", sans-serif;
  --urdu-display: "Nastaliq", "Naskh", "Sora", sans-serif;
  --radius: 18px; --radius-sm: 12px; --radius-xs: 9px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --accent-2: color-mix(in srgb, var(--accent) 62%, #06b6d4);
  --accent-50: color-mix(in srgb, var(--accent) 7%, var(--surface));
  --accent-100: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --accent-200: color-mix(in srgb, var(--accent) 30%, var(--surface));
  --accent-600: var(--accent-t);
  --grad: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--accent) 48%, var(--accent-2) 100%);
  --glow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ------------------------------------------------------------------ dark (default) */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090a; --bg-2: #0d1110;
  --surface: #0f1312; --surface-2: #141918; --surface-3: #1a201f;
  --glass: rgba(15, 19, 18, .72);
  --line: rgba(255, 255, 255, .065); --line-strong: rgba(255, 255, 255, .12);
  --text: #eef3f1; --text-2: #aeb9b5; --muted: #6e7a76; --ink: #ffffff;
  --accent-t: color-mix(in srgb, var(--accent) 88%, #fff);
  --good: #34e3a4; --good-50: rgba(52, 227, 164, .12);
  --warn: #f6b949; --warn-50: rgba(246, 185, 73, .12);
  --bad: #ff5d7a; --bad-50: rgba(255, 93, 122, .12);
  --info: #62a3ff; --info-50: rgba(98, 163, 255, .12);
  --hero: #0a0e0d; --on-hero: #fff;
  --side: #0b0f0e; --side-text: #9aa6a2; --side-strong: #eef3f1; --side-muted: #56615d; --side-hover: rgba(255,255,255,.04);
  --card-hi: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 42%);
  --grid-line: rgba(255,255,255,.06);
  --overlay: rgba(0, 0, 0, .62);
  --toast: rgba(26, 32, 31, .96);
  --skel-a: #141918; --skel-b: #1c2322;
  --thumb: #2a3230;
  --shadow-sm: 0 1px 0 rgba(255,255,255,.02) inset;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 14px 34px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255,255,255,.05);
  --page-glow: radial-gradient(900px 520px at 12% -12%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%), radial-gradient(700px 480px at 100% 0%, color-mix(in srgb, var(--accent-2) 6%, transparent), transparent 70%);
}
/* ------------------------------------------------------------------ light */
html[data-theme="light"], .light-scope {
  color-scheme: light;
  --bg: #f3f6f5; --bg-2: #eaefed;
  --surface: #ffffff; --surface-2: #f8faf9; --surface-3: #eff3f2;
  --glass: rgba(255, 255, 255, .78);
  --line: #e4eae8; --line-strong: #d3dcd9;
  --text: #0c1311; --text-2: #46524e; --muted: #84908c; --ink: #07100d;
  --accent-t: color-mix(in srgb, var(--accent) 58%, #000);
  --good: #0c9d6a; --good-50: #e5f7ef;
  --warn: #b7750a; --warn-50: #fdf4e3;
  --bad: #d7263d; --bad-50: #fdebed;
  --info: #2563eb; --info-50: #eaf1fe;
  --hero: #0b100f; --on-hero: #fff;
  --side: #ffffff; --side-text: #4d5a56; --side-strong: #0c1311; --side-muted: #9aa5a1; --side-hover: #f2f6f5;
  --card-hi: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,0) 40%);
  --grid-line: #e9eeec;
  --overlay: rgba(9, 14, 12, .42);
  --toast: rgba(12, 19, 17, .95);
  --skel-a: #eef2f1; --skel-b: #f8faf9;
  --thumb: #cfd8d5;
  --shadow-sm: 0 1px 2px rgba(10, 20, 16, .05);
  --shadow: 0 1px 2px rgba(10, 20, 16, .04), 0 10px 26px -10px rgba(10, 20, 16, .10);
  --shadow-lg: 0 30px 80px -24px rgba(10, 20, 16, .35), 0 4px 14px rgba(10, 20, 16, .08);
  --page-glow: radial-gradient(900px 520px at 12% -12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.light-scope { color: var(--text); background: var(--surface); }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .4s var(--ease), border-color .4s, color .3s, box-shadow .4s !important; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--page-glow), var(--bg); background-attachment: fixed; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
a { color: var(--accent-t); text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); font-weight: 300; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Urdu / right-to-left */
html[lang="ur"] body { font-family: var(--urdu); line-height: 1.7; }
html[lang="ur"] .num, html[lang="ur"] .mono { unicode-bidi: plaintext; }
html[lang="ur"] input, html[lang="ur"] select, html[lang="ur"] textarea, html[lang="ur"] button { font-family: var(--urdu); }
html[lang="ur"] h1, html[lang="ur"] h2 { font-family: var(--urdu-display) !important; font-weight: 700 !important; line-height: 1.9 !important; letter-spacing: 0 !important; }
html[lang="ur"] h3, html[lang="ur"] h4, html[lang="ur"] b, html[lang="ur"] strong { letter-spacing: 0; }
html[lang="ur"] .table th, html[lang="ur"] .nav-group, html[lang="ur"] .cmdk-group { letter-spacing: 0; text-transform: none; font-size: 12px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------------------------------------------------------------- buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; isolation: isolate; color: var(--text);
  box-shadow: var(--shadow-sm); transition: background .18s var(--ease), border-color .18s, transform .12s var(--ease), box-shadow .2s var(--ease), color .18s; }
.btn:hover { background: var(--surface-3); border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-sm); }
.btn:focus-visible, .input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-accent); font-weight: 750; box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.primary::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.35) 45%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn.primary:hover { background: var(--grad); box-shadow: 0 14px 34px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.good { background: linear-gradient(135deg, #34e3a4, #0c9d6a); border-color: transparent; color: #04120c; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: linear-gradient(135deg, #ff6b86, #d7263d); color: #fff; border-color: transparent; box-shadow: 0 10px 26px -10px rgba(215, 38, 61, .7); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--side-hover); transform: none; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn.lg { height: 52px; padding: 0 24px; font-size: 15.5px; border-radius: 14px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
kbd, .kbd { font: 600 10.5px/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--muted); }
.btn.primary kbd { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.12); color: inherit; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 12px; font-weight: 650; color: var(--text-2); letter-spacing: .01em; }
.input, select.input, textarea.input { height: 42px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); width: 100%;
  transition: border-color .18s, box-shadow .2s var(--ease), background .18s; }
textarea.input { height: auto; padding: 11px 13px; min-height: 84px; resize: vertical; }
.input:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); outline: none; background: var(--surface); }
.input::placeholder { color: var(--muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a948f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
[dir="rtl"] select.input { background-position: left 12px center; padding-right: 13px; padding-left: 34px; }
select.input option { background: var(--surface); color: var(--text); }
input[type=color].input { padding: 5px; }
input[type=date].input { color-scheme: inherit; }
.hint { font-size: 11.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 550; cursor: pointer; font-size: 13.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid var(--line); }
.badge.good { background: var(--good-50); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.badge.warn { background: var(--warn-50); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.badge.bad { background: var(--bad-50); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.badge.info { background: var(--info-50); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.badge.accent { background: var(--accent-100); color: var(--accent-t); border-color: var(--accent-200); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { box-shadow: 0 0 0 0 currentColor; animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------------------------------------------------------------- cards & tables */
.card { background: var(--card-hi), var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: start; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background .15s; }
.table tr:last-child td { border-bottom: 0; }
.table .r, .table th.r { text-align: end; }
.table td.r, .table th.r { white-space: nowrap; }
.table td .mono, .table td.mono { white-space: nowrap; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--accent-50); }
.table tbody tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .table tbody tr.click:hover td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.table tbody tr { animation: rowIn .45s var(--ease) both; }
.table tbody tr:nth-child(1) { animation-delay: .02s } .table tbody tr:nth-child(2) { animation-delay: .04s } .table tbody tr:nth-child(3) { animation-delay: .06s }
.table tbody tr:nth-child(4) { animation-delay: .08s } .table tbody tr:nth-child(5) { animation-delay: .1s } .table tbody tr:nth-child(6) { animation-delay: .12s }
.table tbody tr:nth-child(7) { animation-delay: .14s } .table tbody tr:nth-child(8) { animation-delay: .16s } .table tbody tr:nth-child(n+9) { animation-delay: .18s }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- modal */
.modal-wrap { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(8px) saturate(1.2); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s ease; }
.modal { background: var(--card-hi), var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .38s var(--spring); border: 1px solid var(--line-strong); }
.modal.wide { width: min(880px, 100%); }
.modal.xl { width: min(1120px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 19px; font-weight: 700; }
.modal-body { padding: 6px 22px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 22px 22px; }
.modal-wrap.closing { animation: fade .16s ease reverse forwards; }
.modal-wrap.closing .modal { animation: popOut .16s ease forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes popOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------------------------------------------------------------- toast */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: var(--toast); backdrop-filter: blur(12px); color: #fff; padding: 12px 18px 12px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.08); font-weight: 600; display: flex; align-items: center; gap: 10px; max-width: 90vw;
  animation: toastIn .45s var(--spring); }
.toast .ic { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: rgba(255,255,255,.14); }
.toast.good .ic { background: #1fbf85; } .toast.bad .ic { background: #ef4461; } .toast.warn .ic { background: #e9a321; }
.toast.out { transition: opacity .3s, transform .3s var(--ease); opacity: 0; transform: translateY(10px) scale(.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }

/* ---------------------------------------------------------------- misc */
.empty { text-align: center; padding: 52px 20px; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty .ic { margin: 0 auto 8px; opacity: .55; width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--surface-3); box-sizing: content-box; }
.empty b { color: var(--text-2); font-size: 15px; }
.skeleton { display: grid; gap: 12px; padding: 18px; }
.skeleton i { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 50%, var(--skel-a) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skeleton i:nth-child(2n) { width: 82%; } .skeleton i:nth-child(3n) { width: 64%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.scroll { overflow: auto; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-up { animation: fadeUp .55s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.bump { animation: bump .4s var(--spring); }
@keyframes bump { 40% { transform: scale(1.08); } }
* { scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; } }

/* ---------------------------------------------------------------- theme & language switches */
.switch-btn { height: 38px; min-width: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); display: inline-grid; grid-auto-flow: column; place-items: center; gap: 6px;
  font-weight: 750; font-size: 13px; box-shadow: var(--shadow-sm); transition: .2s var(--ease); }
.switch-btn:hover { color: var(--accent-t); border-color: var(--accent-200); transform: translateY(-1px); }
.switch-btn .ic { transition: transform .5s var(--spring); }
.switch-btn:hover .ic { transform: rotate(40deg); }
.switch-btn.lang { font-family: var(--urdu); font-size: 14px; min-width: 52px; }
html[lang="ur"] .switch-btn.lang { font-family: var(--font); font-size: 12.5px; }

/* ---------------------------------------------------------------- "Powered by" credit */
.powered { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; direction: ltr;
  color: var(--text-2); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); white-space: nowrap; text-decoration: none;
  transition: transform .25s var(--spring), box-shadow .25s, border-color .2s; }
.powered:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent); border-color: var(--accent-200); }
.powered .pw-spark { font-size: 12px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: spark 3.2s ease-in-out infinite; display: inline-block; }
.powered .pw-by { color: var(--muted); font-weight: 550; }
.powered .pw-name { font-weight: 800; background: linear-gradient(90deg, var(--accent-t), var(--accent-2), var(--text), var(--accent-t)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 6s linear infinite; }
.powered.dark { background: rgba(255,255,255,.04); border-color: var(--line); box-shadow: none; }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes spark { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(1.25); } }

/* ===================================================================== Munshi — AI assistant */
.mj-root { position: fixed; z-index: 900; inset-inline-end: 22px; bottom: 22px; font-family: var(--font); }
html[lang="ur"] .mj-root { font-family: var(--urdu); }
.mj-orb { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--grad); color: var(--on-accent);
  box-shadow: var(--glow), 0 12px 30px -10px rgba(0, 0, 0, .5); transition: transform .35s var(--ease), box-shadow .3s; animation: mjFloat 4.5s ease-in-out infinite; }
.mj-orb:hover { transform: translateY(-3px) scale(1.06); }
.mj-orb .mj-face { width: 100%; height: 100%; display: block; }
.mj-orb-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); animation: mjRing 2.8s var(--ease) infinite; pointer-events: none; }
.mj-orb-tip { position: absolute; inset-inline-end: 72px; top: 50%; transform: translateY(-50%) translateX(8px); white-space: nowrap; background: var(--toast); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s var(--ease); }
.mj-orb:hover .mj-orb-tip { opacity: 1; transform: translateY(-50%); }
.mj-root.open .mj-orb { transform: scale(.001); opacity: 0; pointer-events: none; }
.mj-eyes { transform-origin: 32px 29px; animation: mjBlink 4.2s infinite; }
.mj-panel { position: fixed; inset-inline-end: 22px; bottom: 22px; width: min(410px, calc(100vw - 32px)); height: min(640px, calc(100vh - 44px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden;
  transform-origin: calc(100% - 30px) calc(100% - 30px); transform: scale(.4) translateY(30px); opacity: 0; visibility: hidden; transition: transform .42s var(--ease), opacity .25s, visibility 0s .42s; }
[dir="rtl"] .mj-panel { transform-origin: 30px calc(100% - 30px); }
.mj-root.open .mj-panel { transform: none; opacity: 1; visibility: visible; transition: transform .42s var(--ease), opacity .25s, visibility 0s; }
.mj-head { position: relative; display: flex; align-items: center; gap: 11px; padding: 14px 12px 14px 16px; color: var(--on-accent); background: var(--grad); isolation: isolate; }
.mj-head::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.3), transparent 55%), radial-gradient(80% 120% at 0% 100%, rgba(0,0,0,.12), transparent 60%); }
.mj-av { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); flex: none; }
.mj-av .mj-face, .mj-mini .mj-face { width: 100%; height: 100%; display: block; }
.mj-title { flex: 1; min-width: 0; line-height: 1.2; }
.mj-title b { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -.02em; }
html[lang="ur"] .mj-title b { font-family: var(--urdu-display); line-height: 1.8; font-size: 19px; }
.mj-title small { display: flex; align-items: center; gap: 6px; font-size: 11.5px; opacity: .8; margin-top: 2px; }
.mj-live { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.25); animation: mjPulse 2s infinite; }
.mj-mode { font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); white-space: nowrap; }
.mj-mode.ai { background: var(--hero); color: var(--accent); border-color: transparent; }
.mj-x { width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; opacity: .85; transition: .2s; }
.mj-x:hover { background: rgba(255,255,255,.22); opacity: 1; }
.mj-body { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 12px; background:
  radial-gradient(600px 300px at 110% -10%, var(--accent-50), transparent 60%), var(--surface); overscroll-behavior: contain; }
.mj-body, .mj-in { direction: ltr; }
.mj-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; animation: mjIn .38s var(--ease) both; }
.mj-msg.me { justify-content: flex-end; }
.mj-mini { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: var(--on-accent); flex: none; box-shadow: var(--glow); }
.mj-bub { max-width: 84%; padding: 10px 13px; border-radius: 18px; font-size: 13.8px; line-height: 1.55; word-wrap: break-word; }
.mj-msg.bot .mj-bub { background: var(--surface-2); border: 1px solid var(--line); border-end-start-radius: 6px; color: var(--text); }
.mj-msg.me .mj-bub { background: var(--grad); color: var(--on-accent); border-end-end-radius: 6px; box-shadow: var(--glow); font-weight: 600; }
.mj-msg.err .mj-bub { border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-50); color: var(--bad); }
.mj-bub b { font-weight: 800; color: var(--ink); }
.mj-msg.bot .mj-bub b { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 28%, transparent) 62%); }
.mj-msg.me .mj-bub b { color: inherit; }
.mj-bub i { color: var(--muted); font-size: 12.5px; }
.mj-li { display: block; padding-inline-start: 14px; position: relative; }
.mj-li:not(.n)::before { content: ''; position: absolute; inset-inline-start: 3px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.mj-li.n { padding-inline-start: 2px; }
.mj-link { margin-top: 9px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 750; color: var(--accent-t); background: var(--accent-50);
  border: 1px solid var(--accent-200); border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: .2s var(--ease); }
.mj-link:hover { background: var(--accent); color: var(--on-accent); transform: translateX(2px); }
.mj-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.mj-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.mj-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .35; animation: mjDot 1.1s infinite; }
.mj-dots i:nth-child(2) { animation-delay: .15s; } .mj-dots i:nth-child(3) { animation-delay: .3s; }
.mj-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; padding-inline-start: 36px; }
.mj-chip { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px;
  cursor: pointer; transition: .2s var(--ease); animation: mjIn .4s var(--ease) both; text-align: start; direction: ltr; }
.mj-chip:nth-child(2) { animation-delay: .05s; } .mj-chip:nth-child(3) { animation-delay: .1s; } .mj-chip:nth-child(4) { animation-delay: .15s; } .mj-chip:nth-child(5) { animation-delay: .2s; } .mj-chip:nth-child(6) { animation-delay: .25s; }
.mj-chip:hover { border-color: var(--accent); color: var(--accent-t); background: var(--accent-50); transform: translateY(-1px); }
.mj-form { display: flex; align-items: flex-end; gap: 8px; margin: 8px 12px 6px; padding: 6px; padding-inline-start: 14px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface-2); transition: .2s; }
.mj-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.mj-in { flex: 1; border: 0; outline: 0; resize: none; font: inherit; font-size: 14px; line-height: 1.45; padding: 7px 0; max-height: 120px; background: transparent; color: var(--text); }
.mj-send { width: 38px; height: 38px; border-radius: 13px; border: 0; background: var(--grad); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; box-shadow: var(--glow); transition: .2s var(--ease); flex: none; }
[dir="rtl"] .mj-send svg { transform: scaleX(-1); }
.mj-send:hover { transform: translateY(-1px) rotate(-8deg); }
.mj-send:disabled { opacity: .5; transform: none; }
.mj-foot { text-align: center; font-size: 10.5px; color: var(--muted); padding: 0 0 9px; }
@keyframes mjFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes mjRing { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes mjBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes mjPulse { 50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } }
@keyframes mjIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes mjDot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (max-width: 560px) { .mj-root { inset-inline-end: 14px; bottom: 14px; } .mj-panel { inset-inline-end: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); } }
@media (prefers-reduced-motion: reduce) { .mj-orb, .mj-orb-ring, .mj-eyes, .mj-live { animation: none; } }

/* ------------------------------------------------------------------ subscription lock screen + banner */
.lic-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--page-glow), var(--bg); }
.lic-card { width: min(540px, 100%); padding: 34px 32px 26px; text-align: center; animation: fadeUp .5s var(--ease) both; }
.lic-ic { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; }
.lic-ic.bad { background: var(--bad-50); color: var(--bad); box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 7%, transparent); }
.lic-ic.warn { background: var(--warn-50); color: var(--warn); box-shadow: 0 0 0 8px color-mix(in srgb, var(--warn) 7%, transparent); }
.lic-ic.accent { background: var(--accent-100); color: var(--accent-t); box-shadow: 0 0 0 8px var(--accent-50); }
.lic-card h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: -.03em; color: var(--ink); }
.lic-msg { margin: 10px auto 0; max-width: 430px; color: var(--text-2); line-height: 1.55; font-size: 14.5px; }
.lic-facts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.lic-facts div { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); text-align: start; min-width: 130px; }
.lic-facts span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.lic-facts b { font-size: 14.5px; }
.lic-safe { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 12px; border-radius: 999px; background: var(--good-50); color: var(--good); font-size: 12.5px; font-weight: 700; }
.lic-form { display: grid; gap: 7px; margin-top: 22px; text-align: start; }
.lic-form label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.lic-row { display: flex; gap: 8px; }
.lic-row .input { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; height: 46px; }
.lic-row .btn { height: 46px; flex: none; }
.lic-err { background: var(--bad-50); color: var(--bad); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; }
.lic-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.lic-actions:empty { display: none; }
.lic-vendor { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 13px; color: var(--muted); }
.lic-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lic-banner { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid; }
.lic-banner.warn { background: var(--warn-50); color: var(--text); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.lic-banner.bad { background: var(--bad-50); color: var(--text); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.lic-banner > .ic { flex: none; color: var(--warn); } .lic-banner.bad > .ic { color: var(--bad); }
.lic-banner span { flex: 1; min-width: 0; }
.lic-banner a { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; color: var(--accent-t); text-decoration: none; white-space: nowrap; }
.lic-banner button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; display: grid; }
.lic-banner button:hover { background: var(--side-hover); color: var(--text); }
@media (max-width: 560px) { .lic-card { padding: 26px 18px 20px; } .lic-row { flex-direction: column; } .lic-banner { flex-wrap: wrap; } }
.panel .lic-banner, .card .lic-banner { border-radius: 12px; border: 1px solid; margin-bottom: 14px; }

/* ------------------------------------------------------------------ Munshi voice */
.mj-voice { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; flex-wrap: wrap; }
.mj-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.mj-seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 750; height: 26px; padding: 0 11px; border-radius: 999px; cursor: pointer; transition: .18s; }
.mj-seg button[data-vl="ur"] { font-family: var(--urdu); font-size: 13.5px; }
.mj-seg button.on { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.mj-spk { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent-t); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.mj-spk.off { color: var(--muted); }
.mj-vstat { flex: 1 1 100%; font-size: 11.5px; color: var(--muted); min-height: 0; }
.mj-vstat:empty { display: none; }
.mj-vstat.warn { color: var(--warn); } .mj-vstat.info { color: var(--info); }
.mj-mic { position: relative; width: 38px; height: 38px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-t); display: grid; place-items: center; cursor: pointer; flex: none; transition: .2s var(--ease); }
.mj-mic:hover { border-color: var(--accent); transform: translateY(-1px); }
.mj-mic i { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; }
.mj-mic.on { background: #ef4461; border-color: transparent; color: #fff; }
.mj-mic.on i { animation: mjPulse 1.2s ease-out infinite; }
@keyframes mjPulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 97, .55); } 100% { box-shadow: 0 0 0 14px rgba(239, 68, 97, 0); } }
.mj-root.listening .mj-form { border-color: #ef4461; box-shadow: 0 0 0 4px rgba(239, 68, 97, .14); }
.mj-bub.ur { direction: rtl; text-align: right; font-family: var(--urdu); font-size: 15px; line-height: 2; }
.mj-bub.ur .mj-li { padding-inline-start: 0; }
.mj-bub.ur b { unicode-bidi: isolate; }
.mj-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mj-acts:empty { display: none; }
.mj-bub.ur .mj-acts { direction: ltr; }
.mj-say { margin-top: 9px; width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-t); display: grid; place-items: center; cursor: pointer; transition: .18s; }
.mj-say:hover { border-color: var(--accent); }
.mj-say.on { background: var(--accent); color: var(--on-accent); border-color: transparent; animation: mjPulseG 1.4s ease-out infinite; }
@keyframes mjPulseG { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.mj-vic { font-size: 12px; }
.mj-root.speaking .mj-av { animation: mjTalk .5s ease-in-out infinite alternate; }
@keyframes mjTalk { from { transform: scale(1); } to { transform: scale(1.08); } }

/* ------------------------------------------------------------------ modern loaders */
@keyframes hlcSpin { to { transform: rotate(360deg); } }
@keyframes hlcPulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
.hlc-spinner { position: relative; display: inline-block; width: 38px; height: 38px; flex: none; }
.hlc-spinner::before { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 90deg, transparent 0 18%, color-mix(in srgb, var(--accent) 35%, transparent) 40%, var(--accent) 78%, var(--accent-2));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px));
  animation: hlcSpin .75s linear infinite; }
.hlc-spinner::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); animation: hlcPulse 1.2s ease-in-out infinite; }
.hlc-spinner.sm { width: 18px; height: 18px; } .hlc-spinner.sm::after { display: none; }
.loader { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 34px 20px 10px; color: var(--text-2); font-weight: 650; font-size: 13.5px; }
.loader-card { overflow: hidden; }
.loader-card .skeleton { padding-top: 10px; opacity: .7; }
/* buttons working on something */
.btn.busy { color: transparent !important; position: relative; pointer-events: none; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--text) 22%, transparent); border-top-color: var(--text); animation: hlcSpin .7s linear infinite; }
.btn.primary.busy::after { border-color: color-mix(in srgb, var(--on-accent) 30%, transparent); border-top-color: var(--on-accent); }
/* thin progress line at the top of the window while the server works */
.top-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 3000; pointer-events: none; }
.top-progress i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 10px var(--accent), 0 0 4px var(--accent); border-radius: 0 3px 3px 0; transition: width .25s ease, opacity .35s ease .15s; }
.top-progress.done i { opacity: 0; }

/* ------------------------------------------------------------------ form tabs */
.form-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 6px; overflow-x: auto; }
.form-tabs button { position: relative; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; font-size: 13.5px; padding: 11px 16px; cursor: pointer; white-space: nowrap; border-radius: 10px 10px 0 0; }
.form-tabs button:hover { color: var(--text); background: var(--side-hover); }
.form-tabs button.on { color: var(--accent-t); }
.form-tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.tab-hidden { display: none !important; }
.boot-loader { min-height: 100vh; display: grid; place-items: center; background: var(--page-glow), var(--bg); } .boot-loader .hlc-spinner { width: 54px; height: 54px; } .boot-loader .hlc-spinner::after { inset: 16px; }
.form-grid.tabbed { min-height: 440px; align-content: start; }
.lg-row, .lg-row span { color: var(--text); }
