:root {
      --guest-font-stack: system-ui, Segoe UI, Roboto, Inter, Arial, sans-serif;
      --guest-bg:#0b1324;
      --guest-panel:rgba(17,26,47,.92);
      --guest-panel-soft:rgba(11,18,32,.9);
      --guest-border:#1f2c48;
      --guest-text:#e7ecf7;
      --guest-subtle:#9fb0c3;
      --guest-link:#b6c2da;
      --guest-accent:#2563eb;
    }
    html[data-kira-theme-resolved="light"] {
      --guest-bg:#f4f7fb;
      --guest-panel:rgba(255,255,255,.94);
      --guest-panel-soft:rgba(247,251,255,.92);
      --guest-border:#c4d2e0;
      --guest-text:#102033;
      --guest-subtle:#516273;
      --guest-link:#1d4ed8;
      --guest-accent:#2563eb;
    }
    body { font:14px/1.5 var(--guest-font-stack); background:var(--guest-bg); color:var(--guest-text); margin:0; padding:0; }
    .wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
    .grid { display:grid; grid-template-columns: 340px 1fr; gap: 1rem; align-items:start; }
    @media (max-width: 920px){ .grid{ grid-template-columns:1fr; } }
    h1 { margin: 0 0 1rem; font-size: 1.6rem; }
    .topbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom: 1rem; }
    .topbar-actions{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
    .backlink { color:var(--guest-link); text-decoration:none; font-size:0.92rem; }
    .backlink:hover { text-decoration:underline; }
    .theme-toggle{display:inline-flex;align-items:center;gap:.5rem;padding:.65rem .9rem;border-radius:999px;border:1px solid var(--guest-border);background:var(--guest-panel);color:var(--guest-text);cursor:pointer}
    .card { background:var(--guest-panel); border:1px solid var(--guest-border); border-radius:8px; padding:1rem; }
    .log { background:var(--guest-panel); border:1px solid var(--guest-border); border-radius:8px; padding:1rem; min-height:60vh; display:flex; flex-direction:column; gap:10px; }
    .entry { padding:10px; border-radius:10px; background:var(--guest-panel-soft); border:1px solid var(--guest-border); }
    .entry.user { border-color:#2a9d8f; }
    .entry.assistant { border-color:#2a5bbf; }
    .entry small { display:block; color:var(--guest-subtle); margin-bottom:6px; font-size:12px; }
    .entry.typing { opacity: 0.95; }
    .entry.typing .typing-label { color:var(--guest-subtle); margin-right:6px; }
    .entry.typing .dots { display:inline-block; vertical-align:middle; }
    .entry.typing .dots span { display:inline-block; margin-right:3px; opacity:0.25; transform:translateY(0); animation: kira-dots 900ms infinite ease-in-out; }
    .entry.typing .dots span:nth-child(1){ animation-delay:0ms }
    .entry.typing .dots span:nth-child(2){ animation-delay:120ms }
    .entry.typing .dots span:nth-child(3){ animation-delay:240ms }
    @keyframes kira-dots { 0% { opacity:0.25; transform:translateY(0);} 50%{ opacity:1; transform:translateY(-4px);} 100%{ opacity:0.25; transform:translateY(0);} }
    .row { display:flex; gap:0.5rem; margin-top:1rem; }
    input[type=text] { flex:1; padding:0.75rem; border-radius:8px; border:1px solid var(--guest-border); background:var(--guest-panel); color:var(--guest-text); }
    button { padding:0.75rem 1rem; border:none; border-radius:8px; background:var(--guest-accent); color:white; cursor:pointer; }
    input, button { font:inherit; }
    button:disabled { opacity:0.6; cursor:not-allowed; }
    details > summary { cursor:pointer; }
    .muted { color:var(--guest-subtle); font-size:0.92rem; }
    .guest-md-code{background:var(--guest-panel);border:1px solid var(--guest-border);border-radius:6px;padding:1px 5px}
    .guest-md-pre{white-space:pre-wrap;background:var(--guest-panel-soft);border:1px solid var(--guest-border);border-radius:8px;padding:10px;overflow:auto}
    .guest-md-table-wrap{overflow:auto}
    .guest-md-table{border-collapse:collapse;width:100%;margin:8px 0}
    .guest-md-table th{ text-align:left;border:1px solid var(--guest-border);padding:6px 8px;background:var(--guest-panel) }
    .guest-md-table td{ border:1px solid var(--guest-border);padding:6px 8px;vertical-align:top }
    .guest-md-list{margin:8px 0 8px 18px;padding:0}
    .guest-md-paragraph{margin:8px 0}
    /* Only the public demo surface; never expose internal chat/agent controls. */
    body.kui-guest-demo { min-width:0; }
    .kui-guest-demo .wrap { width:100%; min-width:0; padding:clamp(12px,2.5vw,28px); }
    .kui-guest-demo .grid { grid-template-columns:minmax(230px,310px) minmax(0,1fr); }
    .kui-guest-demo .grid > * { min-width:0; }
    .kui-guest-demo #log { min-width:0; max-height:65dvh; overflow-y:auto; overscroll-behavior:contain; }
    .kui-guest-demo :is(.entry,.assistant-body,.user-body) { min-width:0; overflow-wrap:anywhere; }
    .kui-guest-demo .row { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
    .kui-guest-demo #msg { flex:1 1 180px; width:auto; min-width:0; max-width:100%; }
    .kui-guest-demo :is(#send,#guest-voice) { min-height:44px; }
    .kui-guest-demo :is(a,button,input,summary):focus-visible { outline:2px solid var(--guest-accent); outline-offset:3px; }
    .kui-guest-demo .guest-md-table-wrap { max-width:100%; }
    @media(max-width:920px) {
      .kui-guest-demo .grid { grid-template-columns:minmax(0,1fr); }
      .kui-guest-demo #log { min-height:44dvh; max-height:60dvh; }
    }
    @media(max-width:450px) {
      .kui-guest-demo .topbar { align-items:flex-start; }
      .kui-guest-demo .topbar-actions { width:100%; justify-content:space-between; }
      .kui-guest-demo #msg { flex-basis:100%; }
      .kui-guest-demo :is(#send,#guest-voice) { flex:1 1 0; }
    }
    @media(prefers-reduced-motion:reduce) {
      .kui-guest-demo .entry.typing .dots span { animation:none; opacity:.8; transform:none; }
    }