/* AI support chat demo · Vatar DS (tokens.css), light theme. Neat and white, flat buttons. Local values marked "DS gap". */
:root {
  --row: 13.5px;      /* DS gap: dense admin text size, same as app.css */
  --tiny: 12px;       /* DS gap: meta text, same as app.css */
  --top-h: 64px;      /* DS gap: header height */
  --phone-w: 400px;   /* DS gap: phone-width chat */
  --panel-w: 440px;   /* DS gap: Behind the scenes width */
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--color-bg-surface); color: var(--color-text-primary);
  font-family: var(--font-family-body); font-size: var(--row); line-height: 1.45; -webkit-font-smoothing: antialiased;
}
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: var(--focus-ring-offset); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-feature-settings: var(--font-feature-tabular); }
code { font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 5px; border-radius: var(--radius-xs); background: var(--color-bg-surface); color: var(--color-text-secondary); } /* DS gap: no mono token */

/* ── Buttons (same flat set as the inbox) ── */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: var(--row); font-weight: var(--font-weight-medium); line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; color: inherit; transition: background-color var(--motion-duration-fast) var(--motion-easing-standard), border-color var(--motion-duration-fast) var(--motion-easing-standard); }
.b svg { width: 14px; height: 14px; }
.b--secondary { background: var(--color-bg-canvas); color: var(--color-text-primary); border-color: var(--color-border-default); }
.b--secondary:hover { background: var(--color-bg-surface); border-color: var(--color-border-strong); }
.b--ghost { background: none; color: var(--color-text-secondary); }
.b--ghost:hover { background: var(--color-bg-surface); color: var(--color-text-primary); }
.b:active { transform: translateY(1px); }

/* ── Header ── */
.top { min-height: var(--top-h); display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-6); background: var(--color-bg-canvas); border-bottom: 1px solid var(--color-border-subtle); }
.top__mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-xs); background: var(--color-neutral-1000); flex: none; }
.top__mark img, .chat__av img { display: block; width: 16px; height: auto; }
.top__t { margin-right: auto; min-width: 0; }
.top__t h1 { margin: 0; font-family: var(--font-family-display); font-size: var(--font-size-18); font-weight: var(--font-weight-semibold); letter-spacing: var(--font-tracking-h4); }
.top__t p { margin: 1px 0 0; font-size: var(--tiny); color: var(--color-text-tertiary); }
.top__links { display: flex; gap: var(--space-2); flex: none; }

/* ── Stage: player side + team side ── */
.stage { display: grid; grid-template-columns: var(--phone-w) var(--panel-w); justify-content: center; gap: var(--space-12); padding: var(--space-6); height: calc(100dvh - var(--top-h)); min-height: 600px; }
.side { min-height: 0; display: flex; flex-direction: column; }
.side--player { align-items: center; }
.side__h { width: 100%; max-width: var(--phone-w); margin: 0 0 var(--space-3); font-size: var(--row); font-weight: var(--font-weight-semibold); color: var(--color-text-secondary); display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.side--team .side__h { max-width: none; }
.side__h span { font-weight: var(--font-weight-regular); color: var(--color-text-tertiary); font-size: var(--tiny); }

/* ── The player's chat ── */
.phone { position: relative; width: 100%; max-width: var(--phone-w); flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--color-bg-canvas); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised-light); overflow: hidden; }
.chat__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
.chat__av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-neutral-1000); flex: none; }
.chat__who { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.chat__who b { font-size: var(--font-size-14); font-weight: var(--font-weight-semibold); }
.chat__who > span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--tiny); color: var(--color-text-tertiary); }
.pres { width: 7px; height: 7px; border-radius: 50%; background: var(--color-status-success-solid); flex: none; }
.pres--wait { background: var(--color-status-warning-solid); }
.side__me { display: inline-flex; align-items: center; gap: 6px; }
.side__me img { width: 20px; height: 20px; border-radius: 50%; background: var(--color-bg-canvas); border: 1px solid var(--color-border-subtle); object-fit: cover; }
.side__me b { font-weight: var(--font-weight-medium); color: var(--color-text-secondary); }

