/* ── PRIVET IQ MODAL ─────────────────────────────────────────────────────── */
.iq-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s; }
.iq-modal.active { opacity: 1; pointer-events: all; }
.iq-modal-backdrop { position: absolute; inset: 0; background: rgba(3,38,79,0.5); backdrop-filter: blur(4px); }
.iq-modal-panel { position: relative; z-index: 1; width: 100%; max-width: 720px; height: 82vh; max-height: 760px; background: var(--white); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden; transform: translateY(100%); transition: transform .35s cubic-bezier(.32,.72,0,1); box-shadow: 0 -8px 40px rgba(3,38,79,0.15); }
.iq-modal.active .iq-modal-panel { transform: translateY(0); }
.iq-modal-header { padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.iq-modal-brand { display: flex; align-items: center; gap: .6rem; }
.iq-modal-sparkle { color: var(--teal); font-size: 1.1rem; }
.iq-modal-title { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; color: var(--navy); }
.iq-modal-sub { font-size: .68rem; color: var(--text-light); }
.iq-modal-close { background: none; border: none; font-size: 1.2rem; color: var(--text-light); cursor: pointer; padding: .25rem; line-height: 1; }
.iq-modal-close:hover { color: var(--navy); }
.iq-modal-messages { flex: 1; overflow-y: auto; padding: 1.4rem 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; scroll-behavior: smooth; }
.iq-msg { max-width: 88%; display: flex; flex-direction: column; gap: .3rem; }
.iq-msg-user { align-self: flex-end; background: var(--navy); color: white; padding: .85rem 1.1rem; border-radius: 18px 18px 4px 18px; font-size: .9rem; line-height: 1.6; }
.iq-msg-ai-wrap { align-self: flex-start; display: flex; align-items: flex-start; gap: .6rem; max-width: 100%; }
.iq-msg-ai-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: .1rem; }
.iq-msg-ai-avatar svg { width: 14px; height: 14px; fill: none; stroke: white; stroke-width: 2; }
.iq-msg-ai { background: #f4f7fa; border: 1px solid rgba(0,0,0,0.07); padding: .9rem 1.1rem; border-radius: 4px 18px 18px 18px; font-size: .9rem; line-height: 1.75; color: var(--text); flex: 1; display: inline-block; max-width: 100%; }
.iq-msg-ai a { color: var(--teal); text-decoration: underline; font-weight: 500; transition: opacity 0.2s; }
.iq-msg-ai a:hover { opacity: 0.8; }
.iq-msg-ai.loading { color: var(--text-light); white-space: nowrap; display: inline-flex; align-items: baseline; }
.iq-msg-ai.loading::after { content: '...'; animation: iq-dots 1.5s infinite; display: inline; }
@keyframes iq-dots { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } }
.iq-modal-chips { padding: .6rem 1.4rem; display: flex; flex-wrap: wrap; gap: .4rem; flex-shrink: 0; border-top: 1px solid var(--border); }
.iq-modal-chip { background: var(--teal-pale); border: 1px solid rgba(42,172,172,.3); color: var(--teal); font-size: .7rem; padding: .3rem .7rem; border-radius: 999px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.iq-modal-chip:hover { background: var(--teal); color: white; }
.iq-modal-input-row { padding: .85rem 1.4rem; border-top: 1px solid var(--border); display: flex; gap: .6rem; align-items: center; flex-shrink: 0; }
.iq-modal-input { flex: 1; padding: .7rem 1rem; border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: .9rem; outline: none; transition: border .2s; }
.iq-modal-input:focus { border-color: var(--teal); }
.iq-modal-send { background: var(--teal); border: none; color: white; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s; }
.iq-modal-send:hover { background: #229999; }
.iq-modal-send svg { width: 16px; height: 16px; }
.iq-disclaimer-small { font-size: .62rem; color: var(--text-light); text-align: center; padding: .3rem 1.4rem .1rem; flex-shrink: 0; }
@media (max-width: 768px) {
  .iq-modal { padding-top: env(safe-area-inset-top, 44px); }
  .iq-modal-panel {
    height: 92vh;
    height: 92dvh;
    max-height: calc(100dvh - env(safe-area-inset-top, 44px) - 10px);
    border-radius: 16px 16px 0 0;
  }
  .iq-modal-input { font-size: 16px; }
}
