/* ═══════════════════════════════════════════════════════════════
   AI Chat Panel
   ─────────────────────────────────────────────────────────────
   Colors, fonts and sizes come from the theme (docs/THEMING.md);
   modules/ai_assistant/ui/chat_layout.py only sets class names.

   Each mode has its own tone of the amber family (01_theme-dark.css):
     --ai-analyze   ANALYZE mode (acts on the map)
     --ai-ask       ASK mode (answers only)
   Messages carry .ai-mode-ask / .ai-mode-analyze; the panel carries
   data-chat-mode (set by the mode callback) for the input area.
   ═══════════════════════════════════════════════════════════════ */

/* The current mode's tone, used by the input area and send button */
.ai-chat-panel                        { --ai-mode: var(--ai-analyze); }
.ai-chat-panel[data-chat-mode="ask"]  { --ai-mode: var(--ai-ask); }
.ai-mode-analyze                      { --ai-msg-mode: var(--ai-analyze); }
.ai-mode-ask                          { --ai-msg-mode: var(--ai-ask); }

/* ── Typing dots ──────────────────────────────────────────────── */
@keyframes typing-bounce {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%            { opacity: 1;    transform: translateY(-4px); }
}

.typing-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ai-analyze);
  margin: 0 2px;
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }


/* ═══════════════════════════════════════════════════════════════
   FLOATING PANEL
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-panel {
  position: fixed;
  top: 60px; right: 80px;
  width: 370px; height: 480px;
  min-width: 280px; min-height: 200px;
  max-width: 90vw; max-height: calc(var(--app-vh) - var(--statusbar-height) - 60px);
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-raised);
  z-index: 1050;
  display: flex; flex-direction: column;
  font-family: var(--font-sans);
  will-change: left, top, width, height;
  transition: height 0.2s ease, width 0.2s ease;
  /* Hidden until JS restoreLayout() runs — prevents flash-of-floating-panel */
  visibility: hidden;
}

.ai-chat-panel.panel-collapsed        { height: auto !important; min-height: 0 !important; overflow: hidden; }
.ai-chat-panel.dragging,
.ai-chat-panel.resizing               { transition: none !important; }
.ai-chat-panel.dragging               { opacity: 0.95; cursor: grabbing; }


/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-state-hover);
  border-bottom: 1px solid var(--color-border);
  border-radius: 10px 10px 0 0;
  cursor: move;
  user-select: none; -webkit-user-select: none;
  flex-shrink: 0;
}
.ai-chat-panel.panel-collapsed .ai-chat-header { border-bottom: none; border-radius: 10px; }

.ai-chat-header-title { font-size: var(--text-base); font-weight: 600; color: var(--color-accent-text); letter-spacing: 0.04em; }

.ai-chat-toggle-btn {
  background: none; border: 1px solid var(--color-border); border-radius: 4px;
  color: var(--color-text-muted);
  font-size: 16px; /* glyph size, not text - theme-allow */
  font-weight: bold; cursor: pointer;
  padding: 0 6px; line-height: 1.2;
  transition: color 0.15s, border-color 0.15s;
  min-width: 24px; text-align: center;
}
.ai-chat-toggle-btn:hover { color: var(--color-text-strong); border-color: var(--color-border-strong); }


/* ═══════════════════════════════════════════════════════════════
   CONTENT & MESSAGES
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-content {
  display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden;
}
.ai-chat-content.collapsed { display: none !important; }

.ai-chat-messages {
  flex: 1 1 0; min-height: 40px;
  overflow-y: auto; overflow-x: hidden;
  padding: 8px 10px;
}
.ai-chat-messages::-webkit-scrollbar       { width: 3px; }
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }
.ai-chat-messages::-webkit-scrollbar-thumb:hover { background: var(--color-border-strong); }

/* ── Messages ── */
.ai-msg              { text-align: left; margin-bottom: 8px; }
.ai-msg--question    { margin-bottom: 4px; }
.ai-msg--user        { text-align: right; }