.chat__body { position: relative; flex: 1; min-height: 0; display: flex; }
.chat__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-4) var(--space-4) var(--space-2); scrollbar-width: none; overscroll-behavior: contain; }
.chat__scroll::-webkit-scrollbar { display: none; }
.chat__day { text-align: center; font-size: 11px; color: var(--color-text-tertiary); margin-bottom: var(--space-3); }
.log { display: flex; flex-direction: column; }

.mrow { display: flex; align-items: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.mrow.cont { margin-top: var(--space-1); }
.mrow--me { justify-content: flex-end; }
.mav { width: 24px; height: 24px; flex: none; }
.mav--bot { display: grid; place-items: center; border-radius: 50%; background: var(--color-neutral-1000); }
.mav--bot img { width: 12px; height: auto; display: block; }
.bub { max-width: 82%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-bubble); background: var(--color-bg-surface); font-size: var(--font-size-14); line-height: var(--font-line-height-body-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.mrow--me .bub { background: var(--color-bg-inverse); color: var(--color-text-inverse); }
.bub.is-live::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--color-text-tertiary); vertical-align: 1px; animation: caret 900ms var(--motion-easing-in-out) infinite; }
@keyframes caret { 50% { opacity: 0.25; } }
.bub__note { margin: 3px 0 0; display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 11px; color: var(--color-text-tertiary); }
.bub__note svg { width: 12px; height: 12px; }
.bub__note--bot { justify-content: flex-start; padding-left: 32px; }
.bub--card { padding: var(--space-1); background: var(--color-bg-canvas); border: 1px solid var(--color-border-default); }
.article { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; text-align: left; }
.article:hover { background: var(--color-bg-surface); }
.article svg { width: 20px; height: 20px; color: var(--color-text-accent); }
.article span { display: flex; flex-direction: column; }
.article b { font-weight: var(--font-weight-semibold); }
.article small { font-size: var(--tiny); color: var(--color-text-tertiary); }
.divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0 var(--space-2); font-size: var(--tiny); color: var(--color-text-secondary); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border-subtle); }
.divider span { display: inline-flex; align-items: center; gap: 6px; }
.divider svg { width: 13px; height: 13px; }

.typing { display: flex; align-items: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.typing__av { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--color-neutral-1000); }
.typing__av img { width: 12px; height: auto; display: block; }
.typing__dots { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: var(--radius-bubble); background: var(--color-bg-surface); }
.typing__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-tertiary); animation: dot 1100ms var(--motion-easing-in-out) infinite; }
.typing__dots i:nth-child(2) { animation-delay: 160ms; }
.typing__dots i:nth-child(3) { animation-delay: 320ms; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.jump { position: absolute; left: 50%; bottom: var(--space-2); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border: 1px solid var(--color-border-default); border-radius: var(--radius-pill); background: var(--color-bg-canvas); box-shadow: var(--shadow-raised-light); font-size: var(--tiny); font-weight: var(--font-weight-medium); cursor: pointer; }
.jump svg { width: 13px; height: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-4); }
.chips:not(:empty) { padding-top: var(--space-2); padding-bottom: var(--space-3); }
.chip { height: 32px; padding: 0 var(--space-3); border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); background: var(--color-bg-canvas); font-size: var(--row); font-weight: var(--font-weight-medium); cursor: pointer; transition: background-color var(--motion-duration-fast) var(--motion-easing-standard), border-color var(--motion-duration-fast) var(--motion-easing-standard); }
.chip:hover { background: var(--color-bg-surface); border-color: var(--color-border-strong); }
.chip:active { transform: translateY(1px); }
@media (prefers-reduced-motion: no-preference) {
  .chips:not(:empty) .chip { animation: chipIn var(--motion-duration-base) var(--motion-easing-out) both; }
  .chips .chip:nth-child(2) { animation-delay: 40ms; } .chips .chip:nth-child(3) { animation-delay: 80ms; } .chips .chip:nth-child(4) { animation-delay: 120ms; }
}
@keyframes chipIn { from { opacity: 0; transform: translateY(var(--motion-distance-nudge)); } }

