.demo-chat { --chat-paper:#ffffff; --chat-ink:#2a2a2a; --chat-muted:#595757; --chat-line:#c8c8c8; --chat-blue:#14719c; --chat-pale:#e7f1f3; --chat-visible-height:100svh; }
.demo-chat [hidden] { display:none !important; }
.demo-chat .chat-skip { position:fixed; top:-80px; left:16px; z-index:200; background:var(--chat-ink); color:#fff; padding:12px 18px; }
.demo-chat .chat-skip:focus { top:10px; }
.demo-chat .chat-main { padding-bottom:40px; }
.demo-chat .chat-intro { padding-bottom:28px; }
.demo-chat .chat-intro h1 { font-size:clamp(28px,3.4vw,44px); }
.demo-chat .chat-intro > p { max-width:34em; }
.demo-chat .chat-mobile-break { display:none; }
.demo-chat .chat-layout { display:grid; grid-template-columns:minmax(0,1fr) 276px; gap:28px; align-items:start; }
.demo-chat .chat-panel { grid-column:1; grid-row:1; min-width:0; border:1px solid var(--chat-line); background:var(--chat-paper); border-radius:6px; overflow:hidden; }
.demo-chat .chat-panel-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 22px; border-bottom:1px solid var(--chat-line); }
.demo-chat .chat-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.demo-chat .chat-identity h2 { font-size:17px; font-weight:700; letter-spacing:-.02em; margin:0 0 2px; line-height:1.4; }
.demo-chat .chat-identity p { display:flex; align-items:center; gap:5px; margin:0; font-size:11px; color:var(--chat-muted); line-height:1.5; }
.demo-chat .chat-live-dot { width:5px; height:5px; border-radius:50%; background:var(--chat-blue); flex:none; }
.demo-chat .chat-avatar { display:grid; place-content:center; width:43px; height:43px; flex:none; border-radius:12px; background:#d7edf4; transform:rotate(-4deg); }
.demo-chat .chat-avatar span { display:block; width:23px; height:8px; border:2px solid var(--chat-blue); border-radius:100%; transform:rotate(-24deg); }
.demo-chat .chat-avatar span + span { margin-top:-2px; transform:rotate(24deg); }
.demo-chat .chat-reset-button { border:0; background:transparent; color:var(--chat-muted); min-height:44px; padding:4px 0 4px 8px; font-family:inherit; font-size:12px; line-height:1.6; text-align:right; cursor:pointer; flex:none; }
.demo-chat .chat-reset-button:hover, .demo-chat .chat-text-button:hover { color:var(--chat-ink); text-decoration:underline; }
.demo-chat .chat-reset-confirm { padding:18px 22px; border-bottom:1px solid var(--chat-line); background:#f7fafc; }
.demo-chat .chat-reset-confirm p { font-size:13px; margin:0 0 12px; }
.demo-chat .chat-confirm-actions { display:flex; flex-wrap:wrap; gap:8px; }
.demo-chat .chat-confirm-actions .demo-button { padding:10px 14px; font-size:13px; }
.demo-chat .chat-log { height:440px; height:clamp(300px,45svh,520px); overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding:24px; scrollbar-width:thin; scrollbar-color:#c8c8c8 transparent; }
.demo-chat .chat-log:focus-visible { outline-offset:-4px; }
.demo-chat .chat-welcome { display:flex; min-height:100%; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:24px 6px; }
.demo-chat .chat-welcome-mark { color:var(--chat-blue); display:block; font-size:44px; line-height:1; margin-bottom:24px; }
.demo-chat .chat-welcome-title { font-size:23px; font-weight:500; letter-spacing:-.04em; margin:0 0 12px; }
.demo-chat .chat-welcome p:last-child { font-size:13px; color:var(--chat-muted); line-height:1.9; margin:0; }
.demo-chat .chat-message { max-width:92%; margin:0 0 24px; }
.demo-chat .chat-message:last-child { margin-bottom:0; }
.demo-chat .chat-message-user { margin-left:auto; max-width:87%; }
.demo-chat .chat-speaker { color:var(--chat-muted); font-size:11px; margin:0 0 6px; line-height:1.5; }
.demo-chat .chat-message-user .chat-speaker { text-align:right; }
.demo-chat .chat-content { font-size:15px; line-height:1.95; overflow-wrap:anywhere; white-space:pre-wrap; padding:16px 18px; border-radius:2px 12px 12px 12px; background:#f7fafc; }
.demo-chat .chat-message-user .chat-content { background:var(--chat-pale); color:#173d4d; border-radius:12px 2px 12px 12px; }
.demo-chat .chat-message-pending .chat-content { display:inline-flex; gap:8px; align-items:center; color:var(--chat-muted); font-size:13px; padding-block:12px; }
.demo-chat .chat-wait-dots { font-size:18px; color:var(--chat-blue); letter-spacing:3px; }
.demo-chat .chat-starters { display:flex; flex-wrap:wrap; gap:7px; padding:0 22px 16px; }
.demo-chat .chat-starter { padding:8px 11px; min-height:40px; border:1px solid var(--chat-line); border-radius:30px; color:var(--chat-muted); background:transparent; font-family:inherit; font-size:12px; line-height:1.5; cursor:pointer; }
.demo-chat .chat-starter:hover { background:var(--chat-pale); color:var(--chat-blue); border-color:#9cbec8; }
.demo-chat .chat-starter:disabled { opacity:.45; cursor:default; }
.demo-chat .chat-composer { padding:18px 22px 20px; border-top:1px solid var(--chat-line); }
.demo-chat .chat-input-label { display:block; font-size:12px; font-weight:500; margin:0 0 8px; }
.demo-chat #chat-input { display:block; width:100%; min-height:78px; max-height:180px; resize:vertical; padding:12px 14px; border:1px solid #c8c8c8; border-radius:4px; background:#fff; color:var(--chat-ink); font-family:inherit; font-size:16px; line-height:1.7; overflow-wrap:anywhere; }
.demo-chat #chat-input::placeholder { color:#595757; opacity:1; }
.demo-chat #chat-input:read-only { background:#ffffff; color:#595757; }
.demo-chat .chat-composer-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; }
.demo-chat .chat-send-meta { display:flex; flex-direction:column; gap:3px; color:var(--chat-muted); font-size:11px; line-height:1.6; }
.demo-chat .chat-shortcut { font-size:11px; }
.demo-chat .chat-send-buttons { display:flex; align-items:center; gap:7px; flex:none; }
.demo-chat .chat-send-buttons .demo-button { min-height:44px; padding:10px 16px; }
.demo-chat .chat-send-buttons #chat-cancel { font-size:12px; padding-inline:10px; }
.demo-chat .demo-button:disabled { opacity:.45; cursor:not-allowed; }
.demo-chat .chat-request-status { color:var(--chat-blue); font-size:12px; line-height:1.7; }
.demo-chat .chat-request-status:not(:empty) { padding-top:12px; }
.demo-chat .chat-error { border-left:3px solid #a64235; background:#f6eae5; padding:12px 14px; margin-top:14px; font-size:13px; line-height:1.8; }
.demo-chat .chat-error p { margin:0; color:#71382e; }
.demo-chat .chat-text-button { display:inline-flex; align-items:center; border:0; background:transparent; color:var(--chat-blue); min-height:44px; padding:8px 0; text-align:left; text-decoration:underline; text-underline-offset:3px; font-family:inherit; font-size:13px; cursor:pointer; }
.demo-chat .chat-privacy { font-size:11px; line-height:1.8; margin:13px 0 0; color:var(--chat-muted); }
.demo-chat .chat-quota { font-size:11px; color:var(--chat-blue); margin:12px 0 0; line-height:1.6; }
.demo-chat .chat-memory { grid-column:2; grid-row:1; min-width:0; }
.demo-chat .chat-memory details { border-block:1px solid var(--chat-line); }
.demo-chat .chat-memory summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:58px; cursor:pointer; list-style:none; font-size:15px; font-weight:500; }
.demo-chat .chat-memory summary::-webkit-details-marker { display:none; }
.demo-chat .chat-memory summary small { font-size:11px; color:var(--chat-muted); font-weight:400; margin-left:8px; }
.demo-chat .chat-memory-marker { font-size:20px; font-weight:400; }
.demo-chat .chat-memory details[open] .chat-memory-marker { transform:rotate(45deg); }
.demo-chat .chat-memory-body { padding:0 0 20px; }
.demo-chat .chat-memory-intro { font-size:13px; color:var(--chat-muted); margin:0 0 20px; line-height:1.9; }
.demo-chat .chat-memory fieldset { min-width:0; border:0; padding:0; margin:0; }
.demo-chat .chat-memory label { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:18px 0 7px; font-size:13px; font-weight:500; }
.demo-chat .chat-memory label:first-child { margin-top:0; }
.demo-chat .chat-memory label span { color:var(--chat-muted); font-size:11px; font-weight:400; }
.demo-chat .chat-memory input, .demo-chat .chat-memory textarea, .demo-chat .chat-memory select { width:100%; border:1px solid #c8c8c8; border-radius:3px; background:var(--chat-paper); color:var(--chat-ink); padding:10px 11px; font-family:inherit; font-size:16px; line-height:1.6; min-height:44px; }
.demo-chat .chat-memory textarea { min-height:100px; resize:vertical; }
.demo-chat .chat-memory input:disabled, .demo-chat .chat-memory textarea:disabled, .demo-chat .chat-memory select:disabled { opacity:.6; }
.demo-chat .chat-memory-save { width:100%; margin-top:22px; }
.demo-chat .chat-memory-status { min-height:1.8em; color:var(--chat-blue); font-size:12px; line-height:1.8; margin:8px 0 12px; }
.demo-chat .chat-small-note, .demo-chat .chat-tab-note { font-size:11px; color:var(--chat-muted); line-height:1.9; margin:0; }
.demo-chat .chat-tab-note { margin-top:16px; }
.demo-chat .chat-bottom-note { margin-top:22px; max-width:64em; }
.demo-chat .chat-storage-note { font-size:12px; color:var(--chat-muted); margin-top:14px; }
.demo-chat .chat-footer-inner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 24px; }
.demo-chat .chat-footer-inner p { margin:0; }
.demo-chat .chat-footer-inner a { display:inline-flex; align-items:center; min-height:44px; }
.demo-chat .chat-no-script { padding:18px 22px; font-size:14px; }
.demo-chat .chat-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.demo-chat :is(button,input,textarea,select,summary):focus-visible { outline:2px solid var(--chat-blue); outline-offset:3px; }
@media (max-width:900px) {
  .demo-chat .chat-layout { grid-template-columns:minmax(0,1fr) 240px; gap:20px; }
  .demo-chat .chat-panel-head, .demo-chat .chat-composer { padding-inline:18px; }
  .demo-chat .chat-log { padding-inline:18px; }
  .demo-chat .chat-starters { padding-inline:18px; }
}
@media (max-width:740px) {
  .demo-chat .chat-layout { display:flex; flex-direction:column; gap:18px; }
  .demo-chat .chat-memory, .demo-chat .chat-panel { width:100%; }
  .demo-chat .chat-memory summary { min-height:50px; }
  .demo-chat .chat-tab-note { margin-top:8px; }
  .demo-chat .chat-memory-body { padding-bottom:16px; }
  .demo-chat .chat-intro { padding-bottom:20px; }
  .demo-chat .chat-intro > p { font-size:13px; }
  .demo-chat .chat-log { height:clamp(220px,38svh,360px); height:clamp(180px,calc(var(--chat-visible-height) * .38),360px); padding:20px 16px; }
  .demo-chat .chat-log:has(.chat-welcome) { height:160px; }
  .demo-chat .chat-panel-head { padding:15px 16px; }
  .demo-chat .chat-composer { padding:16px; }
  .demo-chat .chat-starters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:0 16px 14px; gap:6px; }
  .demo-chat .chat-starter { min-height:44px; padding-inline:7px; white-space:normal; }
  .demo-chat .chat-message { max-width:95%; }
  .demo-chat .chat-content { padding:12px 14px; font-size:14px; }
  .demo-chat .chat-shortcut { display:none; }
  .demo-chat .chat-welcome { padding:12px 6px; }
  .demo-chat .chat-welcome-title { font-size:21px; }
  .demo-chat .chat-welcome-mark { display:none; }
  .demo-chat .chat-welcome p:last-child { font-size:12px; }
  .demo-chat #chat-input { resize:none; }
}
@media (max-width:420px) {
  .demo-chat .chat-mobile-break { display:block; }
  .demo-chat .chat-identity { gap:9px; }
  .demo-chat .chat-avatar { width:36px; height:36px; border-radius:10px; }
  .demo-chat .chat-identity h2 { font-size:16px; }
  .demo-chat .chat-identity p { font-size:11px; }
  .demo-chat .chat-reset-button { font-size:11px; }
  .demo-chat .chat-send-buttons .demo-button { padding-inline:13px; }
  .demo-chat .chat-send-buttons #chat-cancel { padding-inline:8px; font-size:11px; }
  .demo-chat .chat-composer-actions { gap:7px; }
}
@media (prefers-reduced-motion:reduce) { .demo-chat *, .demo-chat *::before, .demo-chat *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; } }
