/* Offline mode (js/offline-queue.js): status pill, "Saved on this device" panel, notices. */

.oq-pill {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 1990;   /* under the confirm dialog (2000), over drawers */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 28px);
    padding: 9px 14px;
    border: 0;
    border-radius: 999px;
    font: 600 12.5px/1.3 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    background: #475569;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
    cursor: pointer;
    text-align: left;
}
.oq-pill[hidden] { display: none; }
.oq-pill.is-offline { background: #334155; }
.oq-pill.is-pending { background: #1d4ed8; }
.oq-pill.is-failed  { background: #b91c1c; }
.oq-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the mobile app has a bottom nav: sit above it */
body:has(.m-bottom-nav) .oq-pill,
body:has(.m-bottom-nav) .oq-panel { bottom: 92px; }

.oq-panel {
    position: fixed;
    left: 14px;
    bottom: 62px;
    z-index: 1995;
    width: min(380px, calc(100vw - 28px));
    max-height: min(60vh, 520px);
    overflow-y: auto;
    display: none;
    padding: 14px;
    background: #fff;
    color: #1f2937;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .25);
    font: 13px/1.45 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.oq-panel.is-open { display: block; }
.oq-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.oq-x { border: 0; background: none; font-size: 22px; line-height: 1; color: #6b7280; cursor: pointer; padding: 0 4px; }
.oq-empty { margin: 0; color: #6b7280; }
.oq-row { padding: 10px 12px; margin-bottom: 8px; border: 1px solid #e5e7eb; border-radius: 12px; }
.oq-row.is-failed { border-color: #fecaca; background: #fef2f2; }
.oq-row-top { display: flex; justify-content: space-between; gap: 8px; }
.oq-label { font-weight: 700; overflow-wrap: anywhere; }
.oq-time { color: #6b7280; white-space: nowrap; }
.oq-status { display: block; color: #4b5563; margin-top: 2px; }
.oq-row.is-failed .oq-status { color: #b91c1c; }
.oq-acts { display: flex; gap: 8px; margin-top: 8px; }
.oq-btn {
    flex: 1;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
}
.oq-btn-danger { border-color: #fca5a5; color: #b91c1c; }
.oq-btn-main { width: 100%; background: #7b1113; border-color: #7b1113; color: #fff; }

.oq-toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 1998;
    transform: translate(-50%, 20px);
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(100vw - 28px);
    padding: 11px 16px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font: 13px/1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.oq-toast.is-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
body:has(.m-bottom-nav) .oq-toast { bottom: 96px; }
.oq-toast-btn { border: 0; background: #fff; color: #111827; border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    .oq-toast { transition: none; }
}
