/* USTAD: AR car-expert chat */
.us-fab { position: fixed; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 58; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--fg); font: 600 0.9rem/1 var(--font-body); }
.us-fab .us-ring { position: relative; width: 56px; height: 56px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, var(--hp), var(--ev), var(--hp)); box-shadow: 0 10px 30px rgba(0,0,0,0.55); flex: none; }
.us-fab .us-ring::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--hp); opacity: 0; animation: us-pulse 2.6s ease-out infinite; }
.us-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface); border: 2px solid var(--bg); }
.us-fab .us-dot { position: absolute; right: 2px; bottom: 3px; width: 13px; height: 13px; border-radius: 50%; background: #25d366; border: 2px solid var(--bg); }
.us-fab .us-pill { display: none; order: -1; background: rgba(13,17,23,0.94); border: 1px solid var(--line); padding: 10px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); letter-spacing: 0.02em; }
.us-fab .us-pill b { color: var(--hp); font-family: var(--font-display); letter-spacing: 0.08em; }
.us-fab:focus-visible .us-ring { outline: 2px solid var(--ev); outline-offset: 3px; }
@keyframes us-pulse { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.25); opacity: 0; } }
@media (min-width: 900px) { .us-fab { right: 24px; bottom: 24px; } .us-fab .us-pill { display: block; } .us-fab .us-ring { width: 68px; height: 68px; } }

.us-teaser { position: fixed; right: 14px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); z-index: 58; max-width: min(270px, calc(100vw - 28px)); background: var(--fg); color: var(--bg); padding: 11px 34px 11px 14px; border-radius: 14px 14px 4px 14px; font-size: 0.9rem; line-height: 1.4; box-shadow: 0 12px 30px rgba(0,0,0,0.5); cursor: pointer; animation: us-in 0.35s ease-out; }
.us-teaser.ur { font-family: var(--font-urdu); line-height: 2; padding: 8px 14px 8px 34px; border-radius: 14px 14px 14px 4px; }
.us-teaser button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0,0,0,0.08); color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.us-teaser.ur button { right: auto; left: 6px; }
@media (min-width: 900px) { .us-teaser { right: 24px; bottom: 108px; } }
@keyframes us-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

.us-panel { position: fixed; z-index: 85; inset: 0; display: flex; flex-direction: column; background: var(--bg-2); color: var(--fg); padding-top: env(safe-area-inset-top, 0px); animation: us-in 0.25s ease-out; }
@media (min-width: 600px) { .us-panel { inset: auto 24px 24px auto; width: 400px; height: min(640px, calc(100vh - 48px)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.6); padding-top: 0; } }
.us-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: linear-gradient(120deg, rgba(255,106,26,0.18), rgba(47,214,240,0.12)), var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.us-head img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--hp); flex: none; }
.us-head .us-who { flex: 1; min-width: 0; }
.us-head .us-name { font: 800 1.05rem/1.1 var(--font-display); letter-spacing: 0.12em; }
.us-head .us-sub { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-head .us-sub i { width: 8px; height: 8px; border-radius: 50%; background: #25d366; flex: none; }
.us-head button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--fg); cursor: pointer; display: grid; place-items: center; flex: none; }
.us-head button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

.us-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.us-hero { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.us-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.us-hero span { position: absolute; left: 10px; bottom: 8px; font: 800 0.8rem/1 var(--font-display); letter-spacing: 0.14em; background: rgba(7,9,12,0.75); padding: 6px 8px; border-radius: 6px; }
.us-hero span b { color: var(--hp); }
.us-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 0.92rem; line-height: 1.5; overflow-wrap: anywhere; }
.us-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.us-msg.me { align-self: flex-end; background: var(--hp); color: var(--ink); border-bottom-right-radius: 4px; font-weight: 500; }
.us-msg.ur { font-family: var(--font-urdu); line-height: 2.05; font-size: 0.95rem; }
.us-msg.bot.ur { align-self: flex-end; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.us-msg.me.ur { align-self: flex-start; }
.us-msg h4 { margin: 0 0 6px; font: 700 0.95rem/1.35 var(--font-body); color: var(--hp-soft); }
.us-msg.ur h4 { font-family: var(--font-urdu); line-height: 1.9; }
.us-msg ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 5px; }
.us-msg p { margin: 0 0 6px; }
.us-msg p:last-child { margin-bottom: 0; }
.us-msg .us-note { margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.us-msg .us-also { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.us-msg .us-also b { color: var(--ev); }
.us-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.us-acts a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font: 600 0.8rem/1 var(--font-body); text-decoration: none; border: 1px solid var(--line); color: var(--fg); }
.us-acts a.wa { background: #25d366; border-color: #25d366; color: #04160a; }
.us-acts a svg { width: 15px; height: 15px; fill: currentColor; }
.us-tag { font: 500 0.66rem/1 var(--font-mono); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 8px; }
.us-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.us-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: us-blink 1.2s infinite; }
.us-typing i:nth-child(2) { animation-delay: 0.2s; } .us-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes us-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.us-chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px; flex: none; scrollbar-width: none; border-top: 1px solid var(--line); }
.us-chips::-webkit-scrollbar { display: none; }
.us-chips button { flex: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 0.8rem/1 var(--font-body); cursor: pointer; white-space: nowrap; }
.us-chips button.ur { font-family: var(--font-urdu); font-size: 0.82rem; line-height: 1.6; padding: 4px 12px; }
.us-chips button:hover { border-color: var(--hp); }
.us-form { display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); flex: none; background: var(--bg-2); }
@media (min-width: 600px) { .us-form { padding-bottom: 12px; } }
.us-form textarea { flex: 1; min-width: 0; resize: none; height: 46px; max-height: 120px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 400 16px/1.35 var(--font-body); }
.us-form textarea:focus { outline: none; border-color: var(--hp); }
.us-form button { width: 46px; height: 46px; flex: none; border: 0; border-radius: 12px; background: var(--hp); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.us-form button:disabled { opacity: 0.5; cursor: default; }
.us-form button svg { width: 20px; height: 20px; fill: currentColor; }
html.us-lock, html.us-lock body { overflow: hidden; }
@media (min-width: 600px) { html.us-lock, html.us-lock body { overflow: visible; } }
@media (prefers-reduced-motion: reduce) { .us-fab .us-ring::after, .us-panel, .us-teaser, .us-typing i { animation: none; } }