.ai-bubble {
  border-radius: 2px 12px 12px 12px;
  padding: 8px 10px;
}
.ai-bubble--question  { background: color-mix(in srgb, var(--ai-msg-mode) 10%, transparent); }
.ai-bubble--assistant { background: color-mix(in srgb, var(--ai-msg-mode) 6%, transparent); overflow-x: auto; }
.ai-bubble--typing    { background: color-mix(in srgb, var(--ai-analyze) 6%, transparent); padding: 8px 12px; }

.ai-msg-text        { font-size: var(--text-base); line-height: 1.5; color: var(--color-text-strong); }
.ai-msg-text--block { display: block; white-space: pre-wrap; }

/* User message: right-side accent only, mirrors the input container */
.ai-user-bubble {
  display: inline-block; max-width: 90%;
  background: transparent;
  border: none;
  border-right: 2px solid var(--ai-msg-mode);
  border-radius: 6px;
  color: var(--color-text);
  padding: 6px 10px;
  font-size: var(--text-base); line-height: 1.5;
  word-break: break-word;
}

.ai-msg-error      { font-size: var(--text-base); color: var(--color-text); }
.ai-msg-error-icon { color: var(--color-danger); }

.ai-msg-figure { overflow-x: auto; margin-top: 6px; }

/* Mode badge above assistant messages: label + fading rule */
.ai-mode-badge { display: flex; align-items: center; margin-bottom: 4px; }
.ai-mode-badge-label {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em;
  color: var(--ai-msg-mode); white-space: nowrap;
}
.ai-mode-badge-line {
  flex: 1; height: 1px; margin-left: 8px; opacity: 0.5;
  background: linear-gradient(to right, var(--ai-msg-mode), transparent);
}

/* Typing indicator */
.ai-typing-row         { display: inline-flex; align-items: center; gap: 2px; }
.ai-typing-status      { margin-left: 8px; font-size: var(--text-sm); color: var(--color-text-muted); font-style: italic; }
.ai-typing-explanation { font-size: var(--text-base); color: var(--color-text); margin-top: 6px; line-height: 1.4; font-style: italic; }

/* Filter change chips */
.ai-chips { margin-top: 4px; }
.ai-chip {
  display: inline-block;
  background: color-mix(in srgb, var(--ai-analyze) 12%, transparent);
  color: var(--ai-ask);
  border-radius: 3px; padding: 1px 5px;
  font-size: var(--text-xs);
  margin-right: 3px; margin-top: 2px;
}
.ai-chip--computed { background: color-mix(in srgb, var(--ai-ask) 10%, transparent); }

/* Notes: well group created (info), study chart created (success) */
.ai-note        { margin-top: 4px; border-radius: 4px; padding: 6px 8px; font-size: var(--text-sm); line-height: 1.6; }
.ai-note-title  { font-weight: 600; }
.ai-note--group { color: var(--color-info);    background: color-mix(in srgb, var(--color-info) 10%, transparent); }
.ai-note--chart { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 10%, transparent); }
.ai-note--chart .ai-note-meta { opacity: 0.8; }
.ai-note-icon   { margin-right: 5px; }

/* Disclosures: "View AI reasoning", "View computation", "AI reasoning" */
.ai-details { margin-top: 4px; }
.ai-details-summary {
  cursor: pointer; user-select: none; display: block; padding: 4px 0;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--ai-msg-mode);
}
.ai-code {
  background: var(--color-bg-app); color: var(--color-text);
  border-radius: 6px; padding: 8px 10px; margin: 6px 0 0;
  font-family: var(--font-mono); font-size: var(--text-sm);
  white-space: pre; overflow: auto; max-height: 200px;
}
.ai-reasoning-summary {
  cursor: pointer; user-select: none; padding: 3px 0;
  font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted);
}
.ai-reasoning-body { border-left: 2px solid var(--color-border-strong); margin-left: 2px; padding-left: 0; margin-top: 3px; }
.ai-reasoning-pre {
  background: var(--color-bg-app); color: var(--color-text-muted);
  border: none; border-radius: 0 4px 4px 4px;
  padding: 6px 8px; margin: 0;
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.4;
  white-space: pre-wrap; overflow: auto; max-height: 200px;
}

