/* 47-v2-inbox.css — ينتظر قرارك (body.ui-v2): bank-SMS drafts as decision cards inside #bank-sms-screen.
   Plan: docs/plans/2026-11-ui-redesign.md phase 7 · design: prototype #Inbox · code: features/review/inbox*.js.
   Uses the shared v2 components (.v2-pill, .v2-tile, .v2-btn, .v2-chip, .v2-icon-btn, .v2-amt) as they are; only
   the card's own layout lives here. The screen follows the device's dark scheme (docs/DESIGN.md «Dark mode»):
   the v2 colour tokens are pointed at the dark surface tokens inside it. */

.ui-v2 #bank-sms-screen.v2-inbox { background: var(--c-bg); color: var(--c-text); }
.ui-v2 .v2-inbox-body {
    flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
    width: 100%; max-width: 640px; margin-inline: auto;
    padding-bottom: 8px;
}
.ui-v2 .v2-inbox-body > * { flex-shrink: 0; }

/* Header and the «nothing is saved» line */
.ui-v2 .v2-inbox-hd { display: flex; align-items: center; gap: 10px; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 6px; }
.ui-v2 .v2-inbox-h1 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--c-text); }
.ui-v2 .v2-inbox-hd__sub { display: block; font-size: 13px; color: var(--c-text-muted); }
.ui-v2 .v2-inbox-how {
    display: flex; gap: 8px; align-items: flex-start; margin: 8px 16px 0; padding: 10px 12px; border-radius: 14px;
    background: var(--c-primary-soft); color: var(--c-primary); font-size: 12.5px; line-height: 1.6; font-weight: 500;
}
.ui-v2 .v2-inbox-how i { margin-top: 4px; }
.ui-v2 #bank-sms-screen.v2-inbox .na-help { margin: 12px 16px 0; }

/* A decision card */
.ui-v2 .v2-inbox-card { background: var(--c-surface); border-radius: 22px; padding: 14px 16px 16px; margin: 12px 16px 0; }
.ui-v2 .v2-inbox-r1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ui-v2 .v2-inbox-time { font-size: 12px; color: var(--c-text-muted); white-space: nowrap; }
/* «✕ تجاهل»: 44px to tap, drawn as a 32px circle; the negative margin keeps the row's height. */
.ui-v2 .v2-inbox-x {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -10px -10px -8px;
    border: 0; border-radius: 50%; background: none; color: var(--c-text-muted); font-size: 16px; cursor: pointer;
}
.ui-v2 .v2-inbox-x > i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c-surface-2); line-height: 1; }
.ui-v2 .v2-inbox-x:active > i { background: var(--c-border); }
.ui-v2 .v2-inbox-r2 { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ui-v2 .v2-inbox-tile { background: var(--c-surface-2); color: var(--c-text); }
.ui-v2 .v2-inbox-tile--in { background: var(--c-success-soft); color: var(--c-success); }
.ui-v2 .v2-inbox-tile--move { background: var(--money-move-soft); color: var(--money-move); }
.ui-v2 .v2-inbox-title { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-v2 .v2-inbox-sub { display: block; font-size: 12.5px; color: var(--c-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-v2 .v2-inbox-amt { flex: none; font-size: 18px; }
.ui-v2 .v2-inbox-sar { font-size: 11.5px; font-weight: 500; color: var(--c-text-muted); margin-inline-start: 3px; }

/* The raw SMS: two lines, the whole text on tap */
.ui-v2 .v2-inbox-raw { margin-top: 10px; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--c-border-strong); }
.ui-v2 .v2-inbox-raw > summary { list-style: none; cursor: pointer; }
.ui-v2 .v2-inbox-raw > summary::-webkit-details-marker { display: none; }
.ui-v2 .v2-inbox-raw > summary > span {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 12.5px; line-height: 1.55; color: var(--c-text-muted); white-space: pre-line; unicode-bidi: plaintext;
    overflow-wrap: anywhere;
}
.ui-v2 .v2-inbox-raw[open] > summary > span { display: block; -webkit-line-clamp: unset; }

/* What confirming does to an obligation / a receivable */
.ui-v2 .v2-inbox-link {
    display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 14px;
    background: var(--c-surface-2); font-size: 13px; color: var(--c-text); font-weight: 500; line-height: 1.5;
}
.ui-v2 .v2-inbox-link > i { flex: none; color: var(--c-primary); }
.ui-v2 .v2-inbox-link b { font-weight: 700; }

/* Actions, quick categories */
.ui-v2 .v2-inbox-acts { display: flex; gap: 8px; margin-top: 12px; }
.ui-v2 .v2-inbox-acts > .v2-inbox-btn { flex: 1; min-width: 0; min-height: 46px; border-radius: 14px; font-size: 14px; white-space: nowrap; }
.ui-v2 .v2-inbox-acts > .v2-inbox-btn:not(.v2-btn--primary) { background: var(--c-surface-2); border-color: var(--c-surface-2); }
.ui-v2 .v2-inbox-need { font-size: 13px; color: #92400e; font-weight: 600; margin-top: 10px; }
.ui-v2 .v2-inbox-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ui-v2 .v2-inbox-quick > .v2-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* After confirming: one line with «تراجع» */
.ui-v2 .v2-inbox-done {
    display: flex; align-items: center; gap: 10px; background: var(--c-surface); border-radius: 18px;
    padding: 8px 14px; min-height: 54px; margin: 12px 16px 0; font-size: 13.5px; color: var(--c-text-muted);
}
.ui-v2 .v2-inbox-done__ck { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c-success-soft); color: var(--c-success); }
.ui-v2 .v2-inbox-done__ck.is-off { background: var(--c-surface-2); color: var(--c-text-muted); }
.ui-v2 .v2-inbox-done__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-v2 .v2-inbox-done b { color: var(--c-text); font-weight: 600; }
.ui-v2 .v2-inbox-undo {
    flex: none; min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; color: var(--c-primary);
}

/* Empty, loading, error */
.ui-v2 .v2-inbox-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    margin: 28px 16px 0; padding: 28px 20px; border-radius: 22px; border: 1px dashed var(--c-border-strong);
}
.ui-v2 .v2-inbox-empty__ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--c-success-soft); color: var(--c-success); font-size: 22px; }
.ui-v2 .v2-inbox-empty b { font-size: 17px; color: var(--c-text); }
.ui-v2 .v2-inbox-empty span { font-size: 13.5px; color: var(--c-text-muted); }
.ui-v2 .v2-inbox-empty--error .v2-inbox-empty__ic { background: var(--c-danger-soft); color: var(--c-danger); }
.ui-v2 .v2-inbox-empty .v2-btn { margin-top: 8px; }

