/* ==========================================================================
   Ranjith Energy Digest — PWA Stylesheet (v2.0)
   Isolated module: Only active for PWA features, header bell, and notifications tab.
   Zero interference with existing styles.css.
   ========================================================================== */

/* ── 1. Header Notification Bell & Badge ────────────────────────────────── */
.pwa-bell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition, all 0.2s ease);
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.pwa-bell-btn:hover {
  color: #fff;
  background: var(--accent-blue, #2563eb);
  border-color: var(--accent-blue, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.pwa-bell-btn:active {
  transform: scale(0.95);
}

@media (max-width: 1366px) and (min-width: 861px) {
  .pwa-bell-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 1120px) and (min-width: 861px) {
  .pwa-bell-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 860px) {
  header > .header-inner {
    gap: 8px !important;
  }
  .pwa-bell-btn {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    margin-left: auto !important;
    margin-right: 0 !important;
    font-size: 15px;
  }
  .header-inner .hamburger {
    margin-left: 0 !important;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
}

.pwa-badge-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #ef4444;
  color: #ffffff;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: pwaPulse 2s infinite;
}

@keyframes pwaPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── 2. Standalone PWA Bottom Navigation Bar (LinkedIn Style - Frosted White) ─ */
.pwa-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(52px + max(18px, env(safe-area-inset-bottom, 18px)));
  padding-top: 5px;
  padding-bottom: max(18px, env(safe-area-inset-bottom, 18px));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(226, 232, 240, 0.88);
  z-index: 99999;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 14px rgba(15, 23, 42, 0.05);
  user-select: none;
  -webkit-user-select: none;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .pwa-bottom-bar {
    display: flex;
  }
  body {
    padding-bottom: calc(62px + max(18px, env(safe-area-inset-bottom, 18px))) !important;
  }
  footer {
    display: none !important;
  }
  .section-breadcrumb {
    display: none !important;
  }
  .floating-top-btn {
    bottom: calc(126px + max(18px, env(safe-area-inset-bottom, 18px))) !important;
    right: 20px !important;
  }
  .pwa-quick-share {
    bottom: calc(74px + max(18px, env(safe-area-inset-bottom, 18px))) !important;
    right: 20px !important;
  }
}

body.pwa-standalone-active .pwa-bottom-bar,
html.pwa-standalone-active .pwa-bottom-bar {
  display: flex;
}
body.pwa-standalone-active,
html.pwa-standalone-active {
  padding-bottom: calc(62px + max(18px, env(safe-area-inset-bottom, 18px))) !important;
}
body.pwa-standalone-active footer,
html.pwa-standalone-active footer {
  display: none !important;
}
body.pwa-standalone-active .section-breadcrumb,
html.pwa-standalone-active .section-breadcrumb {
  display: none !important;
}
body.pwa-standalone-active .floating-top-btn,
html.pwa-standalone-active .floating-top-btn {
  bottom: calc(126px + max(18px, env(safe-area-inset-bottom, 18px))) !important;
  right: 20px !important;
}
body.pwa-standalone-active .pwa-quick-share,
html.pwa-standalone-active .pwa-quick-share {
  bottom: calc(74px + max(18px, env(safe-area-inset-bottom, 18px))) !important;
  right: 20px !important;
}

.pwa-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 4px 2px 4px;
  min-height: 48px;
  position: relative;
  transition: color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.08);
  touch-action: manipulation;
  cursor: pointer;
  flex: 1;
}

.pwa-nav-item:active {
  opacity: 0.6;
}

.pwa-nav-icon {
  font-size: 1.15rem;
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: relative;
  color: #64748b;
  transition: color 0.15s ease;
}

.pwa-pulse-dot {
  position: absolute;
  top: 1px;
  right: -2px;
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.pwa-nav-icon .pwa-badge-pill {
  border-color: #ffffff;
}

.pwa-badge-pill.pwa-badge-green {
  background: #10b981;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.pwa-nav-item.active {
  color: #2563eb;
}

.pwa-nav-item.active .pwa-nav-icon {
  color: #2563eb;
}

.pwa-nav-item.active span:last-child {
  font-weight: 700;
  color: #0f172a;
}

.pwa-nav-item.active::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 42px;
  height: 3px;
  background: #2563eb;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.35);
}

