/* =================================================================
   Arc — "Ask Arc" assistant.
   Uses the existing Arc tokens only (--paper, --ink, --rule, --hair,
   --sans, --mono, type scale). No new colours are introduced: the
   panel should read as part of the site, not as a bolted-on widget.
   ================================================================= */

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------- launcher */
.ask-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px;
  font: 500 var(--t-sm)/1 var(--sans);
  color: var(--paper); background: var(--ink);
  border: var(--hair) solid var(--ink); cursor: pointer;
  box-shadow: 0 6px 24px -10px rgba(20, 24, 26, .55);
  transition: transform .18s ease, background .18s ease;
}
.ask-fab:hover { transform: translateY(-1px); }
.ask-fab svg { width: 16px; height: 16px; flex: 0 0 auto; }
.ask-fab:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ------------------------------------------------------------- panel */
.ask-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 81;
  width: 380px; max-width: calc(100vw - 40px);
  height: min(600px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: var(--paper);
  border: var(--hair) solid var(--ink);
  box-shadow: 0 24px 60px -24px rgba(20, 24, 26, .5);
  opacity: 0; transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}
.ask-panel.is-open { opacity: 1; transform: none; }

.ask-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: var(--hair) solid var(--rule);
  flex: 0 0 auto;
}
.ask-title { font: 500 var(--t-base)/1.2 var(--sans); margin: 0; }
.ask-note {
  margin: 4px 0 0;
  font: 400 var(--t-xs)/1.35 var(--mono);
  color: var(--ink-50); letter-spacing: .02em;
}
.ask-x {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center;
  background: none; border: var(--hair) solid var(--rule); color: var(--ink); cursor: pointer;
}
.ask-x:hover { border-color: var(--ink); }
.ask-x svg { width: 11px; height: 11px; }

/* --------------------------------------------------------------- log */
.ask-log {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 18px 6px;
  display: flex; flex-direction: column; gap: 14px;
}
.ask-msg { font: 400 var(--t-sm)/1.55 var(--sans); }
.ask-msg p { margin: 0 0 9px; }
.ask-msg p:last-child { margin-bottom: 0; }
.ask-msg ul { margin: 8px 0; padding-left: 18px; }
.ask-msg li { margin: 0 0 5px; }
.ask-msg b { font-weight: 500; }

/* The visitor's own question: right-aligned, inked, so the transcript
   reads as a conversation without resorting to avatars. */
.ask-q {
  align-self: flex-end; max-width: 85%;
  padding: 9px 13px;
  background: var(--ink); color: var(--paper);
}
.ask-a {
  align-self: flex-start; max-width: 100%;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border-left: 2px solid var(--ink);
}
.ask-miss { border-left-color: var(--ink-50); }
.ask-a a { color: var(--ink); text-underline-offset: 3px; }

.ask-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.ask-link {
  display: inline-flex; align-items: center;
  padding: 7px 11px;
  font: 500 var(--t-xs)/1 var(--sans);
  text-decoration: none; color: var(--ink);
  border: var(--hair) solid var(--ink);
}
.ask-link:hover { background: var(--ink); color: var(--paper); }

.ask-rel { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.ask-rel .mono {
  font: 400 var(--t-xs)/1 var(--mono);
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-50);
}
.ask-chip {
  text-align: left; cursor: pointer;
  padding: 8px 11px;
  font: 400 var(--t-xs)/1.35 var(--sans);
  color: var(--ink); background: var(--paper);
  border: var(--hair) solid var(--rule);
}
.ask-chip:hover { border-color: var(--ink); }

/* -------------------------------------------------------------- form */
.ask-form {
  flex: 0 0 auto; display: flex; gap: 8px;
  padding: 12px 18px 16px;
  border-top: var(--hair) solid var(--rule);
}
.ask-form input {
  flex: 1 1 auto; min-width: 0;
  padding: 11px 12px;
  font: 400 var(--t-sm)/1.2 var(--sans);
  color: var(--ink); background: var(--paper);
  border: var(--hair) solid var(--rule);
}
.ask-form input:focus { outline: none; border-color: var(--ink); }
.ask-form button {
  flex: 0 0 auto; width: 42px;
  display: grid; place-items: center; cursor: pointer;
  color: var(--paper); background: var(--ink);
  border: var(--hair) solid var(--ink);
}
.ask-form button svg { width: 15px; height: 9px; }

/* ------------------------------------------------------- small screens */
/* Full-height sheet on a phone. A 380px floating card on a 390px
   viewport is a card with 5px of air either side, which reads as broken
   rather than deliberate. */
@media (max-width: 560px) {
  .ask-fab { right: 14px; bottom: 14px; padding: 11px 15px; }
  .ask-panel {
    right: 0; bottom: 0; left: 0;
    width: 100%; max-width: none;
    height: 88vh; height: 88dvh;
    border-left: none; border-right: none; border-bottom: none;
  }
  /* The launcher would otherwise sit on top of the open sheet. */
  html.ask-open .ask-fab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ask-panel, .ask-fab { transition: none; }
  .ask-panel { transform: none; }
}