/* «تأكيد الجاهز (n)»: a bar under the scrolling list (a sibling of .v2-inbox-body, not inside it), so it never
   covers a card. The list fades into it instead of being cut; on phones it sits on the bottom bar (41-v2-nav.css). */
.ui-v2 .v2-inbox-foot {
    position: relative; z-index: 1; flex-shrink: 0;
    width: 100%; max-width: 640px; margin-inline: auto; padding: 10px 16px 12px; background: var(--c-bg);
}
.ui-v2 .v2-inbox-foot::before {
    content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 28px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--c-bg));
}
.ui-v2 .v2-inbox-foot > .v2-btn {
    width: 100%; min-height: 54px; font-size: 16px;
    box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--c-primary) 55%, transparent);
}

/* The bank-SMS settings and log, closed under the cards */
.ui-v2 .v2-inbox-more { margin: 20px 16px 0; background: var(--c-surface); border-radius: 22px; }
.ui-v2 .v2-inbox-more > summary {
    display: flex; align-items: center; min-height: 54px; padding: 0 16px; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--c-text);
}
.ui-v2 .v2-inbox-more__body { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }

/* Dark scheme (this screen only): the v2 tokens follow the dark surface tokens of #bank-sms-screen. */
@media (prefers-color-scheme: dark) {
    .ui-v2 #bank-sms-screen.v2-inbox {
        --c-bg: var(--sf-page); --c-surface: var(--sf-card); --c-surface-2: var(--sf-sunken);
        --c-text: var(--tx-strong); --c-text-muted: var(--tx-muted);
        --c-border: var(--ln); --c-border-strong: var(--ln-strong);
        --c-primary: #a5b4fc; --c-on-primary: #0b1220; --c-primary-soft: #1e1b4b; --c-primary-line: #3730a3;
        --c-success: #34d399; --c-success-soft: #0d2e26;
        --c-warning-soft: #3b2a0a; --c-danger: #f87171; --c-danger-soft: #3b1a1a;
    }
    .ui-v2 #bank-sms-screen.v2-inbox .v2-pill--warn,
    .ui-v2 #bank-sms-screen.v2-inbox .v2-inbox-need { color: #fbbf24; }
}

/* ── قبل قراءة رسائل البنك: the disclosure before Android's SMS prompt (features/native/bank-sms.js _bankSmsConsent) ── */
/* A .modal-overlay (9900), so it opens above the first-run setup too; a bottom sheet on phones (33-sheets.css), centred on desktop. */
.ui-v2 .sms-consent__card { max-width: 520px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); text-align: start; }
.ui-v2 .sms-consent__title { margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.4; color: var(--c-text); }
.ui-v2 .sms-consent__title i { color: var(--c-primary); margin-inline-end: 4px; }
.ui-v2 .sms-consent__lead { margin: 0 0 12px; font-size: 14.5px; line-height: 1.7; color: var(--c-text-muted); }
.ui-v2 .sms-consent__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ui-v2 .sms-consent__list li { padding: 10px 12px; border-radius: 14px; background: var(--c-surface-2); font-size: 14px; line-height: 1.7; color: var(--c-text); }
.ui-v2 .sms-consent__list b { display: block; font-size: 14.5px; }
.ui-v2 .sms-consent__more { margin: 12px 2px 0; font-size: 13px; line-height: 1.7; color: var(--c-text-muted); }
.ui-v2 .sms-consent__more a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
/* Phones: 33-sheets.css makes every window a bottom sheet and sets its bottom padding to the safe area only. */
.ui-v2 .sms-consent__actions { padding-top: 16px; padding-bottom: 8px; }
.ui-v2 .sms-consent__actions .v2-btn { min-height: 52px; font-size: 16px; }
@media (min-width: 769px) {
    .ui-v2 .sms-consent.modal-overlay { align-items: center; padding: 24px; }
    .ui-v2 .sms-consent__card { border-radius: 22px; }
}
