/* D.EIGHT website assistant (About page). Colours come from the site tokens in brand.css, so light and dark both work. */
.as-host { display: contents; }
.as-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.as-launch {
  position: fixed; left: 22px; bottom: 22px; z-index: 41;
  height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow);
  font: 600 14px/1 var(--f-body); letter-spacing: 0.01em; cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}
.as-launch:hover { transform: translateY(-2px); }

.as-panel {
  position: fixed; left: 22px; bottom: 84px; z-index: 41;
  width: min(380px, calc(100vw - 44px)); height: min(600px, 72vh);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.as-panel.on { opacity: 1; transform: none; }
.as-panel[hidden] { display: none; }

.as-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.as-head b { display: block; font: 700 15px/1.2 var(--f-display); }
.as-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.as-x { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.as-x:hover { background: var(--hover); }

.as-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.as-b { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; animation: as-in 0.24s var(--ease-out) both; }
.as-b.bot { align-self: flex-start; background: var(--soft); color: var(--ink); border-bottom-left-radius: 4px; }
.as-b.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.as-b.err { background: var(--err-bg); color: var(--err-fg); }
@keyframes as-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.as-typing { display: flex; gap: 4px; padding: 13px 14px; }
.as-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: as-dot 1.1s var(--ease-io) infinite; }
.as-typing i:nth-child(2) { animation-delay: 0.15s; }
.as-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes as-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.as-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.as-chips[hidden] { display: none; }
.as-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 500 13px/1.3 var(--f-body); text-align: left; cursor: pointer; }
.as-chip:hover { border-color: var(--brand); }

.as-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.as-in { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); font: 15px var(--f-body); }
.as-send { height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--brand); color: var(--on-brand); font: 600 14px var(--f-body); cursor: pointer; }
.as-send:disabled { opacity: 0.5; cursor: default; }
.as-foot { display: flex; padding: 0 14px 12px; }
.as-link { padding: 4px 0; border: 0; background: none; color: var(--brand); font: 600 13px var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.as-lead { display: grid; gap: 9px; position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.as-lead label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
.as-lead input, .as-lead select, .as-lead textarea { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); font: 14.5px var(--f-body); }
.as-lead textarea { min-height: 64px; resize: vertical; }
.as-lead .as-send { width: 100%; height: 44px; }
.as-lead-h { margin: 0; color: var(--ink); font: 700 14px/1.3 var(--f-display); }
.as-err { margin: 0; color: var(--err-fg); font-size: 13px; }
.as-done { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.45; }
.as-ts[hidden], .as-err[hidden] { display: none; }
.as-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.as-launch:focus-visible, .as-x:focus-visible, .as-chip:focus-visible, .as-send:focus-visible, .as-link:focus-visible,
.as-in:focus-visible, .as-lead input:focus-visible, .as-lead select:focus-visible, .as-lead textarea:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

@media (max-width: 600px) {
  .as-launch { left: 16px; bottom: 16px; }
  .as-panel { left: 12px; right: 12px; bottom: 76px; width: auto; height: min(72vh, 620px); }
  .as-b { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  .as-b, .as-typing i, .as-launch, .as-panel { animation: none; transition: none; }
  .as-launch:hover { transform: none; }
}
