/* Chat cu asistentul AI MaxAuto (adaptat după SEVENS; folosește culorile temei: --c-surface, --c-line…) */
.aichat { position: fixed; z-index: 90; left: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); width: 0; height: 0; }
@media (min-width: 1024px) { .aichat { left: 24px; bottom: 24px; } }
.aichat-panel { position: fixed; left: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); width: 390px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: rgb(var(--c-bg)); color: rgb(var(--c-fg)); border: 1px solid rgb(var(--c-line)); border-radius: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.28); overflow: hidden; transform-origin: bottom left; transform: scale(.92) translateY(14px); opacity: 0; visibility: hidden; transition: .28s cubic-bezier(.22,.8,.2,1); z-index: 95; font-family: inherit; }
@media (min-width: 1024px) { .aichat-panel { left: 24px; bottom: 24px; } }
.aichat.is-open .aichat-panel { transform: none; opacity: 1; visibility: visible; }
.aichat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: rgb(var(--c-surface)); border-bottom: 1px solid rgb(var(--c-line)); }
.aichat-ava { position: relative; width: 48px; height: 48px; flex: none; }
.aichat-ava img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; display: block; background: #fff; }
.aichat-ava i { position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid rgb(var(--c-surface)); }
.aichat-who { display: grid; gap: 2px; min-width: 0; margin-right: auto; }
.aichat-who b { font-size: 16px; font-weight: 800; }
.aichat-who b { font-size: 17px; }
.aichat-who span { font-size: 12.5px; color: rgb(var(--c-muted)); }
.aichat-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgb(var(--c-surface-2)); color: inherit; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.aichat-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.ac-msg { max-width: 86%; display: grid; gap: 3px; animation: acIn .25s ease; }
@keyframes acIn { from { opacity: 0; transform: translateY(6px); } }
.ac-b { padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.ac-b a { color: rgb(224 0 0); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.ac-bot { align-self: flex-start; }
.ac-msg.ac-bot { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; align-items: end; max-width: 90%; }
.ac-ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #fff; grid-row: 1 / span 2; align-self: end; }
.ac-bot .ac-who { grid-column: 2; }
.ac-bot .ac-b { grid-column: 2; }
.ac-bot.ac-admin, .ac-bot.ac-err, .ac-bot.ac-cardsmsg { padding-left: 38px; grid-template-columns: minmax(0, 1fr); }
.ac-bot.ac-admin .ac-who, .ac-bot.ac-admin .ac-b, .ac-bot.ac-err .ac-b, .ac-bot.ac-cardsmsg .ac-cards { grid-column: 1; }
.ac-bot .ac-b { background: rgb(var(--c-surface-2)); border-bottom-left-radius: 6px; }
.ac-admin .ac-b { border: 1px solid rgba(224,0,0,.35); }
.ac-who { font-size: 11.5px; color: rgb(224 0 0); font-weight: 700; padding-left: 8px; }
.ac-me { align-self: flex-end; }
.ac-me .ac-b { background: rgb(224 0 0); color: #fff; font-weight: 600; border-bottom-right-radius: 6px; }
.ac-me .ac-b a { color: inherit; }
.ac-err .ac-b { background: rgba(229,57,53,.12); color: #d32f2f; }
.ac-typing .ac-b { display: flex; gap: 5px; padding: 14px 16px; }
.ac-typing .ac-b span { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c-muted)); animation: acDot 1.1s infinite; }
.ac-typing .ac-b span:nth-child(2) { animation-delay: .15s; }
.ac-typing .ac-b span:nth-child(3) { animation-delay: .3s; }
@keyframes acDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ac-cardsmsg { max-width: 100% !important; width: 100%; }
.ac-cards { display: grid; gap: 10px; }
.ac-card { display: flex; gap: 12px; padding: 8px; border-radius: 18px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; }
.ac-card:hover { border-color: rgb(224 0 0); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.ac-card-img { position: relative; flex: none; width: 112px; height: 84px; border-radius: 12px; overflow: hidden; background: rgb(var(--c-surface-2)); }
.ac-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-card-img em { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; font: 700 11px/1.4 inherit; font-style: normal; }
.ac-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 2px 4px 2px 0; }
.ac-card-body b { font-size: 15px; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-card-body small { font-size: 12.5px; line-height: 1.35; color: rgb(var(--c-muted)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ac-card-foot strong { font-size: 16px; font-weight: 800; color: rgb(224 0 0); white-space: nowrap; }
.ac-card-foot i { font-style: normal; font-size: 12.5px; font-weight: 700; color: rgb(var(--c-muted)); white-space: nowrap; }
.ac-card:hover .ac-card-foot i { color: rgb(224 0 0); }
.aichat-quick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 0 14px 10px; }
.aichat-quick button { max-width: 100%; padding: 7px 13px; border-radius: 16px; border: 1px solid rgba(224,0,0,.45); background: transparent; color: inherit; font: 600 13px/1.3 inherit; font-family: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.aichat-quick button:hover { border-color: rgb(224 0 0); background: rgba(224,0,0,.08); }
.aichat-quick button:hover { border-color: rgb(224 0 0); }
.aichat-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 16px; border-radius: 26px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); }
.aichat-form:focus-within { border-color: rgb(224 0 0); }
.aichat-form textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 9px 0; border: 0; outline: 0; resize: none; background: transparent; color: inherit; font: 15px/1.45 inherit; font-family: inherit; }
.aichat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgb(224 0 0); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.aichat-send:disabled { opacity: .45; cursor: default; }
.aichat-note { padding: 8px 16px 12px; font-size: 11.5px; color: rgb(var(--c-subtle)); text-align: center; }
.aichat-note a { text-decoration: underline; }
.aichat-launch { position: fixed; z-index: 60; left: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; }
@media (min-width: 1024px) { .aichat-launch { left: 24px; bottom: 24px; } }
.aichat-btn { position: relative; width: 62px; height: 62px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 0 0 2px rgba(224,0,0,.9); cursor: pointer; transition: transform .2s; flex: none; }
.aichat-btn:hover { transform: scale(1.06); }
.aichat-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.aichat-online { position: absolute; right: -1px; bottom: 1px; width: 15px; height: 15px; border-radius: 50%; background: #22c55e; border: 2.5px solid #fff; }
.aichat-btn .aichat-dot { position: absolute; top: -3px; right: -3px; width: 16px; height: 16px; border-radius: 50%; background: rgb(224 0 0); border: 2.5px solid #fff; }
.aichat-teaser { position: relative; display: grid; gap: 2px; width: max-content; max-width: 230px; padding: 10px 30px 11px 14px; border-radius: 16px 16px 16px 4px; background: rgb(var(--c-bg)); color: rgb(var(--c-fg)); border: 1px solid rgb(var(--c-line)); box-shadow: 0 12px 30px rgba(0,0,0,.2); font-size: 13.5px; line-height: 1.35; cursor: pointer; animation: acIn .35s ease; }
.aichat-teaser[hidden] { display: none; }
.aichat-teaser b { font-size: 12.5px; color: rgb(224 0 0); }
.aichat-teaser button { position: absolute; top: 5px; right: 7px; border: 0; background: none; color: rgb(var(--c-muted)); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px; }
html.aichat-lock .aichat-launch, .aichat-launch.is-hidden { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .aichat-panel { inset: 0; right: 0; bottom: 0; width: auto; max-width: none; height: 100%; height: 100dvh; border-radius: 0; border: 0; transform: translateY(30px); }
  .aichat-form textarea { font-size: 16px; }
  .aichat-note { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  html.aichat-lock, html.aichat-lock body { overflow: hidden; }
}
