/* Floating card at the bottom centre of the window: capacity bar, then flash progress. */
#flashDock { position:fixed; left:0; right:0; bottom:calc(var(--listen-budget-bar,0px) + max(20px,env(safe-area-inset-bottom))); z-index:70; box-sizing:border-box; width:min(480px,calc(100vw - 24px)); margin-inline:auto; padding:10px 14px 11px; border:1px solid #dce5f0; border-radius:14px; color:#152c48; background:#fff; box-shadow:0 8px 28px rgba(18,45,85,.22); font-size:14px; line-height:1.35; overflow-wrap:anywhere; transition:background-color .2s ease,border-color .2s ease; }
#flashDock[hidden], body.receipt-preview-open #flashDock, body.mobile-menu-open #flashDock { display:none; }
#flashDock.is-changing { overflow:hidden; }
#flashDock[data-tone="danger"], #flashDock[data-tone="bad"] { border-color:#e9a9b4; background:#fff7f8; }
#flashDock[data-tone="warn"] { border-color:#e6cd93; background:#fffbf1; }
#flashDock[data-tone="good"] { border-color:#a9dcc0; background:#f3fbf6; }
#flashDock[data-face="budget"] #flashTaskFeedback, #flashDock[data-face="task"] #flashSoundBudget { display:none; }
body[data-flash-dock="task"] #listenSoundBudget { display:none; }
body.storefront[data-flash-dock] .site-shell { padding-bottom:calc(var(--listen-budget-bar,0px) + var(--flash-dock-height,0px) + 28px); }

.flash-dock-close { position:absolute; top:6px; right:6px; z-index:1; display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:transparent; color:#52627a; font:inherit; font-size:22px; line-height:1; cursor:pointer; }
.flash-dock-close[hidden] { display:none; }
.flash-dock-close:hover { background:rgba(21,44,72,.08); color:#152c48; }
.flash-dock-close:focus-visible, #flashDock button:focus-visible { outline:2px solid #0057d9; outline-offset:2px; }

#flashTaskFeedback[hidden] { display:none; }
#flashTaskFeedback { display:flex; flex-direction:column; gap:7px; }
#flashTaskFeedback .flash-feedback-copy, #flashTaskFeedback .flash-feedback-progress { display:contents; }
#flashLiveNotice[hidden] { display:none; }
#flashLiveNotice { order:1; display:flex; align-items:flex-start; gap:9px; min-height:22px; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; animation:none; }
#flashDock.is-closable #flashLiveNotice strong { padding-right:128px; }
#flashLiveNotice > div { display:grid; gap:2px; min-width:0; }
#flashLiveNotice strong { padding-right:92px; color:#0057d9; font-size:14px; font-weight:700; line-height:1.4; }
#flashLiveNotice small { margin:0; color:#405775; font-size:13px; font-weight:400; line-height:1.4; }
#flashLiveNotice .flash-live-dot { flex:none; width:22px; height:22px; color:#0057d9; background:transparent; box-shadow:none; animation:none; }
#flashLiveNotice[data-state="bad"] :is(strong,.flash-live-dot) { color:#a11e30; }
#flashLiveNotice[data-state="bad"] small { color:#8a1a2b; }
#flashLiveNotice[data-state="good"] :is(strong,.flash-live-dot) { color:#08724c; }
#flashLiveNotice[data-state="warn"] :is(strong,.flash-live-dot) { color:#805600; }
#flashLiveNotice[data-state="warn"] small { color:#593c00; }
#flashTaskFeedback[data-build-pending="true"] #flashLiveNotice :is(strong,.flash-live-dot) { color:#0057d9; }

#flashProgressRegion { order:2; margin:0; padding:0; border:0; background:transparent; }
#flashProgressRegion[data-mode="idle"] { display:none; }
#flashProgressRegion .device-progress-heading { display:block; margin:0; }
#flashProgressLabel { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#flashProgressText { position:absolute; top:11px; right:14px; color:#152c48; font-size:14px; font-weight:700; }
#flashDock.is-closable #flashProgressText { right:46px; }
#flashProgressRegion[data-tone="bad"] #flashProgressText { color:#a11e30; }
#flashProgressRegion[data-tone="good"] #flashProgressText { color:#08724c; }
#flashProgressRegion[data-tone="warn"] #flashProgressText { color:#805600; }
#flashProgressRegion .flash-progress-shell { height:7px; margin:0; border:0; border-radius:7px; background:#dce7f4; box-shadow:none; overflow:hidden; opacity:1; }
#flashProgressRegion .flash-progress-shell span { display:block; height:100%; border-radius:inherit; background:#0066dc; box-shadow:none; transform-origin:left center; }
#flashProgressRegion[data-mode="error"] .flash-progress-shell span { background:#bb263e; }
#flashProgressRegion[data-tone="warn"] .flash-progress-shell span { background:#c47e00; }
#flashProgressRegion[data-mode="complete"][data-tone="good"] .flash-progress-shell span { background:#08724c; }

#flashBuildTimerText { order:3; margin:0; color:#52627a; font-size:13px; font-weight:400; font-variant-numeric:tabular-nums; text-align:left; }
#flashBuildTimerText[hidden], #flashWaitTip[hidden] { display:none; }
#flashWaitTip { order:4; margin:0; color:#52627a; font-size:13px; line-height:1.4; transition:opacity 160ms ease-out; }
#flashWaitTip.is-changing { opacity:0; }
#flashRecovery { order:5; display:grid; gap:8px; margin:3px 0 0; }
#flashRecovery[hidden] { display:none; }
#flashRecovery button { width:100%; min-height:44px; padding:8px 14px; font-size:14px; font-weight:800; }
#flashRecovery button[hidden] { display:none; }
#flashIncidentActions { order:6; display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; margin:0; }
#flashIncidentActions[hidden] { display:none; }
#flashIncidentActions .flash-report-button { width:100%; min-height:40px; margin:0; font-size:14px; font-weight:700; }
#flashIncidentStatus { color:#52627a; font-size:13px; font-weight:400; }

@media (max-width:860px) {
  #flashDock { bottom:calc(var(--listen-budget-bar,0px) + max(10px,env(safe-area-inset-bottom))); padding:8px 12px 9px; }
  #flashProgressText { top:9px; right:12px; }
  #flashDock .listen-budget-guide { min-height:40px; }
  body[data-flash-dock] :is(.zalo-chat-bubble,.store-back-top) { bottom:calc(var(--listen-budget-bar,0px) + var(--flash-dock-height,0px) + 18px) !important; }
}
/* Phones keep the card short: the safety line stays and the rotating tip goes. */
@media (max-width:480px) {
  #flashWaitTip { display:none; }
}
@media (prefers-reduced-motion: reduce) {
  #flashDock { transition:none; }
}
