/* Bright Life Care — PWA layer styles (owner: app/PWA agent). Uses base.css tokens only. */

/* ---------- install bottom sheet ---------- */
.pwa-sheet-wrap { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.pwa-backdrop { position: absolute; inset: 0; background: rgba(27,16,48, .45); opacity: 0; transition: opacity .28s ease; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.pwa-sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px; background: var(--surface, #fff); color: var(--ink, #14213d);
  border-radius: 24px 24px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(27,16,48, .22);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); font-family: var(--font, system-ui, sans-serif); }
.pwa-sheet-wrap.open { pointer-events: auto; }
.pwa-sheet-wrap.open .pwa-backdrop { opacity: 1; }
.pwa-sheet-wrap.open .pwa-sheet { transform: translateY(0); }
.pwa-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line, #e6e7ee); margin: 0 auto 14px; }
.pwa-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2, #f3f4f8); color: var(--ink-2, #475569);
  display: grid; place-items: center; cursor: pointer; }
.pwa-x svg { width: 18px; height: 18px; }
.pwa-sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-right: 36px; }
.pwa-appicon { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; flex: none; box-shadow: 0 6px 16px rgba(11,127,145, .28); }
.pwa-appicon img { width: 100%; height: 100%; display: block; }
.pwa-sheet-head h3 { margin: 0 0 3px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.pwa-sheet-head p { margin: 0; font-size: .82rem; color: var(--ink-3, #7f7690); }
.pwa-stars { color: var(--gold, #ef7d00); letter-spacing: 1px; }
.pwa-benefits, .pwa-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.pwa-benefits li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--green-50, #e8f7f9); }
.pwa-benefits .b { width: 36px; height: 36px; border-radius: 11px; background: var(--green, #0b7f91); color: #fff; display: grid; place-items: center; flex: none; }
.pwa-benefits .b svg { width: 18px; height: 18px; }
.pwa-benefits b { display: block; font-size: .9rem; }
.pwa-benefits small { display: block; font-size: .78rem; color: var(--ink-2, #475569); }
.pwa-steps li { display: flex; gap: 12px; align-items: center; font-size: .9rem; line-height: 1.4; }
.pwa-steps .n { width: 28px; height: 28px; border-radius: 50%; background: var(--green, #0b7f91); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; flex: none; }
.pwa-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2, #f3f4f8); color: #0a84ff; vertical-align: middle; }
.pwa-ico svg { width: 15px; height: 15px; }
.pwa-cta { width: 100%; border-radius: 14px; padding: 14px 18px; font-size: 1rem; font-weight: 700; }
.pwa-later { display: block; width: 100%; margin-top: 6px; padding: 12px; border: 0; background: transparent; color: var(--ink-2, #475569); font: 600 .9rem var(--font, inherit); cursor: pointer; }

/* ---------- notification bell (member top bar) ---------- */
.pwa-bell-wrap { position: relative; flex: none; }
.pwa-member .m-top .m-title { min-width: 0; flex: 0 1 auto; }
@media (max-width: 430px) {
  .pwa-member .m-top { gap: 6px; }
  .pwa-member .m-top .chip { padding-left: 8px; padding-right: 8px; min-width: 0; }
  .pwa-bell { width: 34px !important; height: 36px !important; border-radius: 10px; background: transparent; }
}
.pwa-bell { position: relative; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--surface-2, #f3f4f8); color: var(--ink, #14213d);
  display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.pwa-bell:hover { background: var(--green-50, #e8f7f9); color: var(--green, #0b7f91); }
.pwa-bell svg { width: 20px; height: 20px; }
.pwa-bell.has svg { animation: pwa-ring 1.4s ease 1; transform-origin: 50% 10%; }
.pwa-bell-n { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--orange, #f39c12); color: #fff;
  font: 800 .66rem/19px var(--font, sans-serif); text-align: center; box-shadow: 0 0 0 2px var(--surface, #fff); }
@keyframes pwa-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.pwa-np { display: none; position: absolute; right: -52px; top: calc(100% + 10px); width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 100px));
  background: var(--surface, #fff); border: 1px solid var(--line-2, #eeeff4); border-radius: 18px; box-shadow: var(--shadow-lg, 0 10px 30px rgba(27,16,48, .12));
  z-index: 60; overflow: hidden; flex-direction: column; }
.pwa-bell-wrap.open .pwa-np { display: flex; animation: pwa-pop .18s ease; }
@keyframes pwa-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.pwa-np-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2, #eeeff4); }
.pwa-np-h b { font-size: 1rem; }
.pwa-np-all { border: 0; background: transparent; color: var(--green, #0b7f91); font: 700 .8rem var(--font, inherit); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.pwa-np-all:hover { background: var(--green-50, #e8f7f9); }
.pwa-np-push { display: flex; align-items: center; gap: 10px; margin: 10px 12px 2px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, var(--gold-50, #fff3e3), var(--surface, #fff)); border: 1px solid var(--line-2, #b4dbf6); }
.pwa-np-push[hidden] { display: none; }
.pwa-np-push .pi { width: 34px; height: 34px; border-radius: 10px; background: var(--gold, #ef7d00); color: #fff; display: grid; place-items: center; flex: none; }
.pwa-np-push .pi svg { width: 18px; height: 18px; }
.pwa-np-push > span:nth-child(2) { flex: 1; min-width: 0; font-size: .82rem; }
.pwa-np-push b { display: block; } .pwa-np-push small { display: block; color: var(--ink-2, #475569); font-size: .74rem; }
.pwa-np-list { overflow-y: auto; flex: 1; padding: 6px; overscroll-behavior: contain; }
.pwa-ni { display: flex; gap: 12px; padding: 10px; border-radius: 12px; color: var(--ink, #14213d); text-decoration: none; position: relative; }
.pwa-ni:hover { background: var(--surface-2, #f3f4f8); }
.pwa-ni .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--green-50, #e8f7f9); color: var(--green, #0b7f91); display: grid; place-items: center; flex: none; }
.pwa-ni .ic svg { width: 18px; height: 18px; }
.pwa-ni.k-income .ic { background: var(--gold-50, #fff3e3); color: var(--gold, #ef7d00); }
.pwa-ni.k-team .ic { background: var(--info-bg, #dbeafe); color: var(--info, #1d4ed8); }
.pwa-ni.k-rank .ic { background: var(--orange-50, #e8f7f9); color: var(--orange, #f39c12); }
.pwa-ni .pwa-tx { min-width: 0; flex: 1; display: block; padding-right: 12px; }
.pwa-ni .pwa-tx b { display: block; font-size: .86rem; font-weight: 600; line-height: 1.3; }
.pwa-ni.unread .pwa-tx b { font-weight: 800; }
.pwa-ni .pwa-tx small { display: block; font-size: .78rem; color: var(--ink-2, #475569); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pwa-ni .pwa-tx em { display: block; font-style: normal; font-size: .7rem; color: var(--ink-3, #7f7690); margin-top: 3px; }
.pwa-ni.unread::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange, #f39c12); }
.pwa-np-empty { padding: 30px 16px; text-align: center; color: var(--ink-2, #475569); font-size: .88rem; }
.pwa-np-empty span { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; background: var(--green-50, #e8f7f9); color: var(--green, #0b7f91); }
.pwa-np-empty span svg { width: 22px; height: 22px; }
.pwa-np-empty small { display: block; color: var(--ink-3, #7f7690); margin-top: 4px; font-size: .76rem; }
.pwa-np-f { display: block; text-align: center; padding: 12px; border-top: 1px solid var(--line-2, #eeeff4); font-weight: 700; font-size: .85rem; color: var(--green, #0b7f91); text-decoration: none; }
.pwa-np-f:hover { background: var(--green-50, #e8f7f9); }
@media (max-width: 640px) {
  .pwa-bell { width: 38px; height: 38px; }
  .pwa-np { position: fixed; left: 12px; right: 12px; width: auto; top: calc(var(--tb-h, 64px) + env(safe-area-inset-top) + 4px); max-height: calc(100vh - var(--tb-h, 64px) - var(--bt-h, 64px) - 40px); }
}

/* ---------- toast fallback (pages without member.js) ---------- */
.pwa-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink, #14213d); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: .86rem; opacity: 0; transition: .2s; z-index: 1100; pointer-events: none; max-width: calc(100vw - 32px); }
.pwa-toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- member app feel ---------- */
.pwa-member .m-content { animation: pwa-in .24s ease both; }
@keyframes pwa-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pwa-member.pwa-leaving .m-content { opacity: .35; transition: opacity .14s ease; }
@media (prefers-reduced-motion: reduce) { .pwa-member .m-content, .pwa-bell.has svg { animation: none; } }

/* installed app: no tap highlight, no text-selection callouts on chrome, safe areas */
.is-app { -webkit-tap-highlight-color: transparent; }
.is-app body { overscroll-behavior-y: contain; }
.is-app .m-top, .is-app .m-tabbar, .is-app .btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.is-app.pwa-member .m-top { padding-top: env(safe-area-inset-top); height: calc(var(--tb-h, 64px) + env(safe-area-inset-top)); }
.is-app.pwa-member .m-side { padding-top: env(safe-area-inset-top); }
.pwa-member .m-tabbar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.is-app .m-foot { display: none; }

/* pull-to-refresh indicator */
.pwa-ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 8px); width: 40px; height: 40px; margin-top: -48px; border-radius: 50%; background: var(--surface, #fff);
  color: var(--green, #0b7f91); box-shadow: 0 4px 14px rgba(27,16,48, .18); display: grid; place-items: center; z-index: 90; transform: translate(-50%, 0); opacity: 0; transition: opacity .15s; pointer-events: none; }
.pwa-ptr.vis { opacity: 1; }
.pwa-ptr.arm { background: var(--green, #0b7f91); color: #fff; }
.pwa-ptr svg { width: 20px; height: 20px; }
.pwa-ptr.spin svg { animation: pwa-spin .7s linear infinite; }
@keyframes pwa-spin { to { transform: rotate(360deg); } }

/* ---------- notifications page / security page bits ---------- */
.pwa-switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.pwa-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pwa-switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--line, #e6e7ee); transition: .2s; cursor: pointer; }
.pwa-switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s; }
.pwa-switch input:checked + span { background: var(--green, #0b7f91); }
.pwa-switch input:checked + span::before { transform: translateX(20px); }
.pwa-switch input:focus-visible + span { outline: 2px solid var(--gold, #ef7d00); outline-offset: 2px; }

/* ── Inside the Android app / installed app: no website extras ── */
html.is-app .hide-in-app, html.is-app .topstrip, html.is-app .sitefoot, html.is-app .wa-float { display: none !important; }
html.is-app .phero { padding: 22px 0 20px; }
html.is-app .phero .crumbs, html.is-app .phero-art { display: none; }
html.is-app .phero h1 { font-size: 1.55rem; margin: 2px 0 0; }
html.is-app .phero p { display: none; }
html.is-app .auth-side { display: none !important; }
html.is-app .auth-wrap { padding-top: 8px; }
