/* 31-screenshot.css — the floating «تصوير الشاشة» button (features/tools/screenshot.js) and the «بلّغ عن مشكلة» sheet (features/tools/report.js).
   Above every modal / full screen (the highest z-index elsewhere is 100200). The sheet follows the
   device colour scheme (its tokens are redefined for #shot-sheet in 00-tokens.css). */

/* A small tab tucked into the start edge (right in RTL) at ~42% of the screen height: clear of the
   bottom nav, the sticky footers (review, ledger sheet) and the top bars; only 22px of it shows. The button is a 44×44 hit area flush with the edge; the 44px circle inside
   it sits 22px past the edge (clipped). */
.shot-fab {
    position: fixed;
    inset-inline-start: 0;
    top: 42vh;
    z-index: 100300;
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: flex-start;
    border: 0;
    background: transparent;
    color: var(--tx-inverse);
    font-size: .95rem;
    overflow: hidden;
    opacity: .5;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity var(--mo-fast) var(--ease), transform var(--mo-fast) var(--ease);
}
/* The add-transaction sheet rises to ~half the screen: keep the tab above it. */
body.ledger-sheet-open .shot-fab { top: 33vh; }
.shot-fab::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: -22px;
    width: 44px; height: 44px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(15, 23, 42, .38);
}
.shot-fab i { position: relative; width: 22px; text-align: center; font-size: .8rem; }
.shot-fab:focus-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
    .shot-fab:hover { opacity: 1; }
}
.shot-fab:active { transform: scale(.92); opacity: 1; }
.shot-fab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.shot-fab.is-capturing { visibility: hidden; }
@media print { .shot-fab, .shot-sheet { display: none !important; } }

/* ── Preview sheet ── */
#shot-sheet.modal-overlay {
    z-index: 100400;
    align-items: flex-end;
    padding: 0;
    overflow: hidden;
    background: var(--sf-overlay);
}
body.shot-open .toast-container { z-index: 100500; }

.shot-card {
    width: 100%;
    max-width: 560px;
    max-height: 94vh;
    margin: 0 auto;
    display: flex; flex-direction: column; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
    background: var(--sf-raised);
    color: var(--tx-main);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--el-3);
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: shotUp var(--mo-slow) var(--ease);
}
#shot-sheet [hidden] { display: none !important; }
@keyframes shotUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.shot-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.shot-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 800; line-height: var(--lh-tight); color: var(--tx-strong); }
.shot-head h3 i { color: var(--tx-muted); margin-inline-end: var(--sp-1); }
.shot-x {
    width: 44px; height: 44px; flex: 0 0 auto;
    border: 0; border-radius: 50%;
    background: var(--sf-sunken); color: var(--tx-muted);
    font-size: var(--fs-lg); cursor: pointer;
}

.shot-frame {
    flex: 1 1 auto; min-height: 0;
    display: flex; justify-content: center;
    overflow: auto;
    padding: var(--sp-2);
    background: var(--sf-sunken);
    border: 1px solid var(--ln);
    border-radius: var(--radius-sm);
}
.shot-frame img {
    display: block;
    max-width: 100%;
    max-height: 40vh;
    width: auto; height: auto;
    object-fit: contain;
    border-radius: var(--sp-1);
    box-shadow: var(--el-2);
}

.shot-cap {
    margin: 0;
    font-size: var(--fs-xs); line-height: var(--lh-body);
    color: var(--tx-muted);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.shot-note { margin: 0; font-size: var(--fs-sm); color: var(--tx-muted); line-height: var(--lh-body); }
.shot-note i { margin-inline-end: var(--sp-1); }

/* ── Report form ── */
.shot-label { font-size: var(--fs-sm); font-weight: 800; color: var(--tx-strong); }
.shot-desc {
    width: 100%; box-sizing: border-box;
    min-height: 76px; resize: vertical;
    padding: var(--sp-2) var(--sp-3);
    font: inherit; font-size: var(--fs-base); line-height: var(--lh-body);
    color: var(--tx-main); background: var(--sf-card);
    border: 1px solid var(--ln-strong); border-radius: var(--radius-sm);
}
.shot-desc:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.shot-frame { min-height: 64px; flex: 0 1 auto; }
.shot-empty { margin: auto 0; align-self: center; font-size: var(--fs-sm); color: var(--tx-muted); text-align: center; line-height: var(--lh-body); }
.shot-empty i { margin-inline-end: var(--sp-1); }
.shot-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.shot-row .btn { min-height: 44px; }
.shot-check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; font-size: var(--fs-sm); color: var(--tx-main); cursor: pointer; }
.shot-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.shot-note--error { color: var(--st-bad); font-weight: 700; }
.shot-send { width: 100%; min-height: 48px; justify-content: center; font-weight: 800; }
.shot-send:disabled { opacity: .7; cursor: progress; }
.shot-share--hint { outline: 2px solid var(--brand); outline-offset: 1px; }

/* «منع تصوير الشاشة» block in Settings (native-only = display:flex in the app). */
.shot-guard { flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-2); }

.shot-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-2); }
.shot-actions .btn { min-height: 44px; justify-content: center; font-weight: 800; }
#shot-sheet .btn-outline { background: var(--sf-card); color: var(--tx-main); border-color: var(--ln-strong); }
#shot-sheet .btn-primary { background: var(--brand); color: var(--tx-inverse); }