/* Result table (dash DataTable). DataTable injects light defaults after the
   assets and writes borders inline, hence the long selector and !important
   on the border color. */
.ai-msg-table { margin-top: 6px; overflow-x: auto; }
.ai-chat-panel .ai-msg-table .dash-spreadsheet-container .dash-spreadsheet-inner table {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
}
.ai-chat-panel .ai-msg-table .dash-spreadsheet-container .dash-spreadsheet-inner th,
.ai-chat-panel .ai-msg-table .dash-spreadsheet-container .dash-spreadsheet-inner td {
  background-color: transparent;
  color: var(--color-text);
  border: none !important;
  border-bottom: 1px solid var(--color-border) !important;
}
.ai-chat-panel .ai-msg-table .dash-spreadsheet-container .dash-spreadsheet-inner th {
  background-color: var(--color-state-hover);
  font-weight: 600;
}
.ai-chat-panel .ai-msg-table .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(odd) td {
  background-color: var(--color-row-stripe);
}


/* ═══════════════════════════════════════════════════════════════
   INPUT AREA — transparent bg, accent edge in the mode's tone
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-input-area {
  flex-shrink: 0;
  padding: 0 10px 10px;
}

.ai-session-selector { font-size: var(--text-sm); color: var(--color-field-text); min-height: 28px; }

.ai-memory-indicator { font-size: var(--text-xs); color: var(--color-text-subtle); text-align: center; padding: 1px 0; }

/* ── Unified container: no fill, right-side accent line only ── */
.ai-input-container {
  background: transparent;
  border: none;
  border-right: 2px solid color-mix(in srgb, var(--ai-mode) 35%, transparent);
  border-radius: 8px;
  overflow: visible;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ai-input-container:focus-within {
  border-right-color: color-mix(in srgb, var(--ai-mode) 75%, transparent);
  box-shadow: 4px 0 12px -4px color-mix(in srgb, var(--ai-mode) 20%, transparent);
}

/* Textarea — strip every possible background source, incl. browser autofill */
#ai-chat-panel #ai-chat-input,
#ai-chat-panel #ai-chat-input:focus,
#ai-chat-panel #ai-chat-input:hover,
.ai-input-container textarea,
.ai-input-container .dash-textarea {
  display: block;
  width: 100% !important;
  box-sizing: border-box;
  resize: none; overflow-y: hidden;
  min-height: 36px; max-height: 120px;
  padding: 10px 12px 4px;
  color: var(--color-text);
  font-family: inherit; font-size: var(--text-base); line-height: 1.5;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none;
  caret-color: var(--ai-mode);
}
#ai-chat-panel #ai-chat-input::placeholder { color: var(--color-text-subtle); }

/* Kill browser autofill golden/yellow tint */
#ai-chat-panel #ai-chat-input:-webkit-autofill,
#ai-chat-panel #ai-chat-input:-webkit-autofill:focus,
#ai-chat-panel #ai-chat-input:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 100px var(--color-surface-raised) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
  background-color: transparent !important;
}

/* Footer toolbar */
.ai-input-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 7px;
}
.ai-input-actions { display: flex; gap: 4px; align-items: center; }

.ai-chat-mode-hint { font-size: var(--text-xs); color: var(--color-text-subtle); padding: 3px 4px 0; font-style: italic; }
.ai-chat-error     { font-size: var(--text-sm); color: var(--color-danger); margin-top: 3px; }


/* ═══════════════════════════════════════════════════════════════
   MODE TOGGLE  ●ASK  ●ANALYZE
   Active  → outline + text in the mode's tone, NO background fill
   Dimmed  → no border, subtle text
   ═══════════════════════════════════════════════════════════════ */

