/* v878 - every pop-up opened from the List toolbar, rebuilt as one family (brand tokens from css/399 / css/415).
   PHONES / TABLETS (<=900px): data panels (Two-way sync, Raw sheet, Excel), their result message and the "Vacant since" menu are
   bottom sheets on <body> (js/418 moves them there while open) with a dim backdrop, a title row and a close button; the toast goes to the top.
   DESKTOP: panels keep their dropdown place under the icon; only fonts / fields / status card are tidied.
   Remove this link + js/418 to go back to v877. */

/* ---------- fields + status card (all sizes) ---------- */
.avdp-panel input[type=url],.avdp-panel input[type=text]{font-family:var(--font-body,system-ui,-apple-system,"Segoe UI",sans-serif);direction:ltr;text-align:left;text-overflow:ellipsis;font-style:normal}
.avdp-panel input::placeholder{font-family:inherit;font-style:normal;opacity:.55}
.avdp-panel .avdp-secret{-webkit-text-security:disc;text-security:disc}
.avdp-panel .avdp-f{display:block;margin:2px 0 -4px;font:800 11px/1 var(--font-body,system-ui,sans-serif);letter-spacing:.06em;text-transform:uppercase;color:var(--c-grey-600)}
.avdp-panel .avdp-note{font-size:12px;line-height:1.4;color:var(--c-grey-600)}
.avdp-st{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:10px 12px;border-radius:12px;background:var(--c-grey-100);border:1px solid var(--c-grey-300);border-left:4px solid var(--c-metallic);color:var(--c-starlight)}
.avdp-st.is-ok{border-left-color:var(--c-success);background:rgba(23,114,69,.07)}
.avdp-st.is-bad{border-left-color:var(--c-danger);background:rgba(192,57,43,.07)}
.avdp-st.is-hold{border-left-color:var(--c-warning);background:rgba(138,90,11,.08)}
.avdp-st .avdp-head{display:flex;align-items:center;gap:8px}
.avdp-st .avdp-head b{font-size:14px}
.avdp-st .avdp-head .avdp-dot{flex:none;border-color:transparent}
.avdp-st .avdp-mode{font-size:12px;color:var(--c-grey-600);padding:2px 8px;border-radius:999px;background:rgba(var(--c-starlight-rgb),.07)}
.avdp-st .avdp-msg{font-size:13.5px;line-height:1.4;overflow-wrap:anywhere}
.avdp-st .avdp-hint{font-size:12.5px;line-height:1.45;color:var(--c-grey-600)}
.avdp-st .avdp-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.avdp-st .avdp-btns button{height:34px;border-radius:10px;font-size:13px}
.bhsh-x{display:none}

/* ---------- toast: never under a sheet ---------- */
@media(max-width:900px){
  #toastHost{top:calc(env(safe-area-inset-top,0px) + 10px)!important;bottom:auto!important;left:12px!important;right:12px!important;align-items:center;pointer-events:none}
  #toastHost .toast{pointer-events:auto;max-width:min(520px,100%)}
}