/* ── 3. Smart Install Prompt Banner (White & Minimalist) ────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  z-index: 99998;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pwa-install-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}

.pwa-install-content {
  flex: 1;
  min-width: 0;
}

.pwa-install-title {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 800;
  margin: 0 0 2px 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.pwa-install-desc {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pwa-install-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.pwa-install-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.pwa-install-btn:active {
  transform: scale(0.96);
}

.pwa-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.15rem;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.pwa-close-btn:hover {
  color: #475569;
  background: #f1f5f9;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .pwa-install-banner {
    display: none !important;
  }
}
body.pwa-standalone-active .pwa-install-banner {
  display: none !important;
}

/* ── 4. Notifications Feed Page (pwa/notifications.html) ────────────────── */
.pwa-notif-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 16px 80px 16px;
}

.pwa-notif-head {
  margin-bottom: 24px;
}

.pwa-notif-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.pwa-notif-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  margin-bottom: 8px;
}

.pwa-notif-sub {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Push Permission Card */
.pwa-permission-card {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pwa-permission-info h3 {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-permission-info p {
  color: #94a3b8;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.4;
}

.pwa-permission-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pwa-permission-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.pwa-permission-btn.active {
  background: #10b981;
  cursor: default;
}

/* Filter Pills */
.pwa-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.pwa-filter-row::-webkit-scrollbar { display: none; }

.pwa-filter-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pwa-filter-pill.active,
.pwa-filter-pill:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Alert Feed Items */
.pwa-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-alert-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pwa-alert-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.pwa-alert-card.is-unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #2563eb;
}

.pwa-alert-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
}

.pwa-alert-body {
  flex: 1;
  min-width: 0;
}

.pwa-alert-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.72rem;
}

.pwa-alert-source {
  font-weight: 700;
  color: #2563eb;
}

.pwa-alert-time {
  color: #94a3b8;
}

.pwa-alert-origin {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.68rem;
}

