/* The assistant as one card of the EB microsite template (demo.libertyeb.com, Web Dev's WordPress/Elementor
   template), so it reads as part of the client's page rather than a widget dropped on it. Values copied from
   that template's computed styles (2026-10-29):
     cards        white, 20px radius, no shadow; the contact cards' 7px top border in the client's primary
     buttons      pills (100px radius), 12px 24px, 15px
     titles       700 weight, 27px section titles; Roboto for display, the system stack for everything else
     eyebrows     12px, 600, uppercase, 5.2px letter spacing
     neutrals     page #F9F7F7, light fill #F7F7F7, muted text #7A7A7A
   The page itself is transparent: the card sits on whatever background the client's section has.
   The palette comes from /e/<id>/theme.css, per client (CONTRACT.md `theme`): primary (--accent: the top
   edge, the visitor's bubbles, buttons, the language switch), secondary (the header and tile icons),
   surface (--paper, the card), fill (bubbles, tiles, the question box) and text (--ink). Muted text and
   rules are mixed from text and surface, so they follow a dark or tinted card. No gradients here. */

:root {
  --accent: #004D85;
  --on-accent: #FFFFFF;
  --secondary: var(--accent);
  --on-secondary: var(--on-accent);
  --ink: #1D1D1F;
  --fill: #F7F7F7;
  --paper: #FFFFFF;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--paper));
  --muted: color-mix(in srgb, var(--ink) 58%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 11%, var(--paper));
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --display: Roboto, var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: transparent; }
body { font-family: var(--sans); color: var(--ink); font-size: 16px; line-height: 1.5; }

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  background: var(--paper);
  border-top: 7px solid var(--accent);
  border-radius: 20px;
  overflow: hidden;
}

/* ---- the header: icon, who it is, language ---------------------------------------------------- */
.head { display: flex; align-items: center; gap: 16px; padding: 26px 32px 18px; }
.head-icon {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--secondary); color: var(--on-secondary);
}
.head-icon svg { width: 26px; height: 26px; }
.head-text { flex: 1 1 auto; min-width: 0; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 5.2px; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font-family: var(--display); font-size: 27px; font-weight: 700; line-height: 1.15; color: var(--ink); }

/* the language picker: the client's languages, each in its own name (2026-11-11, replaced the two-button switch) */
.lang {
  display: inline-flex; align-items: center; flex: 0 0 auto; gap: 6px; padding: 0 4px 0 14px;
  background: var(--fill); border-radius: 100px; color: var(--muted);
}
.lang[hidden] { display: none; }
.lang svg { width: 18px; height: 18px; flex: 0 0 auto; }
.lang-select {
  font: inherit; font-size: 14px; min-height: 40px; max-width: 160px; padding: 6px 12px 6px 2px;
  border: 0; border-radius: 100px; background: transparent; color: var(--ink); cursor: pointer;
}
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- the conversation ------------------------------------------------------------------------- */
.log {
  flex: 1 1 auto; overflow-y: auto; padding: 8px 32px 16px;
  display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--line);
}
.log::before { content: ""; flex: 0 0 8px; }
.msg {
  max-width: min(78%, 720px); padding: 14px 20px; border-radius: 20px;
  font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.assistant { align-self: flex-start; background: var(--fill); color: var(--ink); border-top-left-radius: 6px; white-space: normal; }
.msg.assistant p { margin: 0 0 8px; }
.msg.assistant ul { margin: 2px 0 8px; padding-left: 20px; }
.msg.assistant li { margin: 3px 0; }
.msg.assistant li::marker { color: var(--secondary); }
.msg.assistant > :last-child { margin-bottom: 0; }
.msg.assistant.typing { cursor: pointer; }      /* a click shows the rest of the answer at once */
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-top-right-radius: 6px; }
.msg.pending { color: var(--muted); }
.msg.pending::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---- suggestions and the question box --------------------------------------------------------- */
/* The opening suggestions: the template's "Key Actions" tiles (20px radius, 20px padding, a rounded-square icon,
   an 18px/600 title and a 14px line), on the light fill because they sit inside a white card. */
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 6px; }
.examples:empty { display: none; }
.example {
  font: inherit; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px;
  align-items: start; text-align: left; padding: 18px 20px; min-height: 44px;
  border: 1.5px solid transparent; border-radius: 20px; background: var(--fill); color: var(--ink); cursor: pointer;
}
.example:hover, .example:focus-visible { background: var(--accent-soft); border-color: var(--accent); outline: none; }
.example-icon {
  grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 10%; background: var(--secondary); color: var(--on-secondary);
  display: grid; place-items: center;
}
.example-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.example-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.example-q { font-size: 14px; line-height: 1.5; color: var(--muted); }

.ask {
  display: flex; align-items: center; gap: 8px; margin: 0 32px;
  padding: 6px 6px 6px 22px; background: var(--fill); border: 1.5px solid transparent; border-radius: 100px;
}
.ask:focus-within { background: var(--paper); border-color: var(--accent); }
.ask textarea {
  flex: 1 1 auto; font: inherit; font-size: 15px; line-height: 1.4; resize: none;
  min-height: 24px; max-height: 96px; padding: 10px 0; border: 0; background: transparent; color: var(--ink);
  overflow-y: hidden;                       /* app.js turns scrolling on only past max-height */
}
.ask textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask textarea:focus { outline: none; }
.ask textarea::placeholder { color: var(--muted); }
.send {
  flex: 0 0 auto; font: inherit; font-size: 15px; min-height: 44px; padding: 12px 26px;
  border: 0; border-radius: 100px; background: var(--accent); color: var(--on-accent); cursor: pointer;
}
.send:disabled { opacity: .45; cursor: default; }
.send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fine { padding: 12px 32px 0; }
.notice, .contact { margin: 0 0 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.contact:empty { display: none; }
.foot {
  margin: auto 0 0; padding: 12px 32px 18px; font-size: 11px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--muted); text-align: right;
}

/* ---- the not-available page ------------------------------------------------------------------- */
.unavailable { height: auto; padding: 32px; }
.unavailable .title { margin-bottom: 10px; }

/* ---- in the floating panel (button.js): the panel gives the corners, the close button shows ---------------- */
.in-panel .card { max-width: none; border-radius: 0; }
.close-btn {
  flex: 0 0 auto; width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--fill); color: var(--ink); cursor: pointer;
}
.close-btn[hidden] { display: none; }
.close-btn svg { width: 22px; height: 22px; }
.close-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  .head { flex-wrap: wrap; gap: 12px; padding: 20px 18px 14px; }
  .head-icon { width: 44px; height: 44px; }
  .head-icon svg { width: 22px; height: 22px; }
  .title { font-size: 22px; }
  .eyebrow { letter-spacing: 3px; }
  .lang { order: 3; }
  .in-panel .head-text { flex-basis: calc(100% - 112px); }     /* name and close on one line, language below */
  .log { padding: 6px 18px 12px; }
  .msg { max-width: 90%; padding: 12px 16px; }
  .examples { grid-template-columns: 1fr; gap: 8px; }
  .example { padding: 12px 14px; column-gap: 12px; }
  .example-icon { width: 36px; height: 36px; }
  .example-icon svg { width: 18px; height: 18px; }
  .ask { margin: 0 18px; padding-left: 16px; }
  .send { padding: 12px 18px; }
  .fine, .foot { padding-left: 18px; padding-right: 18px; }
}
