/* Essence - PWA: offline status pill + installed-app (standalone) behaviour.
   Flat 2.0: solid fill, 1px border, no shadow/gradient/transform. Dark mode via html.dark. */
.pwa-bar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 50%;
    z-index: 9000;
    max-width: calc(100vw - 24px);
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e8c9bf;
    background: #fdf2f0;
    color: #8a3f2d;
    font: 600 12.5px/1.3 Poppins, system-ui, sans-serif;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    translate: -50% 0;
    transition: opacity .2s ease, visibility .2s ease;
}
.pwa-bar.on { opacity: 1; visibility: visible; }
.pwa-bar.ok { border-color: #c5dbb8; background: #f0f7ec; color: #3f6b2a; }
html.dark .pwa-bar { border-color: #5a3a32; background: #2a1d1a; color: #f0b3a3; }
html.dark .pwa-bar.ok { border-color: #3a4f2e; background: #1c2618; color: #b5d9a0; }
@media (prefers-reduced-motion: reduce) { .pwa-bar { transition: none; } }

/* Installed app: no pull-to-refresh / rubber-band that could drop unsaved work, and no tap flash. */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    html, body { overscroll-behavior-y: none; }
    body { -webkit-tap-highlight-color: transparent; }
}

/* ---- install promotion (js/pwa.js) --------------------------------------------------------
   CRM parity: an inline card at the top of the Morning Brief, not a floating overlay.
   Flat 2.0: solid fill, 1px border, no shadow/gradient/transform on controls. */
.pwa-install-card {
    position: relative;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--surface-color, #fff);
    color: var(--text-primary, #1f2933);
    font: 13px/1.35 Poppins, system-ui, sans-serif;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.06));
}
.pwa-install-txt { flex: 1 1 100%; min-width: 0; }
.pwa-install-acts { display: flex; gap: 8px; margin-left: auto; }
.pwa-install-acts .pwa-btn { flex: 0 0 auto; }
.pwa-install-txt b { display: block; font: 700 13px/1.3 Quicksand, Poppins, sans-serif; }
.pwa-install-txt span { display: block; color: var(--text-secondary, #52606d); font-size: 12px; margin-top: 2px; }
.pwa-btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--btn-primary-bg, #5d8a45);
    background: var(--btn-primary-bg, #5d8a45);
    color: #fff;
    font: 700 12.5px/1 Poppins, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.pwa-btn:hover { background: var(--btn-primary-hover, #4c7438); border-color: var(--btn-primary-hover, #4c7438); }
.pwa-btn.ghost { background: transparent; color: var(--text-secondary, #52606d); border-color: var(--border-color, #cbd2d9); }
.pwa-btn.ghost:hover { background: var(--surface-alt, #f1f5f9); }
.pwa-btn:focus-visible { outline: 2px solid var(--btn-primary-bg, #5d8a45); outline-offset: 2px; }
.pwa-sheet {
    position: fixed; inset: 0; z-index: 2147483000;
    display: grid; place-items: center; padding: 20px;
    background: rgba(20, 22, 24, .55);
}
.pwa-sheet-card {
    width: 100%; max-width: 380px;
    background: var(--surface-color, #fff); color: var(--text-primary, #1f2933);
    border-radius: 18px; padding: 22px 20px 18px;
    box-shadow: var(--shadow-md, 0 12px 40px rgba(0,0,0,.3));
    font: 13.5px/1.5 Poppins, system-ui, sans-serif;
}
.pwa-sheet-card h3 { margin: 0 0 6px; font: 700 18px/1.3 Quicksand, Poppins, sans-serif; }
.pwa-sm { margin: 0 0 10px; color: var(--text-secondary, #52606d); font-size: 12.5px; }
.pwa-xs { margin: 10px 0 0; color: var(--text-muted, #7b8794); font-size: 11.5px; }
.pwa-steps { margin: 10px 0 0; padding-left: 20px; color: var(--text-secondary, #52606d); font-size: 12.5px; }
.pwa-steps li { padding: 3px 0; }
.pwa-sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.pwa-sheet-actions .pwa-btn { flex: 1; min-height: 44px; }
html.dark .pwa-install-card { background: #1c1f22; color: #e4e7eb; border-color: #3e4750; }
html.dark .pwa-install-txt span { color: #aeb6bf; }
html.dark .pwa-btn.ghost { color: #cbd2d9; border-color: #3e4750; }
html.dark .pwa-btn.ghost:hover { background: #262b30; }
html.dark .pwa-sheet-card { background: #1c1f22; color: #e4e7eb; }
html.dark .pwa-sm, html.dark .pwa-steps { color: #aeb6bf; }
html.dark .pwa-xs { color: #8a94a0; }
@media (prefers-reduced-motion: reduce) { .pwa-btn { transition: none; } }

/* ---- bell + notification feed (js/push.js) ---- */
.push-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--secondary-color, #e88d78);
    color: #fff;
    font: 700 9.5px/16px system-ui, sans-serif;
    text-align: center;
    pointer-events: none;
}
.push-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: Poppins, system-ui, sans-serif;
}
.push-item + .push-item { margin-top: 2px; }
.push-item:hover { background: var(--surface-alt, #f8fafc); border-color: var(--border-color, #e5e7eb); }
.push-item.unread { background: rgba(151, 184, 129, .12); border-color: rgba(151, 184, 129, .35); }
.push-item-t { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-primary, #1f2933); }
.push-item-b { display: block; font-size: 11.5px; color: var(--text-secondary, #52606d); margin-top: 2px; }
.push-item-a { display: block; font-size: 10px; color: var(--text-muted, #7b8794); margin-top: 3px; }
html.dark .push-item-t { color: #e4e7eb; }
html.dark .push-item-b { color: #aeb6bf; }
html.dark .push-item.unread { background: rgba(168, 204, 143, .12); border-color: rgba(168, 204, 143, .32); }
html.dark .push-item:hover { background: #262b30; border-color: #3e4750; }
