/* Shared style of the sample pages (no external resources). */
:root {
  --ink: #17212b;
  --muted: #4b5866;
  --line: #d5dce2;
  --paper: #ffffff;
  --bg: #f3f5f7;
  --accent: #003366;        /* per variant; matches the widget colour */
  --accent-deep: #00203f;
  --accent-tint: #e5ecf4;
  --accent2: #a1312e;       /* secondary accent, used sparingly */
  --on-accent: #ffffff;
  --focus-dark: #17212b;
  --focus-light: #ffd34d;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.v-pg { --accent: #a1312e; --accent-deep: #5e1b19; --accent-tint: #f7e9e8; --accent2: #003366; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.6 var(--sans); overflow-wrap: break-word; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus-dark); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--focus-light); }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--paper); color: var(--ink); padding: 10px 14px; }
.skip:focus { left: 12px; top: 12px; }

/* Sample notice */
.sample-banner { background: #fff1c2; color: #4a3600; font-size: .875rem; border-bottom: 1px solid #e5cf80; }
.sample-banner .wrap { display: flex; gap: 10px; align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.sample-banner svg { flex: none; margin-top: 3px; }
.sample-banner p { margin: 0; }

/* Header */
.site-header { background: var(--paper); }
.site-header .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding-top: 18px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { display: block; font-weight: 750; font-size: 1.2rem; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { display: block; color: var(--muted); font-size: .85rem; }
.variants { display: flex; flex-wrap: wrap; margin: 0; padding: 3px; list-style: none; gap: 2px; background: var(--bg); border-radius: 8px; font-size: .875rem; }
.variants a { display: block; padding: 5px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.variants a:hover { color: var(--ink); background: #e4e8ec; }
.variants a[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }

.main-nav { border-top: 1px solid var(--line); }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 0 26px; margin: 0; padding: 0; list-style: none; }
.main-nav a { display: block; padding: 12px 0 10px; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--line); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--accent2); }

/* Hero: headline left, chat preview card right */
.hero { background: var(--accent); color: var(--on-accent); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero h1 { margin: 0 0 18px; font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 750; max-width: 14ch; }
.hero .lead { margin: 0 0 30px; font-size: 1.125rem; line-height: 1.55; max-width: 40ch; color: rgba(255,255,255,.9); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer; border: 2px solid transparent; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-light { background: var(--paper); color: var(--accent-deep); }
.btn-light:hover { background: var(--accent-tint); }
.btn-outline { border-color: rgba(255,255,255,.75); color: var(--on-accent); background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* Chat preview card in the hero, styled close to the widget */
.chat-card { justify-self: end; width: 100%; max-width: 420px; background: var(--paper); color: var(--ink); border-radius: 16px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); overflow: hidden; }
.cc-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cc-head strong { display: block; font-size: 1rem; line-height: 1.3; }
.cc-status { display: block; font-size: .825rem; color: var(--muted); }
.cc-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.cc-avatar svg { width: 20px; height: 20px; }
.cc-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #f7f9fa; }
.cc-msg { margin: 0; padding: 10px 14px; font-size: .95rem; line-height: 1.45; max-width: 85%; }
.cc-user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-radius: 14px 14px 4px 14px; }
.cc-bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.cc-foot { padding: 14px 20px 18px; }
.btn-accent { width: 100%; justify-content: center; background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-deep); }
.chat-card :focus-visible { outline-color: var(--focus-dark); }

/* Topic index: rows instead of identical cards */
.topics { padding-top: 64px; }
.topics .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 40px; }
.topics h2 { margin: 0; font-size: 1.6rem; line-height: 1.2; letter-spacing: -.015em; }
.topics .intro { margin: 10px 0 0; color: var(--muted); max-width: 30ch; }
.topic-list { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.topic-list li { border-bottom: 1px solid var(--line); }
.topic-list a { display: grid; grid-template-columns: 44px minmax(0, 13rem) minmax(0, 1fr); gap: 4px 20px; align-items: start; padding: 18px 12px 18px 4px; color: var(--ink); text-decoration: none; }
.topic-list svg { width: 26px; height: 26px; color: var(--accent2); margin-top: 1px; }
.topic-list strong { font-size: 1.1rem; font-weight: 650; }
.topic-list span { color: var(--muted); }
.topic-list a:hover { background: var(--paper); }
.topic-list a:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }

/* Chat hint */
.hint-sec { padding-top: 48px; }
.hint p { margin: 0; max-width: 60ch; font-size: 1.05rem; border-left: 4px solid var(--accent2); padding-left: 18px; }
.hint strong { display: block; font-size: 1.15rem; }

/* Embed code */
.embed-sec { padding-top: 40px; }
.embed { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.embed summary { cursor: pointer; padding: 16px 20px; font-weight: 650; list-style-position: inside; }
.embed summary:hover { color: var(--accent); }
.embed summary span { font-weight: 400; color: var(--muted); }
.embed .body { padding: 0 20px 20px; }
.embed p { margin: 0 0 12px; color: var(--muted); max-width: 75ch; }
.embed .code-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: .875rem; color: var(--muted); }
.embed pre { margin: 0; padding: 16px; background: #18232b; color: #e9eff3; border-radius: 8px; overflow-x: auto; font: 13px/1.55 ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace; }
.btn-small { padding: 6px 14px; font-size: .875rem; border: 1.5px solid var(--accent); color: var(--accent); background: var(--paper); }
.btn-small:hover { background: var(--accent-tint); }
.copy-status { min-height: 1.5em; font-size: .875rem; color: var(--accent); margin: 8px 0 0; }

/* Footer: bottom padding keeps text clear of the chat launcher */
.site-footer { margin-top: 72px; background: var(--accent-deep); color: rgba(255,255,255,.88); font-size: .9rem; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 28px; padding-top: 36px; padding-bottom: 104px; }
.site-footer .f-name { font-weight: 750; font-size: 1.1rem; color: #fff; margin: 0 0 6px; }
.site-footer h2 { font-size: .95rem; margin: 0 0 6px; color: #fff; }
.site-footer p { margin: 0; max-width: 42ch; }
.site-footer a { color: #fff; }

@media (max-width: 860px) {
  .chat-card { justify-self: stretch; max-width: none; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; padding-bottom: 48px; }
  .topics .wrap { grid-template-columns: 1fr; gap: 20px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .main-nav ul { gap: 0 18px; }
  .variants { width: 100%; flex-wrap: nowrap; }
  .variants li { flex: 1 1 auto; }
  .variants a { padding: 5px 6px; font-size: .78rem; text-align: center; white-space: nowrap; }
  .topic-list a { grid-template-columns: 36px minmax(0, 1fr); }
  .topic-list span { grid-column: 2; }
  .btn { white-space: normal; }
}

/* Tester helper in the sample banner: start a fresh chat */
.sample-banner .wrap { align-items: center; gap: 10px 16px; }
.sample-banner p { flex: 1 1 auto; }
.sample-banner .wrap > svg { margin-top: 0; }
.new-conv {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 6px 16px 6px 13px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 600 14px/1.2 var(--sans); white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.new-conv svg { width: 16px; height: 16px; flex: none; margin: 0; }
.new-conv:hover { background: var(--accent-deep); }
.new-conv:active { transform: translateY(1px); }
.new-conv:focus-visible { outline: 3px solid var(--focus-dark); outline-offset: 2px; }
.new-conv:disabled { opacity: .7; cursor: progress; }
@media (max-width: 600px) {
  .sample-banner .wrap { flex-wrap: wrap; padding-bottom: 12px; }
  .sample-banner p { flex-basis: calc(100% - 34px); }
  .new-conv { width: 100%; }
}
