/* Ask the desk: site assistant widget. Prefix: ask- */

.ask-launcher,
.ask-panel {
  --ask-gap: 16px;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- launcher ---------- */
.ask-launcher {
  position: fixed; right: var(--ask-gap); bottom: var(--ask-gap); z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 16px 0 14px;
  background: var(--ink); color: var(--cover-text);
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 2px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 8px 24px -12px rgba(0, 0, 0, 0.55);
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease), border-color 0.2s, background 0.2s;
}
.ask-launcher:hover { background: var(--ink-2); border-color: rgba(255, 255, 255, 0.36); }
.ask-launcher:focus-visible { outline: 2px solid var(--sealed); outline-offset: 3px; }
.ask-launcher.is-hidden { opacity: 0; transform: translateY(calc(100% + var(--ask-gap) + 8px)); pointer-events: none; }
.ask-launcher[hidden] { display: none; }

.ask-pip { position: relative; width: 7px; height: 7px; background: var(--sealed); flex: none; }
.ask-pip::after {
  content: ""; position: absolute; inset: -3px; border: 1px solid var(--sealed); opacity: 0;
  animation: ask-pip 2.8s var(--ease) infinite;
}
@keyframes ask-pip {
  0% { transform: scale(0.6); opacity: 0.7; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}
.ask-paused .ask-pip::after { animation-play-state: paused; }

/* ---------- panel ---------- */
.ask-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 380px; height: 540px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
  background: var(--ink-2); color: var(--cover-text);
  border: 1px solid var(--line-ink); border-radius: 3px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}
.ask-panel.is-open { opacity: 1; transform: none; }
.ask-panel[hidden] { display: none; }
.ask-panel :focus-visible { outline: 2px solid var(--sealed); outline-offset: 2px; border-radius: 2px; }

.ask-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 10px 14px 18px; border-bottom: 1px solid var(--line-ink); flex: none;
}
.ask-mark { width: 24px; height: 24px; color: var(--accent-bright); flex: none; }
.ask-head__text { flex: 1; min-width: 0; }
.ask-title { margin: 0; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.01em; line-height: 1.2; }
.ask-sub {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cover-dim);
}
.ask-sub .ask-pip { width: 6px; height: 6px; }
.ask-sub .ask-pip::after { display: none; }
.ask-close {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 2px; color: var(--cover-dim);
  transition: color 0.2s, border-color 0.2s;
}
.ask-close:hover { color: #fff; border-color: var(--line-ink); }
.ask-close svg { width: 14px; height: 14px; }

/* ---------- messages ---------- */
.ask-log {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 18px 8px; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent;
}
.ask-msg { margin: 0 0 18px; }
.ask-msg__label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cover-dim);
}
.ask-panel .ask-msg__body p { margin: 0 0 0.7em; font-size: 15px; line-height: 1.55; color: var(--cover-text); max-width: none; }
.ask-panel .ask-msg__body p:last-child { margin-bottom: 0; }
.ask-msg__body a[href^="tel:"], .ask-lead a[href^="tel:"] { white-space: nowrap; }
.ask-msg__body a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ask-msg__body a:hover { color: #fff; }

.ask-msg--user { display: flex; flex-direction: column; align-items: flex-end; }
.ask-msg--user .ask-msg__body {
  max-width: 86%; padding: 10px 14px;
  background: var(--ink-3); border: 1px solid var(--line-ink); border-radius: 2px;
}
.ask-panel .ask-msg--user .ask-msg__body p { color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }

.ask-msg--notice .ask-msg__body {
  padding: 12px 14px; border: 1px solid rgba(227, 163, 59, 0.45); border-radius: 2px;
  background: rgba(227, 163, 59, 0.06);
}
.ask-msg--notice .ask-msg__label { color: var(--exposed-bright); }

.ask-starters { display: grid; gap: 8px; margin: 4px 0 18px; }
.ask-starter {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 10px 14px; text-align: left;
  background: transparent; color: var(--cover-text);
  border: 1px solid var(--line-ink); border-radius: 2px;
  font-size: 14.5px; line-height: 1.35;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.ask-starter::after { content: "\2192"; font-family: var(--font-mono); font-size: 12px; color: var(--accent-bright); flex: none; transition: transform 0.3s var(--ease); }
.ask-starter:hover { border-color: rgba(143, 184, 108, 0.6); background: rgba(143, 184, 108, 0.06); color: #fff; }
.ask-starter:hover::after { transform: translateX(3px); }

.ask-typing { display: flex; align-items: center; gap: 10px; padding: 0 18px 12px; min-height: 26px; flex: none; }
.ask-typing[hidden] { display: none; }
.ask-typing__label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cover-dim); }
.ask-dots { display: inline-flex; gap: 5px; }
.ask-dots span { width: 5px; height: 5px; background: var(--cover-dim); animation: ask-dot 1.2s var(--ease) infinite; }
.ask-dots span:nth-child(2) { animation-delay: 0.15s; }
.ask-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-dot {
  0%, 60%, 100% { opacity: 0.25; transform: none; }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* ---------- lead card ---------- */
.ask-lead {
  margin: 4px 0 18px; padding: 16px 16px 14px;
  background: var(--ink); border: 1px solid var(--line-ink); border-radius: 2px;
}
.ask-panel .ask-lead__title { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.ask-panel .ask-lead__sub { margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--cover-dim); max-width: none; }
.ask-field { margin: 0 0 10px; }
.ask-field label {
  display: block; margin-bottom: 5px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cover-dim);
}
.ask-field input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: var(--cover-text);
  background: var(--ink-2); border: 1px solid var(--line-ink); border-radius: 2px;
  transition: border-color 0.2s;
}
.ask-field input:focus { border-color: var(--accent-bright); outline: none; }
.ask-field input[aria-invalid="true"] { border-color: var(--exposed-bright); }
.ask-lead__actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ask-panel .ask-lead__status { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--exposed-bright); max-width: none; }
.ask-lead__status:empty { display: none; }
.ask-lead--done { border-color: rgba(143, 214, 160, 0.4); background: rgba(143, 214, 160, 0.05); }
.ask-panel .ask-lead--done .ask-lead__sub { margin: 0; }
.ask-lead--done a { color: var(--accent-bright); }

