/* Wivrix AI inside the Cloud app shell. ai.css was written for the classic site's tokens; map them to the
 * shell's, then fit the workspace into the shell: conversations in the side panel, thread and composer in main. */
.ai-app {
  --bg: var(--surface); --surface-2: var(--surface-sunk); --border: var(--line); --border-strong: var(--line-strong, var(--line));
  --text: var(--ink); --text-2: var(--ink-soft); --text-3: var(--ink-muted);
  --accent-soft: var(--accent-tint); --accent-hover: var(--accent-strong); --accent-2: var(--accent); --grad-a: var(--accent);
  --danger-soft: var(--danger-tint); --warn-soft: var(--warn-tint);
  --font: var(--font-sans); --font-display: var(--font-ui, var(--font-sans)); --mono: var(--font-mono);
  --radius-lg: var(--r-lg); --shadow: var(--shadow-lift);
  --code-bg: var(--surface-sunk); --code-text: var(--ink);
}
.ai-app [hidden] { display: none !important; }

/* Buttons the shared markup uses (classic .btn). */
.ai-app .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: var(--fs-sm); text-decoration: none; cursor: pointer; }
.ai-app .btn:hover { background: var(--surface-hover); text-decoration: none; }
.ai-app .btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.ai-app .btn-primary:hover { background: var(--accent-strong); }
.ai-app .btn:disabled { opacity: .5; cursor: default; }
.ai-app .btn-sm { min-height: 32px; padding: 4px 10px; }
.ai-app .ai-ic { flex: none; }

/* Main pane: the thread scrolls, the composer stays at the bottom. */
.ai-app .wx-content { display: flex; flex-direction: column; overflow: hidden; }
.ai-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-app .ai-main { flex: 1; min-height: 0; }
.ai-app .ai-thread { padding-top: 20px; }

/* Side panel: New chat (secondary; Send is the one primary) and the conversation list.
 * Account, credits and dark mode live in the shell, so the classic menu footer is hidden. */
.ai-app .ai-new { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); justify-content: flex-start; }
.ai-app .ai-new:hover { background: var(--surface-hover); }
.ai-app .ai-side-foot { display: none; }
.ai-app .ai-side-toggle { display: none; }
@media (min-width: 861px) {
  .ai-app .wx-side-body { display: flex; flex-direction: column; min-height: 0; height: 100%; padding: 0; overflow: hidden; }
  .ai-app .ai-side { width: auto; flex: 1; height: 100%; background: none; border: 0; padding: 12px 10px; }
}
/* Under 861px the conversations open as a drawer from the Chats button in the bar. */
@media (max-width: 860px) {
  .ai-app .wx-side, .ai-app .wx-side-body { display: contents; }
  .ai-app .ai-side-toggle { display: grid; }
  .ai-app .ai-side { z-index: 80; padding-top: max(14px, env(safe-area-inset-top)); }
  .ai-app .ai-side-foot { display: none; }
}
.ai-app .ai-toast { bottom: 7rem; }
/* Signed out or not open yet: one card with one action; the composer and the chat list stay out of the way. */
.ai-app .ai-composer.is-disabled { opacity: .5; pointer-events: none; }
.ai-app.ai-locked .wx-side, .ai-app.ai-locked .ai-side-toggle { display: none !important; }
@media (max-width: 860px) { .ai-app .ai-side:not(.is-open) { box-shadow: none; visibility: hidden; } .ai-app .ai-side { transition: transform .22s ease, visibility 0s linear .22s; } .ai-app .ai-side.is-open { transition: transform .22s ease; } }
/* Type floor: nothing under the shell's xs size (12px at default text size). */
.ai-app .ai-side-label, .ai-app .ai-price-sm, .ai-app .ai-rec { font-size: var(--fs-xs); }