.pwa-alert-headline {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pwa-alert-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
  margin: 4px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pwa-alert-type-badge {
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

.pwa-alert-type-badge.type-tool {
  color: #0284c7;
  background: #e0f2fe;
}

.pwa-alert-type-badge.type-presentation {
  color: #7c3aed;
  background: #f3e8ff;
}

.pwa-alert-type-badge.type-insight {
  color: #2563eb;
  background: #eff6ff;
}

.pwa-alert-new-pill {
  background: #ef4444;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.pwa-feed-month-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 24px 0 10px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-feed-month-header:first-child {
  margin-top: 8px;
}

.pwa-feed-month-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

@media (max-width: 640px) {
  .pwa-permission-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .pwa-permission-btn {
    width: 100%;
    justify-content: center;
  }
  .pwa-alert-thumb {
    width: 60px;
    height: 60px;
  }
  .pwa-alert-headline {
    font-size: 0.88rem;
  }
}

/* ── 5. Reading Progress Bar (Articles) ─────────────────────────────────── */
.pwa-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #2563eb, #f59e0b);
  z-index: 999999;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

/* ── 6. Native Quick Share & Floating Action Buttons ───────────────────── */
.pwa-quick-share {
  position: fixed;
  bottom: calc(36px + max(12px, env(safe-area-inset-bottom, 12px)));
  right: 20px;
  background: #ffffff !important;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 999px;
  padding: 8px 18px;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.pwa-quick-share:hover {
  background: #ffffff !important;
  transform: translateY(-2px);
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16);
}

.pwa-quick-share:active {
  transform: scale(0.95);
}

.pwa-quick-share i {
  color: #2563eb !important;
  font-size: 0.95rem;
}

.pwa-quick-share.active {
  color: #059669 !important;
  border-color: #a7f3d0 !important;
}

.pwa-quick-share.active i {
  color: #059669 !important;
}

/* Dynamic clearance when smart install banner is active */
body:has(#pwa-install-banner) .pwa-quick-share {
  bottom: calc(84px + max(12px, env(safe-area-inset-bottom, 12px))) !important;
}

/* On desktop widths without bottom bar (browser mode), position cleanly at bottom right */
@media (min-width: 900px) {
  html:not(.pwa-standalone-active) .pwa-quick-share {
    bottom: 24px !important;
    right: 24px !important;
  }
}

/* ── 7. Clipboard Toast Notification ────────────────────────────────────── */
.pwa-toast {
  position: fixed;
  bottom: calc(80px + max(18px, env(safe-area-inset-bottom, 18px)));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 9px 18px;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  z-index: 999999;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 8. Pull-To-Refresh Indicator (Native App Floating Pill) ─────────────── */
.pwa-ptr-indicator {
  position: fixed;
  top: calc(74px + max(10px, env(safe-area-inset-top, 10px)));
  left: 50%;
  transform: translate(-50%, -65px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.06);
  padding: 8px 18px;
  color: #2563eb;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 99999;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform, opacity;
  opacity: 0;
}

.pwa-ptr-indicator.pulling {
  opacity: 1;
  transition: none; /* Instant 1:1 finger tracking while dragging */
}

.pwa-ptr-indicator.ready {
  opacity: 1;
  color: #059669;
  border-color: #a7f3d0;
  background: rgba(240, 253, 250, 0.98);
}

.pwa-ptr-indicator.ready i {
  transform: rotate(180deg);
  color: #059669;
}

.pwa-ptr-indicator.refreshing {
  opacity: 1;
  transform: translate(-50%, 8px) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #2563eb;
  border-color: #bfdbfe;
  background: rgba(239, 246, 255, 0.98);
}

.pwa-ptr-indicator.refreshing i {
  animation: pwaSpin 0.75s linear infinite;
  color: #2563eb;
}

.pwa-ptr-indicator.success {
  opacity: 1;
  transform: translate(-50%, 8px) !important;
  color: #059669;
  border-color: #a7f3d0;
  background: rgba(240, 253, 250, 0.98);
}

.pwa-ptr-indicator.success i {
  color: #059669;
}

.pwa-ptr-indicator i {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

@keyframes pwaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Mobile Hamburger Drawer — PWA Install Action Card ─ */
.mobile-drawer-install {
  margin: 14px 0 6px 0;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  width: 100%;
  text-align: left;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-install:hover,
.mobile-drawer-install:active {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.mobile-drawer-install-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-drawer-install-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.mobile-drawer-install-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-drawer-install-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.mobile-drawer-install-sub {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  line-height: 1.2;
}

.mobile-drawer-install-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.mobile-drawer-install:hover .mobile-drawer-install-btn {
  background: #1d4ed8;
}

/* Hide install button when running inside standalone installed PWA */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .mobile-drawer-install {
    display: none !important;
  }
}

html.pwa-standalone-active .mobile-drawer-install {
  display: none !important;
}

/* ── PWA Install Step-by-Step Modal ─────────────────────────────────────── */
.pwa-install-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: pwaFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-install-modal-backdrop.closing {
  animation: pwaFadeOut 0.2s ease forwards;
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pwaFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.pwa-install-modal {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  max-width: 400px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
  animation: pwaScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaScaleUp {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pwa-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.pwa-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pwa-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-right: 28px;
}

.pwa-modal-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  flex-shrink: 0;
}

.pwa-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
  line-height: 1.25;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.pwa-modal-subtitle {
  font-size: 0.76rem;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

.pwa-modal-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
}

.pwa-modal-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pwa-modal-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pwa-modal-step-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #334155;
}

.pwa-modal-step-text strong {
  color: #0f172a;
  font-weight: 700;
}

.pwa-modal-icon-inline {
  color: #2563eb;
  margin: 0 2px;
  font-size: 0.85em;
}

.pwa-modal-action-btn {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.pwa-modal-action-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.pwa-modal-action-btn:active {
  transform: scale(0.98);
}

body.pwa-modal-open {
  overflow: hidden;
}

