:root {
  --ink: #14232b;
  --ink-2: #4a5b64;
  --ink-3: #7b8a92;
  --line: #dfe5e8;
  --bg: #f4f6f5;
  --card: #ffffff;
  --brand: #0e3b43;
  --brand-2: #155a65;
  --accent: #f2b84b;
  --good: #1f7a4d;
  --good-bg: #e4f3ea;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --warn-bg: #fff4dd;
  --radius: 10px;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.6; }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 48px; text-align: center; color: var(--ink-3); }

/* ---------- شاشة الدخول ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 40px; margin: 0; letter-spacing: -0.5px; }
.auth-side h1 span { color: var(--accent); }
.auth-side p { color: #c9dcdf; max-width: 380px; font-size: 17px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; color: #c9dcdf; }
.auth-side li { padding: 6px 0; border-top: 1px solid rgba(255,255,255,.12); }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin: 0 0 4px; font-size: 24px; }
.auth-card .sub { color: var(--ink-2); margin: 0 0 24px; }

/* ---------- الهيكل ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #e6eff0; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-weight: 700; font-size: 20px; color: #fff; }
.brand img { width: 30px; height: 30px; }
.side a { color: inherit; text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.side a:hover { background: rgba(255,255,255,.07); }
.side a.on { background: var(--brand-2); color: #fff; border-inline-start: 3px solid var(--accent); }
.side .soon { opacity: .45; pointer-events: none; }
.side .soon small { margin-inline-start: auto; font-size: 11px; }
.side .grow { flex: 1; }
.who { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 8px 0; font-size: 13px; color: #b9cfd2; }
.who b { display: block; color: #fff; font-size: 14px; }
.who button { margin-top: 10px; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px; padding: 4px 12px; cursor: pointer; }
main { padding: 28px 32px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; }
.head p { margin: 2px 0 0; color: var(--ink-2); }

/* ---------- عناصر ---------- */
.btn { border: 1px solid transparent; background: var(--brand); color: #fff; padding: 9px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { background: #eef3f3; }
.btn.small { padding: 4px 12px; font-weight: 500; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .6; cursor: wait; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
.field input, .field select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: transparent; }
[dir="rtl"] .field input[dir="ltr"], [dir="rtl"] .ltr-cell { text-align: right; }
.ltr-cell { direction: ltr; unicode-bidi: plaintext; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field input:disabled { background: #f1f3f3; color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.err { background: var(--bad-bg); color: var(--bad); padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.err:empty { display: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 2px; margin: 4px 0 14px; }
legend { font-weight: 700; padding: 0 6px; font-size: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; margin-bottom: 12px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.hint { color: var(--ink-3); font-size: 13px; margin: -6px 0 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfb; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .muted, .muted { color: var(--ink-3); font-size: 13px; }
td.actions { white-space: nowrap; text-align: end; }
td.actions .btn + .btn { margin-inline-start: 6px; }
.empty { padding: 48px 16px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eef1f2; color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: #8a5a00; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 16px 18px; }
.stat .n { font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat .l { color: var(--ink-2); font-size: 14px; }
.stat.next { border-style: dashed; background: transparent; }
.stat.next .n { color: var(--ink-3); }
.pad { padding: 18px 20px; }
.pad h2 { margin: 0 0 12px; font-size: 17px; }
.pad h3 { margin: 18px 0 4px; font-size: 15px; }
.narrow { max-width: 520px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.protect { border-color: var(--accent); }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.lang-switch { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.lang-switch:hover { background: #fff; }
.who .lang-switch { color: #fff; border-color: rgba(255,255,255,.25); margin: 0; }
.who-actions { display: flex; gap: 8px; margin-top: 10px; }
.who-actions button { margin-top: 0; }
.below { margin: 16px 0 0; font-size: 14px; }
.below a, .pad a { color: var(--brand-2); font-weight: 600; }
.warn-line { background: var(--warn-bg); color: #7a4f00; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.codes { columns: 2; font: 600 17px/2 Consolas, "Courier New", monospace; background: #f6f8f8; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 16px 10px 40px; margin: 0 0 10px; }
.code-actions { display: flex; gap: 8px; margin-bottom: 14px; }

/* ---------- النافذة ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(10,30,40,.25); }
dialog::backdrop { background: rgba(10, 30, 40, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { margin: 0; font-size: 18px; }
.dlg-head button { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.dlg-body { padding: 18px 20px 4px; max-height: 70vh; overflow: auto; }
.dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 8px; opacity: 0; transition: .2s; pointer-events: none; z-index: 10; }
#toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; align-content: start; }
  .auth-side { padding: 28px 16px; gap: 16px; justify-content: flex-start; }
  .auth-main { place-items: start center; padding-top: 28px; }
  .auth-side ul { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 10px 16px; align-items: center; }
  .brand { padding: 0 8px 0 0; font-size: 17px; width: 100%; }
  .side .grow, .side .soon { display: none; }
  .who { border: 0; padding: 0; margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
  .who-actions { margin-top: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .who button { margin: 0; }
  main { padding: 20px 16px; }
  .row2 { grid-template-columns: 1fr; }
}

/* ---------- التنبيهات ---------- */
.badge { margin-inline-start: auto; background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; padding: 0 6px; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.notes li:last-child { border-bottom: 0; }
.notes li.unread { background: #fffaf0; box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .notes li.unread { box-shadow: inset -3px 0 0 var(--accent); }
.notes time { white-space: nowrap; }

/* ---------- الاتصال والمسودات والنسخ ---------- */
#netbar { position: sticky; top: 0; z-index: 20; background: var(--bad); color: #fff; padding: 10px 16px; text-align: center; font-weight: 600; }
.draft-note { background: var(--warn-bg); color: #7a4f00; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; }
.alert { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; font-weight: 600; }
.sub-head { margin-top: 32px; }
.big-line { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.path { display: block; direction: ltr; text-align: left; font: 12px/1.5 Consolas, monospace; word-break: break-all; color: var(--ink-2); margin-top: 2px; }

/* ---------- 0.4 ---------- */
.btn-danger, .btn.btn-danger { background: var(--bad); }
.btn.btn-danger:hover { background: #8f1d17; }
.consequences { margin: 4px 0 12px; padding-inline-start: 22px; }
.consequences li { margin: 4px 0; color: var(--bad); }
.ok-line { background: var(--good-bg); color: var(--good); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #e9eeee; padding: 4px; border-radius: 10px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tabs button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.update-note { background: #eef7f6; border: 1px solid var(--brand-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.update-note ul { margin: 6px 0 0; padding-inline-start: 20px; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; text-align: start; }

/* ---------- المرحلة 2 ---------- */
.pill.info { background: #e3eef8; color: #1d5b94; }
a.stat { color: inherit; text-decoration: none; display: block; }
a.stat[href]:hover { border-color: var(--brand-2); }
.stat.warn { border-color: #e7b54a; background: #fffaf0; }
.stat.bad { border-color: var(--bad); background: #fdf3f2; }
.stat.warn .n { color: #8a5a00; } .stat.bad .n { color: var(--bad); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { text-decoration: none; color: var(--ink-2); background: #fff; border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.chip b { color: var(--ink); } .chip.on { background: var(--brand); color: #fff; border-color: var(--brand); } .chip.on b { color: var(--accent); }
.filter-form { display: flex; gap: 8px; }
.filter-form input, .filter-form select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 180px; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f7faf9; }
td.num { font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: #e8edec; border-radius: 3px; overflow: hidden; min-width: 60px; display: inline-block; width: 70px; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--good); }
.bar.big { display: block; width: 100%; height: 8px; margin: 4px 0 12px; }
.req-cell { white-space: nowrap; } .req-cell small { margin-inline-start: 6px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--brand-2); text-decoration: none; font-weight: 600; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.facts dt { font-size: 12px; color: var(--ink-3); } .facts dd { margin: 2px 0 0; font-weight: 600; }
.desc { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 12px; margin: 14px 0 0; }
.detail { margin-bottom: 16px; }
.reqs { list-style: none; padding: 0; margin: 0 0 12px; }
.reqs li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.reqs li label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.reqs li input { width: 20px; height: 20px; accent-color: var(--good); }
.reqs li.done label span { color: var(--ink-3); text-decoration: line-through; }
.link-danger { background: none; border: 0; color: var(--bad); cursor: pointer; font-size: 13px; padding: 0 4px; }
.inline-form { display: flex; gap: 8px; } .inline-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.upload-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.upload-bar .btn { cursor: pointer; } .kind-select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; }
.thumb { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 8px; background: #eef2f1 center / cover no-repeat; cursor: zoom-in; display: block; }
.gallery figcaption { font-size: 12px; color: var(--ink-2); margin-top: 4px; display: flex; justify-content: space-between; }
.doclist, .linklist, .history, .fieldlist { list-style: none; padding: 0; margin: 10px 0 0; }
.doclist li, .linklist li, .fieldlist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fieldlist li.off { opacity: .55; }
.linklist a { color: var(--brand-2); }
.history li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
#files-box { margin-bottom: 16px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.row-head h2 { margin: 0; }
.section-title { font-size: 20px; margin: 28px 0 2px; }
textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
@media (max-width: 860px) {
  .side { gap: 2px; padding: 8px 12px; }
  .brand { font-size: 16px; padding-bottom: 4px; }
  .side a { padding: 6px 10px; font-size: 14px; }
  .side a.on { border-inline-start-width: 2px; }
  .who { font-size: 12px; width: 100%; justify-content: space-between; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; } .stat .n { font-size: 22px; }
  .head h1 { font-size: 21px; }
}
@media (max-width: 760px) {
  table.rows thead { display: none; }
  table.rows, table.rows tbody, table.rows tr, table.rows td { display: block; width: 100%; }
  table.rows tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  table.rows td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
  table.rows td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; }
  .filter-form, .filter-form input, .filter-form select { width: 100%; min-width: 0; }
  .filter-form { flex-direction: column; }
}

dialog.wide { width: min(760px, calc(100vw - 32px)); }
.sub-title { font-size: 14px; color: var(--ink-2); margin: 16px 0 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.facts.small dd { font-weight: 500; font-size: 14px; }
.small-list { font-size: 13px; margin: 6px 0 12px; }
.more { margin-top: 12px; }
#imp-preview .stats { margin: 12px 0; }

table.rows td { white-space: nowrap; }
table.rows td.wrap { white-space: normal; min-width: 160px; max-width: 280px; }
.ltr-inline { white-space: nowrap; }
@media (max-width: 760px) { table.rows td, table.rows td.wrap { white-space: normal; max-width: none; min-width: 0; } }
/* قراءة PDF بلدي: مربع اختيار وسحب الملفات */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; margin: 10px 0; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; text-align: center; }
.drop:hover, .drop.over { border-color: var(--brand, #0e7c86); background: rgba(14, 124, 134, .05); }
#nt-list li { gap: 8px; }
#nt-list li > span { line-height: 1.9; flex: 1; min-width: 0; }

/* الاعتراض */
.obj-card textarea[data-body] { font-size: 15px; line-height: 1.8; }
.obj-preview { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; margin: -4px 0 14px; background: #fcfcfa; font-size: 14px; line-height: 1.8; }
.obj-preview:empty { display: none; }
.obj-preview p, .obj-text { margin: 0 0 6px; white-space: pre-line; line-height: 1.8; }
b.big { font-size: 1.08em; }
.warnbox { background: var(--warn-bg); border-radius: 8px; padding: 8px 14px; margin: 0 0 12px; font-size: 14px; }
.warnbox ul { margin: 4px 0 0; padding-inline-start: 18px; }
.past-obj { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.past-obj summary { cursor: pointer; }
.past-obj .obj-text { margin-top: 8px; }
.gallery.pick { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-bottom: 14px; }
.pick-item { position: relative; display: block; cursor: pointer; }
.pick-item input { position: absolute; top: 6px; inset-inline-start: 6px; width: 20px; height: 20px; z-index: 1; }
.pick-item .thumb { cursor: pointer; }
.pick-item input:not(:checked) + .thumb { opacity: .45; }
.obj-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* إضافة كروم */
.steps-list { line-height: 2; padding-inline-start: 22px; margin: 8px 0; }
.copyline { display: flex; gap: 8px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.copyline code { background: var(--bg-2, #f1f4f4); padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.pair-code { font: 700 40px/1.2 Consolas, monospace; letter-spacing: 6px; text-align: center; padding: 14px; border: 2px dashed currentColor; border-radius: 14px; margin: 6px 0; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; line-height: 1.9; }
ul.plain.small { font-size: 12px; }
.stat.good { border-color: #9fd3b4; background: #f3fbf6; } .stat.good .n { color: var(--good); }

/* التقارير */
.rp-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.rp-group h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.rp-card { display: block; padding: 10px 14px; margin-bottom: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.rp-card b { display: block; font-size: 14px; } .rp-card small { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.rp-card.on { border-color: var(--accent, #0f3d46); box-shadow: 0 0 0 2px rgba(15, 61, 70, .12); }
.rp-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; padding: 14px; margin-bottom: 12px; }
.rp-filters .field { margin: 0; } .rp-split { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.rp-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
table.rp-prev tfoot td { font-weight: 700; background: #e8f0f1; }
.filter-form { flex-wrap: wrap; max-width: 100%; } .filter-form select { max-width: 280px; text-overflow: ellipsis; }
a.btn { display: inline-block; text-decoration: none; } a.btn.ghost { color: var(--brand); }

/* رابط الجوال وتثبيت التطبيق (0.13) */
.pl-qr { width: 220px; max-width: 70vw; margin: 8px auto; background: #fff; border-radius: 12px; padding: 6px; }
.pl-qr svg { display: block; width: 100%; height: auto; }
.pl-url { justify-content: center; }
.pl-url code { font-size: 15px; word-break: break-all; }
.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 8px 0; }
.small { font-size: 13px; }
#instbar { position: fixed; z-index: 50; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px;
  background: #0e3b43; color: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 520px; margin-inline: auto; }
#instbar img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
#instbar div { flex: 1; display: flex; flex-direction: column; font-size: 14px; line-height: 1.4; }
#instbar span { font-size: 12.5px; opacity: .85; }
#instbar .btn { background: #fff; color: #0e3b43; flex: none; }
#instbar .x { background: none; border: 0; color: #fff; font-size: 18px; padding: 4px 6px; cursor: pointer; opacity: .8; flex: none; }
body.m #instbar { bottom: calc(var(--tabs-h, 62px) + var(--safe-b, 0px) + 10px); }
/* الشريط ما يغطي أزرار الصفحة (مثل زر الدخول) */
body.has-instbar .auth, body.has-instbar .m-main { padding-bottom: 96px; }
