/* 26-native-app.css — Android app: settings card (version, updates, bank SMS), floating chips, the رسائل البنك screen, app-only tweaks. */

/* ── App-only feel (html[data-platform="android"] is set in the APK build) ── */
html[data-platform="android"] body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;          }
html[data-platform="android"] #btn-install-app { display: none !important; }   
/* ── Settings card pieces ── */
.na-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.na-row .settings-field__label { margin: 0; }
.na-muted { color: var(--text-muted); font-size: 0.85rem; }
.na-mt { margin-top: 10px; }
.na-danger { color: var(--danger-text) !important; border-color: var(--c-danger-line) !important; }
.settings-field__row .btn + .btn { margin-inline-start: 8px; }

.na-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.na-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.na-switch span {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--c-border-strong); border-radius: 999px; transition: background-color var(--mo-base) var(--ease-out);
}
.na-switch span::before {
    content: ""; position: absolute; width: 20px; height: 20px; top: 3px; inset-inline-start: 3px;
    background: var(--c-surface); border-radius: 50%; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform var(--mo-base) var(--ease-out);
}
.na-switch input:checked + span { background: var(--success); }
.na-switch input:checked + span::before { transform: translateX(-20px); }   /* RTL: start is the right edge */
[dir="ltr"] .na-switch input:checked + span::before { transform: translateX(20px); }
.na-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.na-safe {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--c-success-soft);
    border: 1px solid var(--c-success-line);
    color: var(--c-success);
    font-size: 0.8rem;
    line-height: 1.7;
}
.na-safe i { width: 18px; text-align: center; margin-inline-end: 4px; }

.na-help {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--c-warning-soft);
    border: 1px solid var(--c-warning-line);
    color: var(--c-warning);
    font-size: 0.8rem;
    line-height: 1.7;
}
.na-help strong { display: block; }

.na-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.na-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--c-primary-soft); color: var(--c-primary-hover); border: 1px solid var(--c-primary-line);
    font: inherit; font-size: 0.8rem; direction: ltr;
}
.na-chip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-size: 0.75rem; }
.na-chip--suggest { background: var(--c-surface); border-style: dashed; cursor: pointer; }

/* ── Floating chips (new bank SMS, app update) above the bottom nav ── */
.native-chip {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    z-index: 9000;
    display: flex;
    align-items: stretch;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    animation: naChipIn 0.28s ease-out;
}
.native-chip + .native-chip { bottom: calc(134px + env(safe-area-inset-bottom, 0px)); }
.native-chip__main {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border: 0; color: var(--c-on-primary); font: inherit; font-weight: 700; font-size: 0.88rem;
    text-align: start; cursor: pointer; background: transparent;
}
.native-chip__close { border: 0; background: rgba(255, 255, 255, 0.12); color: var(--c-on-primary); padding: 0 14px; cursor: pointer; }
.native-chip--sms { background: var(--c-success); }
.native-chip--update { background: var(--c-primary); }
@keyframes naChipIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 769px) {
    .native-chip { inset-inline: auto 24px; bottom: 24px; max-width: 420px; }
    .native-chip + .native-chip { bottom: 80px; }
}

/* ── Shown only inside the app ── */
.native-only { display: none !important; }
html[data-platform="android"] .native-only { display: flex !important; }
html[data-platform="android"] .web-only { display: none !important; }

/* ── رسائل البنك screen (features/native/bank-sms-screen.js) ──
   Above the bottom bar and chips (9000), below modals (9900) so the review
   opens on top of it. Built on 00-tokens.css; follows the device's dark
   scheme (the tokens are redefined for #bank-sms-screen there). The shared
   pieces it borrows (.btn, .settings-field__*, .na-*) read the legacy colour
   variables, so they are pointed at the tokens inside the screen. */
.bank-sms-screen {
    --text-main: var(--tx-strong); --text-strong: var(--tx-main);
    --text-muted: var(--tx-muted); --text-faint: var(--tx-faint);
    --border: var(--ln); --bg-main: var(--sf-page); --primary-light: var(--sf-sunken); --primary: var(--tx-strong);
    --success-text: var(--st-ok); --danger-text: var(--st-bad); --accent-text: var(--money-move);
    position: fixed; inset: 0; z-index: 9500;
    display: none; flex-direction: column;
    background: var(--sf-page);
    color: var(--tx-main);
    line-height: var(--lh-body);
}
.bank-sms-screen.open { display: flex; }
body.bank-sms-screen-open .native-chip { display: none !important; }
/* On the phone the bottom bar stays: the screen ends on top of it and «الرسائل» is lit (the bar's
   own .active, set by _syncBottomNav). The bar is the way out, so the screen has no top bar there. */