.ai-mode-toggle               { display: flex !important; gap: 4px !important; }
.ai-mode-toggle .form-check-input { display: none !important; }
.ai-mode-toggle .form-check,
.ai-mode-toggle .form-check-inline { margin: 0 !important; padding: 0 !important; }

/* Dimmed base */
.ai-mode-toggle .form-check-label {
  display: block;
  padding: 3px 10px;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--color-text-subtle);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  line-height: 1.4;
  user-select: none;
}
.ai-mode-toggle .form-check-label:hover { color: var(--color-text-muted); }

/* ── ASK active ── */
.ai-mode-toggle .form-check-input[value="ask"]:checked + .form-check-label {
  background: transparent;
  color: var(--ai-ask);
  border-color: color-mix(in srgb, var(--ai-ask) 50%, transparent);
}

/* ── ANALYZE active ── */
.ai-mode-toggle .form-check-input[value="analyze"]:checked + .form-check-label {
  background: transparent;
  color: var(--ai-analyze);
  border-color: color-mix(in srgb, var(--ai-analyze) 50%, transparent);
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   dbc.Button renders .btn-primary; these rules replace its variables.
   ═══════════════════════════════════════════════════════════════ */

/* New chat / clear memory: icon-only, no fill */
.ai-chat-panel .ai-icon-btn {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--color-text-subtle);
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--color-text);
  --bs-btn-active-bg: transparent;
  --bs-btn-active-border-color: transparent;
  --bs-btn-active-color: var(--color-text-strong);
  --bs-btn-focus-box-shadow: none;
  padding: 2px 6px; line-height: 1; cursor: pointer;
}
.ai-chat-panel .ai-icon-btn--new   { font-size: 15px; } /* glyph size, not text - theme-allow */
.ai-chat-panel .ai-icon-btn--clear { font-size: 12px; padding: 2px 5px; } /* glyph size, not text - theme-allow */

/* Send / stop: filled in the current mode's tone */
.ai-chat-panel .ai-send-btn {
  --bs-btn-bg: var(--ai-mode);
  --bs-btn-border-color: var(--ai-mode);
  --bs-btn-color: var(--ai-on-mode);
  --bs-btn-hover-bg: var(--ai-mode);
  --bs-btn-hover-border-color: var(--ai-mode);
  --bs-btn-hover-color: var(--ai-on-mode);
  --bs-btn-active-bg: var(--ai-mode);
  --bs-btn-active-border-color: var(--ai-mode);
  --bs-btn-active-color: var(--ai-on-mode);
  --bs-btn-focus-box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 8px; font-weight: 700; line-height: 1;
  font-size: 16px; /* glyph size, not text - theme-allow */
  transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.ai-chat-panel .ai-send-btn--stop { font-size: 11px; } /* glyph size, not text - theme-allow */
.ai-chat-panel .ai-send-btn:hover {
  opacity: 0.88;
  transform: scale(1.05);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ai-mode) 45%, transparent);
}
.ai-chat-panel .ai-send-btn:active { transform: scale(0.95); }


