.sofia-chat { --sofia-accent: #c2185b; font-family: inherit; font-size: 15px; line-height: 1.5; color: #222; box-sizing: border-box; }
.sofia-chat *, .sofia-chat *::before, .sofia-chat *::after { box-sizing: border-box; }

.sofia-inline .sofia-panel { max-width: 640px; height: 560px; margin: 1.5em auto; }
.sofia-floating { position: fixed; right: 20px; bottom: 20px; z-index: 99999; }
.sofia-floating .sofia-panel { position: absolute; right: 0; bottom: 72px; width: 370px; max-width: calc(100vw - 40px); height: 540px; max-height: calc(100vh - 110px); }
.sofia-panel[hidden] { display: none !important; }

.sofia-bubble { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--sofia-accent); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.2); transition: transform .15s; }
.sofia-bubble:hover { transform: scale(1.06); }

.sofia-panel { display: flex; flex-direction: column; background: #fff; border: 1px solid #eadde3; border-radius: 16px; box-shadow: 0 10px 34px rgba(0,0,0,.14); overflow: hidden; }
.sofia-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--sofia-accent); color: #fff; }
.sofia-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sofia-title { flex: 1; font-weight: 600; }
.sofia-close { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }

.sofia-log { flex: 1; overflow-y: auto; padding: 14px; background: #fcf8fa; display: flex; flex-direction: column; gap: 10px; }
.sofia-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; word-wrap: break-word; }
.sofia-msg p { margin: 0 0 .5em; }
.sofia-msg p:last-child { margin-bottom: 0; }
.sofia-msg ul { margin: .3em 0 .6em 1.2em; padding: 0; }
.sofia-assistant { align-self: flex-start; background: #fff; border: 1px solid #efe3e9; border-bottom-left-radius: 4px; }
.sofia-user { align-self: flex-end; background: var(--sofia-accent); color: #fff; border-bottom-right-radius: 4px; }
.sofia-error { align-self: center; background: #fff3f3; color: #a30000; font-size: 13px; }
.sofia-typing { opacity: .65; font-style: italic; }

.sofia-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #f0e6eb; background: #fff; margin: 0; }
.sofia-form textarea { flex: 1; resize: none; border: 1px solid #ddd; border-radius: 10px; padding: 9px 11px; font: inherit; min-height: 42px; max-height: 120px; }
.sofia-form textarea:focus { outline: 2px solid var(--sofia-accent); outline-offset: -1px; border-color: transparent; }
.sofia-form button { border: 0; border-radius: 10px; background: var(--sofia-accent); color: #fff; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sofia-form button:disabled { opacity: .5; cursor: default; }
.sofia-disclaimer { font-size: 11px; color: #888; text-align: center; padding: 0 10px 8px; background: #fff; }

/* Voice */
.sofia-msg.sofia-assistant { position: relative; padding-right: 36px; }
.sofia-msg.sofia-nospeak { padding-right: 13px; }
.sofia-speak { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; opacity: .55; padding: 0; }
.sofia-speak:hover, .sofia-speak.is-active { opacity: 1; background: #f6e7ee; }
.sofia-auto { background: rgba(255,255,255,.2); border: 0; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.sofia-auto:hover { background: rgba(255,255,255,.35); }
.sofia-mic, .sofia-lang { border: 1px solid #e5d3dc; background: #fff; border-radius: 10px; cursor: pointer; padding: 0; flex: 0 0 auto; }
.sofia-mic { width: 42px; font-size: 18px; }
.sofia-lang { width: 36px; font-size: 11px; font-weight: 700; color: var(--sofia-accent); }
.sofia-mic:disabled { opacity: .5; cursor: default; }
.sofia-mic.is-active { background: var(--sofia-accent); border-color: var(--sofia-accent); animation: sofia-pulse 1.2s infinite; }
@keyframes sofia-pulse { 0% { box-shadow: 0 0 0 0 rgba(194,24,91,.45); } 70% { box-shadow: 0 0 0 10px rgba(194,24,91,0); } 100% { box-shadow: 0 0 0 0 rgba(194,24,91,0); } }
@media (max-width: 420px) { .sofia-form button.sofia-send { padding: 0 10px; font-size: 12px; } }
