/* Ask Vinify (help center): the bar under the article and the panel it opens.
   The bar is a button in the shape of a prompt. The panel holds the Chatling chatbot, embedded
   inline; assistant.js builds the markup and loads Chatling on the first open.
   Three layouts by width:
     from 1440     docked: the panel has its own column, the header makes room, nothing dims
     720 to 1439   drawer: the panel lies over the page, behind a scrim
     under 720     the panel is the whole screen
   Type uses the roles from landing.css, stated here so the component travels as two files:
   Source Sans A1 16/24 for the bar (inherited from body), Frank Ruhl A3 20/24 for the title. */

:root{--asst-w:400px}

/* ---------- the bar ---------- */
.asst-bar{position:fixed;inset:auto 0 0;z-index:900;padding-bottom:calc(20px + env(safe-area-inset-bottom,0px));
  pointer-events:none;opacity:0;visibility:hidden;transform:translateY(12px);
  transition:opacity var(--dur-ui) var(--ease),transform var(--dur-ui) var(--ease),visibility 0s var(--dur-ui)}
.asst-bar.is-in{opacity:1;visibility:visible;transform:none;
  transition:opacity var(--dur-ui) var(--ease),transform var(--dur-ui) var(--ease)}
/* it steps aside for the footer, for the open panel and for the cookie prompt */
.asst-bar.is-away,html.asst-open .asst-bar,.consent:not([hidden]) ~ .asst-bar{opacity:0;visibility:hidden;transform:translateY(12px);
  transition:opacity var(--dur-ui) var(--ease),transform var(--dur-ui) var(--ease),visibility 0s var(--dur-ui)}

/* the same grid as .help, so the bar sits under the article column at every width */
.asst-bar__grid{display:grid;grid-template-columns:minmax(0,1fr)}
.asst-bar__col{position:relative;min-width:0;max-width:68ch}
@media (min-width:1024px){
  .asst-bar__grid{grid-template-columns:240px minmax(0,1fr);column-gap:var(--space-8)}
  .asst-bar__col{grid-column:2}
}
/* the page fades out above the bar and is gone behind it, so no line of text shows at its edge */
.asst-bar__col::before{content:"";position:absolute;inset:-56px -20px calc(-20px - env(safe-area-inset-bottom,0px));z-index:-1;
  background:linear-gradient(to bottom,transparent,var(--paper) 52px);pointer-events:none}

.asst-bar__btn{pointer-events:auto;display:flex;align-items:center;gap:12px;width:100%;height:56px;padding:0 8px 0 18px;
  border:1px solid var(--hairline-strong);border-radius:var(--r-pill);background:var(--surface);color:var(--ink-2);
  font:inherit;text-align:left;cursor:pointer;box-shadow:var(--shadow-raise);
  transition:transform var(--dur-ui) var(--ease),box-shadow var(--dur-ui) var(--ease),
    border-color var(--dur-micro) var(--ease),color var(--dur-micro) var(--ease)}
.asst-bar__btn:hover{transform:translateY(-2px);box-shadow:var(--shadow-float);border-color:var(--ink-3);color:var(--ink)}
.asst-bar__btn:focus-visible,.asst-panel__x:focus-visible{outline:2px solid var(--burgundy);outline-offset:3px}
.asst-bar__btn > svg,.asst-panel__head > svg{flex:none;width:22px;height:22px;fill:currentColor;color:var(--burgundy)}
.asst-bar__t{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.asst-bar__go{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;
  background:var(--burgundy);color:var(--white);
  transition:transform var(--dur-ui) var(--ease),background var(--dur-micro) var(--ease)}
.asst-bar__go svg{width:18px;height:18px}
.asst-bar__btn:hover .asst-bar__go{transform:translateX(2px);background:var(--burgundy-deep)}

/* ---------- the scrim: only where the panel lies over the page ---------- */
.asst-scrim{position:fixed;inset:0;z-index:1090;background:var(--navy-800-60);opacity:0;visibility:hidden;
  transition:opacity var(--dur-ui) var(--ease),visibility 0s var(--dur-ui)}
html.asst-open .asst-scrim{opacity:.55;visibility:visible;transition:opacity var(--dur-ui) var(--ease)}

/* ---------- the panel ---------- */
.asst-panel{position:fixed;inset:0 0 0 auto;z-index:1100;width:min(var(--asst-w),100%);display:flex;flex-direction:column;
  background:var(--surface);color:var(--ink);border-left:1px solid var(--hairline);box-shadow:var(--shadow-float);
  transform:translateX(100%);visibility:hidden;
  transition:transform var(--dur-ui) var(--ease),visibility 0s var(--dur-ui)}
html.asst-open .asst-panel{transform:none;visibility:visible;transition:transform var(--dur-ui) var(--ease)}

/* the strip is the height of the site header, so on wide screens the two read as one top bar */
.asst-panel__head{flex:none;display:flex;align-items:center;gap:10px;height:54px;padding:0 9px 0 20px;border-bottom:1px solid var(--hairline)}
.asst-panel__t{flex:1;min-width:0;margin:0;font-family:var(--font-display);font-weight:500;font-size:20px;line-height:24px;color:var(--ink)}
.asst-panel__x{flex:none;display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--r-md);
  background:transparent;color:var(--ink-2);cursor:pointer;
  transition:background var(--dur-micro) var(--ease),color var(--dur-micro) var(--ease)}
