/* Proaqsa Support Centre (S0, 2026-11-12). Self-contained: no external fonts, no inline styles (strict CSP). */
:root {
  --bg: #f4f6fa; --panel: #ffffff; --ink: #162033; --muted: #5d6b82; --line: #e2e7ef; --line-2: #eef1f6;
  --brand: #1769e0; --brand-ink: #ffffff; --brand-soft: #e8f0fd; --ok: #0f7b4f; --ok-soft: #e3f5ec;
  --warn: #9a5b00; --warn-soft: #fff3dc; --bad: #b3261e; --bad-soft: #fdeceb; --info: #0b62a8; --info-soft: #e3f1fb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06); --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b; --panel: #161d28; --ink: #e8edf5; --muted: #9aa7bb; --line: #263143; --line-2: #1d2634;
    --brand: #5b9bff; --brand-ink: #08111f; --brand-soft: #172a47; --ok: #5fd39c; --ok-soft: #123425;
    --warn: #f3bf5b; --warn-soft: #3a2c0f; --bad: #ff8b82; --bad-soft: #3d1917; --info: #7cc2f5; --info-soft: #11293b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b; --panel: #161d28; --ink: #e8edf5; --muted: #9aa7bb; --line: #263143; --line-2: #1d2634;
  --brand: #5b9bff; --brand-ink: #08111f; --brand-soft: #172a47; --ok: #5fd39c; --ok-soft: #123425;
  --warn: #f3bf5b; --warn-soft: #3a2c0f; --bad: #ff8b82; --bad-soft: #3d1917; --info: #7cc2f5; --info-soft: #11293b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Nastaliq Urdu", Arial, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.sd-ico { width: 20px; height: 20px; flex: none; }
.sd-muted { color: var(--muted); font-size: 13.5px; }
.sd-lead { color: var(--muted); max-width: 70ch; margin: 0 0 18px; }

/* brand + environment */
.sd-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; white-space: nowrap; }
.sd-brand img { display: block; }
.sd-env { margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* buttons + inputs */
.sd-btn { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.sd-btn:hover { border-color: var(--brand); }
.sd-btn:focus-visible, .sd-icon-btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.sd-btn[disabled] { opacity: .6; cursor: progress; }
.sd-btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.sd-btn-danger { color: var(--bad); }
.sd-btn-sm { padding: 5px 11px; min-height: 32px; font-size: 13px; }
.sd-btn-link { border: 0; background: none; color: var(--brand); padding: 6px 4px; min-height: 0; }
.sd-icon-btn { appearance: none; border: 0; background: none; color: var(--ink); width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; }
.sd-icon-btn:hover { background: var(--line-2); }
.sd-inline { display: inline; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit;
}
label { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; }
.sd-form { display: grid; gap: 14px; margin: 0; }
.sd-form-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.sd-form-row .sd-btn { justify-self: start; }
.sd-grow { flex: 1 1 220px; }

/* notes */
.sd-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.sd-note-error { background: var(--bad-soft); color: var(--bad); }
.sd-note-ok { background: var(--ok-soft); color: var(--ok); }

/* sign-in */
.sd-auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; }
.sd-auth-card { width: min(430px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 16px; }
.sd-auth-card h1 { font-size: 22px; }
.sd-auth-card .sd-note, .sd-auth-card p { margin: 0; }
.sd-auth-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.sd-auth-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.sd-auth-row form { margin: 0; }
.sd-auth-foot { color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.sd-code { font-size: 26px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }

/* shell */
.sd-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sd-top-space { flex: 1; }
.sd-menu { display: none; }
.sd-me { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; line-height: 1.2; }
.sd-me:hover { background: var(--line-2); }
.sd-me b { display: block; font-size: 13.5px; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100dvh - 58px); }
.sd-nav { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 58px; height: calc(100dvh - 58px); overflow-y: auto; }
.sd-nav-a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.sd-nav-a:hover { background: var(--line-2); }
.sd-nav-a.is-active { background: var(--brand-soft); color: var(--brand); }
.sd-nav-a.is-soon { color: var(--muted); font-weight: 500; }
.sd-nav-a em { margin-left: auto; font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.sd-main { padding: 24px clamp(16px, 3vw, 34px) 60px; min-width: 0; }
.sd-h1 { font-size: 24px; margin-bottom: 16px; }
.sd-scrim { position: fixed; inset: 58px 0 0 0; background: rgba(8, 12, 20, .45); z-index: 19; }

/* cards, stats */
.sd-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.sd-card h2 { font-size: 17px; margin-bottom: 14px; }
.sd-card h3 { font-size: 14px; margin: 18px 0 8px; }
.sd-card form + .sd-muted { margin: 12px 0 0; }
.sd-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sd-card-head h2 { margin: 0; }
.sd-card-head .sd-btn { margin-left: auto; }
.sd-empty { text-align: center; padding: 48px 20px; }
.sd-empty p { color: var(--muted); max-width: 52ch; margin: 8px auto 0; }
.sd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sd-stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 2px; }
.sd-stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.sd-stat b { font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sd-stat-warn b { color: var(--warn); }
.sd-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.sd-grid2 .sd-card { margin: 0; }
.sd-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; }
.sd-dl dt { color: var(--muted); }
.sd-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sd-perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sd-perm-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.sd-lvl { font-size: 12.5px; padding: 1px 9px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.sd-lvl-1 { background: var(--info-soft); color: var(--info); }
.sd-lvl-2 { background: var(--ok-soft); color: var(--ok); }

/* filters + tables */
.sd-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 14px; }
.sd-filter label { min-width: 150px; }
.sd-count { color: var(--muted); padding-bottom: 10px; font-size: 13.5px; }
.sd-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.sd-table-wrap.is-loading { opacity: .55; }
.sd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sd-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--line-2); white-space: nowrap; }
.sd-table td { padding: 11px 14px; border-top: 1px solid var(--line-2); vertical-align: middle; overflow-wrap: anywhere; }
.sd-table tr.is-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.sd-table select { min-height: 34px; padding: 4px 8px; min-width: 150px; }
.sd-table form { margin: 0; }
.sd-chips, .sd-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sd-chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.sd-chip-ok { background: var(--ok-soft); color: var(--ok); }
.sd-chip-off { background: var(--bad-soft); color: var(--bad); }
.sd-chip-warn { background: var(--warn-soft); color: var(--warn); }
.sd-chip-info { background: var(--info-soft); color: var(--info); }
.sd-more { margin-top: 14px; }
.sd-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sd-seg-o { display: block; font-weight: 600; cursor: pointer; }
.sd-seg-o input { position: absolute; opacity: 0; pointer-events: none; }
.sd-seg-o span { display: block; padding: 6px 12px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sd-seg-o + .sd-seg-o span { border-left: 1px solid var(--line); }
.sd-seg-o input:checked + span { background: var(--brand-soft); color: var(--brand); }
.sd-seg-o input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: -3px; }
.sd-seg-o input:disabled + span { cursor: not-allowed; opacity: .75; }

