/* Ask shares horizontal space with the site on desktop. The phone dialog uses the native modal layer. */
:root { --pilot-chat-width: clamp(320px, 28vw, 420px); }
@media (min-width: 901px) {
  body.pilot-chat-open { width: calc(100% - var(--pilot-chat-width)); margin-right: var(--pilot-chat-width); }
  .pilot-chat-open [data-ask-fixed-header] { right: var(--pilot-chat-width); }
}
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask), :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) * { box-sizing: border-box; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) {
  position: fixed;
  inset: 0 0 auto auto;
  z-index: 2147483001;
  width: var(--pilot-chat-width);
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--ask-ink, #152e49);
  background: var(--ask-surface, #fffcf7);
  border: 0;
  border-left: 1px solid #d4dce2;
  font: 400 16px/1.5 var(--sans, system-ui, sans-serif);
  text-align: left;
  overflow: hidden;
}
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask)[open] { display: flex; flex-direction: column; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask)[hidden], :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) [hidden] { display: none !important; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) .pilot-chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  color: white;
  background: var(--ask-heading, #152e49);
}
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) h2, :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) h3 { margin: 0; color: inherit; font: 650 20px/1.25 var(--sans, system-ui, sans-serif); letter-spacing: -.025em; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) button { color: inherit; background: transparent; border: 0; font: inherit; cursor: pointer; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) [data-pilot-chat-close] { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border-radius: 6px; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) [data-pilot-chat-close]:hover { background: #2e4c68; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) [data-pilot-chat-close] svg { width: 22px; height: 22px; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-welcome { padding: 26px 20px 0; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-welcome p { margin: 8px 0 0; color: #41566b; line-height: 1.5; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat):has(.pilot-chat-message) .pilot-chat-welcome { display: none; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-log] {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 18px 20px;
  list-style: none;
}
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-message { max-width: 92%; flex: none; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--ask-team, #e9eef2); overflow-wrap: anywhere; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-message[data-author=visitor] { align-self: flex-end; color: white; background: var(--ask-visitor, #234766); }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-author { display: block; margin: 0 0 2px; font-size: 12px; font-weight: 700; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-message p { margin: 0; color: inherit; white-space: pre-wrap; font: inherit; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-earlier], :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-retry] { align-self: center; min-height: 40px; padding-inline: 12px; color: #245a78; font-size: 14px; text-decoration: underline; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) .pilot-chat-feedback { padding-inline: 20px; }
#school-profile-chat [data-school-chat-contact] { display: grid; gap: 8px; padding: 8px 20px 20px; }
#school-profile-chat[data-school-chat-unavailable] [data-pilot-chat-log]:empty { display: none; }
#school-profile-chat[data-school-chat-unavailable] .pilot-chat-feedback { padding-top: 12px; }
#school-profile-chat [data-school-chat-contact] a { width: fit-content; overflow-wrap: anywhere; color: var(--ask-ink, #152e49); text-decoration: underline; text-underline-offset: 3px; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-status] { margin: 0; font: inherit; font-size: 14px; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-status]:not(:empty) { padding-block: 8px; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-form] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; margin: 0; padding: 14px 18px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid #d6dfe5; background: white; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) label { grid-column: 1 / -1; font-size: 14px; font-weight: 650; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-retry] { padding: 3px 0; color: var(--ask-ink, #152e49); text-decoration: underline; text-underline-offset: 2px; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) textarea { display: block; width: 100%; min-height: 48px; max-height: 20dvh; margin: 0; padding: 9px 10px; resize: vertical; border: 1px solid #aab9c4; border-radius: 6px; background: white; color: var(--ask-ink, #152e49); font: inherit; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) [data-pilot-chat-send] { min-height: 44px; align-self: end; padding: 0 15px; border-radius: 6px; background: var(--ask-accent, #b64517); color: var(--ask-accent-text, white); font-weight: 700; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) button:disabled { opacity: .55; cursor: default; }
:is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat) :is(button, textarea, [tabindex]):focus-visible { outline: 3px solid #57a0dd; outline-offset: -3px; }
@media (max-width: 900px) {
  html:has(body.pilot-chat-open), body.pilot-chat-open { overflow: hidden; }
  :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) { inset: var(--chat-screen-top, 0) 0 auto; width: 100%; height: var(--chat-screen-height, 100dvh); border: 0; }
  :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask) .pilot-chat-heading { padding-top: max(12px, env(safe-area-inset-top)); }
  :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat):has(textarea:focus) .pilot-chat-welcome { display: none; }
  :is(#pilot-chat-panel, #school-profile-chat, #specialist-profile-chat, #erken-public-ask)::backdrop { background: var(--ask-surface, #fffcf7); }
}