/* ═══════════════════════════════════════════════════════════════
   RESIZE HANDLES
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-resize-left   { position: absolute; top: 30px; left: -3px;  width: 6px;  bottom: 10px; cursor: ew-resize; z-index: 2; }
.ai-chat-resize-right  { position: absolute; top: 30px; right: -3px; width: 6px;  bottom: 10px; cursor: ew-resize; z-index: 2; }
.ai-chat-resize-bottom { position: absolute; bottom: -3px; left: 10px; right: 10px; height: 6px; cursor: ns-resize; z-index: 2; }

.ai-chat-resize-corner {
  position: absolute; bottom: -3px; right: -3px;
  width: 14px; height: 14px; cursor: nwse-resize; z-index: 3;
}
.ai-chat-resize-corner::after {
  content: ""; position: absolute; bottom: 4px; right: 4px;
  width: 8px; height: 8px;
  border-right: 2px solid var(--color-border-strong); border-bottom: 2px solid var(--color-border-strong); opacity: 0.5;
}
.ai-chat-resize-corner:hover::after { border-color: var(--color-text-muted); opacity: 1; }

.ai-chat-resize-corner-tl { position: absolute; top: -3px; left: -3px; width: 14px; height: 14px; cursor: nwse-resize; z-index: 3; }
.ai-chat-resize-corner-tr { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; cursor: nesw-resize; z-index: 3; }
.ai-chat-resize-corner-bl { position: absolute; bottom: -3px; left: -3px; width: 14px; height: 14px; cursor: nesw-resize; z-index: 3; }

.ai-chat-panel.panel-collapsed .ai-chat-resize-left,
.ai-chat-panel.panel-collapsed .ai-chat-resize-right,
.ai-chat-panel.panel-collapsed .ai-chat-resize-bottom,
.ai-chat-panel.panel-collapsed .ai-chat-resize-corner,
.ai-chat-panel.panel-collapsed .ai-chat-resize-corner-tl,
.ai-chat-panel.panel-collapsed .ai-chat-resize-corner-tr,
.ai-chat-panel.panel-collapsed .ai-chat-resize-corner-bl { display: none; }


/* ═══════════════════════════════════════════════════════════════
   PLOTLY MODEBAR  — transparent, accent highlight
   ID selector beats global .modebar rules in 43_module-map.css
   ═══════════════════════════════════════════════════════════════ */

#ai-chat-panel .modebar-container {
  display: flex !important; flex-direction: row !important;
  flex-wrap: nowrap !important; justify-content: flex-start !important;
  left: 10px !important; right: auto !important; top: 4px !important;
}
#ai-chat-panel .modebar             { background: transparent !important; background-color: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; position: static !important; }
#ai-chat-panel .modebar-group       { display: flex !important; flex-direction: row !important; background: transparent !important; background-color: transparent !important; }
#ai-chat-panel .modebar-btn         { display: inline-flex !important; background: transparent !important; background-color: transparent !important; filter: none !important; }
#ai-chat-panel .modebar-btn:hover   { background: var(--color-accent-subtle) !important; background-color: var(--color-accent-subtle) !important; border-radius: 3px !important; }
#ai-chat-panel .modebar-btn:active,
#ai-chat-panel .modebar-btn.active  { background: transparent !important; background-color: transparent !important; }
#ai-chat-panel .modebar-btn:focus   { outline: none !important; box-shadow: none !important; }

#ai-chat-panel .modebar-btn path        { fill: var(--color-text-subtle) !important; }
#ai-chat-panel .modebar-btn:hover path,
#ai-chat-panel .modebar-btn.active path { fill: var(--color-accent-strong) !important; }   /* same highlight as every chart (23_bridge-plotly.css) */
#ai-chat-panel .modebar-btn svg         { width: 14px !important; height: 14px !important; }

#ai-chat-panel .modebar-icon,
#ai-chat-panel .modebar-btn:hover .modebar-icon,
#ai-chat-panel .modebar-btn.active .modebar-icon { filter: none !important; }


/* ═══════════════════════════════════════════════════════════════
   SUGGESTION CHIPS (empty chat)
   ═══════════════════════════════════════════════════════════════ */

.ai-suggestions       { padding: 15px 8px; }
.ai-suggestions-title { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; margin-bottom: 8px; text-align: center; }
.ai-suggestions-grid  { display: flex; flex-direction: column; gap: 6px; }
.ai-suggestion-icon   { margin-right: 5px; opacity: 0.6; }