/* ---------- buttons ---------- */
.ask-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 2px; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.ask-btn--primary { background: var(--accent); color: #fff; }
.ask-btn--primary:hover { background: var(--accent-deep); }
.ask-btn--ghost { background: transparent; color: var(--cover-dim); }
.ask-btn--ghost:hover { color: #fff; border-color: var(--line-ink); }
.ask-btn[disabled] { opacity: 0.55; cursor: default; }

/* ---------- composer ---------- */
.ask-form { flex: none; padding: 12px 14px 12px; border-top: 1px solid var(--line-ink); }
.ask-compose { display: flex; align-items: flex-end; gap: 8px; }
.ask-input {
  flex: 1; min-width: 0; min-height: 44px; max-height: 132px; resize: none;
  padding: 11px 12px; font: inherit; font-size: 16px; line-height: 1.4;
  color: var(--cover-text); background: var(--ink); border: 1px solid var(--line-ink); border-radius: 2px;
  transition: border-color 0.2s;
}
.ask-input::placeholder { color: var(--cover-dim); }
.ask-input:focus { border-color: var(--accent-bright); outline: none; }
.ask-panel .ask-input:focus-visible { outline: none; }
.ask-send { width: 44px; height: 44px; padding: 0; flex: none; }
.ask-send svg { width: 16px; height: 16px; }
.ask-fine {
  display: flex; justify-content: space-between; gap: 12px; margin: 8px 2px 0;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--cover-dim); line-height: 1.5;
}
.ask-fine span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-count { flex: none; }
.ask-count.is-over { color: var(--exposed-bright); }

.ask-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- mobile: full-screen sheet ---------- */
@media (max-width: 640px) {
  .ask-panel {
    inset: 0; width: auto; height: auto; max-height: none;
    border: 0; border-radius: 0; box-shadow: none;
    transform: translateY(24px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ask-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .ask-msg--user .ask-msg__body { max-width: 90%; }
  html.ask-lock, html.ask-lock body { overflow: hidden; }
}
@media (min-width: 641px) {
  .ask-launcher, .ask-panel { --ask-gap: 24px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ask-launcher, .ask-panel, .ask-starter, .ask-starter::after { transition: none; }
  .ask-panel { transform: none; }
  .ask-pip::after { animation: none; display: none; }
  .ask-dots span { animation: none; opacity: 0.7; }
  .ask-log { scroll-behavior: auto; }
}