.composer { display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-1); border-top: 1px solid var(--color-border-subtle); }
.composer textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 120px; resize: none; padding: 9px 14px; border: 1px solid var(--color-border-default); border-radius: 20px; background: var(--color-bg-canvas); font-size: var(--font-size-16); line-height: 1.35; } /* DS gap: 20px pill radius for a one-line input */
.composer textarea::placeholder { color: var(--color-text-tertiary); }
.composer textarea:hover { border-color: var(--color-border-strong); }
.composer textarea:focus-visible { outline: none; border-color: var(--color-border-focus); box-shadow: 0 0 0 1px var(--color-border-focus); }
.send { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--color-bg-inverse); color: var(--color-text-inverse); cursor: pointer; }
.send:hover { background: var(--color-neutral-700); }
.send:active { transform: scale(var(--motion-scale-press)); }
.send svg { width: 18px; height: 18px; stroke-width: 2; }
.send--stop { background: var(--color-bg-canvas); color: var(--color-text-primary); border: 1px solid var(--color-border-strong); }
.send--stop:hover { background: var(--color-bg-surface); }
.send--stop svg { width: 16px; height: 16px; }
.hint { margin: 0; padding: 4px var(--space-4) var(--space-3); font-size: 11px; color: var(--color-text-tertiary); text-align: center; }

/* ── Behind the scenes ── */
.bts { flex: 1; min-height: 0; overflow-y: auto; background: var(--color-bg-canvas); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); scrollbar-width: none; }
.bts::-webkit-scrollbar { display: none; }
.bts__sec { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border-subtle); transition: background-color var(--motion-duration-slow) var(--motion-easing-out); }
.bts__sec.is-new { animation: flash 1100ms var(--motion-easing-out); }
@keyframes flash { 0% { background: var(--color-bg-brand); } 100% { background: transparent; } }
.bts__sec h3 { margin: 0 0 var(--space-2); font-size: var(--tiny); font-weight: var(--font-weight-semibold); color: var(--color-text-tertiary); }
.bts__cat { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--font-size-16); }
.bts__cat b { font-weight: var(--font-weight-semibold); }
.bts__cat svg { width: 18px; height: 18px; color: var(--color-text-secondary); }
.bts__cat.is-empty b { color: var(--color-text-secondary); font-weight: var(--font-weight-medium); }
.conf { margin-left: auto; height: 22px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: var(--radius-xs); font-size: var(--tiny); font-weight: var(--font-weight-semibold); }
.conf.sure { background: var(--color-status-success-bg); color: var(--color-status-success-fg); }
.conf.unsure { background: var(--color-status-warning-bg); color: var(--color-status-warning-fg); }
.bts__meta { margin: var(--space-2) 0 0; font-size: var(--tiny); color: var(--color-text-tertiary); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: var(--space-2); }
.steps li { counter-increment: s; display: flex; align-items: baseline; gap: var(--space-2); }
.steps li::before { content: counter(s); width: 18px; flex: none; font-size: var(--tiny); color: var(--color-text-tertiary); font-feature-settings: var(--font-feature-tabular); }
.steps li span { flex: 1; min-width: 0; }
.steps em { font-style: normal; font-size: var(--tiny); color: var(--color-text-tertiary); white-space: nowrap; }
.steps em.ok { color: var(--color-status-success-fg); font-weight: var(--font-weight-medium); }
.steps em.no { color: var(--color-status-danger-fg); font-weight: var(--font-weight-medium); }
.steps__out span { color: var(--color-text-accent); font-weight: var(--font-weight-medium); }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.checks li { display: flex; gap: var(--space-2); }
.checks li > svg { margin-top: 1px; }
.checks li.ok > svg { color: var(--color-status-success-fg); }
.checks li.warn > svg { color: var(--color-status-warning-fg); }
.checks li.bad > svg { color: var(--color-status-danger-fg); }
.checks span { display: flex; flex-direction: column; }
.checks small { font-size: var(--tiny); color: var(--color-text-tertiary); }
.state { display: flex; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--color-bg-surface); }
.state > svg { margin-top: 1px; color: var(--color-text-secondary); }
.state b { font-weight: var(--font-weight-semibold); }
.state p { margin: 2px 0 0; color: var(--color-text-secondary); }
.state a { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--space-2); color: var(--color-text-link); font-weight: var(--font-weight-semibold); text-decoration: none; }
.state a:hover { color: var(--color-text-link-hover); text-decoration: underline; }
.state a svg { width: 13px; height: 13px; }
.state--ok { background: var(--color-status-success-bg); }
.state--ok > svg { color: var(--color-status-success-fg); }
.state--handed { background: var(--color-bg-brand); }
.state--handed > svg { color: var(--color-text-accent); }
.rules { margin: var(--space-1) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: var(--tiny); color: var(--color-text-tertiary); }
.rules li { display: flex; align-items: center; gap: var(--space-2); }
.rules li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--color-border-strong); flex: none; }
.rules li.on { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }
.rules li.on::before { background: var(--color-text-accent); }
.bts__foot { margin: 0; padding: var(--space-4) var(--space-5); font-size: var(--tiny); color: var(--color-text-tertiary); }