.ai-suggestion-chip {
  background: color-mix(in srgb, var(--ai-analyze) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--ai-analyze) 12%, transparent);
  border-radius: 8px; color: var(--color-text-muted); font-size: var(--text-sm);
  padding: 7px 10px; text-align: left; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.3; white-space: normal;
}
.ai-suggestion-chip:hover  {
  background: color-mix(in srgb, var(--ai-analyze) 9%, transparent);
  border-color: color-mix(in srgb, var(--ai-analyze) 28%, transparent);
  color: var(--color-text);
}
.ai-suggestion-chip:active { background: color-mix(in srgb, var(--ai-analyze) 15%, transparent); }


/* ═══════════════════════════════════════════════════════════════
   DOCKED MODE — panel fills sidebar tab content
   Height chain: sidebar → tab-content → tab-pane → dock-target → panel
   ═══════════════════════════════════════════════════════════════ */

/* Give the sidebar tab-content a fixed height so children can % from it:
   the sidebar's height, which ends at the status bar.
   IMPORTANT: Do NOT change display — ilayout.js manages block/none. */
#left-sidebar .tab-content {
    height: var(--app-main-height) !important;
    max-height: var(--app-main-height) !important;
}

/* Ensure the dbc.Tabs wrapper propagates height from the sidebar */
#left-sidebar-tabs {
    height: 100%;
}

/* When the AI tab-pane is active, fill the height.
   dbc 2.x generates pane ID as {tabs_id}-tabpane-{tab_id}.
   Also target by className (sidebar__tab) and :has() as robust fallbacks. */
#left-sidebar-tabs-tabpane-tab-ai-assistant.active.show,
#left-sidebar-tabs-tabpane-tab-ai-assistant.active,
#tab-ai-assistant.tab-pane.active.show,
#tab-ai-assistant.tab-pane.active,
.tab-pane:has(> .ai-dock-target),
.sidebar__tab:has(> .ai-dock-target),
#left-sidebar .tab-content > *:has(> .ai-dock-target) {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden;
}

.ai-dock-target {
    display: flex;
    flex-direction: column;
    /* height: 100%; */
    max-height: calc(100% - var(--statusbar-height, 22px) - 20px) !important;
    min-height: 0;
    overflow: hidden;
}

/* Docked, the panel is part of the sidebar: it takes the sidebar's surface
   (opaque, since the sidebar floats over the map) and drops the float styling. */
.ai-chat-panel.ai-chat-docked {
    position: relative !important;
    top: auto !important; left: auto !important; right: auto !important;
    width: 100% !important; height: 100% !important;
    max-width: none; max-height: none;
    min-height: 0;
    background: var(--color-surface);
    box-shadow: none;
    border-radius: 0;
    border: none;
    z-index: auto;
    overflow: hidden;
    visibility: visible;
}
.ai-chat-panel.ai-chat-docked .ai-chat-header {
    border-radius: 0;
    cursor: grab;
    flex-shrink: 0;
}
.ai-chat-panel.ai-chat-docked #ai-chat-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px var(--color-surface) inset !important;
}
.ai-chat-panel.ai-chat-docked .ai-chat-content {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ai-chat-panel.ai-chat-docked .ai-chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}
.ai-chat-panel.ai-chat-docked .ai-chat-input-area {
    flex-shrink: 0;
}
.ai-chat-panel.ai-chat-docked .ai-chat-resize-left,
.ai-chat-panel.ai-chat-docked .ai-chat-resize-right,
.ai-chat-panel.ai-chat-docked .ai-chat-resize-bottom,
.ai-chat-panel.ai-chat-docked .ai-chat-resize-corner,
.ai-chat-panel.ai-chat-docked .ai-chat-resize-corner-tl,
.ai-chat-panel.ai-chat-docked .ai-chat-resize-corner-tr,
.ai-chat-panel.ai-chat-docked .ai-chat-resize-corner-bl {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-panel details > summary                 { list-style: none; }
.ai-chat-panel details > summary::-webkit-details-marker { display: none; }
.ai-chat-panel .dash-table-container .dash-spreadsheet-container { background: transparent !important; }
