:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202a32; background: #fff; font-size: 16px; line-height: 1.5;
  --muted: #65717c; --border: #e8ecef; --blue: #146f9c;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .45; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.shell { max-width: 820px; margin: auto; padding: 0 28px; }
.chat { height: var(--chat-height, 100dvh); display: flex; flex-direction: column; }
.chat-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0 20px; border-bottom: 1px solid var(--border); }
.identity { min-width: 0; }
h1 { font-size: 22px; font-size: 1.375rem; font-weight: 650; letter-spacing: -.045em; line-height: 1.25; margin: 0 0 5px; }
.identity-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .8125rem; color: var(--muted); }
.status { display: flex; align-items: center; gap: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: #87929b; flex-shrink: 0; }
.status.online .dot { background: #168276; }
.subtle { flex-shrink: 0; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; color: var(--blue); background: transparent; font-size: .9375rem; }
.subtle:hover { background: #f1f6f9; }
.conversation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 0; }
.conversation:has(.greeting) { display: flex; flex-direction: column; }
.greeting { width: 100%; margin: auto 0; padding: 32px 8px 48px; }
.greeting > p { margin: 0 0 28px; font-size: 1.625rem; font-weight: 500; letter-spacing: -.04em; }
.suggestions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; max-width: 340px; }
.suggestions button { min-height: 52px; padding: 14px 18px; border: 1px solid #edf0f2; border-radius: 14px; text-align: left; color: #405463; background: #f7f9fa; font-size: .9375rem; line-height: 1.4; }
.suggestions button:hover { background: #edf4f7; border-color: #d4e4ed; }
.bubble { max-width: 94%; margin-bottom: 28px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.bubble.user { width: fit-content; max-width: 85%; margin-left: auto; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: #edf4f8; }
.bubble.assistant { padding: 4px 0; }
.speaker { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.bubble.user .speaker { display: none; }
.typing { color: var(--muted); font-size: .875rem; }
.composer { flex-shrink: 0; padding: 10px 0 0; }
.input-row { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border: 1px solid #dce3e8; border-radius: 28px; background: #f8fafb; }
.input-row:focus-within { border-color: #719eb8; box-shadow: 0 0 0 1px #719eb8; }
textarea { width: 100%; min-width: 0; height: 44px; max-height: 120px; padding: 10px 12px; resize: none; border: 0; color: inherit; background: transparent; font-size: 1rem; line-height: 24px; }
textarea:focus { outline: none; }
textarea::placeholder { color: #75818a; opacity: 1; }
#send { flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--blue); color: white; font-size: 1.5rem; line-height: 1; }
.chat-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 0 max(10px, env(safe-area-inset-bottom)); font-size: .75rem; color: var(--muted); }
.privacy { position: relative; }
.privacy summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; white-space: nowrap; }
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary:hover { color: var(--blue); }
.privacy-content { position: absolute; z-index: 2; bottom: calc(100% + 8px); right: 0; width: min(420px, calc(100vw - 40px)); max-height: 60dvh; overflow-y: auto; padding: 6px 20px; border: 1px solid var(--border); border-radius: 18px; background: white; box-shadow: 0 10px 40px #23344018; font-size: .875rem; color: #455460; }
.error { flex-shrink: 0; max-height: 40%; overflow-y: auto; margin-bottom: 8px; padding: 12px 16px; border: 1px solid #eadcc6; border-radius: 14px; background: #fff9ef; font-size: .875rem; }
.error p { white-space: pre-line; margin: 0 0 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 10px; top: -80px; background: white; padding: 10px; z-index: 10; }
.skip:focus { top: 10px; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  .shell { padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right)); }
  .chat-header { padding: max(18px, env(safe-area-inset-top)) 0 16px; }
  .conversation { padding: 20px 0; }
  .greeting { padding: 24px 4px 40px; }
  .greeting > p { font-size: 1.5rem; }
  .suggestions { max-width: none; gap: 12px; }
  .bubble { max-width: 100%; }
  .bubble.user { max-width: 90%; }
  .chat-footer { justify-content: space-between; gap: 8px; }
}
@media (max-height: 500px) {
  .chat-header { padding-top: 8px; padding-bottom: 8px; }
  .conversation { padding: 12px 0; }
  .greeting { padding: 12px 0; }
  .greeting > p { margin-bottom: 16px; }
  .chat-footer { padding-bottom: 0; }
}