/* ---------- sheets ---------- */
@media(max-width:900px){
  #bhSheetHost{position:fixed;inset:0;z-index:1450;pointer-events:none}
  #bhSheetHost .bhsh-scrim{position:absolute;inset:0;background:rgba(var(--c-starlight-dark-rgb,15,32,54),.5);opacity:0;pointer-events:none;transition:opacity .22s ease}
  #bhSheetHost.has-panel .bhsh-scrim{opacity:1;pointer-events:auto}
  #bhSheetHost .avdp-panel,#bhSheetHost .avd-status,body>.bhvd-menu{
    position:fixed!important;left:12px!important;right:12px!important;top:auto!important;
    bottom:calc(12px + env(safe-area-inset-bottom,0px) + var(--bhsh-kb,0px))!important;width:auto!important;max-width:520px;margin:0 auto!important;
    max-height:calc(100dvh - 110px - var(--bhsh-kb,0px));overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;box-sizing:border-box;
    padding:18px 16px 16px!important;border-radius:22px!important;background:var(--c-white,#fff)!important;border:1px solid rgba(var(--c-starlight-rgb),.14)!important;border-top:3px solid var(--c-sand,#cea577)!important;
    box-shadow:0 -12px 44px -12px rgba(var(--c-starlight-dark-rgb,15,32,54),.6)!important;color:var(--c-starlight,#162d4c);pointer-events:auto;
    animation:bhshUp .26s cubic-bezier(.2,.9,.3,1.05)}
  #bhSheetHost .avdp-panel{display:flex!important;gap:12px}
  #bhSheetHost .avdp-panel.bhsh-col{flex-direction:column}
  #bhSheetHost .avdp-panel.bhsh-row{flex-direction:row;flex-wrap:wrap;align-items:stretch}
  #bhSheetHost .avd-status[hidden]{display:none!important}
  #bhSheetHost .avd-status{z-index:2}
  #bhSheetHost .avd-status::before{content:"Result";display:block;margin:0 0 8px;font:800 15px/1.2 var(--font-body,system-ui,sans-serif);color:var(--c-starlight)}
  #bhSheetHost .avd-status .avd-x{top:12px;right:12px;width:32px;height:32px;border-radius:50%;background:var(--c-grey-200);color:var(--c-starlight);font-size:14px}
  #bhSheetHost .avd-st{font-size:14px;line-height:1.5;padding:10px 12px;border-radius:12px;background:var(--c-grey-100);border:1px solid var(--c-grey-300);overflow-wrap:anywhere}
  /* header row */
  #bhSheetHost .avdp-panel .avd-txt{flex:1 0 100%;padding-right:40px;margin:0;display:flex;flex-direction:column;align-items:flex-start;gap:3px}
  #bhSheetHost .avdp-panel .avd-txt b{font-size:17px;line-height:1.2}
  #bhSheetHost .avdp-panel .avd-txt small{font-size:12.5px;color:var(--c-grey-600)}
  #bhSheetHost .bhsh-x{display:inline-flex;align-items:center;justify-content:center;position:absolute;top:12px;right:12px;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:var(--c-grey-200);color:var(--c-starlight);font-size:14px;cursor:pointer;-webkit-tap-highlight-color:transparent}
  #bhSheetHost .bhsh-x:active{transform:scale(.92)}
  /* controls */
  #bhSheetHost .avdp-panel input[type=url],#bhSheetHost .avdp-panel input[type=text]{height:46px;font-size:16px;padding:0 12px;border-radius:12px;border:1.5px solid var(--c-grey-300);background:var(--c-grey-100);color:var(--c-starlight)}
  #bhSheetHost .avdp-panel input:focus{outline:none;border-color:var(--c-sand);background:var(--c-white)}
  #bhSheetHost .avdp-panel .avd-go{flex:1 1 0;height:46px;padding:0 16px;justify-content:center;font-size:15px;border-radius:12px;background:var(--c-starlight);color:var(--c-white);align-self:stretch}
  #bhSheetHost .avdp-panel .avd-mini{flex:none;width:46px;height:46px;border-radius:12px;font-size:15px;align-self:stretch}
  #bhSheetHost .avdp-panel .avd-pop{flex:1 0 100%;display:flex;flex-direction:column;gap:8px;position:static;padding:0;border:0;box-shadow:none;background:none;width:auto}
  #bhSheetHost .avdp-panel .avd-pop[hidden]{display:none}
  #bhSheetHost .avdp-panel .avd-pop label{font:800 11px/1 var(--font-body,system-ui,sans-serif);letter-spacing:.06em;text-transform:uppercase;color:var(--c-grey-600);margin:0}
  #bhSheetHost .avdp-panel .avd-pop-actions .avd-go{flex:1}
  #bhSheetHost .avdp-st .avdp-btns button{height:44px;font-size:14px;border-radius:12px}
  #bhSheetHost .avdp-st .avdp-msg{font-size:14.5px}
  /* Vacant since menu on phones = same sheet */
  body>.bhvd-menu{min-width:0!important;z-index:1460!important;padding:14px 12px 12px!important}
  body>.bhvd-menu .bhvd-head{padding:2px 6px 10px;font-size:12px}
  body>.bhvd-menu .bhvd-opt{min-height:48px;padding:12px 14px;font-size:15px;border-radius:12px}
  body>.bhvd-menu .bhvd-foot{font-size:12px}
  body:has(>.bhvd-menu)::after{content:"";position:fixed;inset:0;z-index:1455;background:rgba(var(--c-starlight-dark-rgb,15,32,54),.5);animation:bhshFade .2s ease}
  /* tray captions: explicit colour, never inherited from a white/open tile */
  html body .avl-kw.avl-kw--admin .avl-tray [data-lbl]::after{color:var(--c-starlight)}
  [data-theme="dark"] html body .avl-kw.avl-kw--admin .avl-tray [data-lbl]::after,[data-theme="dark"] .avl-kw.avl-kw--admin .avl-tray [data-lbl]::after{color:var(--c-white)}
  /* dark */
  [data-theme="dark"] #bhSheetHost .avdp-panel,[data-theme="dark"] #bhSheetHost .avd-status,[data-theme="dark"] body>.bhvd-menu{background:var(--c-starlight-dark,#0f2036)!important;color:var(--c-white);border-color:rgba(255,255,255,.16)!important;border-top-color:var(--c-sand)!important}
  [data-theme="dark"] #bhSheetHost .avdp-panel .avd-txt b,[data-theme="dark"] #bhSheetHost .avd-status::before,[data-theme="dark"] .avdp-st{color:var(--c-white)}
  [data-theme="dark"] #bhSheetHost .bhsh-x,[data-theme="dark"] #bhSheetHost .avd-status .avd-x{background:rgba(255,255,255,.12);color:var(--c-white)}
  [data-theme="dark"] #bhSheetHost .avdp-panel input[type=url],[data-theme="dark"] #bhSheetHost .avdp-panel input[type=text]{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.2);color:var(--c-white)}
  [data-theme="dark"] #bhSheetHost .avd-st{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.16);color:var(--c-white)}
  [data-theme="dark"] #bhSheetHost .avdp-panel .avd-go{background:var(--c-sand);color:var(--c-starlight-dark)}
}
@keyframes bhshUp{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
@keyframes bhshFade{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){#bhSheetHost .avdp-panel,#bhSheetHost .avd-status,body>.bhvd-menu,body:has(>.bhvd-menu)::after{animation:none!important}#bhSheetHost .bhsh-scrim{transition:none}}
