/* ============================================================================
   Pajhwok Newsroom - the shared brand layer.

   Every page links this AFTER its own <style>, so the palette and fonts below
   win. The two brand colours (--brand, --brand-2) are set per install in
   Admin -> Branding and written into each page right after this file.
   Pajhwok defaults: blue #00589d, yellow #ffc425 (sign-in card only), navy #062b4f.
   Contrast checked (WCAG): body text 14.6:1, muted 6.8:1, white on the
   accent 4.9:1, accent-coloured text 7.7:1 on the panels.
   ========================================================================= */
:root{
  --bg:#0a1420; --s:#101d2b; --s2:#152638; --b:#20344a; --b2:#2c4661;
  --t:#e8eef5; --m:#94a6ba; --m2:#7a8ea3;
  --acc:#1873c8; --acc2:#135fa6; --acc-t:#6cb4f0;
  --navy:#062b4f;
  --brand:#00589d; --brand-ink:#ffffff; --brand-2:#ffc425; --brand-2-ink:#0b1622;
  --font:'Noto Sans','Vazirmatn',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --font-rtl:'Vazirmatn','Noto Sans',system-ui,'Segoe UI',Tahoma,sans-serif;
  color-scheme:dark;
}
/* ── the three looks (data-theme on <html>, each person's own choice) ───── */
/* Midnight: near-black, for night shifts and dim rooms. */
:root[data-theme="midnight"]{
  --bg:#050608; --s:#0e1014; --s2:#15181e; --b:#23272f; --b2:#323844;
  --t:#e6e8ec; --m:#9aa1ad; --m2:#7b8390;
  color-scheme:dark;
}
/* Light: paper and white panels, as in the News Designer. The header stays
   dark (below) so the white Pajhwok logo keeps its contrast. */
:root[data-theme="light"]{
  --bg:#eef1f4; --s:#ffffff; --s2:#f3f6f9; --b:#d6dce2; --b2:#c2cbd4;
  --t:#17212b; --m:#4a5663; --m2:#5f6b78;
  --acc:#00589d; --acc2:#004a85; --acc-t:#00589d;
  --new:#15803d; --rss:#c2410c; --x:#0369a1; --fb:#1d4ed8;
  color-scheme:light;
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0}
[hidden]{display:none!important}
body{font-family:var(--font)}
button,input,select,textarea{font-family:inherit}
:focus-visible{outline:2px solid var(--acc-t);outline-offset:2px}

/* ── the header on every page: logo, product name, brand stripe ─────────── */
/* The stripe is all Pajhwok blue: the yellow end of it distracted from the
   work. Yellow stays only on the sign-in card (.auth-card::before). */
header{background-color:var(--s);
  background-image:linear-gradient(90deg,var(--brand) 0,var(--brand) 100%);
  background-size:100% 3px;background-position:0 100%;background-repeat:no-repeat;
  border-bottom:0!important;padding-bottom:3px}
.brandmark{display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:var(--t);
  flex:0 0 auto;min-width:0;margin-right:8px}
.bm-logo{display:block;height:22px;width:auto}
.bm-logo.plate{background:#fff;border-radius:6px;padding:3px 7px;height:28px}
.bm-name{font-weight:700;font-size:15px;line-height:1.2;white-space:nowrap;padding-left:10px;border-left:1px solid var(--b2)}
.bm-section{font-size:13px;font-weight:500;color:var(--m);white-space:nowrap}
@media(max-width:760px){.bm-name,.bm-section{display:none}}
header h1{display:none}   /* replaced by .brandmark on every page */

/* signed-in user + sign out */
.usermenu{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto}
.um-user{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--m);text-decoration:none;
  padding:4px 8px;border-radius:7px;border:1px solid transparent;white-space:nowrap}
.um-user:hover{color:var(--t);border-color:var(--b)}
.um-ic{font-size:12px;opacity:.85}
.um-out{display:inline;margin:0}
.um-out button{font-size:12px;color:var(--m);background:none;border:1px solid transparent;border-radius:7px;
  padding:4px 8px;cursor:pointer;white-space:nowrap}
