/* OMS assistant — floating chat */
.ai-launch {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60;
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 22px 0 8px; border-radius: 999px;
  background: var(--ink); color: var(--bg); border: 0; cursor: pointer; box-shadow: var(--shadow);
  font: 500 15px var(--sans); transition: transform .25s var(--ease), opacity .25s;
}
.ai-launch:hover { transform: translateY(-2px); }
.ai-launch__dot { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; position: relative; }
.ai-launch__dot svg { width: 18px; height: 18px; }
.ai-launch__dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--accent); animation: aiPulse 2.6s var(--ease) infinite; }
@keyframes aiPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.ai-open .ai-launch { opacity: 0; pointer-events: none; transform: translateY(10px); }

.ai-panel {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 70;
  width: min(420px, calc(100vw - 40px)); height: min(680px, calc(100svh - 40px));
  display: flex; flex-direction: column; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; pointer-events: none; visibility: hidden;
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
}
.ai-open .ai-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .3s var(--ease), transform .3s var(--ease); }
@media (max-width: 560px) { .ai-panel { inset: 0; width: 100%; height: 100svh; border-radius: 0; border: 0; } }

.ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--line); }
.ai-head__seal { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #b3262d; flex: none; }
.ai-head__title { font: 400 22px/1.1 var(--serif); }
.ai-head__sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ai-head__sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3f9b62; }
.ai-head__tools { margin-left: auto; display: flex; gap: 2px; }
.ai-head .icon-btn { width: 38px; height: 38px; }
.ai-head .icon-btn svg { width: 18px; height: 18px; }

.ai-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; overscroll-behavior: contain; }
.ai-msg { max-width: 88%; font-size: 15px; line-height: 1.55; animation: aiIn .35s var(--ease); }
@keyframes aiIn { from { opacity: 0; transform: translateY(6px); } }
.ai-msg--user { align-self: flex-end; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.ai-msg--bot { align-self: flex-start; }
.ai-msg--bot p + p, .ai-msg--bot p + ul, .ai-msg--bot ul + p { margin-top: 8px; }
.ai-msg--bot ul { margin: 6px 0 0; padding-left: 18px; }
.ai-msg--bot a { color: var(--accent); }
.ai-msg--bot strong { font-weight: 600; }
.ai-msg--error { color: var(--accent); font-size: 14px; }

.ai-products { display: grid; gap: 8px; margin-top: 10px; }
.ai-prod { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ai-prod img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.ai-prod a { font: 400 17px/1.15 var(--serif); text-decoration: none; color: var(--ink); }
.ai-prod a:hover { text-decoration: underline; }
.ai-prod span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.ai-prod button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 13px; color: var(--ink); white-space: nowrap; }
.ai-prod button:hover { background: var(--ink); color: var(--bg); }

.ai-typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: aiDot 1.2s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-suggest { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: none; }
.ai-suggest::-webkit-scrollbar { display: none; }
.ai-suggest button { flex: none; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.ai-suggest button:hover { border-color: var(--ink); color: var(--ink); }

.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.ai-form textarea { flex: 1; resize: none; min-height: 46px; max-height: 120px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; line-height: 1.4; }
.ai-form textarea:focus { outline: none; border-color: var(--ink); }
.ai-form button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; flex: none; transition: transform .15s; }
.ai-form button:active { transform: scale(.94); }
.ai-form button[disabled] { opacity: .4; cursor: default; }
.ai-form button svg { width: 18px; height: 18px; }
.ai-foot { font-size: 11px; color: var(--muted); text-align: center; padding: 0 16px 10px; }
@media (prefers-reduced-motion: reduce) { .ai-launch__dot::after { animation: none; } }