.toast { position: fixed; z-index: 40; left: 50%; bottom: var(--space-6); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: var(--space-3) var(--space-4); background: var(--color-bg-inverse); color: var(--color-text-inverse); border-radius: var(--radius-sm); box-shadow: var(--shadow-overlay-light); }

/* ── Tablet and phone: stacked, chat first ── */
@media (max-width: 1023px) {
  .stage { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; max-width: 680px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-10); gap: var(--space-8); } /* DS gap: 680 stacked width */
  .phone { flex: none; height: min(680px, calc(100dvh - 150px)); min-height: 480px; }
  .bts { overflow: visible; }
}
@media (max-width: 600px) {
  .top { flex-wrap: wrap; padding: var(--space-3) var(--space-4); row-gap: var(--space-2); }
  .top__t { flex: 1 1 calc(100% - 44px); }
  .top__links { width: 100%; }
  .top__links .b--secondary { flex: 1; }
  .stage { padding: var(--space-4) var(--space-4) var(--space-10); }
  .phone { border-radius: var(--radius-md); height: calc(100dvh - 140px); }
  .bts__sec { padding: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  .typing__dots i, .bub.is-live::after { animation: none; opacity: 0.6; }
  .bts__sec.is-new { animation: none; }
  .b:active, .chip:active, .send:active { transform: none; }
}

/* Two-way demo (12 Nov): replies from the inbox come from a real person, so they carry the staff photo and a white bubble */
.mav--staff { overflow: hidden; background: var(--color-bg-surface); }
.mav--staff img { width: 100%; height: 100%; object-fit: cover; }
.bub--staff { background: var(--color-bg-canvas); border: 1px solid var(--color-border-default); }
.typing--staff .typing__av { overflow: hidden; border-radius: 50%; }
.typing--staff .typing__av img { width: 100%; height: 100%; object-fit: cover; }
.pres--live { background: var(--color-status-success-solid); }
.mav--staff { border-radius: 50%; }

/* ── Phone mockup, phone first (12 Nov) ──
   The player's chat sits in a device frame, centred. "Behind the scenes" opens beside it from the top bar. On a real phone the frame drops away. */
.stage { grid-template-columns: auto; }
.stage.with-bts { grid-template-columns: auto var(--panel-w); }
.stage:not(.with-bts) .side--team { display: none; }
.side--player .side__h { justify-content: center; text-align: center; }
.device { flex: 1; min-height: 0; width: 390px; max-height: 844px; aspect-ratio: 390 / 844; padding: 11px; border-radius: 56px; background: #111113; box-shadow: 0 0 0 1px #2a2a2e, 0 30px 60px -20px rgb(0 0 0 / .35), 0 12px 24px -12px rgb(0 0 0 / .25); } /* DS gap: device bezel colours + radius (a hardware mockup, not UI) */
.device__screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 45px; background: var(--color-bg-canvas); }
.device__status { flex: none; position: relative; display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 4px 30px 0 34px; font-size: 15px; font-weight: var(--font-weight-semibold); color: var(--color-text-primary); }
.device__island { position: absolute; left: 50%; top: 11px; width: 120px; height: 34px; margin-left: -60px; border-radius: 20px; background: #000; }
.device__icons { display: inline-flex; align-items: center; gap: 6px; } .device__icons svg { height: 11px; width: auto; fill: currentColor; }
.device .phone { max-width: none; border: 0; border-radius: 0; box-shadow: none; flex: 1; }
.device .hint { display: none; } /* keyboard hints don't belong on a phone */
.device .composer { padding-bottom: var(--space-2); }
.device__home { flex: none; display: block; width: 134px; height: 5px; margin: 6px auto 8px; border-radius: 3px; background: var(--color-text-primary); }
@media (max-width: 1023px) { .stage.with-bts { grid-template-columns: auto; } }
@media (max-width: 600px) {
  .device { width: 100%; max-height: none; aspect-ratio: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .device__screen { border-radius: 0; } .device__status, .device__home { display: none; }
}
@media (max-width: 600px) {
  .top { flex-wrap: wrap; }
  .top__t p { display: none; }
  .top__links { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: var(--space-1); }
  .top__links::-webkit-scrollbar { display: none; }
  .top__links .b { flex: none; padding: 0 var(--space-3); }
  .stage { padding: 0; gap: 0; }
  .side--player .side__h { display: none; }
  .device { flex: 1; }
}
@media (max-width: 600px) {
  body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  .top { flex: none; }
  .stage { flex: 1; display: flex; height: auto; min-height: 0; }
  .side--player { flex: 1; width: 100%; }
  .device { height: 100%; }
}

/* ── iPhone 18 Pro Max mockup (12 Nov): our own frame from app/2026-10-30-vatar-app/kit/iphone18.css, black finish as in the app prototype; replaces the drawn .device ── */
.ip18-fit { flex: none; position: relative; }
.ip18-fit .ip18 { --ip18-screen-w: 402px; --ip18-screen-h: 874px; --ip18-screen-r: 56px; transform-origin: top left; position: absolute; top: 0; left: 0; }
.ip18-screen { display: flex; flex-direction: column; background: var(--color-bg-canvas); }
.ios-status { flex: none; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 8px 34px 0 40px; font: var(--font-weight-semibold) 16px/1 var(--font-family-body); color: var(--color-text-primary); }
.ios-status__r { display: flex; gap: 6px; align-items: center; } .ios-status svg { display: block; fill: currentColor; }
.ip18-screen .phone { max-width: none; border: 0; border-radius: 0; box-shadow: none; flex: 1; min-height: 0; }
.ip18-screen .hint { display: none; }
.ip18-screen .composer { padding-bottom: var(--space-2); }
.ios-home { flex: none; display: block; width: 140px; height: 5px; margin: 8px auto 9px; border-radius: 3px; background: var(--color-text-primary); }
@media (max-width: 600px) {
  .ip18-fit { flex: 1; width: 100%; height: 100%; }
  .ip18-fit .ip18 { position: static; width: 100%; height: 100%; border-radius: 0; transform: none !important; }
  .ip18-fit .ip18::before, .ip18-btn, .ip18-island, .ip18-glare, .ios-status, .ios-home { display: none; }
  .ip18-band, .ip18-bezel { position: static; height: 100%; border-radius: 0; background: none; box-shadow: none; }
  .ip18-band::before, .ip18-band::after { display: none; }
  .ip18-screen { position: static; height: 100%; border-radius: 0; }
}

/* ════════════════════════════════════════════════════════════════════════════════════════
   Chat styles (12 Nov) · ?chat=1|2|3 (data-chat on <html>, set in ai-chat.html). No param = the original look above.
   Lilac = Vatar (the bot, its V, every action). Peach = warmth, used in style 2 only.
   Text on lilac or peach is ink or white at ≥ 4.5:1 (ratios in the comments). Compare: chat-styles.html
   ════════════════════════════════════════════════════════════════════════════════════════ */
.chip__ic, .chip__go { display: none; } /* topic icon + chevron: only the chat styles show them */
[data-chat] .chip { display: inline-flex; align-items: center; gap: 6px; }
[data-chat] .chip--ic .chip__ic { display: inline-flex; }
[data-chat] .chip svg { width: 16px; height: 16px; }
[data-chat] .chip__t { min-width: 0; }

/* ── 1 · Lilac: one brand colour, soft and round. Bot speaks in lilac-50, the player in deep lilac ── */
[data-chat="1"] .chat__head { border-bottom-color: var(--color-lilac-100); }
[data-chat="1"] .chat__av, [data-chat="1"] .mav--bot, [data-chat="1"] .typing__av { background: var(--color-brand-lilac); } /* C09 black V on lilac 13.1:1 */
[data-chat="1"] .chat__av img { width: 17px; }
[data-chat="1"] .mrow--bot:not(.mrow--staff) .bub:not(.bub--card), [data-chat="1"] .typing__dots { background: var(--color-bg-brand); } /* ink on lilac-50 19:1 */
[data-chat="1"] .mrow--me .bub { background: var(--color-brand-lilac-deep); color: var(--color-text-on-accent); } /* white on lilac-700 7.9:1 */
[data-chat="1"] .typing__dots i, [data-chat="1"] .bub.is-live::after { background: var(--color-lilac-500); }
[data-chat="1"] .bub--card { border-color: var(--color-lilac-100); }
[data-chat="1"] .chip { height: 36px; padding: 0 var(--space-4) 0 var(--space-3); border-radius: var(--radius-pill); border-color: var(--color-lilac-300); background: var(--color-bg-canvas); color: var(--color-brand-lilac-deep); } /* lilac-700 label on white 7.9:1 */
[data-chat="1"] .chip:not(.chip--ic) { padding: 0 var(--space-4); }
[data-chat="1"] .chip:hover { background: var(--color-bg-brand); border-color: var(--color-lilac-400); }
[data-chat="1"] .chip:active { background: var(--color-lilac-100); }
[data-chat="1"] .divider { color: var(--color-brand-lilac-deep); }
[data-chat="1"] .divider::before, [data-chat="1"] .divider::after { background: var(--color-lilac-100); }
[data-chat="1"] .composer { border-top-color: var(--color-lilac-100); }
[data-chat="1"] .composer textarea { background: var(--color-bg-brand); border-color: transparent; }
[data-chat="1"] .composer textarea:hover { border-color: var(--color-lilac-200); }
[data-chat="1"] .composer textarea:focus-visible { border-color: var(--color-border-focus); }
[data-chat="1"] .send { background: var(--color-action-primary-bg); color: var(--color-action-primary-text); } /* the one filled action: lilac-700, white arrow */
[data-chat="1"] .send:hover { background: var(--color-action-primary-bg-hover); }
[data-chat="1"] .send--stop { background: var(--color-bg-canvas); color: var(--color-brand-lilac-deep); border-color: var(--color-lilac-300); }
[data-chat="1"] .send--stop:hover { background: var(--color-bg-brand); }

/* ── 2 · Sunset: a warm peach band and Vatar's chamfered plate. The V sits on a deep-lilac plate with a peach slab,
      the same cut-plate-on-a-slab as the DS buttons. Topics are small cards with a peach icon tile ── */
[data-chat="2"] { --sun-tint: color-mix(in oklab, var(--color-brand-peach) 24%, var(--color-bg-canvas)); /* DS gap: peach tint band */
  --sun-cream: color-mix(in oklab, var(--color-brand-peach) 13%, var(--color-bg-canvas)); /* DS gap: warm bot bubble */
  --sun-line: color-mix(in oklab, var(--color-brand-peach) 55%, var(--color-bg-canvas)); /* DS gap: peach hairline */ }
/* the DS button chamfer (top-left and bottom-right cut, button.css): defined on every element so each one's own --_c is used */
[data-chat="2"] * { --sun-cut: polygon(var(--_c) 0, 100% 0, 100% calc(100% - var(--_c)), calc(100% - var(--_c)) 100%, 0 100%, 0 var(--_c)); }
[data-chat="2"] .ios-status, [data-chat="2"] .chat__head { background: var(--sun-tint); }
[data-chat="2"] .chat__head { border-bottom-color: var(--sun-line); padding-block: var(--space-3) calc(var(--space-3) + 2px); }
[data-chat="2"] .chat__who > span { color: var(--color-text-secondary); } /* n-700 on the tint 9:1 */
[data-chat="2"] .chat__av { --_c: 9px; position: relative; isolation: isolate; width: 40px; height: 40px; margin: 0 4px 4px 0; border-radius: 0; background: none; }
[data-chat="2"] .chat__av::before, [data-chat="2"] .chat__av::after { content: ""; position: absolute; inset: 0; clip-path: var(--sun-cut); }
[data-chat="2"] .chat__av::before { z-index: -2; background: var(--color-brand-peach); transform: translate(4px, 4px); } /* the slab */
[data-chat="2"] .chat__av::after { z-index: -1; background: var(--color-brand-lilac-deep); } /* C13 light V on lilac-700 7.0:1 */
[data-chat="2"] .chat__av img { width: 19px; }
[data-chat="2"] .mav--bot, [data-chat="2"] .typing__av { --_c: 6px; border-radius: 0; clip-path: var(--sun-cut); background: var(--color-brand-lilac-deep); }
[data-chat="2"] .typing--staff .typing__av { clip-path: none; border-radius: 50%; }
[data-chat="2"] .mrow--bot:not(.mrow--staff) .bub:not(.bub--card), [data-chat="2"] .typing__dots { background: var(--sun-cream); border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) var(--radius-xs); } /* ink on cream 18:1 */
[data-chat="2"] .mrow--me .bub { background: var(--color-brand-lilac-deep); color: var(--color-text-on-accent); border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-xs) var(--radius-bubble); } /* white on lilac-700 7.9:1 */
[data-chat="2"] .typing__dots i, [data-chat="2"] .bub.is-live::after { background: var(--color-lilac-500); }
[data-chat="2"] .chips[data-kind="topics"] { display: grid; grid-template-columns: 1fr 1fr; }
[data-chat="2"] .chip { height: auto; min-height: 40px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); border-color: var(--color-border-default); background: var(--color-bg-canvas); color: var(--color-text-primary); text-align: left; line-height: 1.25; }
[data-chat="2"] .chip--ic { gap: 10px; min-height: 54px; padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); }
[data-chat="2"] .chip__ic { --_c: 7px; flex: none; place-items: center; width: 36px; height: 36px; clip-path: var(--sun-cut); background: var(--color-brand-peach); color: var(--color-lilac-800); } /* lilac-800 icon on peach 7.0:1 */
[data-chat="2"] .chip--ic .chip__ic { display: grid; }
[data-chat="2"] .chip__ic svg { width: 19px; height: 19px; stroke-width: 1.9; }
@media (hover: hover) and (pointer: fine) { [data-chat="2"] .chip:hover { background: var(--sun-cream); border-color: var(--sun-line); } }
[data-chat="2"] .chip:active { background: var(--sun-tint); }
[data-chat="2"] .divider span { --_c: 6px; padding: 5px 12px; clip-path: var(--sun-cut); background: var(--color-brand-peach); color: var(--color-text-primary); font-weight: var(--font-weight-medium); } /* the hand-over: n-900 on peach 12:1 */
[data-chat="2"] .divider::before, [data-chat="2"] .divider::after { background: var(--sun-line); }
[data-chat="2"] .composer textarea { border-radius: var(--radius-md); } /* squarer field beside the chamfered send */
[data-chat="2"] .composer textarea:focus-visible { border-color: var(--color-border-focus); }
[data-chat="2"] .send { --_c: 9px; border-radius: 0; clip-path: var(--sun-cut); background: var(--color-action-primary-bg); color: var(--color-action-primary-text); } /* white arrow on lilac-700 7.9:1 */
[data-chat="2"] .send:hover { background: var(--color-action-primary-bg-hover); }
[data-chat="2"] .send--stop { border: 0; background: var(--color-lilac-100); color: var(--color-brand-lilac-deep); } /* lilac-700 on lilac-100 6.2:1 */
[data-chat="2"] .send--stop:hover { background: var(--color-lilac-200); }
[data-chat="2"] .send:focus-visible { clip-path: none; border-radius: var(--radius-xs); } /* keep the ring visible: the cut would clip it */

