/* The sample websites' customiser and chatbot (kit.js). Each template themes them through the --kit-* tokens on
   :root; the fallbacks below are a neutral light look. Logical properties throughout, so RTL works if a sample
   is ever translated. */
:root {
  --kit-accent: #1f2a24; --kit-accent-ink: #fff; --kit-surface: #fff; --kit-ink: #1d1b18;
  --kit-muted: #6b655c; --kit-line: #e2dcd2; --kit-radius: 14px; --kit-font: system-ui, sans-serif;
}
.kit-sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- customiser: shared/configurator.js markup, mapped onto the kit tokens ---- */
.kit-cfg-host {
  --card: var(--kit-surface); --line: var(--kit-line); --ink: var(--kit-ink); --paper: var(--kit-surface);
  --muted: var(--kit-muted); --accent: var(--kit-accent); --accent-ink: var(--kit-accent-ink); --radius: var(--kit-radius);
  color: var(--kit-ink); font-family: var(--kit-font);
}
.kit-cfg-host .cfg { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); background: var(--kit-surface);
  border: 1px solid var(--kit-line); border-radius: var(--kit-radius); overflow: hidden; text-align: start; }
.kit-cfg-host .cfg-stage { min-block-size: 480px; position: relative; background: #e6ebef; }
.kit-cfg-host .cfg-stage canvas { position: absolute; inset: 0; inline-size: 100% !important; block-size: 100% !important; cursor: grab; touch-action: none; }
.kit-cfg-host .cfg-stage canvas:active { cursor: grabbing; }
.kit-cfg-host .cfg-panel { padding: 24px; border-inline-start: 1px solid var(--kit-line); display: flex; flex-direction: column; gap: 16px; }
.kit-cfg-host .cfg-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.kit-cfg-host .cfg-tabs button { border: 1px solid var(--kit-line); background: transparent; color: var(--kit-ink); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.kit-cfg-host .cfg-tabs button:hover { border-color: var(--kit-ink); }
.kit-cfg-host .cfg-tabs button[aria-selected="true"] { background: var(--kit-ink); color: var(--kit-surface); border-color: var(--kit-ink); }
.kit-cfg-host .cfg fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-inline-size: 0; }
.kit-cfg-host .cfg legend { font-weight: 600; margin-block-end: 6px; font-size: 14px; padding: 0; }
.kit-cfg-host .cfg label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.kit-cfg-host .cfg input[type="radio"] { accent-color: var(--kit-accent); margin-block-start: 3px; flex: none; }
.kit-cfg-host .cfg label small { color: var(--kit-muted); }
.kit-cfg-host .cfg-total { font-size: 28px; font-weight: 600; line-height: 1.2; }
.kit-cfg-host .cfg-quote { border: 0; background: var(--kit-accent); color: var(--kit-accent-ink); border-radius: max(6px, calc(var(--kit-radius) * 2));
  padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; inline-size: fit-content; transition: transform .2s, filter .2s; }
.kit-cfg-host .cfg-quote:hover { filter: brightness(1.08); transform: translateY(-1px); }
.kit-cfg-host .cfg-note { font-size: 13px; line-height: 1.5; color: var(--kit-muted); margin: 0; }
.kit-cfg-host :focus-visible { outline: 2px solid var(--kit-accent); outline-offset: 2px; }
.kit-cfg-fail { padding: 24px; border: 1px dashed var(--kit-line); border-radius: var(--kit-radius); color: var(--kit-muted); }
[data-sample-customiser]:empty { min-block-size: 480px; border-radius: var(--kit-radius); background: color-mix(in srgb, var(--kit-ink) 6%, transparent); }
@media (max-width: 860px) {
  .kit-cfg-host .cfg { grid-template-columns: 1fr; }
  .kit-cfg-host .cfg-stage { min-block-size: 320px; }
  .kit-cfg-host .cfg-panel { border-inline-start: 0; border-block-start: 1px solid var(--kit-line); padding: 18px; }
  [data-sample-customiser]:empty { min-block-size: 640px; }
}

/* ---- chat: a launcher and a panel, both above the SAMPLE bar (fixed to the bottom; kit.js sets --kit-bar to its height, which grows to 3 lines on phones) ---- */
.kit-launch, .kit-chat { font-family: var(--kit-font); }
.kit-launch { position: fixed; inset-inline-end: 20px; inset-block-end: calc(var(--kit-bar, 40px) + 16px + env(safe-area-inset-bottom)); z-index: 2147482000;
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px 12px 14px;
  background: var(--kit-accent); color: var(--kit-accent-ink); font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18); transition: transform .2s, box-shadow .2s; }
