/* Chat-only layout refinement. Loaded after the existing theme. */
.chat-page .sidebar-user { display: none; }
@media (min-width:769px) {
  .chat-page .app-header > #status-indicator { display: inline-flex; flex-shrink: 0; white-space: nowrap; margin-left: -8px; }
  .chat-page .history-panel > .sidebar-user { display: flex; position: relative; align-items: center; flex-shrink: 0; height: var(--composer-height,78px); box-sizing: border-box; padding: 0 12px; border-top: 1px solid var(--line); color: #c8d7e6; }
  .chat-page .sidebar-user svg { flex-shrink: 0; }
  .chat-page .sidebar-user #current-user { display: block; font-size: 13px; overflow-wrap: anywhere; }
  .chat-page.history-sidebar-collapsed .history-panel > .sidebar-user { display: flex; margin-top: auto; padding: 0 4px; justify-content: center; }
  .chat-page.history-sidebar-collapsed .sidebar-user #current-user { display: none; }
  .chat-page .sidebar-user-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.045); color: inherit; cursor: pointer; text-align: left; }
  .chat-page .sidebar-user-button:hover, .chat-page .sidebar-user-button[aria-expanded="true"] { background: rgba(112,184,255,.12); border-color: rgba(112,184,255,.35); }
  .chat-page .sidebar-user-button .user-menu-arrow { margin-left: auto; transition: transform .2s ease; }
  .chat-page .sidebar-user-button[aria-expanded="true"] .user-menu-arrow { transform: rotate(180deg); }
  .chat-page.history-sidebar-collapsed .sidebar-user-button { justify-content: center; padding-inline: 0; }
  .chat-page.history-sidebar-collapsed .user-menu-arrow { display: none; }
  .chat-page .sidebar-user-menu { position: absolute; bottom: calc(100% + 8px); left: 12px; width: max(180px,calc(100% - 24px)); padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #13253b; box-shadow: 0 12px 36px #020c1c66; z-index: 2; }
  .chat-page .sidebar-user-menu[hidden] { display: none; }
  .chat-page .sidebar-user-menu button { display: block; width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 7px; text-align: left; font-size: 14px; }
  .chat-page .sidebar-user-menu button:hover { background: rgba(112,184,255,.12); }
  .chat-page.history-sidebar-collapsed .sidebar-user-menu { left: 4px; }
}
.chat-page { --conversation-sidebar-width: 264px; --muted: #a7b8cb; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
.chat-page .app-header { gap: 20px; padding-inline: 24px; }
.chat-page .header-brand { flex-shrink: 0; }
.chat-page .header-brand h1 { font-size: 16px; }
.chat-page .header-actions { flex-shrink: 0; gap: 8px !important; }
.chat-page .parking-lot-dropdown { min-width: 0; }
.chat-page .parking-lot-dropdown-btn { min-height: 40px; border-color: rgba(112,184,255,.35); background: rgba(112,184,255,.08); }
.chat-page #selected-parking-lot-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-page .screen-dropdown-btn, .chat-page .notification-bell { min-height: 40px; border-radius: 10px; }
.chat-page :is(button,summary,a,input):focus-visible { outline: 2px solid #85c5ff; outline-offset: 3px; }
.chat-page #chat-messages { padding: 28px clamp(16px,3vw,44px) !important; }
.chat-page #chat-messages > .message-bubble { width: min(100%,1120px); margin-top: 22px; }
.chat-page #chat-messages .ai-bubble { max-width: min(100%,780px); padding: 20px 24px; border-radius: 16px; line-height: 1.85; background: rgba(13,29,47,.95); box-shadow: none; overflow-wrap: anywhere; }
.chat-page #chat-messages .ai-bubble:has(.chart-container,table),
.chat-page #chat-messages .ai-bubble.dashboard-answer-bubble { width: 100%; max-width: 100%; min-width: 0; }
.chat-page .ai-bubble p + p { margin-top: 12px; }
.chat-page .ai-bubble :is(h2,h3,h4) { margin-block: 18px 8px; line-height: 1.5; }
.chat-page .ai-bubble > :first-child { margin-top: 0; }
.chat-page .user-bubble { max-width: min(85%,680px); border-radius: 16px 16px 4px 16px; line-height: 1.7; }
.chat-page .ai-bubble :is(.tool-monitor,.evidence-panel) { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; margin-top: 14px; box-shadow: none; }
.chat-page .ai-bubble :is(.tool-monitor,.evidence-panel) > summary { color: var(--muted); font-size: 12px; padding: 10px 0; }
.chat-page .ai-bubble .chart-container { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding-top: 16px; background: transparent; margin-top: 18px; }
.chat-page .dashboard-metric-card { border: 0; background: rgba(255,255,255,.04); }
.chat-page .dashboard-metric-value { color: #edf4fb; font-variant-numeric: tabular-nums; }
.chat-page .ai-bubble .screen-btn { display: flex; width: fit-content; margin-top: 16px; }
.chat-page .history-panel-header { flex-shrink: 0; padding-bottom: 18px; }
.chat-page .history-panel-body { min-height: 0; overscroll-behavior: contain; }
.chat-page .history-item { border-color: transparent; border-radius: 10px; box-shadow: none; }
.chat-page > footer { padding-inline: 20px; padding-bottom: max(16px,env(safe-area-inset-bottom)); }
.chat-page footer .max-w-3xl { max-width: 960px; }
.chat-page #user-input { min-width: 0; min-height: 46px; }
.chat-page #send-btn { min-height: 46px; }
.chat-page .notification-panel { background: #102438; border-color: var(--line); border-radius: 16px; box-shadow: 0 18px 48px #020c1c66; }
.chat-page .notification-heading h2 { font-size: 15px; line-height: 1.6; }
.chat-page #notification-status, .chat-page .notification-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.chat-page .notification-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 14px; }
.chat-page .notification-actions button { min-height: 40px; font-size: 13px; }
.chat-page .notification-item { border-color: var(--line); padding-block: 12px; }
.chat-page .notification-item summary { line-height: 1.8; font-size: 13px; cursor: pointer; }
.chat-page .notification-item p { padding: 12px 14px; border-radius: 8px; background: rgba(255,255,255,.035); font-size: 13px; }
@media (min-width:769px) and (max-width:1180px) {
  .chat-page .header-brand h1 { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-page #status-indicator, .chat-page #current-user { display: none; }
  .chat-page .app-header { gap: 12px; padding-inline: 16px; }
}
@media (max-width:768px) {
  .chat-page .app-header { padding-inline: 12px; gap: 8px; }
  .chat-page .header-actions { gap: 2px !important; }
  .chat-page .header-brand h1 { font-size: 15px; }
  .chat-page #chat-messages { padding: 16px 12px !important; }
  .chat-page #chat-messages .ai-bubble { max-width: 100% !important; padding: 16px; font-size: 15px; }
  .chat-page #chat-messages > .message-bubble { margin-top: 16px; }
  .chat-page > footer { padding-inline: 12px; }
  .chat-page footer .max-w-3xl { gap: 8px; }
  .chat-page #send-btn { padding-inline: 14px; }
  .chat-page .notification-panel { left: 12px; right: 12px; width: auto; max-width: none; max-height: calc(100dvh - 148px); }
  .chat-page .notification-actions button { min-height: 44px; flex: 1; }
}
@media (prefers-reduced-motion:reduce) {
  .chat-page *, .chat-page *::before, .chat-page *::after { scroll-behavior: auto !important; transition: none !important; }
}