.um-out button:hover{color:var(--t);border-color:var(--b)}
.um-theme{font-size:14px;line-height:1;color:var(--m);background:none;border:1px solid transparent;border-radius:7px;
  padding:4px 7px;cursor:pointer}
.um-theme:hover{color:var(--t);border-color:var(--b)}
.um-install{display:inline-grid;place-items:center;color:var(--m);background:none;border:1px solid transparent;
  border-radius:7px;padding:4px 6px;cursor:pointer}
.um-install:hover{color:var(--t);border-color:var(--b)}

/* "Install the app": the sign-in page pill (as in the News Designer) and the steps dialog */
.auth-install{justify-self:center;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 20px;
  border:1px solid rgba(255,255,255,.55);border-radius:999px;background:rgba(255,255,255,.08);color:#fff;
  font-size:15px;font-weight:600;cursor:pointer}
.auth-install:hover{background:rgba(255,255,255,.16)}
.install-dlg{max-width:min(420px,calc(100vw - 32px));border:1px solid var(--b2);border-radius:14px;padding:20px 22px;
  background:var(--s);color:var(--t);box-shadow:0 18px 50px #0009}
.install-dlg::backdrop{background:#000a}
.install-dlg h3{margin:0 0 10px;font-size:18px}
.install-dlg ol{margin:0 0 16px;padding-inline-start:22px;display:grid;gap:6px;font-size:14.5px;line-height:1.5}
.install-dlg button{min-height:40px;padding:0 22px;border:0;border-radius:8px;background:var(--acc);color:#fff;
  font-weight:600;cursor:pointer}
@media(max-width:560px){
  .um-user span.um-ic+*{display:none}
  header .btn,header .hbtn{padding:4px 8px;font-size:12px}   /* phones: more buttons per row */
  header{gap:6px!important}
}

/* Plain story text (the Original box, the reader): each paragraph reads in the
   direction of its own first letters, so an English line inside a Pashto
   story keeps its full stop on the right - as in the editor. */
.orig,#rsnip{unicode-bidi:plaintext}

/* a count inside the highlighted (current) nav button: white badge, dark number */
.btn.on .bdg{background:#fff;color:#0b4a80}
.btn.on .bdg.hot{background:#fee2e2;color:#b91c1c}

/* ── sign-in, first-time setup and notices (a Pajhwok-blue page with the
      logo, and a white card - the same look as the News Designer) ───────── */
.auth{min-height:100vh;display:grid;place-items:center;padding:max(28px,env(safe-area-inset-top)) 16px 36px;color:#fff;
  background:radial-gradient(120% 70% at 85% 0%,rgba(255,255,255,.14),transparent 60%),
             linear-gradient(165deg,var(--navy) 0%,var(--brand) 62%,#0a74c2 100%)}
@supports(height:1dvh){.auth{min-height:100dvh}}
.auth-wrap{width:min(400px,100%);display:grid;gap:22px}
.auth-brand{display:grid;justify-items:center;gap:4px;text-align:center}
.auth-brand img{width:min(300px,86%);height:auto;filter:drop-shadow(0 2px 6px rgba(0,0,0,.25))}
.auth-brand img.plate{background:#fff;border-radius:12px;padding:10px 16px;filter:none}
.auth-brand h1{margin:16px 0 0;font-size:24px;font-weight:700;line-height:1.25;letter-spacing:.01em}
.auth-brand p{margin:0;font-size:14px;color:rgba(255,255,255,.84)}
.auth-card{position:relative;overflow:hidden;display:grid;gap:14px;padding:28px 24px 24px;border-radius:14px;
  background:#fff;color:#17212b;box-shadow:0 18px 50px rgba(3,22,43,.35);text-align:left}
.auth-card::before{content:'';position:absolute;inset:0 0 auto;height:4px;background:var(--brand-2)}
.auth-card h2{margin:0;font-size:20px;font-weight:700;color:#17212b}
.auth-card label{display:grid;gap:5px;font-size:14px;color:#4a5663;margin:0}
.auth-card input{width:100%;height:44px;padding:0 12px;border:1px solid #cfd7df;border-radius:8px;background:#fff;
  color:#17212b;font-size:16px}   /* 16px: phones do not zoom in */
.auth-card input:focus{outline:2px solid var(--brand);outline-offset:1px;border-color:var(--brand)}
/* A browser that fills in a saved username and password tints those fields
   (yellow or blue). Keep them white like the others: a white inset shadow
   covers the tint. Two rules: a browser that does not know one of these
   selectors drops only that rule. */
.auth-card input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #fff inset;box-shadow:0 0 0 1000px #fff inset;
  -webkit-text-fill-color:#17212b;caret-color:#17212b}
.auth-card input:autofill{box-shadow:0 0 0 1000px #fff inset;-webkit-text-fill-color:#17212b;filter:none}
.auth-card code{background:#eef2f6;border-radius:5px;padding:1px 6px;font-size:13px;color:#17212b}
.pw-row{position:relative;display:block}
.pw-row input{padding-right:70px}
.pw-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);height:32px;padding:0 10px;border:0;
  border-radius:6px;background:none;color:var(--brand);font-size:13px;font-weight:600;cursor:pointer}
.pw-eye:hover{background:#eef4fa}
.auth-btn{height:48px;border:0;border-radius:8px;background:var(--brand);color:var(--brand-ink);font-size:16px;
  font-weight:600;cursor:pointer;width:100%}
.auth-btn:hover{filter:brightness(1.08)}
.auth-btn[disabled]{opacity:.6;cursor:default}
.auth-btn.ghost{background:#fff;color:var(--brand);border:1px solid #cfd7df}
.auth-err{margin:0;padding:10px 12px;border-radius:8px;background:#fdecee;color:#9f1239;font-size:14px}
.auth-ok{margin:0;padding:10px 12px;border-radius:8px;background:#e8f5ee;color:#14573a;font-size:14px}
.auth-note{margin:0;font-size:13.5px;color:#4a5663;line-height:1.55}
.auth-caps{margin:-6px 0 0;font-size:13px;color:#8a5a00}
.auth-row{display:flex;gap:10px}
.auth-row>*{flex:1}
.auth-foot{text-align:center;font-size:12px;color:rgba(255,255,255,.72)}
.auth-card a{color:var(--brand);font-weight:600}
.auth-card a.auth-link{justify-self:center;font-size:14px;text-decoration:none;padding:4px 8px}
.auth-card a.auth-link:hover{text-decoration:underline}
/* the security code (same picture and controls as the News Designer) */
.captcha{display:grid;gap:6px}
.captcha>label{font-size:14px;color:#4a5663;display:block}
.captcha-row{display:flex;gap:8px}
.captcha-img{flex:1 1 auto;min-width:0;width:100%;height:auto;aspect-ratio:260/84;border:1px solid #c9d8e8;border-radius:10px;
  background:#dbe8f5;transition:opacity .15s}
.captcha-img.loading{opacity:.35}          /* the old code stops working while the new one loads */
.captcha-new{flex:0 0 46px;display:grid;place-items:center;padding:0;border:1px solid #c9d8e8;border-radius:10px;
  background:#f3f7fb;color:var(--brand);cursor:pointer}
.captcha-new:hover{border-color:var(--brand)}
.captcha-new.busy svg{animation:cap-spin .8s linear infinite}
@keyframes cap-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.captcha-new.busy svg{animation:none}}
.auth-card .captcha input{font-size:18px;font-weight:600;letter-spacing:.3em;text-transform:uppercase}
.auth-card .captcha input::placeholder{font-size:15px;font-weight:400;letter-spacing:normal;text-transform:none}

/* ── plain building blocks for the newer admin pages (account, branding,
      system) so they match the older ones without copying their CSS ─────── */
.ui-main{max-width:900px;margin:0 auto;padding:20px 16px 60px}
.ui-sec{font-size:11px;font-weight:600;letter-spacing:.8px;text-transform:uppercase;color:var(--m);margin:22px 0 10px}
.ui-card{background:var(--s);border:1px solid var(--b);border-radius:10px;padding:18px;margin-bottom:14px}
.ui-card h3{font-size:15px;margin:0 0 6px}
.ui-note{font-size:12.5px;color:var(--m);line-height:1.6;margin:0 0 12px}
.ui-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 14px}
@media(max-width:620px){.ui-grid{grid-template-columns:1fr}}
.ui-field label{display:block;font-size:12px;color:var(--m);margin-bottom:4px}
.ui-field input[type=text],.ui-field input[type=password],.ui-field input[type=file],.ui-field select{
  width:100%;padding:8px 11px;background:var(--bg);border:1px solid var(--b);color:var(--t);border-radius:7px;font-size:14px}
.ui-field input:focus,.ui-field select:focus{outline:none;border-color:var(--acc)}
.ui-field .hint{font-size:11.5px;color:var(--m2);margin-top:4px;line-height:1.5}
.ui-acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;align-items:center}
.ui-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:7px;border:1px solid var(--b);
  background:var(--s);color:var(--t);font-size:13px;cursor:pointer;text-decoration:none}
.ui-btn:hover{border-color:var(--acc)}
.ui-btn.p{background:var(--acc);border-color:var(--acc);color:#fff;font-weight:600}
.ui-btn.p:hover{background:var(--acc2)}
.ui-btn.d{background:#7f1d1d30;border-color:#991b1b;color:#fca5a5}
.ui-msg{padding:10px 13px;border-radius:8px;font-size:13px;margin-bottom:14px;line-height:1.5}
.ui-msg.ok{background:#14532d;color:#86efac;border:1px solid #166534}
.ui-msg.err{background:#450a0a;color:#fca5a5;border:1px solid #7f1d1d}
.ui-msg.warn{background:#451a03;color:#fcd34d;border:1px solid #854d0e}
.ui-msg.info{background:#0f2f52;color:#9fcbf2;border:1px solid #1d4f86}
.ui-pill{font-size:11px;padding:2px 8px;border-radius:20px;font-weight:600;background:var(--s2);color:var(--m);border:1px solid var(--b)}
.ui-table{width:100%;border-collapse:collapse;font-size:13px}
.ui-table th{text-align:left;padding:8px 10px;font-size:11px;color:var(--m);border-bottom:1px solid var(--b);text-transform:uppercase;letter-spacing:.4px}
.ui-table td{padding:9px 10px;border-bottom:1px solid var(--b);vertical-align:top}
.ui-ok{color:#86efac;font-weight:600}
.ui-bad{color:#fca5a5;font-weight:600}
.ui-warn{color:#fcd34d;font-weight:600}
/* sign-in history: failed tries stand out, successful ones are calm green */
.ui-table tr.sg-bad td:nth-child(2){color:#fca5a5;font-weight:600}
.ui-table tr.sg-ok td:nth-child(2){color:#86efac}
[data-theme="light"] .ui-table tr.sg-bad td:nth-child(2){color:#b91c1c}
[data-theme="light"] .ui-table tr.sg-ok td:nth-child(2){color:#15803d}
.ui-swatch{display:inline-block;width:18px;height:18px;border-radius:5px;border:1px solid var(--b2);vertical-align:middle}

/* ── tick-box filters on the monitoring screen ───────────────────────────── */
.msel{position:relative;display:inline-block}
.msel-btn{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:7px;border:1px solid var(--b);
  background:var(--bg);color:var(--t);font-size:13px;cursor:pointer;white-space:nowrap;max-width:230px}
.msel-btn:hover,.msel.open .msel-btn{border-color:var(--acc)}
.msel-btn .lbl{overflow:hidden;text-overflow:ellipsis}
.msel-btn.some{border-color:var(--acc);background:#0f2f52}
.msel-btn .car{font-size:10px;opacity:.7}
.msel-pop{position:absolute;top:calc(100% + 6px);left:0;z-index:300;width:290px;max-width:calc(100vw - 24px);
  background:var(--s);border:1px solid var(--b2);border-radius:10px;box-shadow:0 14px 40px #000a;padding:10px;display:none}
.msel.open .msel-pop{display:block}
.msel-pop.right{left:auto;right:0}
.msel-find{width:100%;padding:7px 10px;margin-bottom:8px;background:var(--bg);border:1px solid var(--b);border-radius:7px;
  color:var(--t);font-size:13px}
.msel-find:focus{outline:none;border-color:var(--acc)}
.msel-quick{display:flex;gap:6px;margin-bottom:8px}
.msel-quick button{flex:1;padding:5px 8px;border-radius:6px;border:1px solid var(--b);background:var(--bg);color:var(--t);
  font-size:12px;cursor:pointer}
.msel-quick button:hover{border-color:var(--acc)}
.msel-list{max-height:300px;overflow:auto;display:grid;gap:1px}
.msel-opt{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;font-size:13px;cursor:pointer;user-select:none}
.msel-opt:hover{background:var(--s2)}
.msel-opt input{accent-color:var(--acc);width:15px;height:15px;flex:none;margin:0}
.msel-opt .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msel-opt .ct{margin-left:auto;font-size:11px;color:var(--m2);font-variant-numeric:tabular-nums}
.msel-foot{display:flex;justify-content:space-between;align-items:center;margin-top:8px;font-size:11.5px;color:var(--m2)}
.msel-foot button{padding:5px 12px;border-radius:6px;border:1px solid var(--acc);background:var(--acc);color:#fff;font-size:12px;
  font-weight:600;cursor:pointer}
.msel-empty{font-size:12px;color:var(--m2);padding:8px}

/* ── Light look: the colours the pages draw for dark backgrounds ────────────
   Pale text that reads well on navy (#fca5a5, #86efac, #fcd34d, #93c5fd...)
   is unreadable on white, so each gets a darker partner here. Everything
   else follows the palette variables above. */
[data-theme="light"] header{background-color:#17212b}
[data-theme="light"] header .brandmark{color:#fff}
[data-theme="light"] header .bm-name{border-left-color:#3a4754}
[data-theme="light"] header .bm-section{color:#b7c4d1}
[data-theme="light"] header .um-user,[data-theme="light"] header .um-out button,
[data-theme="light"] header .um-theme,[data-theme="light"] header .um-install,[data-theme="light"] header .hbtn-out{color:#c9d4df}
[data-theme="light"] header .hbtn-out{background:transparent}
[data-theme="light"] header .um-user:hover,[data-theme="light"] header .um-out button:hover,
[data-theme="light"] header .um-theme:hover,[data-theme="light"] header .um-install:hover,
[data-theme="light"] header .hbtn-out:hover{color:#fff;border-color:#3a4754}
[data-theme="light"] header .hbtn:not(.hbtn-p){color:#e8eef5;border-color:#3a4754}
[data-theme="light"] header .hbtn:not(.hbtn-p):hover{background:#22303d;border-color:#5b6b7b}

[data-theme="light"] .msg-ok,[data-theme="light"] .ui-msg.ok,[data-theme="light"] .st-done,[data-theme="light"] .flag-d{background:#e8f5ee;color:#14573a;border-color:#b6dfc6}
[data-theme="light"] .msg-err,[data-theme="light"] .ui-msg.err,[data-theme="light"] .st-rejected,[data-theme="light"] .st-left{background:#fdecee;color:#9f1239;border-color:#f5b5bf}
[data-theme="light"] .msg-warn,[data-theme="light"] .ui-msg.warn,[data-theme="light"] .st-missed,[data-theme="light"] .flag-o{background:#fff5d9;color:#6b4e00;border-color:#f1d58a}
[data-theme="light"] .msg-info,[data-theme="light"] .ui-msg.info,[data-theme="light"] .st-forwarded{background:#e6f0fa;color:#0b4a80;border-color:#b3d0ec}
[data-theme="light"] .btn-d,[data-theme="light"] .ui-btn.d{background:#fdecee;border-color:#f1a1ab;color:#b4232c}
[data-theme="light"] .bdg{background:#dbeafe;color:#1d4ed8}
[data-theme="light"] .bdg.hot{background:#fee2e2;color:#b91c1c}
[data-theme="light"] .pill-breaking{background:#fee2e2;color:#b91c1c;border-color:#fca5a5}
[data-theme="light"] .pill-important{background:#fef3c7;color:#92400e;border-color:#fcd34d}
[data-theme="light"] .pill-src,[data-theme="light"] .pill-admin{background:#e6f0fa;color:#0b4a80;border-color:#b3d0ec}
[data-theme="light"] .pill-rss,[data-theme="light"] .pill-finder,[data-theme="light"] .type-rss .spill{background:#ffedd5;color:#c2410c;border-color:#fdba74}
[data-theme="light"] .pill-twitter,[data-theme="light"] .type-twitter .spill,
[data-theme="light"] .pill-telegram,[data-theme="light"] .type-telegram .spill{background:#e0f2fe;color:#0369a1;border-color:#7dd3fc}
[data-theme="light"] .pill-facebook,[data-theme="light"] .type-facebook .spill{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}
[data-theme="light"] .pill-youtube,[data-theme="light"] .type-youtube .spill{background:#fee2e2;color:#b91c1c;border-color:#fca5a5}
[data-theme="light"] .pill-editor{background:#dcfce7;color:#15803d;border-color:#86efac}
[data-theme="light"] .pill-poster{background:#f3e8ff;color:#7e22ce;border-color:#d8b4fe}
[data-theme="light"] .claimed,[data-theme="light"] .dupe h4,[data-theme="light"] .dupe-pc,
[data-theme="light"] .asfound.aswarn b,[data-theme="light"] .src-warn,[data-theme="light"] .ui-warn{color:#92400e}
[data-theme="light"] .dupe,[data-theme="light"] .asfound.aswarn{background:#fff7e0;border-color:#f1d58a}
[data-theme="light"] .sentmark,[data-theme="light"] .sentmark:hover{color:#15803d;border-color:#86efac}
[data-theme="light"] .sendbtn:hover{color:var(--acc)}
[data-theme="light"] #s-err,[data-theme="light"] .src-err,[data-theme="light"] .ui-bad{color:#b91c1c}
[data-theme="light"] .src-ok,[data-theme="light"] .ui-ok{color:#15803d}
[data-theme="light"] code{color:#0b4a80;background:#eef3f8}
[data-theme="light"] .dot{background:#9ca3af}
[data-theme="light"] .dot.set{background:#d97706}
[data-theme="light"] .atab:hover{background:#00000008}
[data-theme="light"] .msel-btn.some{background:#e6f0fa}
[data-theme="light"] .msel-btn.none{background:#fff5d9;border-color:#d97706}
[data-theme="light"] #vis-dot{background:#dcfce7;border-color:#86efac}
[data-theme="light"] #vis-dot.off{background:#ffedd5;border-color:#fdba74}
[data-theme="light"] #qwrap .ql-snow .ql-stroke{stroke:#4a5663}
[data-theme="light"] #qwrap .ql-snow .ql-fill,[data-theme="light"] #qwrap .ql-snow .ql-stroke.ql-fill{fill:#4a5663}
[data-theme="light"] #qwrap .ql-snow .ql-picker{color:#4a5663}
[data-theme="light"] #qwrap .ql-editor a,[data-theme="light"] .qread a{color:#00589d}
[data-theme="light"] #qwrap .ql-editor blockquote,[data-theme="light"] .qread blockquote{color:#4a5663}
[data-theme="light"] .card:hover{box-shadow:0 4px 14px #17212b14}
