:root {
  --bg: #f1f5f9; --panel: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --side: #0b1220; --side2: #111a2e; --side-ink: #cbd5e1;
  --brand: #b8860b; --brand2: #d4af37; --brand-soft: var(--gold-soft);
  --blue: #2563eb; --amber: #d97706; --red: #dc2626; --green: #16a34a; --violet: #7c3aed;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; }
body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; direction: rtl; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* mixed Arabic/English product names: let each name pick its own direction */
.pcard .n, .pcard .muted, .citem .nm, .tbl td, .modal-h h3, .receipt td { unicode-bidi: plaintext; text-align: right; }

/* ---------- auth screens */
.auth { height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 80% -10%, #d4af37 0%, transparent 60%), linear-gradient(160deg, #0b1220, #0f2a3a 60%, #b8860b);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 44px; margin: 18px 0 8px; letter-spacing: -.5px; }
.auth-hero p { color: #cbd5e1; font-size: 17px; line-height: 1.8; max-width: 520px; }
.hero-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; }
.hero-feats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 14px; font-size: 14px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; overflow: auto; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 26px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; line-height: 1.7; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #d4af37, #b8860b); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 20px rgba(184,134,11,.45); }
.status-pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }

/* ---------- form */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; outline: none; transition: .15s; }
.input:focus { border-color: var(--brand2); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.row { display: flex; gap: 12px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; background: var(--line); transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand2), var(--brand)); color: #fff; box-shadow: 0 4px 14px rgba(184,134,11,.3); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-lg { padding: 14px 20px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 250px 1fr; height: 100%; }
.side { background: linear-gradient(180deg, var(--side), var(--side2)); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px; overflow: auto; }
.side .logo { color: #fff; padding: 4px 8px 18px; font-size: 18px; }
.side .logo small { display: block; font-size: 11px; color: #94a3b8; font-weight: 500; }
.nav-sec { font-size: 11px; color: #64748b; margin: 14px 10px 6px; letter-spacing: .5px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; cursor: pointer; margin-bottom: 2px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(135deg, rgba(212,175,55,.25), rgba(184,134,11,.15)); color: #fff; box-shadow: inset 3px 0 0 var(--brand2); }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav .kbd { margin-inline-start: auto; font-size: 11px; color: #64748b; border: 1px solid #334155; border-radius: 5px; padding: 0 5px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #64748b; }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.top { height: 64px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 16px; flex: none; }
.top h1 { font-size: 20px; margin: 0; }
.top .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: grid; place-items: center; font-weight: 700; }
.content { flex: 1; overflow: auto; padding: 22px 24px 40px; }

/* ---------- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid rgba(226,232,240,.7); min-width: 0; }
.card h3 { margin: 0 0 14px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h3 .right { margin-inline-start: auto; }
.stat { position: relative; overflow: hidden; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 12px; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat .delta { font-size: 12px; margin-top: 6px; font-weight: 600; }
.stat::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; inset-inline-end: -50px; top: -60px; background: currentColor; opacity: .05; }
.c-teal .ico { background: linear-gradient(135deg, #d4af37, #b8860b); } .c-teal { color: #b8860b; }
.c-blue .ico { background: linear-gradient(135deg, #3b82f6, #2563eb); } .c-blue { color: #2563eb; }
.c-amber .ico { background: linear-gradient(135deg, #f59e0b, #d97706); } .c-amber { color: #d97706; }
.c-red .ico { background: linear-gradient(135deg, #f87171, #dc2626); } .c-red { color: #dc2626; }
.c-violet .ico { background: linear-gradient(135deg, #a78bfa, #7c3aed); } .c-violet { color: #7c3aed; }
.c-green .ico { background: linear-gradient(135deg, #4ade80, #16a34a); } .c-green { color: #16a34a; }
.stat .label, .stat .value { color: var(--ink); } .stat .label { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 230px; }

/* ---------- table */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { width: auto; }
.search { position: relative; flex: 1; min-width: 240px; }
.search .input { width: 100%; padding-inline-start: 38px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }
.tbl-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: var(--panel2); text-align: start; font-size: 12px; color: var(--muted); font-weight: 700; padding: 11px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; overflow-wrap: anywhere; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel2); }
.tbl tr.click { cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel3); white-space: nowrap; }
.b-green { background: #dcfce7; color: #15803d; } .b-red { background: #fee2e2; color: #b91c1c; } .b-amber { background: #fef3c7; color: #b45309; }
.b-blue { background: #dbeafe; color: #1d4ed8; } .b-violet { background: #ede9fe; color: #6d28d9; } .b-teal { background: var(--gold-soft); color: #8a6508; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; }
.tabs { display: flex; gap: 6px; background: var(--line); padding: 4px; border-radius: 12px; width: fit-content; margin-bottom: 14px; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- POS */
.pos { display: grid; grid-template-columns: 1fr 420px; gap: 16px; height: calc(100vh - 64px - 62px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; }
.scan { display: flex; gap: 10px; margin-bottom: 12px; }
.scan .search .input { font-size: 17px; padding-top: 14px; padding-bottom: 14px; border-radius: 12px; border-width: 2px; }
.results { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-content: start; padding: 2px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; transition: .12s; display: flex; flex-direction: column; gap: 6px; }
.pcard:hover { border-color: var(--brand2); box-shadow: 0 6px 18px rgba(184,134,11,.15); transform: translateY(-1px); }
.pcard .n { font-weight: 700; line-height: 1.35; }
.pcard .ar { color: var(--muted); font-size: 13px; }
.pcard .meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.pcard .price { font-weight: 800; color: var(--brand); font-size: 16px; }
.cart { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.cart-items { flex: 1; overflow: auto; }
.citem { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.citem .nm { font-weight: 600; line-height: 1.35; }
.citem .ctl { display: flex; align-items: center; gap: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button { border: 0; background: var(--panel2); width: 30px; height: 30px; cursor: pointer; font-size: 16px; }
.qty input { width: 46px; text-align: center; border: 0; outline: none; height: 30px; }
.cart-foot { padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel2); border-radius: 0 0 var(--radius) var(--radius); }
.totline { display: flex; justify-content: space-between; margin: 4px 0; }
.grand { font-size: 28px; font-weight: 800; color: var(--brand); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.pay-methods button { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 8px; cursor: pointer; font-weight: 600; }
.pay-methods button.on { border-color: var(--brand); background: var(--brand-soft); color: #8a6508; }

/* ---------- modal / toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(2px); animation: fade .15s; }
.modal { background: var(--panel); border-radius: 16px; width: min(640px, 94vw); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: pop .15s; }
.modal.wide { width: min(980px, 96vw); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-h .x { margin-inline-start: auto; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--panel); }
#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); min-width: 260px; animation: pop .2s; border-inline-start: 4px solid var(--brand2); }
.toast.err { border-color: #f87171; } .toast.warn { border-color: #fbbf24; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- about */
.about-hero { background: linear-gradient(135deg, #0b1220, #0f2a3a 55%, #b8860b); color: #fff; border-radius: 18px; padding: 32px; display: flex; gap: 24px; align-items: center; margin-bottom: 18px; }
.about-hero h2 { margin: 0 0 6px; font-size: 28px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.kv div:nth-child(odd) { color: var(--muted); font-weight: 600; }

/* ---------- receipt (print only) */
#print-area { display: none; }
@media print {
  @page { margin: 4mm; }
  body { overflow: visible; background: var(--panel); }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
}
.receipt { width: 72mm; font-size: 12px; color: #000; font-family: Tahoma, Arial, sans-serif; }
.receipt h2 { text-align: center; margin: 0 0 2px; font-size: 16px; }
.receipt .c { text-align: center; }
.receipt table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.receipt td, .receipt th { padding: 3px 0; border-bottom: 1px dashed #999; font-size: 11px; text-align: start; }
.receipt .tot { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; border-top: 2px solid #000; padding-top: 4px; }

/* ---------- v1.1: invoice tabs, lines, ticker, photos */
.input.sm { padding: 5px 7px; border-radius: 8px; font-size: 13px; }
.pos { grid-template-columns: 1fr 560px; height: calc(100vh - 64px - 62px - 34px); }
.inv-tabs { display: flex; gap: 4px; padding: 8px 10px 0; background: var(--panel3); border-radius: var(--radius) var(--radius) 0 0; overflow-x: auto; flex: none; }
.inv-tabs button { border: 1px solid var(--line); border-bottom: 0; background: var(--line); padding: 7px 12px; border-radius: 9px 9px 0 0; cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--muted); }
.inv-tabs button.on { background: var(--panel); color: var(--ink); }
.inv-tabs button .x { margin-inline-start: 6px; color: var(--red); font-weight: 800; }
.inv-tabs button.add { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.seg { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--brand); box-shadow: var(--shadow); }
.cust { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
table.lines td, table.lines th { padding: 6px 6px; font-size: 13px; }
table.lines .nm { font-weight: 700; line-height: 1.3; unicode-bidi: plaintext; }
table.lines tr.new { background: var(--gold-soft); box-shadow: inset -3px 0 0 var(--gold); }
.totgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
.totgrid > div { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ticker { height: 34px; background: linear-gradient(90deg, #0b1220, #0f2a3a); color: #e2e8f0; display: flex; align-items: center; overflow: hidden; flex: none; font-size: 14px; }
.ticker .lead { background: var(--brand); color: #fff; padding: 0 14px; height: 100%; display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; flex: none; z-index: 1; }
.ticker .track { flex: 1; overflow: hidden; position: relative; height: 100%; }
.ticker .run { position: absolute; white-space: nowrap; top: 50%; transform: translateY(-50%); animation: tick linear infinite; }
.ticker .run span { margin: 0 28px; }
.ticker .warn { color: #fcd34d; } .ticker .verse { color: #a7f3d0; }
@keyframes tick { from { right: 0; } to { right: 100%; } }
.photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: inline-grid; place-items: center; font-weight: 800; flex: none; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.lg { width: 96px; height: 96px; font-size: 32px; }
.photo.sm { width: 34px; height: 34px; font-size: 14px; }
.user-pick { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.user-pick button { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; font-weight: 600; font-size: 12px; }
.user-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(212,175,55,.2); }
.section-t { font-weight: 800; color: var(--brand); margin: 16px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); display: flex; align-items: center; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 10px; }
.att-late { color: var(--red); font-weight: 700; } .att-ok { color: var(--green); }
.labels-sheet { display: flex; flex-wrap: wrap; gap: 2mm; }
.bc-label { border: 1px dashed #bbb; padding: 1mm 1.5mm; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; font-family: Tahoma, Arial; color: #000; background: #fff; }
.bc-label .t { font-size: 7pt; display: flex; justify-content: space-between; width: 100%; }
.bc-label .n { font-size: 7pt; text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-label svg { max-width: 100%; height: auto; }
@media print { .bc-label { border-color: transparent; page-break-inside: avoid; } .labels-sheet.thermal .bc-label { page-break-after: always; margin: 0; } }
table.lines select.input.sm { min-width: 74px; }
.scan .btn { padding: 10px 12px; }

.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rx-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; transition: .12s; }
.rx-item.click { cursor: pointer; } .rx-item.click:hover { border-color: var(--brand2); box-shadow: 0 6px 18px rgba(184,134,11,.15); }
.rx-item img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; background: var(--panel3); display: block; margin-bottom: 6px; }
.click { cursor: pointer; }
#qr svg { width: 100%; height: auto; }

.kv > div { text-align: right; }
.kv > div.num { unicode-bidi: plaintext; direction: rtl; }

/* =====================================================================
   RM LUXURY THEME — black · gold · red · silver  (light / dark / auto)
   ===================================================================== */
:root {
  --bg: #f3f2ef; --panel: #ffffff; --panel2: #faf9f6; --panel3: #f1efe9; --ink: #141416; --muted: #6e6c74; --line: #e7e2d4; --line2: #f0ece2;
  --side: #09090b; --side2: #151519; --side-ink: #cfcfd6;
  --gold: #d4af37; --gold2: #f3d77a; --gold3: #8a6508; --gold-soft: #fbf4dc; --amber-soft: #fef3c7;
  --brand: #b8860b; --brand2: #d4af37; --brand-soft: #fbf4dc;
  --red: #c1121f; --red2: #e63946; --silver: #c0c0c8; --silver2: #8e8e99;
  --green: #15803d; --blue: #475569; --violet: #6b21a8;
  --shadow: 0 1px 2px rgba(10,10,12,.05), 0 8px 24px rgba(10,10,12,.07);
  --glow: 0 0 0 1px rgba(212,175,55,.35), 0 10px 30px rgba(212,175,55,.18);
  --radius: 16px;
}
:root[data-theme="dark"] {
  --bg: #0b0b0d; --panel: #141418; --panel2: #18181d; --panel3: #1f1f25; --ink: #f1f0ec; --muted: #a09fa8; --line: #2b2a31; --line2: #222128;
  --gold-soft: #2a2414; --amber-soft: #3a2f10; --brand-soft: #2a2414;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
}
body { background: var(--bg); color: var(--ink); transition: background .4s, color .4s; }
.input, select.input, textarea.input { background: var(--panel); color: var(--ink); border-color: var(--line); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.22); }
.card, .tbl-wrap, .cart, .modal, .modal-h, .modal-f, .pcard, .rx-item, .top { background: var(--panel); border-color: var(--line); color: var(--ink); }
.tbl th { background: var(--panel2); color: var(--muted); border-color: var(--line); }
.tbl tbody tr:hover { background: var(--panel3); }
.tbl td { border-color: var(--line2); }
.tabs { background: var(--panel3); } .tabs button.on { background: var(--panel); color: var(--ink); }
.btn { background: var(--panel3); color: var(--ink); position: relative; overflow: hidden; transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, filter .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.btn:active { transform: scale(.94); }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s; }
.btn:hover::after { transform: translateX(120%); }
.btn-primary, .btn-gold { background: linear-gradient(135deg, #f3d77a, #d4af37 45%, #a67c00); color: #1a1406; box-shadow: 0 4px 16px rgba(212,175,55,.35); border: 0; }
.btn-danger { background: linear-gradient(135deg, #e63946, #a4161a); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.badge { background: var(--panel3); color: var(--ink); }
.b-gold { background: var(--gold-soft); color: #8a6508; } :root[data-theme="dark"] .b-gold { color: var(--gold2); }
.b-silver { background: #ececf1; color: #4b4b55; } :root[data-theme="dark"] .b-silver { background: #2a2a31; color: #d6d6dd; }
.b-teal { background: var(--gold-soft); color: #8a6508; }
:root[data-theme="dark"] .b-green { background: #12321e; color: #6ee7a0; } :root[data-theme="dark"] .b-red { background: #3a1216; color: #ff8a8f; }
:root[data-theme="dark"] .b-amber { background: #3a2f10; color: #f3d77a; } :root[data-theme="dark"] .b-blue { background: #1c2533; color: #b6c4dc; }
:root[data-theme="dark"] .b-violet { background: #2b1a3a; color: #d8b4fe; }

/* sidebar */
.side { background: radial-gradient(600px 300px at 120% -10%, rgba(212,175,55,.18), transparent 60%), linear-gradient(180deg, #09090b, #141418); border-left: 1px solid rgba(212,175,55,.15); }
.logo-mark { background: linear-gradient(135deg, #f3d77a, #d4af37 50%, #8a6508); box-shadow: 0 6px 22px rgba(212,175,55,.45); animation: pulseGold 4s ease-in-out infinite; }
.logo-mark svg { stroke: #1a1406; }
.nav a { transition: background .2s, color .2s, transform .25s cubic-bezier(.34,1.56,.64,1); }
.nav a svg { transition: transform .35s cubic-bezier(.34,1.56,.64,1), filter .3s, color .3s; }
.nav a:hover { background: rgba(212,175,55,.08); color: #fff; transform: translateX(-4px); }
.nav a:hover svg { color: var(--gold); filter: drop-shadow(0 0 6px rgba(212,175,55,.8)); transform: scale(1.22) rotate(-6deg); }
.nav a.active { background: linear-gradient(90deg, rgba(212,175,55,.04), rgba(212,175,55,.22)); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.nav a.active svg { color: var(--gold); }
.nav-sec { color: var(--gold3); letter-spacing: 1px; }
.side-foot { color: #6b6b75; border-color: rgba(212,175,55,.12); }

/* top bar */
.top { border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.top h1 { background: linear-gradient(90deg, var(--ink), var(--gold3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .top h1 { background: linear-gradient(90deg, #fff, var(--gold2)); -webkit-background-clip: text; background-clip: text; }
.chip { background: var(--panel3); color: var(--ink); }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, color .2s; }
.icon-btn:hover { transform: translateY(-2px) scale(1.08); color: var(--gold3); box-shadow: var(--glow); }
.icon-btn svg { width: 18px; height: 18px; }
.weather { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--panel3), var(--panel)); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.weather .t { font-weight: 800; font-size: 15px; } .weather .w-ico { font-size: 20px; animation: floaty 3s ease-in-out infinite; }
.clock-big { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .5px; }

/* cards & stats */
.card { transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow), 0 0 0 1px rgba(212,175,55,.25); }
.stat .ico { box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.stat:hover .ico { animation: rubber .8s; }
.c-teal .ico, .c-amber .ico { background: linear-gradient(135deg, #f3d77a, #d4af37 50%, #8a6508); } .c-teal, .c-amber { color: #b8860b; }
.stat.c-gold .ico { background: linear-gradient(135deg, #f3d77a, #d4af37 50%, #8a6508); } .stat.c-gold { color: #b8860b; }
.c-blue .ico { background: linear-gradient(135deg, #3a3a44, #0f0f12); } .c-blue { color: #3a3a44; }
.c-violet .ico { background: linear-gradient(135deg, #e5e5ea, #9a9aa5 55%, #5c5c66); } .c-violet { color: #7a7a85; }
.c-red .ico { background: linear-gradient(135deg, #ff4d5a, #c1121f 55%, #6a040f); } .c-red { color: #c1121f; }
.c-green .ico { background: linear-gradient(135deg, #34d399, #15803d); }
.stat::after { opacity: .07; }
.pcard:hover, .alt-card:hover, .lib-card:hover { border-color: var(--gold); box-shadow: var(--glow); transform: translateY(-3px); }
.grand { color: var(--gold3); text-shadow: 0 0 18px rgba(212,175,55,.25); } :root[data-theme="dark"] .grand { color: var(--gold2); }
.pcard .price { color: var(--gold3); } :root[data-theme="dark"] .pcard .price { color: var(--gold2); }
.seg button.on { color: var(--gold3); } .pay-methods button { background: var(--panel); color: var(--ink); border-color: var(--line); }
.pay-methods button.on { border-color: var(--gold); background: var(--gold-soft); color: #8a6508; }
.inv-tabs { background: var(--panel3); } .inv-tabs button { background: var(--panel2); } .inv-tabs button.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.cart-foot { background: var(--panel2); }
.ticker { background: linear-gradient(90deg, #09090b, #1b1608 50%, #09090b); border-top: 1px solid rgba(212,175,55,.3); }
.ticker .lead { background: linear-gradient(135deg, #f3d77a, #d4af37 60%, #8a6508); color: #1a1406; }
.ticker .verse { color: var(--gold2); } .ticker .warn { color: #ff8a8f; }
.about-hero, .auth-hero { background: radial-gradient(900px 500px at 85% -20%, rgba(212,175,55,.35), transparent 60%), radial-gradient(700px 400px at -10% 120%, rgba(193,18,31,.35), transparent 60%), linear-gradient(160deg, #060607, #141418 60%, #1b1608); position: relative; overflow: hidden; }
.auth-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(212,175,55,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(212,175,55,.07) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: radial-gradient(circle at 70% 30%, #000 0, transparent 70%); animation: gridMove 18s linear infinite; }
.auth-hero > * { position: relative; }
.auth-hero h1 { background: linear-gradient(90deg, #fff, var(--gold2), #fff); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
.auth-form { background: var(--bg); }
.hero-feats div { background: rgba(212,175,55,.08); border-color: rgba(212,175,55,.25); transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.hero-feats div:hover { transform: translateY(-3px) scale(1.03); }
.orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; animation: floaty 9s ease-in-out infinite; pointer-events: none; }

/* page enter animation */
#view > * { animation: enter .45s cubic-bezier(.2,.8,.2,1) both; }
#view > *:nth-child(2) { animation-delay: .05s; } #view > *:nth-child(3) { animation-delay: .1s; } #view > *:nth-child(4) { animation-delay: .15s; }
.cards > .card { animation: enter .5s cubic-bezier(.2,.8,.2,1) both; }
.cards > .card:nth-child(2) { animation-delay: .06s; } .cards > .card:nth-child(3) { animation-delay: .12s; } .cards > .card:nth-child(4) { animation-delay: .18s; } .cards > .card:nth-child(5) { animation-delay: .24s; } .cards > .card:nth-child(6) { animation-delay: .3s; }

/* tooltip */
#tip { position: fixed; z-index: 200; max-width: 300px; background: linear-gradient(160deg, #111114, #1c1a14); color: #f1f0ec; border: 1px solid rgba(212,175,55,.45); border-radius: 12px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.7; box-shadow: 0 14px 40px rgba(0,0,0,.35); pointer-events: none; opacity: 0; transform: translateY(6px) scale(.97); transition: opacity .18s, transform .18s; }
#tip.show { opacity: 1; transform: none; }
#tip b { color: var(--gold2); display: block; margin-bottom: 2px; font-size: 13px; }

/* assistant */
.big-tabs button { padding: 10px 16px; font-size: 14px; }
.alt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.alt-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; transition: .25s cubic-bezier(.34,1.56,.64,1); }
.alt-card.out { opacity: .65; } .alt-card .n { font-weight: 700; unicode-bidi: plaintext; }
.note-gold { background: var(--gold-soft); border: 1px solid rgba(212,175,55,.35); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.issue { border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); background: var(--panel2); border-inline-start: 4px solid var(--silver); }
.issue.major { border-inline-start-color: var(--red); background: rgba(193,18,31,.06); } .issue.moderate { border-inline-start-color: var(--gold); }
.ok-box { background: rgba(21,128,61,.08); border: 1px solid rgba(21,128,61,.25); color: var(--green); padding: 12px; border-radius: 12px; font-weight: 600; }
.red-flag { background: linear-gradient(135deg, rgba(193,18,31,.12), rgba(193,18,31,.04)); border: 1px solid rgba(193,18,31,.45); border-radius: 16px; padding: 14px 18px; margin-bottom: 12px; animation: pulseRed 2.2s ease-in-out infinite; }
.red-flag h3 { color: var(--red); margin: 0 0 6px; } .red-flag ul { margin: 0; padding-inline-start: 20px; line-height: 1.9; }
.plan-card { margin-bottom: 12px; } .opt { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel2); }
.opt.no { opacity: .7; } .opt .dose { margin: 6px 0; font-weight: 700; color: var(--gold3); } :root[data-theme="dark"] .opt .dose { color: var(--gold2); }
.caution { font-size: 12.5px; color: #a16207; margin-top: 3px; } :root[data-theme="dark"] .caution { color: #f3d77a; }
.advice { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--green); margin-top: 6px; }
.disclaimer { font-size: 11.5px; color: var(--muted); margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; transition: .2s cubic-bezier(.34,1.56,.64,1); }
.chip-btn:hover { transform: translateY(-1px) scale(1.04); border-color: var(--gold); }
.chip-btn.on { background: linear-gradient(135deg, #f3d77a, #d4af37); color: #1a1406; border-color: transparent; font-weight: 700; }
.chip-btn.flag { border-color: rgba(193,18,31,.4); color: var(--red); } .chip-btn.flag.on { background: linear-gradient(135deg, #e63946, #a4161a); color: #fff; }
.sym-group { margin-bottom: 10px; } .sym-group .g { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.sym-group.danger .g { color: var(--red); }
.counsel-card { margin-bottom: 12px; } .counsel-list, .lib-list { line-height: 2; padding-inline-start: 20px; margin: 8px 0 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lib-card { border-radius: 16px; padding: 16px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; transition: .3s cubic-bezier(.34,1.56,.64,1); min-height: 150px; }
.lib-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; }
.lib-card.gold::before { background: linear-gradient(90deg, #f3d77a, #d4af37, #8a6508); } .lib-card.red::before { background: linear-gradient(90deg, #ff4d5a, #c1121f); } .lib-card.silver::before { background: linear-gradient(90deg, #e5e5ea, #8e8e99); }
.lib-card .cat { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .5px; } .lib-card h3 { margin: 6px 0; font-size: 16px; } .lib-card p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 24px; }
.lib-card .more { position: absolute; bottom: 12px; inset-inline-start: 16px; font-weight: 700; color: var(--gold3); font-size: 13px; }
.ix-warn, .ix-ok { margin: 8px 10px 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.ix-warn { background: var(--amber-soft); color: #8a6508; border: 1px solid rgba(212,175,55,.5); animation: pulseGold 2.5s infinite; }
.ix-warn.major { background: rgba(193,18,31,.1); color: var(--red); border-color: rgba(193,18,31,.45); animation: pulseRed 2s infinite; }
.ix-ok { background: rgba(21,128,61,.07); color: var(--green); cursor: default; }

/* daily brief */
.brief-hero { background: radial-gradient(500px 220px at 90% -40%, rgba(212,175,55,.45), transparent 60%), linear-gradient(135deg, #0b0b0d, #1b1608); color: #fff; border-radius: 18px; padding: 22px; margin-bottom: 14px; position: relative; overflow: hidden; }
.brief-hero h2 { margin: 0 0 6px; font-size: 24px; } .brief-hero .line { color: var(--gold2); }
.brief-box { border-radius: 14px; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 10px; line-height: 1.8; }
.brief-box h4 { margin: 0 0 4px; color: var(--gold3); } :root[data-theme="dark"] .brief-box h4 { color: var(--gold2); }

@keyframes rubber { 0% { transform: scale(1); } 30% { transform: scale(1.25, .75); } 40% { transform: scale(.75, 1.25); } 50% { transform: scale(1.15, .85); } 65% { transform: scale(.95, 1.05); } 75% { transform: scale(1.05, .95); } 100% { transform: scale(1); } }
@keyframes pulseGold { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,.35); } 50% { box-shadow: 0 0 0 8px rgba(212,175,55,0); } }
@keyframes pulseRed { 0%, 100% { box-shadow: 0 0 0 0 rgba(193,18,31,.3); } 50% { box-shadow: 0 0 0 8px rgba(193,18,31,0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes gridMove { to { background-position: 42px 42px, 42px 42px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { body { background: #fff !important; color: #000 !important; } }
.top h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top { gap: 8px; flex-wrap: nowrap; }
.top .chip small { white-space: nowrap; }
@media (max-width: 1350px) { .weather small, #lic-chip span { display: none; } }
.brief-box, .note-gold { color: var(--ink); }
/* v1.4 brand */
.logo-img { width: 46px; height: 46px; object-fit: contain; border-radius: 12px; filter: drop-shadow(0 6px 16px rgba(212,175,55,.35)); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.logo:hover .logo-img { transform: rotate(-6deg) scale(1.08); }
.auth-hero .logo-img { width: 96px; height: 96px; border-radius: 22px; }
.upd-btn { position: relative; border-color: var(--gold); animation: pulseGold 2s infinite; }
.upd-dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--panel); }
.receipt-big { font-family: Tahoma, Arial, sans-serif; }
.receipt-big td, .receipt-big th { font-size: inherit; padding: 5px 4px; }
.stat.click { cursor: pointer; }
.stat .ico { font-size: 22px; }
/* splash + always-visible RM logo */
#splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(700px 420px at 50% 42%, rgba(212,175,55,.22), transparent 70%), linear-gradient(160deg, #050506, #121216 60%, #1b1608); transition: opacity .6s, visibility .6s; }
#splash.out { opacity: 0; visibility: hidden; }
#splash img { width: 210px; height: 210px; border-radius: 46px; filter: drop-shadow(0 20px 50px rgba(212,175,55,.45)); animation: spIn 1.1s cubic-bezier(.2,1.4,.4,1) both, floaty 4s 1.1s ease-in-out infinite; }
#splash .sp-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(243,215,122,.35), transparent 65%); animation: pulseGlow 2.4s ease-in-out infinite; }
#splash .sp-name { font-size: 34px; font-weight: 800; letter-spacing: 1px; background: linear-gradient(90deg, #fff, #f3d77a, #d4af37, #fff); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 3s linear infinite, enter .8s .4s both; position: relative; }
#splash .sp-sub { color: #bdb7a5; font-size: 14px; animation: enter .8s .6s both; position: relative; }
#splash .sp-bar { width: 220px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 14px; position: relative; }
#splash .sp-bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, #f3d77a, #d4af37, transparent); animation: spBar 1.2s ease-in-out infinite; }
@keyframes spIn { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }
@keyframes spBar { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
@keyframes pulseGlow { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.1); opacity: 1; } }
.side .logo .logo-img { width: 58px; height: 58px; border-radius: 14px; }
.rm-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px; color: var(--gold2); font-weight: 700; letter-spacing: .5px; }
.rm-foot img { width: 26px; height: 26px; border-radius: 7px; }
#rm-watermark { position: fixed; left: 24px; bottom: 54px; width: 150px; opacity: .07; pointer-events: none; z-index: 0; border-radius: 30px; filter: grayscale(.2); }
.content { position: relative; z-index: 1; }
.rm-hero { display: flex; align-items: center; gap: 20px; padding: 18px 22px; margin-bottom: 18px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(600px 260px at 10% -40%, rgba(212,175,55,.40), transparent 60%), radial-gradient(500px 240px at 100% 140%, rgba(193,18,31,.30), transparent 60%), linear-gradient(135deg, #070708, #17161b 55%, #1d1709);
  border: 1px solid rgba(212,175,55,.35); box-shadow: var(--shadow); }
.rm-hero-logo { width: 104px; height: 104px; border-radius: 24px; filter: drop-shadow(0 10px 26px rgba(212,175,55,.5)); animation: floaty 5s ease-in-out infinite; transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.rm-hero:hover .rm-hero-logo { transform: scale(1.06) rotate(-4deg); }
.rm-hero .t1 { color: var(--gold2); font-weight: 700; } .rm-hero .t2 { font-size: 28px; font-weight: 800; margin: 2px 0; } .rm-hero .t3 { color: #bdb7a5; font-size: 13px; }
.rm-hero-ph { max-width: 120px; max-height: 90px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; }
.receipt td, .receipt th { padding: 3px 2px; }
/* subscription plans */
.pay-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pay-plan { position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; transition: .25s cubic-bezier(.34,1.56,.64,1); }
.pay-plan:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--glow); }
.pay-plan.best { border-color: var(--gold); background: linear-gradient(160deg, var(--gold-soft), var(--panel2)); }
.pay-plan .pay-name { font-weight: 800; } .pay-plan .pay-price { font-size: 22px; font-weight: 800; color: var(--gold3); } :root[data-theme="dark"] .pay-plan .pay-price { color: var(--gold2); }
.pay-plan ul { margin: 0; padding-inline-start: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.9; flex: 1; }
.pay-tag { position: absolute; top: -10px; inset-inline-start: 12px; background: linear-gradient(135deg, #f3d77a, #d4af37); color: #1a1406; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
.input.bad { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(193,18,31,.2); }

/* v1.6.5 keyboard shortcuts */
.kb-key { display: inline-block; min-width: 110px; text-align: center; font: 700 12px/1.2 "Segoe UI", Tahoma, Arial; direction: ltr; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel3); color: var(--ink); cursor: pointer; }
button.kb-key:hover { border-color: var(--gold); }
.kb-key.empty { color: var(--muted); font-weight: 400; direction: rtl; }
.kb-key.bad { border-color: var(--red); color: var(--red); }
.kb-key.fixed { cursor: default; opacity: .8; }
.kb-key.big { font-size: 22px; padding: 14px 20px; min-width: 220px; border: 2px dashed var(--gold); }
.kp-list { max-height: 50vh; overflow: auto; margin-top: 8px; }
.kp-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.kp-row span { flex: 1; } .kp-row:hover, .kp-row.on { background: var(--gold-soft); }
.kp-row kbd, kbd.kb-key { font: 700 11px "Segoe UI", Tahoma, Arial; direction: ltr; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; background: var(--panel3); }
/* v1.6.6 alerts */
.refill-bar { margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid rgba(212,175,55,.45); }
.refill-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 4px 0; border-top: 1px dashed rgba(212,175,55,.35); }
.refill-item:first-of-type { border-top: 0; }
.nav .nav-count { margin-inline-start: auto; min-width: 20px; text-align: center; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; background: #d4af37; color: #1a1406; }
.nav .nav-count.hot { background: #e63946; color: #fff; }
.nav .nav-count + .kbd { margin-inline-start: 6px; }
/* v1.6.7 dose stickers (auto-fit) */
.rxl { justify-content: center; gap: .3mm; padding: .6mm 1mm !important; text-align: center; }
.rxl-ph { display: flex; justify-content: space-between; width: 100%; font-size: 5.5pt; border-bottom: .2mm solid #000; padding-bottom: .2mm; }
.rxl-drug { font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; direction: ltr; }
.rxl-dose { font-weight: 800; line-height: 1.15; word-break: break-word; }
.rxl-pt { font-size: 6pt; }
.rx-prev { display: flex; justify-content: center; align-items: center; padding: 8px; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.rx-prev .bc-label { transform-origin: center; }
.rxd-tbl td { vertical-align: top; } .rxd-tbl .input.sm { padding: 5px 6px; }
.rx-topics { max-height: 130px; overflow: auto; }
.rx-sheet-prev { background: #fff; padding: 14px; border-radius: 10px; display: flex; justify-content: center; align-items: flex-start; max-height: 70vh; overflow: auto; }
.rx-sheet-prev.pg .rxs { width: 180mm !important; box-shadow: 0 6px 30px rgba(0,0,0,.12); padding: 10mm; }

/* v1.6.7 patient sheet — prints well on roll (b/w) and A4/A5 (gold accents) */
.rxs { color: #111; font-family: "Segoe UI", Tahoma, Arial, sans-serif; direction: rtl; line-height: 1.5; background: #fff; }
.rxs .ltr { unicode-bidi: plaintext; }
.rxs-head { display: flex; align-items: center; gap: 10px; justify-content: center; text-align: center; }
.rxs-logo { max-width: 38%; max-height: 22mm; object-fit: contain; }
.rxs-ph b { font-size: 1.35em; display: block; } .rxs-ph div { font-size: .85em; }
.rxs-title { text-align: center; font-weight: 800; font-size: 1.25em; margin: 6px 0 2px; }
.rxs-meta { display: flex; justify-content: space-between; font-size: .9em; border-bottom: 1px dashed #777; padding-bottom: 4px; margin-bottom: 4px; }
.rxs-sec { font-weight: 800; margin: 8px 0 4px; font-size: 1.05em; }
.rxs-drug { border: 1px solid #bbb; border-radius: 6px; padding: 4px 6px; margin-bottom: 5px; break-inside: avoid; }
.rxs-dn { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; } .rxs-dn small { color: #555; font-size: .8em; }
.rxs-no { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.5em; border-radius: 50%; background: #111; color: #fff; font-size: .8em; font-weight: 800; }
.rxs-dd { font-weight: 800; font-size: 1.15em; margin: 2px 0; }
.rxs-cn, .rxs-adv ul { margin: 2px 0; padding-inline-start: 1.2em; font-size: .88em; } .rxs-cn li, .rxs-adv li { margin: 1px 0; }
.rxs-sch { width: 100%; border-collapse: collapse; font-size: .9em; } .rxs-sch th, .rxs-sch td { border: 1px solid #999; padding: 2px 3px; text-align: center; }
.rxs-sch td:first-child { text-align: start; }
.rxs-adv { margin-bottom: 6px; break-inside: avoid; } .rxs-flag { font-size: .85em; border-inline-start: 3px solid #000; padding-inline-start: 6px; margin-top: 2px; }
.rxs-notes { border: 1px dashed #777; padding: 4px 6px; border-radius: 6px; }
.rxs-foot { text-align: center; font-size: .82em; border-top: 1px dashed #777; margin-top: 8px; padding-top: 5px; } .rxs-rm { font-size: .8em; opacity: .65; margin-top: 2px; }
.rxs.roll .rxs-head { flex-direction: column; gap: 2px; }
.rxs.page .rxs-head { justify-content: space-between; text-align: start; border-bottom: 3px solid #d4af37; padding-bottom: 8px; }
.rxs.page .rxs-title { background: linear-gradient(135deg, #f8ecc4, #f3d77a); border-radius: 8px; padding: 6px; margin-top: 10px; }
.rxs.page .rxs-sec { color: #8a6508; border-bottom: 1px solid #e8d79a; padding-bottom: 2px; }
.rxs.page .rxs-drug { border-color: #e2d3a0; background: #fffdf6; padding: 6px 10px; }
.rxs.page .rxs-no { background: #d4af37; color: #1a1406; }
.rxs.page .rxs-sch th { background: #f8ecc4; }
.rxs.page .rxs-flag { border-color: #c1121f; color: #7a0c14; }
@media print { .rxs.page { width: 100% !important; } }
/* v1.6.8 */
.qty input { background: var(--panel); color: var(--ink); font-weight: 700; font-size: 14px; }
.qty button { color: var(--ink); }
:root[data-theme="dark"] .qty input { background: #1b1b21; color: #f5f1e6; }
:root[data-theme="dark"] .qty button { background: #26252b; color: #f3d77a; }
.rxs-life { text-align: center; font-weight: 700; margin-top: 8px; padding: 5px 6px; border: 1px solid #999; border-radius: 8px; }
.rxs.page .rxs-life { border-color: #e2d3a0; background: #fffdf6; color: #6b4f05; }
.rxs.roll { margin: 0 auto; } .rxs.roll .rxs-sch th, .rxs.roll .rxs-sch td { padding: 1px; }
/* v1.6.11 subscription page */
.sub-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.sub-plan { position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.sub-plan.best { border: 2px solid #d4af37; box-shadow: 0 10px 30px rgba(212,175,55,.18); }
.sub-plan.once { background: linear-gradient(180deg, var(--panel), var(--panel2)); }
.sub-tag { position: absolute; top: -11px; inset-inline-start: 14px; background: linear-gradient(135deg, #f3d77a, #d4af37); color: #1a1406; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.sub-name { font-weight: 800; font-size: 16px; }
.sub-price { font-size: 26px; font-weight: 900; color: var(--gold2, #b8901f); direction: ltr; text-align: right; } .sub-price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.sub-plan ul { margin: 0 0 6px; padding-inline-start: 4px; list-style: none; font-size: 13px; line-height: 1.9; flex: 1; }
.sub-bar { height: 10px; border-radius: 999px; background: var(--panel3); overflow: hidden; margin-top: 10px; } .sub-bar span { display: block; height: 100%; border-radius: 999px; }
.sub-cmp td:not(:first-child), .sub-cmp th:not(:first-child) { text-align: center; width: 150px; }
/* v1.6.11 smooth tickers (rAF + translate3d, direction by language) + announcements bar */
.ticker .run { animation: none !important; right: auto !important; left: 0; will-change: transform; backface-visibility: hidden; }
.ticker2 { height: 30px; font-size: 13px; background: linear-gradient(90deg, #1b1608, #2a210a 50%, #1b1608); border-top: 1px solid rgba(212,175,55,.35); }
.ticker2 .lead { background: linear-gradient(135deg, #c1121f, #8a0c16); color: #fff; cursor: pointer; }
.ticker2 .ad { color: #f3d77a; font-weight: 700; } .ticker2 .soon { color: #fcd34d; } .ticker2 .warn { color: #ff8a8f; font-weight: 700; }
.ticker2 .run span, .ticker .run span { margin: 0 34px; }
/* v1.6.11 layout fixes */
.dose-link { display: inline-block; margin-top: 3px; border: 1px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: 999px; font-size: 11px; padding: 1px 8px; cursor: pointer; }
.dose-link:hover { border-color: var(--gold); }
.rxd-tbl select.input.sm { max-width: 120px; }
.rxd-tbl .rx-txt { min-width: 280px; }
.rxd .grid-2 { grid-template-columns: 1fr 1.25fr; }
.tbl.lines td:first-child { max-width: 200px; min-width: 140px; }
.tbl.lines input[data-p] { width: 58px !important; } .tbl.lines input[data-d] { width: 40px !important; } .tbl.lines td, .tbl.lines th { padding-inline: 5px; }
.tbl.lines .exp-slot .badge { white-space: nowrap; display: inline-block; font-size: 11px; line-height: 1.4; }
.tbl.lines .nm { white-space: normal; word-break: break-word; }
.tbl.lines .qty button { width: 24px; } .tbl.lines .qty input { width: 34px; } .tbl.lines td:last-child { padding-inline: 2px; }
.tbl.lines input[data-p] { width: 50px !important; } .tbl.lines select.input.sm { padding-inline: 4px 18px; max-width: 72px; } .tbl.lines [data-rm] { padding: 4px 6px; }
/* v1.6.13 advanced pharmacist assistant */
.clin-terms { background: linear-gradient(90deg, rgba(193,18,31,.10), rgba(212,175,55,.12)); border: 1px solid rgba(193,18,31,.3); border-radius: 10px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.clin-terms a { color: var(--link); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.clin-terms-list { line-height: 1.9; padding-inline-start: 18px; } .clin-terms-list li { margin: 4px 0; }
.clin-offline { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.45); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin: 6px 0; }
.clin-note { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.evidence { background: var(--panel2); border-inline-start: 3px solid var(--gold); border-radius: 6px; padding: 6px 10px; margin: 6px 0; font-size: 12.5px; line-height: 1.6; text-align: left; font-family: "Segoe UI", Arial, sans-serif; }
.evidence p { margin: 3px 0; }
.label-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.label-card details { margin: 4px 0; } .label-card summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.clin-locked { text-align: center; padding: 30px; } .clin-feats { display: inline-block; text-align: start; line-height: 2; font-size: 14px; margin: 10px auto 16px; }

/* =====================================================================
   v1.6.15 — top bar cards · plans · fixed layout · permissions
   ===================================================================== */
/* top bar: equal cards */
.top.top2 { height: 74px; gap: 8px; padding: 0 16px; }
.top.top2 h1 { font-size: 19px; white-space: nowrap; }
.tcard { flex: none; width: 150px; height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); display: flex; align-items: center; gap: 8px; padding: 0 10px;
  overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .2s; position: relative; }
.tcard.click { cursor: pointer; } .tcard.click:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.tcard.hidden { display: none; }
.tcard .tc-ico { font-size: 22px; width: 30px; display: grid; place-items: center; flex: none; }
.tcard .tc-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tcard .tc-body b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .tc-body small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-clock .tc-time { font-size: 17px; font-weight: 800; letter-spacing: .3px; direction: ltr; text-align: right; }
.t-clock .tc-time small { font-size: 11px; color: var(--muted); font-weight: 600; } .t-clock .tc-time b { font-size: 13px; color: var(--gold3); }
:root[data-theme="dark"] .t-clock .tc-time b { color: var(--gold2); }
.t-clock .tc-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.t-lic.pl-gold { background: linear-gradient(135deg, #fff7d6, #f3d77a); border-color: #d4af37; color: #4a3605; } .t-lic.pl-gold small { color: #7a5c0c; }
.t-lic.pl-plat { background: linear-gradient(135deg, #f1f5f9, #cbd5e1 60%, #ddd6fe); border-color: #a78bfa; color: #1e1b4b; } .t-lic.pl-plat small { color: #4c4a7a; }
.t-lic.pl-classic { background: linear-gradient(135deg, #e0ecff, #93c5fd); border-color: #3b82f6; color: #0b2559; } .t-lic.pl-classic small { color: #1e3a8a; }
.t-lic.pl-bad { background: linear-gradient(135deg, #ffe4e6, #fecaca); border-color: var(--red); color: #7f1d1d; }
.t-wx.wx-day { background: linear-gradient(135deg, #e0f2fe, #fef9c3); border-color: #bae6fd; color: #0c4a6e; } .t-wx.wx-day small { color: #0369a1; }
.t-wx.wx-night { background: linear-gradient(135deg, #0f172a, #1e1b4b); border-color: #312e81; color: #e0e7ff; } .t-wx.wx-night small { color: #a5b4fc; }
.wx-svg { width: 32px; height: 32px; overflow: visible; }
.wx-rays { transform-origin: 24px 24px; animation: wxspin 12s linear infinite; }
.wx-moon { animation: floaty 4s ease-in-out infinite; } .wx-stars circle { animation: twinkle 2.4s ease-in-out infinite; } .wx-stars circle:nth-child(2) { animation-delay: .8s; } .wx-stars circle:nth-child(3) { animation-delay: 1.6s; }
.wx-cloud { animation: drift 6s ease-in-out infinite; } .wx-rain { animation: rain 1.1s linear infinite; } .wx-bolt { animation: bolt 2.6s infinite; } .wx-fog { animation: drift 5s ease-in-out infinite; }
@keyframes wxspin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2.5px); } }
@keyframes rain { from { transform: translateY(-3px); opacity: 1; } to { transform: translateY(4px); opacity: .2; } }
@keyframes bolt { 0%, 86%, 100% { opacity: 0; } 88%, 94% { opacity: 1; } }
.t-upd.upd-ok { background: linear-gradient(135deg, #dcfce7, #bbf7d0); border-color: #86efac; color: #14532d; } .t-upd.upd-ok small { color: #166534; }
.t-upd.upd-new { background: linear-gradient(135deg, #fef3c7, #f3d77a); border-color: #d4af37; color: #4a3605; animation: updpulse 2s infinite; } .t-upd.upd-new small { color: #7a5c0c; }
@keyframes updpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,.55); } 50% { box-shadow: 0 0 0 7px rgba(212,175,55,0); } }
:root[data-theme="dark"] .t-upd.upd-ok { background: linear-gradient(135deg, #052e16, #14532d); color: #bbf7d0; border-color: #166534; } :root[data-theme="dark"] .t-upd.upd-ok small { color: #86efac; }
.t-me { width: 160px; } .t-me .photo { width: 36px; height: 36px; } .t-me > span:last-child { line-height: 1.25; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tact { flex: none; width: 64px; height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; font-size: 19px; padding: 0; box-shadow: var(--shadow); transition: transform .18s, box-shadow .2s, color .2s; font-family: inherit; }
.tact:hover { transform: translateY(-2px); box-shadow: var(--glow); color: var(--gold3); }
.tact .tact-l { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tact svg { width: 18px; height: 18px; }
#btn-logout.tact:hover { color: var(--red); }
#btn-update { display: none !important; }
/* order of the cards (right → left in RTL) */
.top.top2 #page-title { order: 0; } .top.top2 .spacer { order: 1; } .top.top2 #clock { order: 2; } .top.top2 #lic-chip { order: 3; } .top.top2 #wx { order: 4; } .top.top2 #upd-card { order: 5; }
.top.top2 #btn-brief { order: 6; } .top.top2 #btn-switch { order: 7; } .top.top2 #btn-theme { order: 8; } .top.top2 #btn-help { order: 9; } .top.top2 #me-chip { order: 10; } .top.top2 #btn-pass { order: 11; } .top.top2 #btn-logout { order: 12; }
.top.top2 #btn-pass { display: none; } .top.top2 #btn-keys { order: 9; } .top.top2 #btn-help { order: 10; }
.top.top2 h1 { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tcard { width: 140px; } .t-me { width: 150px; } .tact { width: 60px; }
@media (max-width: 1560px) { .top.top2 h1 { display: none; } }
@media (max-width: 1380px) { .top.top2 #wx, .top.top2 #btn-keys { display: none; } .tcard { width: 132px; } .t-me { width: 136px; } }
@media (max-width: 1220px) { .top.top2 #btn-theme, .top.top2 #btn-help { display: none; } }
@media (max-width: 1100px) { .top.top2 #upd-card { display: none; } }

/* fixed layout: only lists scroll */
.content.fit { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 12px; }
.content.fit > .pos { height: auto !important; flex: 1; min-height: 0; }
.content.fit > * { flex: none; }
.content.fit > .pos, .content.fit > .card:last-child { flex: 1 1 auto; min-height: 0; }
.content.fit > .card:last-child { display: flex; flex-direction: column; }
.content.fit > .card:last-child > .tbl-wrap { flex: 1; min-height: 0; overflow: auto; }
.content .toolbar { position: sticky; top: -22px; z-index: 4; background: inherit; }
.cart-items { overscroll-behavior: contain; } .results { overscroll-behavior: contain; }

/* dashboard lock */
.dash-lockbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat-locked { cursor: pointer; } .stat-locked:hover { box-shadow: var(--glow); }
.blur-num { filter: blur(6px); user-select: none; letter-spacing: 2px; } .lock-ic { font-size: 13px; }
.chart-locked { height: 220px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; cursor: pointer; background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--panel2) 10px, var(--panel2) 20px); }

/* plans */
.sub-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.my-plan { position: relative; overflow: hidden; }
.my-plan.pl-gold { background: linear-gradient(135deg, #fffaf0, #fbe7a1); border: 1px solid #d4af37; color: #3d2c04; }
.my-plan.pl-plat { background: linear-gradient(135deg, #f8fafc, #e2e8f0 55%, #ede9fe); border: 1px solid #a78bfa; color: #1e1b4b; }
.my-plan.pl-classic { background: linear-gradient(135deg, #eff6ff, #bfdbfe); border: 1px solid #3b82f6; color: #0b2559; }
.my-plan.pl-review, .my-plan.pl-none { background: var(--panel); }
.mp-head { display: flex; align-items: center; gap: 12px; }
.mp-ico { font-size: 40px; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.mp-lbl { font-size: 12px; opacity: .75; } .mp-name { font-size: 24px; font-weight: 900; } .mp-kind { font-size: 13px; opacity: .8; }
.mp-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mp-kv > div { background: rgba(255,255,255,.5); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; } .mp-kv small { opacity: .7; font-size: 11px; } .mp-kv b { font-size: 14px; }
.mp-left { font-weight: 800; margin-top: 6px; }
:root[data-theme="dark"] .mp-ico, :root[data-theme="dark"] .mp-kv > div { background: rgba(255,255,255,.45); }
.ver-card .ver-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ver-row > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.ver-row small { color: var(--muted); font-size: 11px; } .ver-row b { font-size: 20px; }
.ver-status { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel3); font-weight: 700; font-size: 13px; }
.ver-status.ok { background: #dcfce7; color: #14532d; } .ver-status.new { background: #fef3c7; color: #4a3605; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan-card { position: relative; border-radius: 20px; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.plan-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 92px; z-index: 0; }
.plan-card > * { position: relative; z-index: 1; }
.plan-card.pl-gold::before { background: linear-gradient(135deg, #f3d77a, #d4af37 60%, #b8860b); }
.plan-card.pl-plat::before { background: linear-gradient(135deg, #e2e8f0, #94a3b8 50%, #8b5cf6); }
.plan-card.pl-classic::before { background: linear-gradient(135deg, #60a5fa, #2563eb 60%, #1e3a8a); }
.plan-card.best { border: 2px solid #8b5cf6; box-shadow: 0 14px 40px rgba(139,92,246,.22); }
.plan-card.cur { outline: 3px solid var(--green); outline-offset: -3px; }
.plan-ribbon { position: absolute !important; top: 12px; inset-inline-start: -34px; transform: rotate(-35deg); background: #111; color: #fff; font-size: 11px; font-weight: 800; padding: 4px 40px; z-index: 2 !important; }
html[dir="rtl"] .plan-ribbon, .plan-ribbon { transform: rotate(35deg); inset-inline-start: auto; inset-inline-end: -40px; }
.plan-cur { align-self: flex-start; background: var(--green); color: #fff; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 3px 12px; margin-top: 4px; }
.plan-head { display: flex; align-items: center; gap: 10px; color: #fff; min-height: 60px; }
.plan-card.pl-plat .plan-head { color: #1e1b4b; } .plan-card.pl-gold .plan-head { color: #2d2003; }
.plan-ico { font-size: 34px; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.35); }
.plan-name { font-size: 20px; font-weight: 900; } .plan-en { font-size: 12px; opacity: .85; }
.plan-price { margin-top: 6px; } .plan-price b { font-size: 32px; font-weight: 900; } .plan-price small { color: var(--muted); }
.plan-card.pl-gold .plan-price b { color: #a67c00; } .plan-card.pl-plat .plan-price b { color: #6d28d9; } .plan-card.pl-classic .plan-price b { color: #1d4ed8; }
:root[data-theme="dark"] .plan-card.pl-gold .plan-price b { color: var(--gold2); } :root[data-theme="dark"] .plan-card.pl-plat .plan-price b { color: #c4b5fd; } :root[data-theme="dark"] .plan-card.pl-classic .plan-price b { color: #93c5fd; }
.plan-feats { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 2; flex: 1; }
.plan-feats li::before { display: inline-block; width: 22px; font-weight: 900; }
.plan-feats li.y::before { content: "✔"; color: var(--green); } .plan-feats li.n { color: var(--muted); text-decoration: line-through; } .plan-feats li.n::before { content: "✕"; color: var(--red); text-decoration: none; }
.plan-btn { font-weight: 800; color: #fff; border: 0; }
.plan-card.pl-gold .plan-btn { background: linear-gradient(135deg, #f3d77a, #d4af37 60%, #8a6508); color: #1a1406; }
.plan-card.pl-plat .plan-btn { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.plan-card.pl-classic .plan-btn { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.cmp-tbl th small { display: block; font-weight: 500; font-size: 11px; }
.cmp-tbl th.c-gold { color: #a67c00; } .cmp-tbl th.c-plat { color: #6d28d9; } .cmp-tbl th.c-classic { color: #1d4ed8; }
.cmp-tbl td.cmp-v { text-align: center; width: 130px; } .cmp-tbl .yes { color: var(--green); font-weight: 900; font-size: 17px; } .cmp-tbl .no { color: var(--red); font-weight: 900; opacity: .7; }
.cmp-tbl .txt { font-size: 12px; font-weight: 700; } .cmp-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.dist-grid { display: grid; gap: 10px; }
.dist-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--panel2); }
.dist-ava { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #fff; background: linear-gradient(135deg, #d4af37, #8a6508); flex: none; }
.dist-info { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.4; } .dist-info small { color: var(--muted); font-size: 11.5px; } .dist-info .num { font-weight: 700; }
.dist-btns { display: flex; gap: 6px; flex-wrap: wrap; } .dist-wa { background: #16a34a; color: #fff; border: 0; }
.live-pair { display: flex; gap: 16px; align-items: center; } .live-qr { width: 150px; height: 150px; flex: none; background: #fff; border-radius: 12px; padding: 6px; } .live-qr svg { width: 100%; height: 100%; }
.live-lock { padding: 14px; border-radius: 12px; background: var(--panel3); color: var(--muted); }
@media (max-width: 1250px) { .plan-grid { grid-template-columns: 1fr; } .sub-top { grid-template-columns: 1fr; } }

/* users & permissions */
.perm-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel2); }
.perm-gt { font-weight: 800; margin-bottom: 4px; font-size: 13px; } .perm-group .check { display: flex; margin: 4px 0; font-size: 13px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; } .perm-chips span { font-size: 11px; background: var(--panel3); color: var(--muted); border-radius: 99px; padding: 2px 8px; }
.jobs-list { display: grid; gap: 8px; } .job-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.country-card { margin-bottom: 14px; border: 1px solid var(--gold); }

/* cloud backup */
.bk-hero { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--gold-soft), var(--panel2)); border: 1px solid var(--line); margin-bottom: 12px; }
.bk-hero h3 { margin: 0 0 4px; } .bk-hero p { margin: 0; line-height: 1.8; font-size: 13px; }
.bk-ico { font-size: 38px; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--panel); flex: none; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .bk-stat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--panel2); } .bk-stat small { color: var(--muted); }
.rs-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rs-item { text-align: start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-family: inherit; }
.rs-item:hover { border-color: var(--gold); box-shadow: var(--glow); }

/* v1.6.17 — photo reading, connection card, referral */
.pro-tag { font-size: 9.5px; font-weight: 900; background: #111; color: #f3d77a; border-radius: 6px; padding: 1px 5px; margin-inline-start: 4px; vertical-align: middle; }
.scan-tips { margin-top: 12px; font-size: 12.5px; line-height: 1.9; color: var(--muted); text-align: right; background: var(--panel); border-radius: 10px; padding: 8px 12px; }
.ocr-busy { text-align: center; padding: 20px 10px; } .ocr-busy b { display: block; font-size: 16px; margin-top: 12px; }
.ocr-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); margin: 0 auto; animation: wxspin 0.9s linear infinite; }
.ocr-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
.ocr-sum { display: flex; gap: 8px; font-weight: 800; padding-bottom: 8px; } .ocr-sum span { padding: 4px 10px; border-radius: 99px; background: var(--panel3); }
.st-pill { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.st-pill.st-ok { background: #dcfce7; color: #166534; } .st-pill.st-unsure { background: #fef3c7; color: #92400e; } .st-pill.st-new { background: #fee2e2; color: #991b1b; }
.ocr-tbl tr.st-unsure td { background: rgba(251,191,36,.08); } .ocr-tbl tr.st-new td { background: rgba(239,68,68,.08); } .ocr-tbl tr.skip { opacity: .4; }
.warn-in { border-color: #f59e0b !important; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.lines tr.rv-new td { background: rgba(239,68,68,.09); } .lines tr.rv-unsure td { background: rgba(251,191,36,.09); }
.rv-tag { font-size: 11px; font-weight: 800; margin-top: 2px; } .rv-tag.new { color: #dc2626; } .rv-tag.unsure { color: #b45309; }
.rv-banner { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; } .rv-banner a { color: #991b1b; font-weight: 700; }
.id-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; padding: 10px; border: 1px dashed var(--gold); border-radius: 12px; background: var(--gold-soft); }
.filled-ocr { box-shadow: 0 0 0 2px rgba(34,197,94,.35); }
.t-net.net-ok { background: linear-gradient(135deg, #ecfeff, #cffafe); border-color: #67e8f9; color: #164e63; } .t-net.net-ok small { color: #0e7490; }
.t-net.net-phone { background: linear-gradient(135deg, #ede9fe, #ddd6fe); border-color: #a78bfa; color: #3b0764; } .t-net.net-phone small { color: #6d28d9; }
.t-net.net-off { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); border-color: #cbd5e1; color: #334155; } .t-net.net-off small { color: #64748b; }
:root[data-theme="dark"] .t-net.net-off { background: linear-gradient(135deg, #1f2937, #111827); color: #cbd5e1; border-color: #374151; }
.top.top2 #net-card { order: 5; } .top.top2 #upd-card { order: 5; }
.net-mode { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.net-mode.on-yes { background: linear-gradient(135deg, #ecfeff, var(--panel2)); } .net-mode.on-no { background: linear-gradient(135deg, #f1f5f9, var(--panel2)); }
.net-mode p { margin: 2px 0 0; font-size: 13px; color: var(--muted); } .nm-ico { font-size: 32px; }
.net-steps ol { margin: 8px 0; padding-inline-start: 22px; line-height: 2; font-size: 13.5px; }
.ref-card { display: flex; gap: 16px; align-items: center; border-radius: 18px; padding: 16px 18px; background: linear-gradient(135deg, #fff7ed, #fde68a 60%, #fbbf24); color: #3d2c04; border: 1px solid #f59e0b; }
.ref-card h3 { margin: 0 0 4px; } .ref-card p { margin: 0 0 8px; line-height: 1.8; } .ref-gift { font-size: 46px; animation: floaty 3s ease-in-out infinite; }
.ref-code { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .ref-code b { background: rgba(255,255,255,.7); padding: 3px 10px; border-radius: 8px; }
@media (max-width: 1700px) { .top.top2 h1 { display: none; } }

:root[data-theme="dark"] .net-mode.on-yes { background: linear-gradient(135deg, #083344, var(--panel2)); } :root[data-theme="dark"] .net-mode.on-no { background: linear-gradient(135deg, #1f2937, var(--panel2)); }
:root[data-theme="dark"] .t-net.net-ok { background: linear-gradient(135deg, #083344, #164e63); color: #cffafe; border-color: #0e7490; } :root[data-theme="dark"] .t-net.net-ok small { color: #67e8f9; }
:root[data-theme="dark"] .t-net.net-phone { background: linear-gradient(135deg, #2e1065, #4c1d95); color: #ede9fe; border-color: #6d28d9; } :root[data-theme="dark"] .t-net.net-phone small { color: #c4b5fd; }
:root[data-theme="dark"] .rv-banner { background: #450a0a; color: #fecaca; border-color: #7f1d1d; } :root[data-theme="dark"] .rv-banner a { color: #fca5a5; }

/* v1.6.19 unknown barcode dialog */
.ub-head { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:10px; }
.ub-code { font-size:20px; font-weight:800; letter-spacing:1px; padding:4px 12px; border-radius:10px; background:rgba(127,127,127,.12); }
.ub-origin { font-weight:700; padding:3px 10px; border-radius:999px; background:rgba(16,185,129,.14); color:#059669; }
.ub-cloud { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; border-radius:12px; border:1px dashed rgba(127,127,127,.4); }
.ub-cloud.hit { border:1px solid #10b981; background:rgba(16,185,129,.08); }
.ub-cloud.none { opacity:.75; }
.ub-tag { font-size:12px; padding:2px 8px; border-radius:999px; background:rgba(16,185,129,.15); color:#059669; white-space:nowrap; }
.ub-tag.has { background:rgba(127,127,127,.15); color:inherit; opacity:.7; }
.tbl tr.sel td { background:rgba(59,130,246,.10); }
.spin { display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-top-color:transparent; border-radius:50%; animation:ubspin .8s linear infinite; vertical-align:middle; margin-inline-end:6px; }
@keyframes ubspin { to { transform:rotate(360deg); } }

/* v1.6.19 Saudi VAT */
.zt-msg { margin-top:8px; padding:8px 12px; border-radius:10px; font-weight:600; }
.zt-msg.ok { background:rgba(16,185,129,.12); color:#059669; }
.zt-msg.warn { background:rgba(245,158,11,.14); color:#b45309; }

/* ===== v1.6.22 home page ===== */
.hm-hero { display:grid; grid-template-columns: 1.1fr 1fr; gap:16px; align-items:stretch; margin-bottom:14px; }
.hm-hi, .hm-word { border-radius:18px; padding:18px 20px; }
.hm-hi { background:linear-gradient(135deg,#0f766e,#1e3a8a); color:#fff; box-shadow:var(--shadow); }
.hm-greet { font-size:24px; font-weight:800; }
.hm-date { opacity:.85; margin-top:4px; }
.hm-off { margin-top:12px; background:rgba(255,255,255,.14); border-radius:12px; padding:8px 12px; font-weight:600; }
.hm-off.on { background:#fde68a; color:#78350f; }
.hm-word { background:var(--panel); border:1px solid var(--line); font-size:18px; line-height:1.9; font-weight:600; display:flex; align-items:center; box-shadow:var(--shadow); }
.hm-alerts { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.hm-alerts span { background:rgba(239,68,68,.10); color:#b91c1c; border:1px solid rgba(239,68,68,.25); padding:6px 12px; border-radius:999px; font-weight:600; font-size:13px; }
.hm-quick { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin-bottom:14px; }
.hm-q { display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:14px; border:1px solid var(--line); background:var(--panel); cursor:pointer; font:inherit; color:inherit; text-align:start; }
.hm-q:hover { border-color:var(--brand); transform:translateY(-1px); }
.hm-q span { font-size:22px; } .hm-q small { margin-inline-start:auto; opacity:.6; }
.hm-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.hm-card { border-radius:16px; padding:16px 18px; background:var(--panel); border:1px solid var(--line); box-shadow:var(--shadow); }
.hm-h { display:flex; align-items:center; gap:8px; margin-bottom:8px; } .hm-h span { font-size:22px; } .hm-more { margin-inline-start:auto; }
.hm-b { font-size:16px; line-height:1.9; }
.c-work { border-inline-start:5px solid #0ea5e9; } .c-joke { border-inline-start:5px solid #f59e0b; } .c-life { border-inline-start:5px solid #22c55e; } .c-day { border-inline-start:5px solid #a855f7; }
.hm-foot { margin-top:14px; font-size:13px; }
@media (max-width:1100px) { .hm-hero, .hm-grid { grid-template-columns:1fr; } }

/* ===== v1.6.22 about page ===== */
.about-badges { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; } .about-badges span { background:rgba(255,255,255,.12); color:#fff; padding:3px 10px; border-radius:999px; font-size:12px; }
.loc-card { cursor:pointer; padding:0 !important; overflow:hidden; display:flex; flex-direction:column; }
.loc-map { position:relative; } .pa-map { width:100%; display:block; }
.loc-logo { position:absolute; left:14px; bottom:14px; width:56px; height:56px; border-radius:14px; box-shadow:0 6px 18px rgba(0,0,0,.35); border:2px solid #fff; }
.loc-cap { padding:10px 14px; display:flex; flex-direction:column; gap:2px; } .loc-cap span { opacity:.7; font-size:13px; }
.loc-card:hover { outline:2px solid var(--brand); }
.feat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
.feat { background:var(--panel2); border-radius:14px; padding:12px 14px; }
.feat-h { display:flex; align-items:center; gap:8px; margin-bottom:6px; } .feat-h span { font-size:20px; }
.feat ul { margin:0; padding-inline-start:18px; line-height:1.8; font-size:13.5px; }
.job-card { border:1px solid rgba(16,185,129,.35); background:linear-gradient(135deg,rgba(16,185,129,.07),rgba(59,130,246,.06)); }
.job-req { background:var(--panel2); border-radius:12px; padding:10px 14px; margin-bottom:10px; line-height:1.8; font-size:13.5px; } .job-req ul { margin:4px 0; }
.u-del { color:#ef4444; }

/* ===== v1.6.22 red update badge ===== */
.t-upd { position:relative; }
.t-upd.upd-new { border-color:#ef4444 !important; box-shadow:0 0 0 2px rgba(239,68,68,.25); }
.upd-badge { position:absolute; top:-7px; left:-7px; background:#ef4444; color:#fff; font-size:11px; font-weight:800; padding:2px 7px; border-radius:999px; box-shadow:0 0 0 2px var(--bg, #fff); animation:updPulse 1.4s ease-in-out infinite; }
@keyframes updPulse { 0%,100% { transform:scale(1); box-shadow:0 0 0 0 rgba(239,68,68,.6); } 50% { transform:scale(1.12); box-shadow:0 0 0 6px rgba(239,68,68,0); } }

/* v1.6.22 launch offer */
.promo-banner { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; background:linear-gradient(90deg,#dc2626,#f59e0b); color:#fff; border-radius:14px; padding:10px 16px; margin-bottom:12px; font-size:15px; box-shadow:0 6px 18px rgba(220,38,38,.25); }
.promo-banner span { opacity:.92; font-size:13px; }
.plan-promo { display:inline-block; background:#dc2626; color:#fff; font-weight:800; padding:2px 10px; border-radius:999px; font-size:12px; margin:4px 0; }
.plan-old { opacity:.55; font-size:.8em; }

/* v1.6.22 labs */
.lab-entry { display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:linear-gradient(90deg,rgba(14,165,233,.10),rgba(168,85,247,.08)); border:1px solid rgba(14,165,233,.3); border-radius:14px; padding:10px 14px; margin-bottom:12px; }
.lab-tbl td, .lab-tbl th { vertical-align:top; }
.lab-tbl tr.lab-high td { background:rgba(239,68,68,.07); } .lab-tbl tr.lab-low td { background:rgba(245,158,11,.08); }
.lab-tbl tr.lab-c td { background:rgba(239,68,68,.18); font-weight:700; }
.lab-crit { background:#dc2626; color:#fff; border-radius:12px; padding:10px 14px; margin-bottom:10px; font-weight:600; }
.lab-rad { background:var(--panel2); border-radius:12px; padding:10px 14px; margin-top:10px; } .lab-rad li.rl-3 { color:#dc2626; font-weight:700; } .lab-rad li.rl-2 { color:#b45309; font-weight:600; }
.lab-disc { margin-top:10px; font-size:12px; opacity:.75; }
.lab-print { font-family:Tahoma,Arial,sans-serif; color:#000; font-size:12.5px; } .lab-print h2 { margin:6px 0 10px; }
.lab-print .lp-head { display:flex; justify-content:space-between; border-bottom:2px solid #000; padding-bottom:6px; }
.lab-print table { width:100%; border-collapse:collapse; } .lab-print td, .lab-print th { border:1px solid #999; padding:4px 6px; }
.lab-print .lp-notes { margin-top:10px; border:1px dashed #666; padding:8px; } .lab-print .lp-foot { margin-top:14px; text-align:center; font-size:10px; opacity:.6; }

/* v1.6.23 company + network + feature requests */
.co-about { margin:0 0 10px; line-height:1.9; font-size:14px; opacity:.9; }
.net-card { border:1px solid rgba(99,102,241,.35); background:linear-gradient(135deg,rgba(99,102,241,.08),rgba(20,184,166,.07)); }
.net-flow { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:8px; }
.net-flow span { background:var(--panel2); border-radius:12px; padding:8px 12px; font-size:13.5px; font-weight:600; }
.feat-req { border:1px solid rgba(245,158,11,.35); }

/* v1.6.24 RM network */
.net-hero { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; background:linear-gradient(135deg,rgba(99,102,241,.10),rgba(20,184,166,.08)); border:1px solid rgba(99,102,241,.3); border-radius:16px; padding:14px 18px; margin-bottom:12px; }
.net-warn { background:rgba(245,158,11,.12); color:#b45309; border-radius:12px; padding:10px 14px; margin-bottom:10px; font-weight:600; }
.net-sup { display:flex; flex-direction:column; padding:8px 0; border-bottom:1px solid var(--line); }
.inv-code { font-size:18px; letter-spacing:2px; background:var(--panel2); padding:2px 10px; border-radius:8px; }
.nw-res { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.nt-steps { display:grid; grid-template-columns:repeat(6,1fr); gap:6px; }
.nt-step { text-align:center; padding:8px 4px; border-radius:12px; background:var(--panel2); opacity:.55; display:flex; flex-direction:column; gap:2px; font-size:12px; }
.nt-step span { font-size:20px; } .nt-step.done { opacity:1; background:rgba(16,185,129,.12); } .nt-step.cur { outline:2px solid #10b981; }
.pk-ok td { background:rgba(16,185,129,.10); } .pk-part td { background:rgba(245,158,11,.10); }
.pk-tot { margin-top:8px; font-size:15px; }
.net-setup { max-width:760px; }

/* v1.6.27 interactions: colour flash + status bar + Arabic explanation */
@keyframes ixRed{0%,100%{box-shadow:inset 0 0 0 0 rgba(220,38,38,0)}20%,60%{box-shadow:inset 0 0 0 9999px rgba(220,38,38,.22)}40%,80%{box-shadow:inset 0 0 0 9999px rgba(220,38,38,.05)}}
@keyframes ixAmber{0%,100%{box-shadow:inset 0 0 0 0 rgba(245,158,11,0)}30%{box-shadow:inset 0 0 0 9999px rgba(245,158,11,.22)}}
@keyframes ixGreen{0%,100%{box-shadow:inset 0 0 0 0 rgba(22,163,74,0)}30%{box-shadow:inset 0 0 0 9999px rgba(22,163,74,.16)}}
#view.ix-flash-red{animation:ixRed 1.6s ease 2;outline:4px solid #dc2626;outline-offset:-4px}
#view.ix-flash-amber{animation:ixAmber 1.4s ease 1;outline:4px solid #f59e0b;outline-offset:-4px}
#view.ix-flash-green{animation:ixGreen 1.2s ease 1;outline:4px solid #16a34a;outline-offset:-4px}
.ix-status{margin-top:12px;padding:14px 16px;border-radius:12px;font-weight:800;font-size:17px;border:2px solid transparent}
.ix-status.idle{background:#f1f5f9;color:#475569;font-weight:600;font-size:14px}
.ix-status.red{background:#fee2e2;color:#991b1b;border-color:#dc2626}
.ix-status.amber{background:#fef3c7;color:#92400e;border-color:#f59e0b}
.ix-status.green{background:#dcfce7;color:#166534;border-color:#16a34a}
.ix-card .ix-t{margin:8px 0 6px;font-size:16px}
.ix-card.major{border-inline-start:6px solid #dc2626}.ix-card.moderate,.ix-card.minor{border-inline-start:6px solid #f59e0b}
.ix-kv{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;font-size:14px;line-height:1.7;margin-bottom:8px}.ix-kv b{white-space:nowrap}
.ix-src{background:var(--panel2,#f8fafc);color:inherit;border:1px solid var(--line,#e2e8f0);border-radius:8px;padding:8px 10px;font-size:13px;line-height:1.8;margin-bottom:6px}.ix-src p{margin:4px 0}
.ix-src details summary{cursor:pointer;color:#64748b;font-size:12px}
@keyframes ixPulseR{0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.6)}50%{box-shadow:0 0 0 8px rgba(220,38,38,0)}}
.ix-pulse-red{animation:ixPulseR 1.2s ease infinite;background:#fee2e2!important;color:#991b1b!important;border:2px solid #dc2626!important;font-weight:800}
.ix-pulse-amber{background:#fef3c7!important;color:#92400e!important;border:2px solid #f59e0b!important;font-weight:700}
.lab-sum{background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;padding:10px 12px;margin-bottom:10px;line-height:1.8}
.lab-print .lp-list .lp-row{border-bottom:1px dashed #999;padding:3px 0}.lab-print .lp-row.lab-low b,.lab-print .lp-row.lab-high b{text-decoration:underline}
.lab-print .lp-row small{display:block;font-size:.85em}.lab-print .lab-sum{background:none;border:1px solid #000;color:#000}
/* v1.6.27 print box: any page rebuilt to fit the receipt roll */
.roll-doc{font-family:Tahoma,Arial,sans-serif;color:#000;line-height:1.45;direction:rtl;word-wrap:break-word;overflow-wrap:anywhere}
.roll-doc *{max-width:100%!important;box-sizing:border-box}.roll-doc h1,.roll-doc h2{font-size:1.25em;margin:4px 0;text-align:center}.roll-doc h3,.roll-doc h4{font-size:1.1em;margin:4px 0}
.roll-doc table{width:100%!important;border-collapse:collapse;font-size:.9em;table-layout:auto}.roll-doc td,.roll-doc th{padding:2px 3px!important;border:1px solid #000!important}
.roll-doc img{height:auto}.roll-doc [style*="columns"]{columns:1!important}.roll-doc .lab-tbl{display:none}
.roll-doc .receipt{width:100%!important}.roll-doc .lp-head{flex-wrap:wrap}.page-doc{font-family:Tahoma,Arial,sans-serif;color:#000;direction:rtl}
.roll-doc .lab-rad,.page-doc .lab-rad,.roll-doc .lab-crit,.page-doc .lab-crit{background:none!important;color:#000!important;border:1px solid #000!important;border-radius:6px;padding:6px}
.roll-doc .lab-rad *,.page-doc .lab-rad *,.roll-doc .muted,.page-doc .muted,.roll-doc .lab-disc,.page-doc .lab-disc{color:#000!important;background:none!important}
.roll-doc .lab-note{display:none}
.imp-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.tbl th.imp-on{background:var(--gold,#d4a72c);color:#111}

/* v1.7 clinic mode */
.c-hero{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:linear-gradient(135deg,rgba(212,175,55,.14),transparent);border:1px solid var(--line);border-radius:16px;padding:16px 18px;margin-bottom:14px}
.c-stats{grid-template-columns:repeat(5,minmax(0,1fr))}@media(max-width:1100px){.c-stats{grid-template-columns:repeat(2,1fr)}}
.c-file-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;line-height:1.9}
.c-allergy{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5;border-radius:8px;padding:3px 10px;font-weight:700;margin:4px 0;display:inline-block}
.c-visit{border-bottom:1px dashed var(--line);padding:10px 0;line-height:1.9}.c-visit:last-child{border:0}
.c-vitals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.c-rx-item{border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin-bottom:8px;background:var(--panel2)}
.c-alts{margin-top:6px;font-size:13px}.c-alts .chip-btn{margin:2px}
.c-visit-bar{position:sticky;bottom:0;display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:var(--panel,#fff);border-top:1px solid var(--line);padding:10px 4px;margin-top:12px;z-index:5}
.sug-box{position:absolute;inset-inline:0;top:100%;z-index:30;background:var(--panel,#fff);border:1px solid var(--line);border-radius:10px;max-height:300px;overflow:auto;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.sug-box:empty{display:none}.sug{padding:8px 10px;cursor:pointer;border-bottom:1px solid var(--line)}.sug:hover{background:var(--panel2)}
.c-ph{display:flex;justify-content:space-between;gap:10px}
.nav-count{background:#dc2626;color:#fff;border-radius:999px;padding:0 7px;font-size:11px;margin-inline-start:4px}
.rxin-card{margin-bottom:10px}
/* printed prescription */
.rxp{color:#111;background:#fff;font-size:13px;line-height:1.6;border-top:6px solid var(--rxc);padding:4mm 2mm;min-height:180mm;display:flex;flex-direction:column}
.rxp-head{display:grid;grid-template-columns:1fr auto 1fr;gap:4mm;align-items:center;border-bottom:2px solid var(--rxc);padding-bottom:3mm}
.rxp-name{font-size:19px;font-weight:800;color:var(--rxc)}.rxp-title{font-weight:700}.rxp-deg{font-size:11px;color:#444}
.rxp-clinic{text-align:left;font-size:12px}.rxp-clinic b{font-size:14px;color:var(--rxc)}
.rxp-logo{width:22mm;height:22mm;object-fit:contain}.rxp-mark{display:grid;place-items:center;font-size:30px;color:var(--rxc);border:2px solid var(--rxc);border-radius:50%}
.rxp-pt{display:flex;gap:6mm;flex-wrap:wrap;padding:2.5mm 0;border-bottom:1px dashed #999;font-size:12.5px}
.rxp-dx{font-size:12px;padding-top:2mm}
.rxp-body{flex:1;padding:3mm 0;position:relative}.rxp-rx{font-size:30px;font-weight:800;color:var(--rxc);line-height:1}
.rxp-item{margin:2.5mm 0 3mm;padding-inline-start:4mm}.rxp-drug{font-size:15px}.rxp-dose{padding-inline-start:6mm;color:#222}
.rxp-adv{margin-top:4mm;border-top:1px dashed #bbb;padding-top:2mm;font-size:12.5px}
.rxp-ph{display:flex;justify-content:space-between;align-items:center;gap:4mm;border:1.5px solid var(--rxc);border-radius:3mm;padding:2.5mm 3mm;font-size:12px}
.rxp-qr{width:20mm;flex:none}.rxp-qr svg{width:100%;height:auto}
.rxp-foot{display:flex;justify-content:space-between;border-top:2px solid var(--rxc);margin-top:3mm;padding-top:2mm;font-size:11px;color:#333}
.rxp-preview{background:#e5e7eb;padding:10px;border-radius:10px;max-height:72vh;overflow:auto}.rxp-preview .rxp{box-shadow:0 4px 18px rgba(0,0,0,.15);max-width:148mm;margin:0 auto}
.roll-doc .rxp{min-height:0;border-top-width:3px}.roll-doc .rxp-head{grid-template-columns:1fr;text-align:center}.roll-doc .rxp-clinic{text-align:center}.roll-doc .rxp-logo{margin:0 auto}
.page-doc .rxp{min-height:calc(100vh - 20mm)}
.c-visit-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:14px;margin-top:12px;align-items:start}@media(max-width:1000px){.c-visit-grid{grid-template-columns:1fr}}
.c-vitals{grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}

/* v1.8 lab report */
.labrep{font-family:Tahoma,Arial,sans-serif;color:#000;font-size:12.5px;line-height:1.5}
.labrep-h{display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #0f4c81;padding-bottom:3mm}
.labrep-pt{display:flex;flex-wrap:wrap;gap:6mm;padding:2.5mm 0;border-bottom:1px dashed #888;margin-bottom:2mm}
.labrep-g{font-weight:800;color:#0f4c81;margin:3mm 0 1mm;font-size:13.5px}
.labrep-t{width:100%;border-collapse:collapse}.labrep-t th{background:#eef2f7;text-align:left;padding:4px 6px;font-size:11.5px}.labrep-t td{border-bottom:1px solid #ddd;padding:4px 6px;text-align:left}
.labrep-t tr.abn td{font-weight:800}.labrep-c{margin-top:4mm;border:1px solid #999;border-radius:2mm;padding:2.5mm}
.labrep-f{margin-top:5mm;font-size:10.5px;color:#444;border-top:1px solid #ccc;padding-top:2mm;display:flex;justify-content:space-between}
.lab-res td{vertical-align:middle}

/* readable links on light and dark themes (gold text was too faint on white) */
:root { --link: #1d4ed8; }
:root[data-theme="dark"] { --link: #93c5fd; }
a.ext, .muted a, .ix-src a, .card p a, .modal-b p a, a[data-file], .lab-disc a, .disclaimer a { color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* v1.8.3 branches */
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.br-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.br-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.br-num { font-size: 24px; font-weight: 800; margin-top: 10px; }
.fam-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fam-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border, #ddd); cursor: pointer; background: var(--card, transparent); }
.fam-chip.on { border-color: var(--gold, #d4af37); font-weight: 700; }

/* v1.8.4 referrals */
.ref-strip { border: 1px solid var(--gold, #d4af37); margin-bottom: 14px; }
.ref-strip-code { font-size: 17px; }
.ref-strip-code b { font-size: 22px; letter-spacing: 3px; color: var(--gold2, #d4af37); }
.ref-big { text-align: center; margin: 4px 0 10px; }
.ref-big b { display: block; font-size: 34px; letter-spacing: 6px; color: var(--gold2, #d4af37); }
.ref-credit { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.5); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.ref-tbl tr.ref-qualified td:first-child { border-inline-start: 4px solid #10b981; }
.ref-tbl tr.ref-pending td:first-child { border-inline-start: 4px solid #9ca3af; }
.ref-tbl tr.ref-cancelled td:first-child { border-inline-start: 4px solid #ef4444; }
.ref-tbl tr.ref-cancelled .ref-name { text-decoration: line-through; text-decoration-color: #ef4444; text-decoration-thickness: 2px; }
.ref-tbl tr.ref-cancelled td:last-child { color: #ef4444; }
.ref-tbl tr.ref-qualified td:last-child { color: #10b981; font-weight: 700; }