/* ── 3 · Help menu: white and quiet. The deep-lilac V is the only colour until the player types.
      The bot writes on the page (no bubble), topics are a tappable help list, the send arrow turns lilac with text ── */
[data-chat="3"] .chat__av, [data-chat="3"] .mav--bot, [data-chat="3"] .typing__av { background: var(--color-bg-brand); box-shadow: inset 0 0 0 1px var(--color-lilac-100); } /* C07 deep-lilac V on lilac-50 7.2:1 */
[data-chat="3"] .chat__av img { width: 17px; }
[data-chat="3"] .mrow--bot:not(.mrow--staff) { align-items: flex-start; }
[data-chat="3"] .mrow--bot:not(.mrow--staff) .bub:not(.bub--card) { max-width: 88%; padding: 2px 0 0; background: none; border-radius: 0; font-size: 15px; line-height: 1.5; } /* DS gap: 15px reading size for unboxed text */
[data-chat="3"] .mrow--bot.cont:not(.mrow--staff) { margin-top: var(--space-2); }
[data-chat="3"] .mrow--me .bub { background: var(--color-bg-surface); color: var(--color-text-primary); }
[data-chat="3"] .typing__dots { padding: 9px 2px; background: none; }
[data-chat="3"] .typing--staff .typing__dots { padding: 12px 14px; background: var(--color-bg-surface); }
[data-chat="3"] .chips:not(:empty) { flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 0 var(--space-4) var(--space-3); padding: 0; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); overflow: hidden; }
[data-chat="3"] .chip { position: relative; width: 100%; height: 48px; padding: 0 var(--space-3) 0 var(--space-4); gap: var(--space-3); border: 0; border-radius: 0; background: var(--color-bg-canvas); font-size: 15px; font-weight: var(--font-weight-regular); text-align: left; } /* DS gap: 15px list row, as the bot text */
[data-chat="3"] .chip--ic { padding-left: var(--space-3); }
[data-chat="3"] .chip + .chip::before { content: ""; position: absolute; top: 0; right: 0; left: var(--space-4); height: 1px; background: var(--color-border-subtle); }
[data-chat="3"] .chip--ic + .chip::before { left: 52px; } /* hairline starts under the label, iOS list style */
[data-chat="3"] .chip__t { flex: 1; }
[data-chat="3"] .chip__ic { color: var(--color-brand-lilac-deep); } /* lilac-700 icon on white 7.9:1 */
[data-chat="3"] .chip__ic svg { width: 22px; height: 22px; stroke-width: 1.6; }
[data-chat="3"] .chip__go { display: inline-flex; color: var(--color-text-tertiary); }
[data-chat="3"] .chip__go svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { [data-chat="3"] .chip:hover { background: var(--color-bg-surface); } [data-chat="3"] .chip:hover .chip__go { color: var(--color-brand-lilac-deep); } }
[data-chat="3"] .chip:active { transform: none; background: var(--color-bg-brand); }
[data-chat="3"] .chip:focus-visible { outline-offset: -3px; border-radius: var(--radius-sm); } /* the list clips anything outside a row */
[data-chat="3"] .composer textarea:focus-visible { border-color: var(--color-border-focus); }
[data-chat="3"] .send:not(.send--stop) { background: var(--color-bg-surface); color: var(--color-text-tertiary); transition: background-color var(--motion-duration-fast) var(--motion-easing-standard), color var(--motion-duration-fast) var(--motion-easing-standard); } /* n-600 arrow on n-50 5.8:1 */
[data-chat="3"] .composer:has(textarea:not(:placeholder-shown)) .send:not(.send--stop) { background: var(--color-action-primary-bg); color: var(--color-action-primary-text); } /* lilac-700, white arrow 7.9:1 */
[data-chat="3"] .composer:has(textarea:not(:placeholder-shown)) .send:not(.send--stop):hover { background: var(--color-action-primary-bg-hover); }

/* Email card for account issues (12 Nov) */
.emailcard { margin: var(--space-2) 0 var(--space-3) 32px; padding: var(--space-3); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-canvas); }
.emailcard label { display: block; margin-bottom: 6px; font-size: var(--tiny); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); }
.emailcard__row { display: flex; gap: var(--space-2); }
.emailcard input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); font: inherit; font-size: 16px; background: var(--color-bg-canvas); color: var(--color-text-primary); }
.emailcard input:focus-visible { outline: none; border-color: var(--color-border-focus); box-shadow: 0 0 0 1px var(--color-border-focus); }
.emailcard button { flex: none; height: 40px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: var(--color-brand-lilac-deep); color: #fff; font: inherit; font-weight: var(--font-weight-semibold); cursor: pointer; }
.emailcard button:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
.emailcard__err { margin: 6px 0 0; font-size: var(--tiny); color: var(--color-status-danger-fg); } .emailcard__err:empty { display: none; }