.kit-launch:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgb(0 0 0 / .22); }
.kit-launch:focus-visible { outline: 3px solid var(--kit-accent); outline-offset: 3px; }
.kit-chat-open .kit-launch { display: none; }
.kit-chat { position: fixed; inset-inline-end: 20px; inset-block-end: calc(var(--kit-bar, 40px) + 16px + env(safe-area-inset-bottom)); z-index: 2147482001;
  inline-size: min(380px, calc(100vw - 32px)); block-size: min(560px, calc(100dvh - 96px)); display: flex; flex-direction: column;
  background: var(--kit-surface); color: var(--kit-ink); border: 1px solid var(--kit-line); border-radius: var(--kit-radius);
  box-shadow: 0 20px 50px rgb(0 0 0 / .22); overflow: hidden; }
.kit-chat[hidden] { display: none; }
.kit-chat__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
  background: var(--kit-accent); color: var(--kit-accent-ink); }
.kit-chat__title { margin: 0; font-weight: 700; font-size: 16px; line-height: 1.3; }
.kit-chat__sub { margin: 2px 0 0; font-size: 12px; opacity: .85; }
.kit-chat__close { flex: none; display: grid; place-items: center; inline-size: 36px; block-size: 36px; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer; }
.kit-chat__close:hover { background: rgb(255 255 255 / .16); }
.kit-chat__close:focus-visible, .kit-chat__send:focus-visible, .kit-chip:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.kit-chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kit-msg { margin: 0; max-inline-size: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.kit-msg--bot { align-self: flex-start; background: color-mix(in srgb, var(--kit-ink) 7%, var(--kit-surface)); border-end-start-radius: 4px; }
.kit-msg--me { align-self: flex-end; background: var(--kit-accent); color: var(--kit-accent-ink); border-end-end-radius: 4px; }
.kit-msg--err { align-self: flex-start; background: #fdecea; color: #8a1c12; }
.kit-msg--wait { display: inline-flex; gap: 4px; }
.kit-msg--wait span:not(.kit-sr) { inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--kit-muted); animation: kit-dot 1s infinite ease-in-out; }
.kit-msg--wait span:nth-child(2) { animation-delay: .15s; } .kit-msg--wait span:nth-child(3) { animation-delay: .3s; }
@keyframes kit-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.kit-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.kit-chip { border: 1px solid var(--kit-line); background: var(--kit-surface); color: var(--kit-ink); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 13px; cursor: pointer; text-align: start; }
.kit-chip:hover { border-color: var(--kit-accent); }
.kit-chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-block-start: 1px solid var(--kit-line); }
.kit-chat__form textarea { flex: 1; min-inline-size: 0; resize: none; border: 1px solid var(--kit-line); border-radius: 12px; padding: 10px 12px;
  font: inherit; font-size: 15px; line-height: 1.4; background: var(--kit-surface); color: var(--kit-ink); }
.kit-chat__form textarea:focus { outline: 2px solid var(--kit-accent); outline-offset: 0; border-color: transparent; }
.kit-chat__send { flex: none; display: grid; place-items: center; inline-size: 42px; block-size: 42px; border: 0; border-radius: 50%;
  background: var(--kit-accent); color: var(--kit-accent-ink); cursor: pointer; }
.kit-chat__note { margin: 0; padding: 0 14px 10px; font-size: 11.5px; line-height: 1.4; color: var(--kit-muted); }
.kit-chat__note a { color: inherit; }
@media (max-width: 480px) {
  .kit-launch { inset-inline-end: 12px; padding: 12px; }
  .kit-launch span { display: none; }
  .kit-chat { inset-inline: 8px; inline-size: auto; block-size: calc(100dvh - var(--kit-bar, 40px) - 24px - env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .kit-launch, .kit-cfg-host .cfg-quote, .kit-cfg-host .cfg-tabs button { transition: none; }
  .kit-msg--wait span:not(.kit-sr) { animation: none; opacity: .6; }
}
