/* Intake conversation (site/js/chat.js). A correspondence file on legal paper: the assistant
   writes in Caslon with a pink-tape rule, the customer's notes sit on white slips, a turn meter of
   folded pages, and a brief that reads like a docket. Uses brand.css tokens with fallbacks.
   The live panel has a fixed height and scrolls inside, so streaming never moves the page. */

.chat-host {
  --cx-ink: var(--ink, #14201b);
  --cx-ink-2: var(--ink-2, #4c5852);
  --cx-ink-3: var(--ink-3, #5a6660);
  --cx-paper: var(--paper, #fbfaf6);
  --cx-sheet: #fffdf8;
  --cx-rule: var(--rule, #d6d2c7);
  --cx-edge: #cdc6b6;
  --cx-tape: var(--tape, #e8607a);
  --cx-tape-ink: var(--tape-ink, #a8344c);
  --cx-oxblood: #7d2230;
  --cx-oxblood-bg: #f8ecee;
  --cx-green: var(--green, #1e5b3f);
  --cx-night: var(--night, #0e2620);
  --cx-brass: var(--brass, #c9a86a);
  --cx-serif: var(--serif, "Libre Caslon Text", Georgia, serif);
  --cx-sans: var(--sans, "Instrument Sans", system-ui, sans-serif);
  --cx-mono: var(--mono, "IBM Plex Mono", ui-monospace, monospace);
  --cx-ease: var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  display: block;
  margin: 22px 0 0;
  min-width: 0;
}
.chat-host[hidden] { display: none; }
.cx { container-type: inline-size; font-family: var(--cx-sans); color: var(--cx-ink); }
.cx p { margin: 0; }
.cx button { font: inherit; color: inherit; }
.cx .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cx [hidden] { display: none !important; }

.cx-kicker { font: 500 0.7rem/1.3 var(--cx-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cx-ink-2); margin-bottom: 8px !important; }
.cx-fine { font-size: 0.8rem; color: var(--cx-ink-3); line-height: 1.45; }

/* ---------- buttons ---------- */
.cx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0 20px;
  background: var(--cx-night); color: var(--cx-paper) !important;
  border: 0; border-radius: 2px; cursor: pointer;
  font-weight: 600 !important; font-size: 0.95rem !important; letter-spacing: 0.01em;
  transition: transform 0.25s var(--cx-ease), box-shadow 0.25s var(--cx-ease), opacity 0.2s;
}
.cx-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(14, 38, 32, 0.75); }
.cx-btn:disabled { opacity: 0.5; cursor: progress; transform: none; box-shadow: none; }
.cx-ghost {
  min-height: 44px; padding: 0 16px; border: 1px solid #8a857a; background: #fff; border-radius: 2px;
  cursor: pointer; font-weight: 500; font-size: 0.92rem;
}
.cx-ghost:hover { border-color: var(--cx-ink); }
.cx-link { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; font-weight: 500; }

/* ---------- intro card ---------- */
.cx-intro {
  position: relative; overflow: hidden;
  padding: 22px 24px 22px 34px;
  background:
    linear-gradient(90deg, transparent 17px, rgba(232, 96, 122, 0.5) 17px, rgba(232, 96, 122, 0.5) 18px, transparent 18px, transparent 20px, rgba(232, 96, 122, 0.5) 20px, rgba(232, 96, 122, 0.5) 21px, transparent 21px),
    var(--cx-sheet);
  border: 1px solid var(--cx-edge); border-radius: 2px;
  box-shadow: 0 1px 0 rgba(20, 32, 27, 0.04), 0 22px 40px -36px rgba(14, 38, 32, 0.55);
}
.cx-tape { /* a length of pink tape tied across the corner, like a brief */
  position: absolute; top: 18px; right: -34px; width: 150px; height: 9px;
  background: linear-gradient(180deg, #f59aac 0 2px, var(--cx-tape) 2px);
  transform: rotate(32deg); box-shadow: 0 2px 4px -2px rgba(168, 52, 76, 0.5);
  pointer-events: none;
}
.cx-h { font: 400 1.42rem/1.16 var(--cx-serif); letter-spacing: -0.005em; margin: 0 0 8px; max-width: 24ch; }
.cx-opt { font-style: italic; color: var(--cx-ink-3); font-size: 0.82em; }
.cx-lede { font-size: 0.95rem; line-height: 1.55; color: var(--cx-ink-2); max-width: 54ch; }
.cx-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px !important; font-size: 0.84rem; line-height: 1.5; color: var(--cx-green); max-width: 56ch; }
.cx-consent svg { flex: none; margin-top: 3px; }
.cx-consent a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
.cx-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.cx-go .cx-fine { max-width: 30ch; }

/* ---------- live panel ---------- */
.cx-live {
  background: var(--cx-paper); border: 1px solid var(--cx-edge); border-radius: 2px;
  box-shadow: 0 1px 0 rgba(20, 32, 27, 0.04), 0 26px 48px -40px rgba(14, 38, 32, 0.6);
  overflow: hidden;
}
.cx-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; background: var(--cx-sheet); border-bottom: 1px solid var(--cx-rule); }
.cx-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-who img { width: 28px; height: 28px; flex: none; }
.cx-title { font: 400 1.08rem/1.2 var(--cx-serif); }
.cx-sub { font-size: 0.76rem; color: var(--cx-ink-3); margin-top: 1px !important; }
.cx-head-r { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; justify-content: flex-end; min-height: 36px; }

/* turn meter: folded-page pips */
.cx-meter { display: flex; align-items: center; gap: 10px; }
.cx-pips { display: inline-flex; gap: 3px; }
.cx-pip {
  position: relative; display: block; width: 9px; height: 12px;
  background: #e4dfd2;
  clip-path: polygon(0 0, 62% 0, 100% 30%, 100% 100%, 0 100%);
  transition: background-color 0.35s var(--cx-ease), transform 0.35s var(--cx-ease);
}
.cx-pip::after { content: ""; position: absolute; top: 0; right: 0; width: 38%; height: 30%; background: #cfc8b8; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.cx-pip.on { background: var(--cx-night); transform: translateY(-1px); }
.cx-pip.on::after { background: var(--cx-tape); }
.cx-meter-l { font: 500 0.8rem/1 var(--cx-sans); font-variant-numeric: tabular-nums; color: var(--cx-ink-2); white-space: nowrap; }

.cx-views { display: inline-flex; border: 1px solid #8a857a; border-radius: 2px; overflow: hidden; }
.cx-view { border: 0; background: #fff; padding: 0 12px; min-height: 34px; font-size: 0.8rem !important; font-weight: 500; cursor: pointer; }
.cx-view + .cx-view { border-left: 1px solid #8a857a; }
.cx-view[aria-pressed="true"] { background: var(--cx-night); color: var(--cx-paper) !important; }

/* stage: fixed height, scrolls inside (no page movement while a reply streams) */
.cx-stage {
  position: relative;
  height: clamp(320px, 54vh, 500px);
  overflow-y: auto; overscroll-behavior: contain; scroll-padding: 16px;
  padding: 18px 18px 22px;
  background:
    linear-gradient(var(--cx-paper) 30%, rgba(251, 250, 246, 0)) top / 100% 24px no-repeat local,
    linear-gradient(rgba(251, 250, 246, 0), var(--cx-paper) 70%) bottom / 100% 24px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(20, 32, 27, 0.1), transparent) top / 100% 8px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(20, 32, 27, 0.1), transparent) bottom / 100% 8px no-repeat scroll,
    var(--cx-paper);
}

/* The brief and its edit form read in full: the panel grows with them (never shorter than the
   live panel, so the switch from conversation to brief only ever extends the card downward). */
.cx:is([data-state="briefing"], [data-state="brief"], [data-state="edit"]) .cx-stage { height: auto; min-height: clamp(320px, 54vh, 500px); overflow: visible; }
.cx[data-state="briefing"] .cx-stage { display: grid; } /* the "writing your brief" line stays centred */
/* A brief shorter than the room made for it fills the sheet: its closing note sits at the foot
   of the page, like the last line of a docket, rather than leaving loose space under it. */
.cx[data-state="brief"] .cx-stage { display: flex; flex-direction: column; }
.cx[data-state="brief"] .cx-brief:not([hidden]) { flex: 1 0 auto; display: flex; flex-direction: column; }
.cx[data-state="brief"] .cx-bview { flex: 1 0 auto; display: flex; flex-direction: column; }
.cx[data-state="brief"] .cx-bview > .cx-bfoot { margin-top: auto !important; }
.cx[data-state="brief"] .cx-bview > :nth-last-child(2) { margin-bottom: 20px; }

.cx-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.cx-msg { max-width: 88%; animation: cx-in 0.32s var(--cx-ease) both; }
.cx-msg.cx-still { animation: none; }
.cx-from { display: flex; align-items: center; gap: 6px; margin: 0 0 6px !important; font: 500 0.68rem/1 var(--cx-sans); letter-spacing: 0.13em; text-transform: uppercase; color: var(--cx-ink-3); }
.cx-from img { width: 16px; height: 16px; }
.cx-ai { align-self: flex-start; }
.cx-ai .cx-body { font: 400 1rem/1.62 var(--cx-serif); color: var(--cx-ink); padding-left: 14px; border-left: 2px solid var(--cx-tape); }
.cx-you { align-self: flex-end; }
.cx-you .cx-from { justify-content: flex-end; }
.cx-you .cx-body {
  font: 400 0.96rem/1.55 var(--cx-sans);
  background: #fff; border: 1px solid #d8d2c4; border-radius: 2px; padding: 10px 14px;
  box-shadow: 0 8px 18px -16px rgba(14, 38, 32, 0.6);
  overflow-wrap: anywhere;
}
.cx-body p + p, .cx-body p + ul, .cx-body p + ol, .cx-body ul + p, .cx-body ol + p { margin-top: 0.7em; }
.cx-body ul, .cx-body ol { margin: 0.4em 0 0; padding-left: 1.2em; }
.cx-body li + li { margin-top: 0.25em; }

/* soft caret while a reply is being written */
.cx-msg.streaming .cx-body > :last-child::after {
  content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -0.18em;
  background: var(--cx-tape-ink); border-radius: 1px; animation: cx-caret 1.05s ease-in-out infinite;
}

/* typing indicator: three ink dots */
.cx-dots { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding-left: 14px; border-left: 2px solid var(--cx-tape); }
.cx-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cx-ink); opacity: 0.55; animation: cx-bob 1.1s var(--cx-ease) infinite; }
.cx-dots i:nth-child(2) { animation-delay: 0.12s; }
.cx-dots i:nth-child(3) { animation-delay: 0.24s; }
.cx-writing { display: none; font: italic 400 0.92rem var(--cx-serif); color: var(--cx-ink-3); }

.cx-notice { align-self: center; display: flex; gap: 8px; align-items: flex-start; max-width: 92%; font: italic 400 0.88rem/1.5 var(--cx-serif); color: var(--cx-ink-2); text-align: center; animation: cx-in 0.32s var(--cx-ease) both; }
.cx-notice.cx-warn { align-self: stretch; max-width: none; text-align: left; font: 400 0.88rem/1.5 var(--cx-sans); color: var(--cx-oxblood); background: var(--cx-oxblood-bg); border-left: 3px solid var(--cx-oxblood); padding: 10px 12px; border-radius: 2px; }
.cx-notice svg { flex: none; margin-top: 2px; }
.cx-notice .cx-link { color: inherit; }
/* what the assistant could read: a docket line above the opening */
.cx-notice.cx-readlist { align-self: stretch; max-width: none; text-align: left; font: 400 0.8rem/1.5 var(--cx-sans); color: var(--cx-ink-3); padding-bottom: 10px; border-bottom: 1px dashed var(--cx-rule); }

/* documents changed since the conversation started */
.cx-stale { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: #fbf6ea; border-bottom: 1px solid rgba(201, 168, 106, 0.55); border-left: 3px solid var(--cx-brass); color: var(--cx-ink); animation: cx-in 0.32s var(--cx-ease) both; }
.cx-stale > svg { flex: none; margin-top: 2px; color: #8a6a2c; }
.cx-stale-t { font-size: 0.88rem; line-height: 1.5; }
.cx-stale-b { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cx-btn-s { min-height: 44px; padding: 0 14px; font-size: 0.86rem !important; }
.cx-ghost-s { font-size: 0.86rem !important; font-weight: 600 !important; padding: 0 14px; }

/* Turnstile: takes no room unless Cloudflare needs a click */
.cx-ts { margin: 4px 0 10px; width: 100%; }
.cx-ts:empty { display: none; }

/* quick-start chips */
.cx-chips { align-self: stretch; margin-top: 2px; animation: cx-in 0.32s var(--cx-ease) 0.1s both; }
.cx-chips-l { font-size: 0.78rem; color: var(--cx-ink-3); margin-bottom: 8px !important; }
.cx-chips-in { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-chip {
  min-height: 44px; padding: 0 14px; border: 1px solid #a49e90; border-radius: 2px; background: #fff;
  font-size: 0.9rem !important; cursor: pointer; text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--cx-ease);
}
.cx-chip:hover { border-color: var(--cx-tape-ink); background: #fff7f8; transform: translateY(-1px); }

/* reading documents */
.cx-reading { display: grid; align-content: center; justify-items: start; height: 100%; max-width: 44ch; margin: 0 auto; outline: none; }
.cx-reading-l { font: 400 1.05rem/1.4 var(--cx-serif); overflow-wrap: anywhere; }
.cx-hair { position: relative; display: block; width: 100%; height: 1px; margin: 14px 0; background: var(--cx-rule); overflow: hidden; }
.cx-hair i { position: absolute; inset: 0; background: var(--cx-tape-ink); transform: scaleX(0.02); transform-origin: left; transition: transform 0.3s var(--cx-ease); }
.cx-reading-s { font-size: 0.82rem; color: var(--cx-ink-3); line-height: 1.5; }

/* dock: composer or brief buttons; constant height so nothing below moves */
.cx-dock { min-height: 98px; padding: 12px 14px 8px; background: #fff; border-top: 1px solid var(--cx-rule); }
.cx-field { display: flex; align-items: flex-end; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid #8a857a; border-radius: 2px; background: #fff; transition: border-color 0.2s; }
.cx-field:focus-within { border-color: var(--cx-ink); box-shadow: 0 0 0 1px var(--cx-ink); }
.cx-input {
  flex: 1; min-width: 0; min-height: 44px; max-height: 168px; padding: 10px 0;
  border: 0; outline: none; resize: none; background: transparent;
  font: 400 1rem/1.5 var(--cx-sans); color: var(--cx-ink);
}
.cx-input::placeholder { color: #6b726e; opacity: 1; } /* 4.9:1 on white (AA) */
.cx-input:disabled { background: transparent; }
.cx-send {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 2px; background: var(--cx-night); color: var(--cx-paper) !important; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s var(--cx-ease);
}
.cx-send:hover:not(:disabled) { transform: translateX(1px); }
.cx-send:disabled { opacity: 0.32; cursor: default; }
.cx-under { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding-top: 4px; }
.cx-hint { font-size: 0.74rem; color: var(--cx-ink-3); }
/* touch: no keyboard hint, and its row collapses unless it holds the button or the counter */
@media (hover: none) and (pointer: coarse) {
  .cx-hint { display: none; }
  .cx-under { min-height: 0; padding-top: 0; }
  .cx-under:has(.cx-done:not([hidden])), .cx-under:has(.cx-count:not(:empty)) { min-height: 40px; padding-top: 4px; }
  .cx-dock { min-height: 0; }
}
.cx-count { font: 500 0.76rem var(--cx-sans); font-variant-numeric: tabular-nums; color: var(--cx-ink-3); margin-left: auto !important; text-align: right; }
.cx-count.over { color: var(--cx-oxblood); }
.cx-done {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--cx-ink); border-radius: 2px; background: #fff;
  font-size: 0.84rem !important; font-weight: 600; cursor: pointer; white-space: nowrap;
  animation: cx-in 0.32s var(--cx-ease) both;
}
.cx-done:hover { background: var(--cx-night); color: var(--cx-paper) !important; }

.cx-briefbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; min-height: 76px; }
.cx-briefbtns { display: flex; gap: 8px; margin-left: auto; }
.cx-saved { display: flex; gap: 6px; align-items: flex-start; font-size: 0.86rem; color: var(--cx-ink-2); min-height: 1.3em; outline: none; max-width: 46ch; }
.cx-saved.is-ok { color: var(--cx-green); font-weight: 600; }
.cx-saved svg { flex: none; margin-top: 2px; }
.cx-saved:focus-visible { box-shadow: 0 0 0 2px var(--cx-paper), 0 0 0 4px var(--cx-ink); border-radius: 2px; }
.cx-saved.over { color: var(--cx-oxblood); }

.cx-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 9px 16px 11px; border-top: 1px solid var(--cx-rule); background: var(--cx-sheet); }
.cx-note { font-size: 0.78rem; color: var(--cx-ink-3); }
.cx-restart { border: 0; background: none; padding: 6px 0; min-height: 32px; font-size: 0.78rem !important; color: var(--cx-ink-2); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* ---------- brief ---------- */
.cx-brief { outline: none; }
.cx-brief-wait { display: grid; justify-items: start; align-content: center; gap: 12px; min-height: 100%; height: 100%; max-width: 42ch; margin: 0 auto; }
.cx-brief-wait p { font: italic 400 1rem/1.5 var(--cx-serif); color: var(--cx-ink-2); }
.cx-warn-t { display: flex; gap: 8px; font: 400 0.92rem/1.5 var(--cx-sans) !important; font-style: normal !important; color: var(--cx-oxblood) !important; }
.cx-warn-t svg { flex: none; margin-top: 3px; }

.cx-bview, .cx-bedit { animation: cx-in 0.36s var(--cx-ease) both; max-width: 62ch; }
.cx-bh { font: 400 1.4rem/1.15 var(--cx-serif); margin: 0 0 12px; outline: none; }
.cx-bsum { font: 400 1.02rem/1.6 var(--cx-serif); color: var(--cx-ink); }
.cx-urgent { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 14px !important; padding: 10px 12px; background: var(--cx-oxblood-bg); border-left: 3px solid var(--cx-oxblood); color: var(--cx-oxblood); font-size: 0.88rem; line-height: 1.5; border-radius: 2px; }
.cx-urgent svg { flex: none; margin-top: 2px; }
.cx-bsec { margin-top: 18px; }
.cx-bsec h5 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--cx-rule); font: 500 0.7rem/1.3 var(--cx-sans); letter-spacing: 0.13em; text-transform: uppercase; color: var(--cx-ink-2); }
.cx-bsec > p + p { margin-top: 4px; }
.cx-blist { margin: 0; padding: 0; list-style: none; font-size: 0.95rem; line-height: 1.5; }
.cx-blist li { position: relative; padding-left: 20px; }
.cx-blist li + li { margin-top: 6px; }
ul.cx-blist > li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 9px; height: 1.5px; background: var(--cx-tape-ink); }
ol.cx-blist { counter-reset: cx; }
ol.cx-blist > li { counter-increment: cx; padding-left: 26px; }
ol.cx-blist > li::before { content: counter(cx) "."; position: absolute; left: 0; top: 0.1em; font: 500 0.8rem var(--cx-mono); color: var(--cx-tape-ink); }
.cx-b-deadlines li { display: flex; gap: 8px; padding-left: 0 !important; }
.cx-b-deadlines li::before { display: none; }
.cx-b-deadlines svg { flex: none; margin-top: 3px; color: var(--cx-ink-3); }
.cx-b-deadlines b { font-weight: 600; }
.cx-b-deadlines .is-urgent, .cx-b-deadlines .is-urgent svg { color: var(--cx-oxblood); }
.cx-date { font-variant-numeric: tabular-nums; }
.cx-src { display: inline-block; margin-left: 8px; padding: 2px 6px; border: 1px solid currentColor; border-radius: 2px; font: 500 0.62rem/1.2 var(--cx-sans); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; vertical-align: 0.15em; }
.cx-scope { padding: 10px 12px 12px; border-left: 3px solid var(--cx-brass); background: #fbf6ea; }
.cx-scope h5 { border-bottom-color: rgba(201, 168, 106, 0.5); }
.cx-bfoot { margin-top: 20px !important; padding-top: 10px; border-top: 1px dashed var(--cx-rule); }

/* edit mode */
.cx-efs { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.cx-efs legend, .cx-elabel { display: block; padding: 0; margin-bottom: 6px; font: 500 0.7rem/1.3 var(--cx-sans); letter-spacing: 0.13em; text-transform: uppercase; color: var(--cx-ink-2); }
.cx-in { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #8a857a; border-radius: 2px; background: #fff; font: 400 0.95rem/1.45 var(--cx-sans); color: var(--cx-ink); }
.cx-in:focus { outline: none; border-color: var(--cx-ink); box-shadow: 0 0 0 1px var(--cx-ink); }
.cx-ta { resize: vertical; min-height: 64px; }
.cx-elist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cx-elist li { display: flex; gap: 6px; align-items: center; }
.cx-edl li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 11em) 40px; }
.cx-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; border-radius: 2px; color: var(--cx-ink-3); cursor: pointer; }
.cx-x:hover { background: var(--stone, #eceae4); color: var(--cx-ink); }
.cx-add { margin-top: 6px; min-height: 36px; border: 0; background: none; padding: 0; color: var(--cx-ink-2); font-size: 0.86rem !important; font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.cx-wc { margin-top: 4px !important; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.76rem; }
.cx-wc.over { color: var(--cx-oxblood); }
.cx-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 0.9rem; line-height: 1.45; cursor: pointer; }
.cx-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--cx-oxblood); flex: none; }

/* ---------- narrow containers / phones ---------- */
@container (max-width: 460px) {
  .cx-intro { padding: 20px 18px 20px 30px; }
  .cx-h { font-size: 1.3rem; }
  .cx-head { padding: 10px 12px; }
  .cx-head-r { justify-content: flex-start; width: 100%; }
  .cx-stage { padding: 14px 12px 18px; }
  .cx-msg { max-width: 94%; }
  .cx-dock { padding: 10px 10px 6px; }
  .cx-edl li { grid-template-columns: minmax(0, 1fr) 40px; }
  .cx-edl li .cx-in-date { grid-column: 1; grid-row: 2; }
  .cx-edl li .cx-x { grid-column: 2; grid-row: 1 / span 2; }
  .cx-briefbtns { width: 100%; }
  .cx-briefbtns .cx-btn { flex: 1; }
}
@media (max-width: 520px) {
  /* nearly a screen tall, so the opening and the starter chips fit above the composer */
  .cx-stage { height: clamp(420px, calc(100svh - 176px), 700px); }
  /* the brief and its edit form flow with the page rather than in a short inner pane */
  .cx[data-state="brief"] .cx-stage, .cx[data-state="edit"] .cx-stage { height: auto; min-height: 320px; overflow: visible; }
  .cx[data-state="briefing"] .cx-stage { min-height: clamp(420px, calc(100svh - 176px), 700px); }
  .cx-stale { padding: 12px; }
  .cx-stale-b > * { flex: 1 1 auto; }
}

/* ---------- motion ---------- */
@keyframes cx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cx-bob { 0%, 70%, 100% { transform: translateY(0); opacity: 0.45; } 35% { transform: translateY(-4px); opacity: 0.95; } }
@keyframes cx-caret { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .cx *, .cx *::before, .cx *::after { animation: none !important; transition: none !important; }
  .cx-dots i { display: none; }
  .cx-dots .cx-writing { display: inline; }
  .cx-msg.streaming .cx-body > :last-child::after { opacity: 0.7; }
}

@media print { .chat-host { display: none; } }