.asst-panel__x svg{width:18px;height:18px}
.asst-panel__x:hover{background:var(--paper-2);color:var(--ink)}

.asst-panel__body{position:relative;flex:1;min-height:0}
/* Chatling appends its frame to the element with this id and sizes it for its floating window
   (a max-height, a scale it animates on open); inline it simply fills the panel */
#chtl-inline-bot{position:absolute;inset:0}
#chtl-inline-bot iframe{display:block!important;width:100%!important;height:100%!important;max-height:none!important;
  border:0;transform:none!important;transition:none!important}

/* until Chatling answers: three dots, then either the chat or a way out */
.asst-panel__wait{position:absolute;inset:0;z-index:1;display:grid;place-content:center;justify-items:center;gap:var(--space-3);
  padding:var(--space-6);background:var(--surface);color:var(--ink-2);text-align:center;
  transition:opacity var(--dur-ui) var(--ease),visibility 0s var(--dur-ui)}
.asst-panel__wait p{margin:0;max-width:30ch}
.asst-panel__wait a{color:var(--burgundy);text-decoration:underline;text-underline-offset:3px}
.asst-panel.is-ready .asst-panel__wait{opacity:0;visibility:hidden}
.asst-panel__dots{display:flex;gap:6px}
.asst-panel__dots span{width:7px;height:7px;border-radius:50%;background:var(--ink-3);animation:asst-wait 1.2s var(--ease) infinite}
.asst-panel__dots span:nth-child(2){animation-delay:.15s}
.asst-panel__dots span:nth-child(3){animation-delay:.3s}
.asst-panel.is-failed .asst-panel__dots{display:none}
@keyframes asst-wait{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-3px)}}

/* ---------- docked: the panel has its own column ---------- */
@media (min-width:1440px){
  .asst-scrim{display:none}
  .asst-panel{box-shadow:none}
  /* the header makes room at the pace of the panel; its own padding transition is repeated so it is not lost */
  html.has-asst .header{transition:right var(--dur-ui) var(--ease),padding .5s var(--ease)}
  html.asst-open .header{right:var(--asst-w)}
}
/* the category list is the one block wider than the article column: on the widths where the
   panel would reach it, it steps back in line */
@media (min-width:1440px) and (max-width:1639px){html.asst-open .help-list{max-width:68ch}}
/* arriving on the next help page with the panel still open: it is already there, nothing slides */
html.asst-now .asst-panel,html.asst-now .header{transition:none}

@media (max-width:719px){
  .asst-panel{width:100%;border-left:0}
  .asst-bar{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
  .asst-bar__btn{height:52px}
}
@media (prefers-reduced-motion:reduce){
  .asst-bar,.asst-bar.is-in,.asst-bar.is-away,html.asst-open .asst-bar,.asst-bar__btn,.asst-bar__go,
  .asst-scrim,html.asst-open .asst-scrim,.asst-panel,html.asst-open .asst-panel,html.has-asst .header,.asst-panel__wait{transition:none}
  .asst-panel__dots span{animation:none;opacity:.6}
}
@media print{.asst-bar,.asst-scrim,.asst-panel{display:none}}
