/* Ofi: página, widget flotante y tarjetas de confirmación */
.ofi { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.ofi__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--gray-100); }
.ofi__head .icon-btn { width: 34px; height: 34px; }
.ofi__avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange-500); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ofi__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ofi__title strong { color: var(--navy-900); }
.ofi__title span { font-size: 12px; color: var(--gray-500); }
.ofi__tts[aria-pressed="true"] { color: var(--orange-600); border-color: var(--orange-500); }
.ofi__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--gray-50); }
.ofi__empty { margin: auto 0; text-align: center; color: var(--gray-500); }
.ofi__empty p { max-width: 420px; margin: 0 auto 14px; }
.ofi__chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ofi__chip { border: 1px solid var(--gray-300); background: #fff; border-radius: var(--radius-full); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--navy-900); }
.ofi__chip:hover { border-color: var(--orange-500); color: var(--orange-600); }
.ofi-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.ofi-msg--user { align-self: flex-end; background: var(--navy-900); color: #fff; border-bottom-right-radius: 4px; }
.ofi-msg--ofi { align-self: flex-start; background: #fff; color: var(--gray-900); border: 1px solid var(--gray-100); border-bottom-left-radius: 4px; }
.ofi-msg img { max-width: 160px; border-radius: 8px; display: block; margin-top: 6px; }
.ofi-typing { align-self: flex-start; color: var(--gray-500); font-size: 13px; display: flex; gap: 4px; align-items: center; padding: 6px 4px; }
.ofi-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); animation: ofi-blink 1s infinite; }
.ofi-typing i:nth-child(2) { animation-delay: .2s; } .ofi-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ofi-blink { 50% { background: var(--orange-500); } }
.ofi-card { align-self: stretch; background: #fff; border: 1px solid var(--gray-100); border-left: 4px solid var(--orange-500); border-radius: 12px; padding: 14px; box-shadow: var(--shadow-card); }
.ofi-card--strong { border-left-color: var(--danger); }
.ofi-card__label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange-600); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.ofi-card--strong .ofi-card__label { color: var(--danger); }
.ofi-card__summary { white-space: pre-wrap; color: var(--navy-900); font-weight: 500; }
.ofi-card textarea { margin-top: 10px; min-height: 90px; }
.ofi-card__strong { margin-top: 10px; display: grid; gap: 6px; }
.ofi-card__strong label { font-size: 13px; font-weight: 600; }
.ofi-card__actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.ofi-card.is-done { opacity: .6; }
.ofi-result { align-self: flex-start; display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--success-50); color: #166534; font-weight: 500; max-width: 90%; }
.ofi-result--error { background: var(--danger-50); color: #991B1B; }
.ofi-result a { text-decoration: underline; font-weight: 600; }
.ofi__attach { display: flex; gap: 8px; padding: 8px 14px 0; flex-wrap: wrap; }
.ofi__attach span { position: relative; }
.ofi__attach img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.ofi__attach button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--navy-900); color: #fff; cursor: pointer; font-size: 12px; line-height: 20px; padding: 0; }
.ofi__composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--gray-100); }
.ofi__composer textarea { flex: 1; min-height: 40px; max-height: 140px; height: 40px; resize: none; padding: 9px 12px; }
.ofi__composer .icon-btn { flex: none; cursor: pointer; }
.ofi__mic.is-listening { background: var(--danger); color: #fff; border-color: var(--danger); animation: ofi-pulse 1.2s infinite; }
@keyframes ofi-pulse { 50% { box-shadow: 0 0 0 6px rgba(220,38,38,.2); } }
.ofi__send { width: 44px; padding: 0; flex: none; }
.ofi__close { display: none; }

.ofi-page { height: calc(100dvh - 120px); max-width: 900px; margin: 0 auto; }

.ofi-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--orange-500); color: #fff; box-shadow: var(--shadow-elevated); cursor: pointer; z-index: 40; display: flex; align-items: center; justify-content: center; }
.ofi-fab:hover { background: var(--orange-600); }
.ofi-panel { position: fixed; right: 24px; bottom: 92px; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 120px)); z-index: 41; }
.ofi-panel .ofi { box-shadow: var(--shadow-elevated); border: 1px solid var(--gray-100); }
.ofi-panel .ofi__close { display: inline-flex; }
@media (max-width: 767px) {
  .ofi-fab, .ofi-panel { display: none !important; }
  .ofi-page { height: calc(100dvh - 76px - 64px - env(safe-area-inset-bottom)); }
  .ofi { border-radius: 0; box-shadow: none; }
}
