:root { font-family: Arial, Helvetica, sans-serif; color: #000; background: #fff; color-scheme: light; }
body { margin: 0; overflow: hidden; }
button, textarea { font-family: inherit; }
[hidden] { display: none !important; }
#publicApp { display: grid; grid-template-columns: 280px minmax(0, 1fr); width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 0; margin: 0; padding: 0; overflow: hidden; background: #fff; }
#publicApp * { box-sizing: border-box; }
#publicSidebar { min-width: 0; height: 100%; padding: 29px 24px; border-right: 1px solid #e5e5e5; overflow: auto; background: #fff; }
#publicSidebar h2 { margin: 0 0 17px; color: #000; font-size: 18px; line-height: 24px; font-weight: 600; }
#publicChatList { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.public-chat-link { display: flex; align-items: center; flex: none; width: 100%; height: 32px; padding: 0; gap: 10px; border: 0; background: transparent; color: #000; text-align: left; font-size: 14px; font-weight: 400; }
.public-chat-link[aria-current] { font-weight: 600; }
.public-chat-link:hover:not(:disabled) { background: #f7f7f7; }
.public-presence-slot { display: inline-flex; align-items: center; justify-content: flex-end; flex: none; width: 14px; min-width: 14px; height: 16px; }
.public-presence-dot { display: block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.public-chat-title { display: block; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#sidebarEmpty { margin: 8px 0 0 24px; color: #666; font-size: 12px; }
.public-main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.public-topbar { display: flex; align-items: center; justify-content: flex-end; flex: none; height: 80px; padding: 20px 24px; gap: 12px; margin: 0; }
.public-topbar-actions { display: flex; align-items: center; gap: 12px; }
.public-topbar button, #sidebarClose { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; min-width: 36px; padding: 0; border: 0; background: #fff; color: #000; }
.public-topbar button svg, #sidebarClose svg { width: 28px; height: 28px; }
.public-topbar button:hover:not(:disabled), #sidebarClose:hover { background: #f5f5f5; }
#sidebarToggle, #sidebarClose { display: none; }
#publicConnectionStatus { margin: 0 2px 0 0; color: #666; font-size: 11px; line-height: 16px; font-weight: 400; }
#conversationPanel { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; margin: 0; padding: 0; }
#chatEmptyState { position: absolute; top: calc(50% - 176px); left: 24px; right: 24px; margin: 0; text-align: center; }
#chatEmptyState h2 { margin: 0; color: #000; font-size: 34px; line-height: 42px; font-weight: 500; }
.public-composer-wrap { position: relative; flex: none; width: calc(100% - 64px); max-width: 752px; margin: 0 auto 48px; }
#conversationPanel[data-mode="new"] .public-composer-wrap { position: absolute; top: calc(50% - 71px); left: 50%; transform: translateX(-50%); margin: 0; }
#publicComposerForm { display: flex; align-items: flex-end; gap: 8px; width: 100%; min-height: 56px; margin: 0; padding: 7px; border: 1px solid #8d8d8d; background: #fff; }
#publicComposerForm:focus-within { border-color: #000; }
#publicPrompt { flex: 1; min-width: 0; width: 100%; height: 40px; min-height: 40px; max-height: 152px; margin: 0; padding: 6px 8px; resize: none; border: 0; outline: 0; background: #fff; color: #000; font-size: 16px; line-height: 28px; overflow-y: auto; }
#publicPrompt:focus-visible { outline: none; }
#publicPrompt::placeholder { color: #777; }
#publicSendButton { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; min-width: 40px; margin: 0; padding: 0; border: 1px solid #000; background: #000; color: #fff; }
#publicSendButton svg { width: 24px; height: 24px; }
#publicSendButton:hover:not(:disabled) { background: #262626; }
#publicSendButton:disabled { border-color: #ddd; background: #ddd; color: #888; cursor: default; }
#publicChatStatus { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; margin: 0; color: #666; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
#publicChatStatus:empty { display: none; }
#publicNotice { margin: 8px 0 0; color: #666; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.public-notice-action { display: inline; padding: 0; border: 0; background: transparent; color: #000; font-size: inherit; line-height: inherit; text-decoration: underline; text-underline-offset: 2px; }
.public-notice-action:hover:not(:disabled) { background: transparent; }
#publicMessages { flex: 1; min-width: 0; min-height: 0; width: 100%; margin: 0 0 20px; padding: 48px 32px 16px; overflow: auto; overscroll-behavior: contain; }
.public-message { width: 100%; max-width: 752px; margin: 0 auto 24px; font-size: 16px; line-height: 28px; }
.public-message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.public-message-user .public-message-text { width: fit-content; max-width: calc(100% - 40px); margin-left: auto; padding: 3px 8px; border: 1px solid #e5e5e5; background: #fff; }
.public-message-assistant { padding: 0 20px; }
.public-message-error { margin: 6px 0 0; color: #555; font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
#occupiedState { width: 100%; min-height: 56px; padding: 0; text-align: center; }
#occupiedState h2 { margin: 0 0 6px; font-size: 18px; line-height: 26px; font-weight: 500; }
#occupiedState p { margin: 0 0 14px; color: #666; font-size: 14px; line-height: 20px; }
#occupiedState p:first-child { margin-bottom: 6px; color: #000; font-size: 18px; line-height: 26px; font-weight: 500; }
#startNewChatButton { padding: 8px 14px; border: 1px solid #000; background: #fff; color: #000; font-size: 14px; line-height: 20px; }
.public-sidebar-backdrop { display: none; }
#poolDialog { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: auto; border: 1px solid #ddd; background: #fff; color: #111; }
#poolDialog::backdrop { background: rgb(0 0 0 / 28%); }
#poolDialog .pool-panel { padding: 24px; min-width: 0; }
#poolDialog .pool-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
#poolClose { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; background: #fff; }
#poolClose svg { width: 24px; height: 24px; }
#poolDialog .topbar { margin: 0 0 24px; }
#poolDialog section { min-width: 0; }
#poolDialog h1 { color: #111; }
#poolDialog .pool-dialog-header h2 { margin: 0; font-size: 18px; font-weight: 500; }
:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
@media (max-width: 760px) {
  #publicApp { display: block; min-height: 0; }
  #publicSidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: min(280px, calc(100vw - 48px)); transform: translateX(-100%); visibility: hidden; padding-top: 25px; }
  #publicApp.sidebar-open #publicSidebar { transform: none; visibility: visible; }
  #sidebarToggle, #sidebarClose { display: inline-flex; }
  #sidebarToggle { margin-right: auto; }
  #sidebarClose { position: absolute; top: 19px; right: 12px; }
  #publicSidebar h2 { padding-right: 24px; }
  .public-sidebar-backdrop { position: fixed; z-index: 20; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(0 0 0 / 20%); }
  .public-sidebar-backdrop:hover:not(:disabled) { background: rgb(0 0 0 / 20%); }
  .public-topbar { height: 64px; gap: 8px; padding: 12px 16px; }
  #publicConnectionStatus { font-size: 10px; }
  #chatEmptyState { top: calc(50% - 150px); left: 20px; right: 20px; }
  #chatEmptyState h2 { font-size: 28px; line-height: 36px; }
  .public-composer-wrap { width: calc(100% - 32px); margin-bottom: 40px; }
  #conversationPanel[data-mode="new"] .public-composer-wrap { top: calc(50% - 48px); }
  #publicMessages { margin-bottom: 12px; padding: 24px 16px 12px; }
  .public-message { margin-bottom: 24px; }
  .public-message-assistant { padding: 0 8px; }
  .public-message-user .public-message-text { max-width: calc(100% - 24px); }
  #poolDialog { max-height: calc(100dvh - 24px); }
  #poolDialog .pool-panel { padding: 20px 16px; }
}
@media (max-height: 540px) {
  #chatEmptyState { top: calc(50% - 112px); }
  #chatEmptyState h2 { font-size: 26px; line-height: 34px; }
  #conversationPanel[data-mode="new"] .public-composer-wrap { top: calc(50% - 42px); }
  #publicMessages { padding-top: 20px; }
}
