/* One chat shell for public and signed-in Cally. */
.cally-chat-shell { width: 396px; height: 576px; max-height: calc(100dvh - var(--ds-space-6) - 92px); background: var(--ds-surface); color: var(--ds-text); font-family: var(--ds-font-sans); border: var(--ds-border-width) solid var(--ds-border); border-radius: var(--ds-radius-2xl) !important; box-shadow: var(--ds-shadow-xl); flex-direction: column; overflow: hidden; }
.cally-chat-shell .ai-companion-header { display: flex; justify-content: space-between; align-items: center; gap: var(--ds-space-3); padding: var(--ds-space-4) var(--ds-space-5); border-bottom: var(--ds-border-width) solid var(--ds-border); background: linear-gradient(180deg, var(--ds-primary-subtle), var(--ds-surface)); flex-shrink: 0; }
.cally-chat-shell .ai-companion-header-left { display: flex; align-items: center; gap: var(--ds-space-3); }
.cally-chat-shell .cally-avatar img { width: 40px; height: 40px; display: block; }
.cally-chat-shell .ai-companion-header-title { margin: 0; font-size: var(--ds-text-lg); font-weight: var(--ds-weight-extrabold); color: var(--ds-primary-ink); background: none; -webkit-text-fill-color: currentColor; animation: none; }
.cally-chat-shell .ai-companion-header-sub { display: flex; align-items: center; gap: var(--ds-space-1); font-size: var(--ds-text-xs); color: var(--ds-text); }
.cally-chat-shell .cally-status-dot { width: 6px; height: 6px; border-radius: var(--ds-radius-full) !important; background: var(--ds-success-strong); }
.cally-chat-shell .ai-companion-header-actions { display: flex; gap: var(--ds-space-1); }
.cally-chat-shell .ai-companion-close { display: inline-flex; justify-content: center; align-items: center; padding: var(--ds-space-2); width: var(--ds-touch-target); height: var(--ds-touch-target); border: 0; border-radius: var(--ds-radius-md) !important; background: transparent; color: var(--ds-text); cursor: pointer; }
.cally-chat-shell .ai-companion-close:hover { background: var(--ds-background-muted); }
.cally-chat-shell .ai-companion-tabs { display: flex; border-bottom: var(--ds-border-width) solid var(--ds-border); background: var(--ds-surface); flex-shrink: 0; }
.cally-chat-shell .ai-companion-tab { flex: 1; padding: var(--ds-space-3); min-height: var(--ds-touch-target); border: 0; border-bottom: var(--ds-border-width-strong) solid transparent; background: transparent; color: var(--ds-text); font: inherit; font-size: var(--ds-text-xs); }
.cally-chat-shell .ai-companion-tab.active { color: var(--ds-primary-ink); border-bottom-color: var(--ds-primary-solid); }
.cally-chat-shell .ai-chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: var(--ds-space-4) var(--ds-space-5); display: flex; flex-direction: column; gap: var(--ds-space-4); }
.cally-chat-shell .ai-chat-welcome { text-align: center; padding: var(--ds-space-6) var(--ds-space-2) var(--ds-space-4); }
.cally-chat-shell .cally-welcome-orb { margin: 0 auto var(--ds-space-4); width: 48px; height: 48px; }
.cally-chat-shell .ai-chat-welcome-text { font-size: var(--ds-text-base); line-height: var(--ds-leading-relaxed); color: var(--ds-text); max-width: 30ch; margin: 0 auto var(--ds-space-5); }
.cally-chat-shell .ai-chat-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-space-2); }
.cally-chat-shell .ai-chat-starter { padding: var(--ds-space-2) var(--ds-space-3); min-height: var(--ds-touch-target); border: var(--ds-border-width) solid var(--ds-border); border-radius: var(--ds-radius-full) !important; background: var(--ds-surface); color: var(--ds-text); font: inherit; font-size: var(--ds-text-xs); cursor: pointer; }
.cally-chat-shell .ai-chat-starter:hover { background: var(--ds-primary-soft); color: var(--ds-primary-ink); border-color: var(--ds-primary-solid); }
.cally-chat-shell .ai-chat-input-area { display: flex; align-items: center; gap: var(--ds-space-2); padding: var(--ds-space-4) var(--ds-space-5); border-top: var(--ds-border-width) solid var(--ds-border); background: var(--ds-surface); flex-shrink: 0; }
.cally-chat-shell .cally-input-pill { flex: 1; min-width: 0; display: flex; align-items: center; padding: var(--ds-space-1) var(--ds-space-3); background: var(--ds-surface); border: var(--ds-border-width) solid var(--ds-border-control); border-radius: var(--ds-radius-full) !important; }
.cally-chat-shell .cally-input-pill:focus-within { border-color: var(--ds-primary-solid); box-shadow: var(--ds-focus-ring); }
.cally-chat-shell .cally-input-pill .ai-chat-input { width: 100%; min-width: 0; min-height: var(--ds-touch-target); padding: var(--ds-space-2) 0; border: 0; background: transparent; color: var(--ds-text); font: inherit; font-size: var(--ds-text-base); box-shadow: none; outline: none; }
.cally-chat-shell .cally-action-btn { display: flex; justify-content: center; align-items: center; flex-shrink: 0; width: var(--ds-touch-target); height: var(--ds-touch-target); border: 0; border-radius: var(--ds-radius-full) !important; background: var(--ds-primary-solid); color: var(--ds-on-primary); cursor: pointer; }
.cally-chat-shell .ai-chat-bubble, .cally-chat-shell .cally-help-turn { padding: var(--ds-space-3) var(--ds-space-4); border-radius: var(--ds-radius-xl) !important; background: var(--ds-background-muted); color: var(--ds-text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--ds-text-base); line-height: var(--ds-leading-relaxed); }
.cally-chat-shell .ai-chat-bubble-user, .cally-chat-shell .cally-help-turn--user { background: var(--ds-primary-solid); color: var(--ds-on-primary); margin-left: var(--ds-space-6); }
.cally-chat-shell :focus-visible { outline: var(--ds-focus-outline); outline-offset: var(--ds-focus-offset); }
.cally-chat-shell [hidden] { display: none !important; }
.cally-chat-shell.maximized { height: calc(100dvh - 116px); max-height: calc(100dvh - 116px); }
@media (max-width: 600px) { .cally-chat-shell { width: calc(100vw - var(--ds-space-8)); max-height: calc(100dvh - 116px); } }
.cally-chat-shell .cally-avatar, .cally-chat-shell .cally-welcome-orb { display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, var(--ds-primary-solid), var(--ds-primary-accent), var(--ds-chart-2)); border-radius: var(--ds-radius-full) !important; box-shadow: 0 0 0 4px var(--ds-primary-soft); animation: none; }
.cally-chat-shell .cally-avatar { width: 40px; height: 40px; }
.cally-chat-shell::before, .cally-chat-shell::after { content: ''; position: absolute; width: 240px; height: 240px; border-radius: var(--ds-radius-full) !important; filter: blur(64px); opacity: 0.12; z-index: 0; pointer-events: none; animation: none; }
.cally-chat-shell::before { background: var(--ds-primary-solid); top: -70px; left: -70px; }
.cally-chat-shell::after { background: var(--ds-chart-2); bottom: -80px; right: -60px; }
.cally-chat-shell > .ai-companion-header, .cally-chat-shell > .ai-companion-tabs, .cally-chat-shell > .ai-chat-messages, .cally-chat-shell > .ai-chat-input-area, .cally-chat-shell > .ai-companion-tab-content { position: relative; z-index: 1; }

@media (max-width: 600px) { .cally-chat-shell .cally-input-pill .ai-chat-input { font-size: var(--ds-text-lg); } }

@keyframes callably-icon-popup-open {
    from { transform: scale(0.04); }
    to { transform: scale(1); }
}
@keyframes callably-icon-popup-close {
    from { transform: scale(1); }
    to { transform: scale(0.04); }
}