/* flash, dialogs, network toast */
.sd-flash { position: sticky; top: 70px; z-index: 20; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-weight: 600; background: var(--ok-soft); color: var(--ok); box-shadow: var(--shadow); }
.sd-flash.is-error { background: var(--bad-soft); color: var(--bad); }
.sd-dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.sd-dialog::backdrop { background: rgba(8, 12, 20, .5); }
.sd-dialog h2 { font-size: 18px; margin-bottom: 10px; overflow-wrap: anywhere; }
.sd-dialog p { margin: 0 0 16px; color: var(--muted); }
.sd-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sd-secret { display: block; font: 600 20px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--line-2); border-radius: 10px; padding: 14px; text-align: center; margin-bottom: 12px; user-select: all; overflow-wrap: anywhere; }

/* phone */
@media (max-width: 860px) {
  .sd-menu { display: inline-grid; }
  .sd-shell { grid-template-columns: minmax(0, 1fr); }
  .sd-nav { position: fixed; top: 58px; left: 0; bottom: 0; width: min(290px, 86vw); height: auto; z-index: 20; transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--shadow); }
  body.sd-nav-open .sd-nav { transform: none; }
  .sd-brand span, .sd-me span { display: none; }
  .sd-env { margin-left: 0; }
  .sd-table thead { display: none; }
  .sd-table, .sd-table tbody, .sd-table tr, .sd-table td { display: block; width: 100%; }
  .sd-table tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .sd-table tr:first-child { border-top: 0; }
  .sd-table td { border: 0; padding: 4px 14px; }
  .sd-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }
  .sd-seg { display: flex; }
  .sd-seg-o { flex: 1; text-align: center; }
  .sd-seg-o span { padding: 9px 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* S1: register drawer, answer review, try the assistant */
textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; resize: vertical; min-height: 70px; }
textarea[dir="rtl"], .sd-answer[dir="rtl"], .sd-answer-text[dir="rtl"] { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", system-ui, sans-serif; line-height: 2; }
.sd-link-btn { appearance: none; border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; text-align: start; }
.sd-link-btn:hover { text-decoration: underline; }
.sd-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.sd-check input { width: 18px; height: 18px; }
.sd-drawer { position: fixed; top: 58px; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 25; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px; overflow-y: auto; }
.sd-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sd-drawer-head h2 { font-size: 18px; }
.sd-drawer .sd-form { margin-top: 8px; }
.sd-table-answers td:nth-child(2) { min-width: 320px; }
.sd-answer-edit { display: grid; gap: 8px; }
.sd-answer-text, .sd-answer { margin: 0; white-space: normal; }
.sd-answer { background: var(--line-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.sd-why { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 14px; }
.sd-why li { margin: 3px 0; }
@media (max-width: 860px) { .sd-table-answers td:nth-child(2) { min-width: 0; } }
