/* App shell — 2026-10-30 (install banner, iPhone guide, update toast, pull-to-refresh, page progress, splash) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* launch splash: only the first open of the installed app in a session */
html.amd-splash body::after {
  content: 'আমার ডুমুরিয়া'; position: fixed; inset: 0; z-index: 99999; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: calc(50vh - 120px); background: #F7F4EC url('../images/icons/icon-192.png') no-repeat center calc(50% - 50px) / 112px;
  font: 800 28px/1 'Anek Bangla', 'Noto Sans Bengali', sans-serif; color: #0E6E4C; transition: opacity .35s ease;
}
html.amd-splash.amd-splash-out body::after { opacity: 0; pointer-events: none; }

/* top progress bar while the next page loads */
.amd-prog { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 10050; background: linear-gradient(90deg, #0E6E4C, #C6A15B); box-shadow: 0 0 8px rgba(14,110,76,.5); opacity: 0; transition: width .25s ease, opacity .2s; pointer-events: none; }
.amd-prog.on { opacity: 1; }

/* install banner (sits above the mobile quick bar) */
.amd-inst { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 1060; display: flex; align-items: center; gap: 12px;
  background: #0F5136; color: #fff; border-radius: 18px; padding: 12px 12px 12px 14px; box-shadow: 0 14px 34px rgba(0,0,0,.28); transform: translateY(140%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.amd-inst.on { transform: none; }
.amd-inst img { width: 46px; height: 46px; border-radius: 12px; background: #fff; flex: none; }
.amd-inst .t { flex: 1; min-width: 0; line-height: 1.3; }
.amd-inst .t b { display: block; font-size: 15px; }
.amd-inst .t small { display: block; font-size: 12.5px; color: #d9eadf; }
.amd-inst .go { flex: none; border: 0; border-radius: 999px; background: #F5D98B; color: #0A3A27; font-weight: 800; padding: 9px 16px; font-size: 14px; }
.amd-inst .x { flex: none; border: 0; background: transparent; color: #cfe3d6; font-size: 20px; padding: 4px 6px; line-height: 1; }
@media (min-width: 992px) { .amd-inst { left: auto; right: 24px; bottom: 24px; width: 420px; } }

/* bottom sheet (iPhone guide / manual steps) */
.amd-sheet-bg { position: fixed; inset: 0; z-index: 1070; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .25s; }
.amd-sheet-bg.on { opacity: 1; }
.amd-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1071; background: var(--surface, #fff); color: inherit; border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.amd-sheet.on { transform: none; }
.amd-sheet h3 { font-size: 20px; font-weight: 800; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.amd-sheet h3 img { width: 40px; height: 40px; border-radius: 10px; }
.amd-sheet p.s { color: #6b6b6b; font-size: 14px; margin: 0 0 14px; }
.amd-sheet ol { list-style: none; padding: 0; margin: 0 0 16px; counter-reset: s; }
.amd-sheet li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e4dccb; font-size: 15.5px; }
.amd-sheet li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: #0E6E4C; color: #fff; display: grid; place-items: center; font-weight: 800; }
.amd-sheet li i { color: #1677ff; margin: 0 3px; }
.amd-sheet .ok { width: 100%; border: 0; border-radius: 14px; background: #0E6E4C; color: #fff; font-weight: 800; padding: 12px; font-size: 16px; }
.amd-sheet .perks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.amd-sheet .perks span { font-size: 12.5px; background: #EEF5EF; color: #0F5136; border-radius: 999px; padding: 4px 10px; font-weight: 700; }

/* "new version" toast */
.amd-upd { position: fixed; left: 50%; top: 14px; z-index: 10060; transform: translate(-50%, -160%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
  display: flex; align-items: center; gap: 10px; background: #13261E; color: #fff; border-radius: 999px; padding: 8px 8px 8px 16px; box-shadow: 0 12px 30px rgba(0,0,0,.3); font-size: 14px; white-space: nowrap; }
.amd-upd.on { transform: translate(-50%, 0); }
.amd-upd button { border: 0; border-radius: 999px; background: #F5D98B; color: #0A3A27; font-weight: 800; padding: 6px 14px; }
.amd-upd .x { background: transparent; color: #aaa; padding: 4px 8px; }

/* pull-to-refresh (installed app only) */
.amd-ptr { position: fixed; left: 50%; top: 0; z-index: 1062; width: 42px; height: 42px; margin-left: -21px; border-radius: 50%; background: #fff; color: #0E6E4C;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.2); transform: translateY(-60px); font-size: 18px; pointer-events: none; }
.amd-ptr.spin i { animation: amdspin .7s linear infinite; }
@keyframes amdspin { to { transform: rotate(360deg); } }
html.is-app body { overscroll-behavior-y: contain; }
html.is-app { -webkit-tap-highlight-color: transparent; }

[data-theme="dark"] .amd-sheet, html.dark .amd-sheet { background: #16231c; color: #e8efe9; }
@media (prefers-reduced-motion: reduce) { .amd-inst, .amd-sheet, .amd-upd, .amd-prog { transition: none; } }
