/* Alreda Web App – شريط التثبيت */
.alrwa-standalone .alrwa-root,
.alrwa-standalone .alrwa-sc-btn,
.alrwa-standalone a[href$="#install-app"],
.alrwa-standalone a[href$="#alreda-install"],
.alrwa-standalone .alreda-install-trigger { display: none !important; }

/* الحاوية */
.alrwa-root { position: fixed; inset: 0; z-index: 99990; pointer-events: none; font-family: inherit; direction: inherit; line-height: 1.4; }
.alrwa-root > * { pointer-events: auto; }
.alrwa-root.dim { pointer-events: auto; background: rgba(15, 23, 20, 0.35); }
.alrwa-root.p-inline { position: relative; inset: auto; z-index: auto; pointer-events: auto; }
.alrwa-root, .alrwa-root *, .alrwa-root *::before, .alrwa-root *::after { box-sizing: border-box; }

/* تصفير تنسيقات الثيم على الأزرار */
.alrwa-root button { all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.alrwa-root button:focus-visible, .alrwa-root .d-tab:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.alrwa-root img { max-width: none !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }

/* أماكن الصندوق */
.awa-box { position: absolute; left: 12px; right: 12px; max-width: 560px; margin: 0 auto; }
.p-top .awa-box { top: calc(12px + env(safe-area-inset-top, 0px)); }
.p-bottom .awa-box { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.p-middle .awa-box { top: 50%; transform: translateY(-50%); }
.p-inline .awa-box { position: relative; left: auto; right: auto; margin: 16px auto; padding: 0 12px; }

.awa-tab { position: absolute; inset-inline-end: 0; }
.awa-fab { position: absolute; inset-inline-end: calc(16px + env(safe-area-inset-right, 0px)); }
.p-top .awa-tab, .p-top .awa-fab { top: calc(16px + env(safe-area-inset-top, 0px)); }
.p-bottom .awa-tab, .p-bottom .awa-fab { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.p-middle .awa-tab, .p-middle .awa-fab { top: 50%; margin-top: -26px; }

/* عناصر مشتركة */
.awa .ib { flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; }
.awa .ib.on { background: var(--awa-ibg); padding: 6px; }
.awa .ib img { width: var(--awa-isz) !important; height: var(--awa-isz) !important; object-fit: contain; border-radius: 6px; display: block; }
.awa .cp { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.awa .t { font-size: 14px !important; font-weight: 700 !important; line-height: 1.4 !important; }
.awa .s { font-size: 12.5px !important; line-height: 1.5 !important; opacity: 0.78; }
.awa .bt { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--awa-bb); color: var(--awa-bf); font-size: 13.5px; font-weight: 700; line-height: 1; white-space: nowrap; text-align: center; transition: transform 150ms ease-out, opacity 150ms ease-out; }
.awa .bt:active { transform: scale(0.97); }
.awa .x { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: inherit; opacity: 0.55; transition: opacity 150ms ease-out; }
.awa .x:hover { opacity: 1; }

/* 1. إطار بسيط */
.d-frame { display: flex; align-items: center; gap: 10px; background: var(--awa-bg); color: var(--awa-fg); border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 16px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }

/* 2. كبسولة */
.d-pill { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; margin-inline: auto; background: var(--awa-bg); color: var(--awa-fg); border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 999px; padding-block: 6px; padding-inline: 8px 6px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14); }
.d-pill .ib.on { padding: 4px; }
.d-pill .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-pill .bt { min-height: 38px; }
.d-pill .x { width: 34px; height: 34px; }

/* 3. نص فقط */
.d-text { display: flex; align-items: center; gap: 8px; background: var(--awa-bg); color: var(--awa-fg); border-block: 1px solid rgba(0, 0, 0, 0.08); padding: 8px 12px; }
.d-text .go { flex: 1 1 auto; min-width: 0; min-height: 36px; display: flex; align-items: center; color: var(--awa-bb); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.p-top .d-text, .p-bottom .d-text, .p-middle .d-text { border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12); }

/* 4. كتلة ملوّنة */
.d-block { display: flex; align-items: center; gap: 10px; background: var(--awa-bb); color: var(--awa-bf); border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18); }
.d-block .bt { background: var(--awa-bf); color: var(--awa-bb); }
.d-block .ib.on { background: rgba(255, 255, 255, 0.18); }

/* 5. لسان جانبي */
.d-tab { display: flex; align-items: center; gap: 8px; background: var(--awa-bg); color: var(--awa-fg); border: 1px solid rgba(0, 0, 0, 0.1); border-inline-end: 0; border-start-start-radius: 14px; border-end-start-radius: 14px; padding-block: 8px; padding-inline: 10px 8px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16); cursor: pointer; }
.d-tab .t { font-size: 13px !important; }
.d-tab .x { width: 28px; height: 28px; }

