.chat-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); min-height: 640px; height: calc(100dvh - 190px); max-height: 960px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: #11141d; }
.chat-preview { color: #bcb5fa; font-size: 10px; letter-spacing: .16em; border: 1px solid #36314d; border-radius: 20px; padding: 8px 12px; }
.chat-version { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -8px 0 16px; font-size: 11px; color: var(--muted); }
.chat-version select { background: #211e37; color: var(--text); border: 1px solid #494060; border-radius: 8px; padding: 8px 12px; font: inherit; }
.chat-version select:focus-visible { outline: 2px solid #c8b9fb; outline-offset: 3px; }
.chat-approval { margin: 12px 26px 0; padding: 14px; border: 1px solid #494060; border-radius: 10px; color: #d2c6ee; }
.chat-approval p { margin: 0 0 9px; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.chat-approval-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-history { background: #0d1018; padding: 22px 15px; overflow-y: auto; border-right: 1px solid var(--line); }
.chat-history h2 { font-size: 9px; letter-spacing: .15em; color: var(--quiet); margin: 28px 10px 16px; }
.chat-new, .chat-send { border: 1px solid #7770bb; color: #fff; background: #6155b5; border-radius: 10px; padding: 12px 18px; cursor: pointer; font: inherit; font-size: 12px; }
.chat-new { width: 100%; background: #211e37; border-color: #38304f; text-align: left; }
.chat-conversation { display: block; width: 100%; border: 0; padding: 12px; margin: 3px 0; text-align: left; color: #a6aabd; background: transparent; border-radius: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: inherit; font-size: 12px; cursor: pointer; }
.chat-conversation[aria-current="true"], .chat-conversation:hover { background: #242135; color: #e0dafa; }
.chat-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 26px; border-bottom: 1px solid var(--line); }
.chat-panel-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-panel-header span { font-size: 10px; color: #a7b8af; flex-shrink: 0; }
.chat-welcome { text-align: center; margin: auto; padding: 30px 20px 10px; }
.chat-orb { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 24px; font-size: 36px; color: #c8b9fb; border: 1px solid #494060; border-radius: 20px; background: radial-gradient(circle at 20% 20%, #3e315a, #191b29); }
.chat-eyebrow { font-size: 9px; letter-spacing: .22em; color: #a298c9; }
.chat-welcome h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 500; letter-spacing: -.04em; margin: 15px 0; }
.chat-welcome p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.chat-prompts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.chat-prompts button, .chat-secondary { border: 1px solid var(--line-strong); background: transparent; color: #c2bfd1; border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 11px; cursor: pointer; }
.chat-messages { overflow-y: auto; flex: 1; min-height: 0; padding: 8px 30px; scroll-behavior: auto; overflow-wrap: anywhere; }
.chat-welcome:not([hidden]) ~ .chat-messages { flex: 0; }
.chat-message { max-width: 760px; margin: 22px auto 30px; }
.chat-speaker { font-size: 9px; letter-spacing: .15em; color: #a79bc9; margin-bottom: 10px; }
.chat-text { font-size: 14px; line-height: 1.85; white-space: pre-wrap; margin: 7px 0; }
.chat-user { padding: 16px 20px; background: #201f30; border-radius: 14px; }
.chat-user .chat-speaker { color: var(--muted); }
.chat-tool { font-size: 11px; padding: 9px 12px; border-left: 2px solid #77669f; color: #b8b0c8; margin: 10px 0; }
.chat-citation { display: block; color: #bfb2f1; font-size: 12px; margin: 12px 0; }
.chat-muted, .chat-generating { font-size: 12px; color: var(--muted); line-height: 1.7; }
.chat-generating { color: #c1b2ec; }
.chat-composer { border: 1px solid #3b374c; border-radius: 15px; margin: 14px 26px 0; background: #1b1c28; padding: 15px; }
.chat-input-label { font-size: 10px; color: #aaa4bd; }
.chat-composer textarea { display: block; resize: vertical; min-height: 58px; max-height: 160px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 10px 0; font: inherit; font-size: 13px; box-shadow: none; }
.chat-composer textarea:focus { outline: none; }
.chat-composer:focus-within { border-color: #9e8ae7; }
.chat-composer-actions { display: flex; align-items: center; gap: 10px; }
.chat-composer-actions span { font-size: 9px; color: #a09bab; margin-right: auto; }
.chat-footnote { display: flex; gap: 10px; justify-content: space-between; padding: 12px 28px 18px; font-size: 9px; color: #8c879b; }
.chat-footnote button { border: 0; background: transparent; color: #b9accf; cursor: pointer; font: inherit; }
.chat-error { margin: 12px 26px 0; padding: 12px; border-radius: 8px; background: #38232e; color: #ffb9c8; font-size: 12px; }
.chat-older { align-self: center; margin-top: 12px; }
#chatView button:disabled { opacity: .45; cursor: default; }
#chatView button:focus-visible, #chatView a:focus-visible { outline: 2px solid #c8b9fb; outline-offset: 3px; }
#chatView [hidden] { display: none !important; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 180px minmax(0, 1fr); } .chat-composer-actions span { display: none; } .chat-send { margin-left: auto; } }
@media (max-width: 600px) {
  .sidebar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .app-nav { min-width: 0; overflow-x: auto; }
  .app-nav .nav-item { flex-shrink: 0; white-space: nowrap; }
  .chat-layout { display: flex; flex-direction: column; height: calc(100dvh - 180px); min-height: 640px; }
  .chat-history { padding: 12px; flex-shrink: 0; max-height: 148px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-history h2 { display: none; } .chat-history [data-chat="conversations"] { display: flex; overflow-x: auto; margin-top: 6px; }
  .chat-conversation { width: auto; max-width: 190px; flex-shrink: 0; }
  .chat-panel { flex: 1; } .chat-panel-header { padding: 14px; } .chat-panel-header span { max-width: 130px; }
  .chat-messages { padding: 8px 16px; } .chat-composer { margin: 10px 12px 0; }
  .chat-welcome { padding: 18px 12px 0; } .chat-orb { display: none; } .chat-footnote { padding: 10px 14px; }
}