@media (max-width: 768px) {
    .bank-sms-screen { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
    body.kb-open .bank-sms-screen { bottom: 0; }
}
/* scroll, never squash the cards */
.bank-sms-screen .btn-primary { background: var(--brand); color: var(--tx-inverse); }
.bank-sms-screen .btn-outline { background: var(--sf-card); border-color: var(--ln-strong); color: var(--tx-main); }
.bank-sms-screen .btn { font-weight: 700; border-radius: var(--radius-md); }
.bank-sms-screen .settings-field__note { color: var(--tx-muted); font-size: var(--fs-sm); line-height: var(--lh-body); }
.bank-sms-screen .na-help {
    margin-top: 0; padding: var(--sp-3); border-radius: var(--radius-md);
    background: var(--st-warn-soft); border: 0; color: var(--st-warn); font-size: var(--fs-sm);
}
.bank-sms-screen .na-help strong { color: var(--tx-strong); }

/* Cards: one surface, one border, one radius */
.bsms-msg, .bsms-health, .bsms-log, .bsms-tips, .bsms-auto {
    background: var(--sf-card); border: 1px solid var(--ln); border-radius: var(--radius-md); box-shadow: var(--el-1);
}

.bsms-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.bsms-msg { padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.bsms-msg__head { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); margin: calc(-1 * var(--sp-2)) 0; }
.bsms-msg__sender { font-weight: 800; color: var(--tx-main); font-size: var(--fs-sm); }
.bsms-msg__time { color: var(--tx-muted); font-size: var(--fs-xs); }
.bsms-msg__body { white-space: pre-wrap; font-size: var(--fs-md); line-height: var(--lh-body); color: var(--tx-main); word-break: break-word; }
.bsms-msg--done { box-shadow: none; }

/* The raw message under a draft (and on handled ones): two muted lines, all of it on tap */
.bsms-raw > summary {
    display: block; list-style: none; cursor: pointer;
    padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); background: var(--sf-sunken);
}
.bsms-raw > summary::-webkit-details-marker { display: none; }
.bsms-raw .bsms-msg__body { font-size: var(--fs-sm); color: var(--tx-muted); }
.bsms-raw:not([open]) .bsms-msg__body {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* Handled ones: compact — one line of the message, the whole text on tap. */
.bsms-msg--done { padding: var(--sp-2) var(--sp-3); gap: var(--sp-1); }
.bsms-msg--done .bsms-raw > summary { padding: var(--sp-1) var(--sp-2); }
.bsms-msg--done .bsms-raw:not([open]) .bsms-msg__body { -webkit-line-clamp: 1; line-clamp: 1; }
.bsms-raw > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Status pills (docs/DESIGN.md vocabulary) */
.bsms-badge {
    display: inline-flex; align-items: center; gap: var(--sp-1); flex-shrink: 0;
    font-size: var(--fs-xs); font-weight: 700; border-radius: var(--radius-pill); padding: 1px var(--sp-2);
    color: var(--st-neutral); background: var(--st-neutral-soft);
}
.bsms-badge--new { color: var(--st-new); background: var(--st-new-soft); }
.bsms-badge--green { color: var(--st-ok); background: var(--st-ok-soft); }
.bsms-badge--blue { color: var(--money-move); background: var(--money-move-soft); }
.bsms-badge--gray { color: var(--st-neutral); background: var(--st-neutral-soft); }

.bsms-section-title { margin-top: var(--sp-3); font-weight: 800; font-size: var(--fs-sm); color: var(--tx-muted); padding: 0 var(--sp-1); }
.bsms-section-title small { font-weight: 600; color: var(--tx-faint); }
.bsms-section-title--sub { margin-top: var(--sp-1); }
/* Handled messages: the latest 10, the rest behind «عرض الأقدم». */
.bsms-done { display: flex; flex-direction: column; gap: var(--sp-2); }
/* The arrival log is for «why didn't it show?»: closed until asked for. */
.bsms-logbox > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); }
.bsms-logbox > summary::-webkit-details-marker { display: none; }
.bsms-logbox > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .75em; margin-inline-start: auto; }
.bsms-logbox[open] > summary::after { content: '\f077'; }
.bsms-health, .bsms-log { overflow: hidden; }
.bsms-health__row, .bsms-log__row {
    display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm);
    border-bottom: 1px solid var(--ln);
}
.bsms-health__row > i, .bsms-log__row > i { width: 18px; text-align: center; flex-shrink: 0; }
.bsms-health__row:last-child, .bsms-log__row:last-child { border-bottom: 0; }
.bsms-log__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bsms-log__text small { color: var(--tx-muted); font-size: var(--fs-xs); }
.bsms-tone--green > i { color: var(--st-ok); }
.bsms-tone--blue > i { color: var(--money-move); }
.bsms-tone--amber > i { color: var(--st-warn); }
.bsms-tone--gray > i { color: var(--tx-faint); }
.bsms-tips { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); line-height: var(--lh-body); }
.bsms-tips summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; color: var(--tx-strong); }
.bsms-tips ul { padding-inline-start: 18px; margin: 6px 0; }
.bsms-auto { padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); }