/* 6. زر عائم */
.awa .d-fab { display: flex; align-items: center; height: 54px; min-width: 54px; padding: 0 14px; border-radius: 999px; background: var(--awa-bb); color: var(--awa-bf); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22); overflow: hidden; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.d-fab .ib.on { background: rgba(255, 255, 255, 0.2); padding: 3px; }
.d-fab .ib img { width: 26px !important; height: 26px !important; }
.d-fab .lab { max-width: 0; opacity: 0; transition: max-width 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease-out, margin 240ms ease-out; }
.d-fab:focus-visible .lab { max-width: 200px; opacity: 1; margin-inline-start: 8px; }
@media (hover: hover) { .d-fab:hover .lab { max-width: 200px; opacity: 1; margin-inline-start: 8px; } }

/* شاشة ضيقة: الزر ينزل سطر لوحده، ونص الكبسولة يلف على سطرين */
@media (max-width: 600px) {
  .d-pill .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px !important; line-height: 1.3 !important; }
  .d-frame, .d-block { flex-wrap: wrap; }
  .d-frame .cp, .d-block .cp { flex-basis: calc(100% - 100px); }
  .d-frame .bt, .d-block .bt { order: 3; flex: 1 1 100%; }
  .d-frame .x, .d-block .x { order: 2; }
}
.alrwa-narrow .d-pill .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3 !important; }
.alrwa-narrow .d-frame, .alrwa-narrow .d-block { flex-wrap: wrap; }
.alrwa-narrow .d-frame .cp, .alrwa-narrow .d-block .cp { flex-basis: calc(100% - 100px); }
.alrwa-narrow .d-frame .bt, .alrwa-narrow .d-block .bt { order: 3; flex: 1 1 100%; }
.alrwa-narrow .d-frame .x, .alrwa-narrow .d-block .x { order: 2; }

/* حركة الظهور */
.anim .awa-box, .anim .awa-tab, .anim .awa-fab { transition: opacity 200ms ease-out, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.anim.dim { transition: background-color 200ms ease-out; }
.anim.pre.dim { background: rgba(15, 23, 20, 0); }
.anim.pre .awa-box, .anim.pre .awa-tab, .anim.pre .awa-fab { opacity: 0; }
.anim.pre.p-bottom .awa-box, .anim.pre.p-bottom .awa-fab { transform: translateY(16px); }
.anim.pre.p-top .awa-box, .anim.pre.p-top .awa-fab { transform: translateY(-16px); }
.anim.pre.p-middle .awa-box { transform: translateY(-50%) scale(0.96); }
.anim.pre.p-inline .awa-box { transform: translateY(8px); }
.anim.pre .awa-tab { transform: translateX(14px); }
[dir="rtl"] .anim.pre .awa-tab, .rtl .anim.pre .awa-tab { transform: translateX(-14px); }

/* زر الشورت كود */
.alrwa-sc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 12px; background: #0e7c6b; color: #fff !important; font-weight: 700; text-decoration: none !important; line-height: 1; transition: transform 150ms ease-out, opacity 150ms ease-out; }
.alrwa-sc-btn:active { transform: scale(0.97); }
@media (hover: hover) { .alrwa-sc-btn:hover { opacity: 0.9; } }

@media (prefers-reduced-motion: reduce) {
  .alrwa-root, .alrwa-root * { transition: none !important; }
  .anim.pre .awa-box, .anim.pre .awa-tab, .anim.pre .awa-fab { transform: none !important; }
  .anim.pre.p-middle .awa-box { transform: translateY(-50%) !important; }
}
