/* ==========================================================================
   AI Build chat (js/ai-chat-build.js)
   Chat on one side, products on the other. The site's global theme forces
   font sizes / weights / square corners with !important, so sizes here use
   !important too.
   ========================================================================== */

html.aib-open, html.aib-open body { overflow: hidden !important; }
/* the builder's own bottom bar and the support chatbot button would sit on top of the AI Build screen */
html.aib-open .quick-actions-bar, html.aib-open #builder-quick-actions, html.aib-open .chatbot-trigger, html.aib-open .chatbot-container, html.aib-open .mobile-bottom-nav, html.aib-open #mobile-action-bar, html.aib-open .mobile-action-bar { display: none !important; }

.aib-root {
    --aib-cyan: #00ffff;
    --aib-red: #cc181e;
    --aib-green: #00e676;
    --aib-bg: #000000;
    --aib-panel: #0a0a0a;
    --aib-panel-2: #111111;
    --aib-line: rgba(0, 255, 255, 0.18);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: 120px; /* set by JS to sit right under the site header */
    z-index: 1500;
    display: none;
    background: var(--aib-bg);
    color: #ededed;
    font-family: 'Outfit', 'Cairo', sans-serif;
}
.aib-root.aib-visible { display: grid; grid-template-columns: minmax(0, 1fr) 440px; }
.aib-root *, .aib-root *::before, .aib-root *::after { box-sizing: border-box; }

/* dark scrollbars */
.aib-root * { scrollbar-width: thin; scrollbar-color: #333333 #050505; }
.aib-root ::-webkit-scrollbar { width: 8px; height: 8px; }
.aib-root ::-webkit-scrollbar-track { background: #050505; }
.aib-root ::-webkit-scrollbar-thumb { background: #333333; border: 2px solid #050505; border-radius: 0; }
.aib-root ::-webkit-scrollbar-thumb:hover { background: #555555; }
.aib-root ::-webkit-scrollbar-corner { background: #050505; }
.aib-root button { font-family: inherit; cursor: pointer; }
.aib-root #aib-nothing, .aib-root [hidden] { display: none !important; }

/* ---------- Left: products ---------- */
.aib-left {
    position: relative;
    min-width: 0; min-height: 0;
    display: flex; flex-direction: column;
    padding: 22px 26px;
    overflow: hidden;
    background: var(--aib-bg);
}

.aib-welcome {
    margin: auto; text-align: center; max-width: 420px;
}
.aib-welcome img { width: 92px; height: 92px; object-fit: contain; opacity: 0.95; filter: drop-shadow(0 0 22px rgba(0, 255, 255, 0.35)); }
.aib-welcome h2 { margin: 18px 0 8px !important; font-size: 26px !important; font-weight: 700 !important; letter-spacing: 1px; color: #fff; }
.aib-welcome p { margin: 0 !important; font-size: 15px !important; line-height: 1.7; color: #8c8c8c; }
.aib-welcome .aib-pulse {
    width: 160px; height: 2px; margin: 24px auto 0;
    background: linear-gradient(90deg, transparent, var(--aib-cyan), transparent);
    animation: aib-sweep 2.6s ease-in-out infinite;
}
@keyframes aib-sweep { 0%, 100% { opacity: 0.2; transform: scaleX(0.4); } 50% { opacity: 1; transform: scaleX(1); } }

.aib-stage { display: none; flex-direction: column; min-height: 0; flex: 1; }
.aib-root[data-state="scan"] .aib-welcome,
.aib-root[data-state="done"] .aib-welcome { display: none; }
.aib-root[data-state="scan"] .aib-stage-scan { display: flex; }
.aib-root[data-state="done"] .aib-stage-done { display: flex; }

.aib-stagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.aib-stagehead h3 { margin: 0 !important; font-size: 18px !important; font-weight: 700 !important; color: #fff; letter-spacing: 0.5px; }
.aib-stagehead small { font-size: 13px !important; color: #8c8c8c; }
.aib-scanline { height: 3px; margin-bottom: 14px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.aib-scanline i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aib-cyan), #4facfe); box-shadow: 0 0 12px var(--aib-cyan); transition: width 0.5s ease; }

/* DeepSeek-style loader laid over the products (they stay visible behind it) */
.aib-stage-scan { position: relative; }
.aib-think {
    position: absolute; inset: 0; z-index: 20; overflow: hidden; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.48);
    -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
    transition: background 0.5s ease;
}
/* the scan line sweeps the whole screen from top to bottom, with a soft glow trailing behind it */
.aib-think-line {
    position: absolute; left: 0; right: 0; top: -100px; height: 100px;
    background: linear-gradient(to bottom, rgba(0, 242, 254, 0), rgba(0, 242, 254, 0.16));
    border-bottom: 2px solid rgba(0, 242, 254, 0.85); box-shadow: 0 6px 18px rgba(0, 242, 254, 0.55);
    animation: aib-scanv 3.4s infinite linear;
}
@keyframes aib-scanv { 0% { top: -100px; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.aib-think-main { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(520px, 92%); text-align: center; }
.aib-think-icon { position: relative; flex: none; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.aib-think-icon i { position: relative; z-index: 2; font-size: 56px !important; color: #e9fbff; animation: aib-float 3s infinite ease-in-out; }
.aib-think-icon span { position: absolute; inset: -22px; background: radial-gradient(circle, rgba(0, 242, 254, 0.3) 0%, transparent 70%); animation: aib-glow 2s infinite alternate; }
@keyframes aib-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes aib-glow { 0% { opacity: 0.3; transform: scale(0.8); } 100% { opacity: 0.9; transform: scale(1.2); } }
.aib-think-body { width: 100%; }
.aib-think-title { font-size: 22px !important; font-weight: 900 !important; letter-spacing: 4px; text-transform: uppercase; background: linear-gradient(90deg, #00f2fe, #4facfe); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.aib-think-sub { font-size: 12px !important; letter-spacing: 2px; text-transform: uppercase; color: #4facfe; opacity: 0.8; margin: 4px 0 18px; }
.aib-think-status { min-height: 1.5em; font-size: 15px !important; color: #ececec; font-family: 'Space Mono', 'Consolas', monospace; text-shadow: 0 0 6px rgba(0, 242, 254, 0.4); }
.aib-cursor { display: inline-block; width: 8px; height: 15px; margin-inline-start: 4px; vertical-align: -2px; background: #00f2fe; animation: aib-blink 1s steps(1) infinite; }
@keyframes aib-blink { 50% { opacity: 0; } }
.aib-think-bar { height: 4px; margin-top: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(0, 242, 254, 0.15); overflow: hidden; }
.aib-think-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #00f2fe, #4facfe); box-shadow: 0 0 10px #00f2fe; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* while the real parts are picked: slim strip on top so the products can be followed */
.aib-think.aib-compact { inset: 0 0 auto 0; justify-content: flex-start; background: rgba(0, 0, 0, 0.94); border-bottom: 1px solid rgba(0, 242, 254, 0.3); padding: 10px 16px; }
.aib-think.aib-compact .aib-think-line { display: none; }
.aib-think.aib-compact .aib-think-main { flex-direction: row; width: 100%; text-align: start; gap: 14px; }
.aib-think.aib-compact .aib-think-icon { width: 36px; height: 36px; }
.aib-think.aib-compact .aib-think-icon i { font-size: 24px !important; }
.aib-think.aib-compact .aib-think-icon span { inset: -10px; }
.aib-think.aib-compact .aib-think-title { font-size: 13px !important; letter-spacing: 2px; display: inline; }
.aib-think.aib-compact .aib-think-sub { display: none; }
.aib-think.aib-compact .aib-think-status { font-size: 12.5px !important; min-height: 0; }
.aib-think.aib-compact .aib-think-bar { margin-top: 6px; }
.aib-stage-scan.aib-pad { padding-top: 72px; }
.aib-stagehead h3 { display: none; }
.aib-stagehead { margin-bottom: 8px; }
.aib-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.aib-chip {
    padding: 6px 12px; font-size: 12px !important; letter-spacing: 0.5px; text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.12); color: #7a7a7a; background: rgba(255, 255, 255, 0.02);
}
.aib-chip.aib-chip-on { color: #001; background: var(--aib-cyan); border-color: var(--aib-cyan); font-weight: 700 !important; }
.aib-chip.aib-chip-done { color: var(--aib-green); border-color: rgba(0, 230, 118, 0.45); }
.aib-chip.aib-chip-done::before { content: "\2713\00a0"; }

.aib-grid {
    flex: 1; min-height: 0; overflow: auto;
    display: grid; align-content: start; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    padding: 4px 4px 12px;
}
.aib-card {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    padding: 12px; background: var(--aib-panel); border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, opacity 0.25s ease;
}
.aib-card .aib-img { height: 110px; display: flex; align-items: center; justify-content: center; background: #050505; }
.aib-card .aib-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aib-card .aib-brand { font-size: 11px !important; letter-spacing: 1.2px; text-transform: uppercase; color: var(--aib-cyan); }
.aib-card .aib-name { font-size: 13px !important; line-height: 1.35; color: #ededed; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aib-card .aib-price { font-size: 15px !important; font-weight: 700 !important; color: var(--aib-green); }
.aib-card.aib-hot { border-color: var(--aib-cyan); box-shadow: 0 0 0 1px var(--aib-cyan), 0 0 22px rgba(0, 255, 255, 0.5); transform: scale(1.035); z-index: 2; }
.aib-card.aib-dim { opacity: 0.28; }
.aib-card.aib-seen { border-color: rgba(0, 255, 255, 0.35); }
.aib-card.aib-out { border-color: rgba(204, 24, 30, 0.7); }
.aib-card.aib-out > :not(.aib-tag) { opacity: 0.28; filter: grayscale(0.8); }
.aib-tag { position: absolute; left: 0; right: 0; top: 0; z-index: 4; padding: 6px 8px; font-size: 11.5px !important; line-height: 1.3; background: rgba(204, 24, 30, 0.94); color: #fff; animation: aib-in 0.25s ease both; }
.aib-lines { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.aib-line { font-size: 13px !important; color: #bdbdbd; line-height: 1.45; animation: aib-in 0.3s ease both; }
.aib-line::before { content: "\203A\00a0"; color: var(--aib-cyan); }
.aib-pickline .aib-pf, .aib-pf { font-size: 12px !important; line-height: 1.4; color: var(--aib-green); }
.aib-card.aib-picked { border-color: var(--aib-green); box-shadow: 0 0 0 1px var(--aib-green), 0 0 26px rgba(0, 230, 118, 0.45); transform: scale(1.04); z-index: 3; opacity: 1; }
.aib-card.aib-picked::after {
    content: "\2713"; position: absolute; top: 8px; inset-inline-end: 8px;
    width: 24px; height: 24px; line-height: 24px; text-align: center; font-size: 15px !important; font-weight: 700 !important;
    background: var(--aib-green); color: #00170a;
}

/* Done: build summary */
.aib-sumlist { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 12px; }
.aib-sumrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px; background: var(--aib-panel); border: 1px solid rgba(255, 255, 255, 0.08); }
.aib-sumrow .aib-img { width: 64px; height: 56px; display: flex; align-items: center; justify-content: center; background: #050505; }
.aib-sumrow .aib-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aib-sumrow .aib-cat { font-size: 11px !important; letter-spacing: 1.2px; text-transform: uppercase; color: var(--aib-cyan); }
.aib-sumrow .aib-name { font-size: 14px !important; color: #fff; line-height: 1.35; }
.aib-sumrow .aib-price { font-size: 15px !important; font-weight: 700 !important; color: var(--aib-green); white-space: nowrap; }
.aib-sumtotal { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--aib-panel-2); border: 1px solid var(--aib-line); }
.aib-sumtotal strong { font-size: 24px !important; font-weight: 700 !important; color: #fff; }
.aib-sumtotal span { font-size: 13px !important; color: #8c8c8c; letter-spacing: 1px; text-transform: uppercase; }

/* ---------- Right: chat ---------- */
.aib-chat {
    min-height: 0; min-width: 0; display: flex; flex-direction: column;
    background: var(--aib-panel);
    border-inline-start: 1px solid var(--aib-line);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}
[dir="rtl"] .aib-chat { box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5); }
.aib-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--aib-panel-2); border-bottom: 1px solid var(--aib-line); }
.aib-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0, 255, 255, 0.45); background: linear-gradient(135deg, rgba(0, 255, 255, 0.18), rgba(204, 24, 30, 0.18)); }
.aib-avatar img { width: 24px; height: 24px; object-fit: contain; }
.aib-chat-head .aib-t { flex: 1; min-width: 0; }
.aib-chat-head .aib-t b { display: block; font-size: 15px !important; font-weight: 700 !important; color: #fff; }
.aib-chat-head .aib-t span { display: block; font-size: 12px !important; color: #8c8c8c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aib-hbtn { display: inline-flex; align-items: center; justify-content: center; line-height: 1; background: none; border: 1px solid rgba(255, 255, 255, 0.14); color: #bdbdbd; padding: 7px 10px; font-size: 12px !important; letter-spacing: 0.4px; }
.aib-hbtn:hover { border-color: var(--aib-cyan); color: var(--aib-cyan); }
.aib-minbtn { display: none; }
.aib-minbtn i { transition: transform 0.25s ease; }

.aib-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.aib-row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; animation: aib-in 0.3s ease both; }
@keyframes aib-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.aib-row.aib-user { justify-content: flex-end; }
.aib-bubble { max-width: 94%; padding: 11px 14px; font-size: 14px !important; line-height: 1.6; background: var(--aib-panel-2); border: 1px solid rgba(255, 255, 255, 0.08); color: #ededed; }
.aib-bot .aib-bubble { border-inline-start: 3px solid var(--aib-cyan); }
.aib-user .aib-bubble { background: linear-gradient(135deg, #a3141a, #cc181e); border-color: transparent; color: #fff; cursor: pointer; }
.aib-user .aib-bubble:hover { filter: brightness(1.12); }
.aib-bubble b, .aib-bubble strong { font-weight: 700 !important; color: #fff; }
.aib-typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.aib-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--aib-cyan); opacity: 0.4; animation: aib-dot 1s infinite; }
.aib-typing i:nth-child(2) { animation-delay: 0.15s; } .aib-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes aib-dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* Option / game cards inside the chat */
.aib-options { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; width: 100%; }
.aib-bubble.aib-wide { width: 94%; }
.aib-opt {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
    padding: 9px 12px; background: var(--aib-bg); border: 1px solid rgba(255, 255, 255, 0.12); color: #ededed;
    transition: border-color 0.15s, background 0.15s;
}
.aib-opt:hover { border-color: var(--aib-cyan); }
.aib-opt .aib-oi { width: 46px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; background: #050505; color: var(--aib-cyan); font-size: 18px !important; overflow: hidden; }
.aib-opt .aib-oi img { width: 100%; height: 100%; object-fit: cover; }
.aib-opt .aib-ot { flex: 1; min-width: 0; font-size: 14px !important; line-height: 1.3; }
.aib-opt .aib-ot small { display: block; font-size: 12px !important; color: #7a7a7a; margin-top: 2px; }
.aib-opt .aib-ck { width: 20px; height: 20px; flex: none; border: 1px solid rgba(255, 255, 255, 0.25); display: flex; align-items: center; justify-content: center; font-size: 12px !important; color: transparent; }
.aib-opt.aib-sel { border-color: var(--aib-cyan); background: rgba(0, 255, 255, 0.07); }
.aib-opt.aib-sel .aib-ck { background: var(--aib-cyan); border-color: var(--aib-cyan); color: #001; }
.aib-optlist { max-height: 300px; overflow-y: auto; padding-inline-end: 4px; }
.aib-widget.aib-locked { opacity: 0.55; pointer-events: none; }

.aib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.aib-btn { padding: 11px 16px; font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0.8px; text-transform: uppercase; border: 1px solid rgba(0, 255, 255, 0.5); background: transparent; color: var(--aib-cyan); }
.aib-btn:hover:not(:disabled) { background: rgba(0, 255, 255, 0.12); }
.aib-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.aib-btn.aib-primary { background: linear-gradient(135deg, #00d2d3, #0098c9); border-color: transparent; color: #04141a; }
.aib-btn.aib-primary:hover:not(:disabled) { filter: brightness(1.1); background: linear-gradient(135deg, #00d2d3, #0098c9); }
.aib-btn.aib-ghost { border-color: rgba(255, 255, 255, 0.18); color: #bdbdbd; }
.aib-btn.aib-wa { border-color: rgba(37, 211, 102, 0.6); color: #25d366; }

.aib-budget { display: flex; gap: 8px; margin-top: 10px; width: 100%; }
.aib-budget input { flex: 1; min-width: 0; padding: 11px 12px; font-size: 15px !important; background: var(--aib-bg); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; outline: none; }
.aib-budget input:focus { border-color: var(--aib-cyan); }
.aib-optwrap { display: flex; flex-direction: column; }
.aib-budgetpanel { padding: 10px 12px 12px; background: var(--aib-bg); border: 1px solid rgba(0, 255, 255, 0.35); border-top: 0; }
.aib-budgetpanel .aib-hint { font-size: 12.5px !important; color: #8c8c8c; margin-bottom: 2px; }
.aib-budgetpanel .aib-budget { margin-top: 10px; }
.aib-optwrap > .aib-opt.aib-sel { border-bottom-color: rgba(0, 255, 255, 0.35); }
.aib-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aib-quick button { padding: 6px 10px; font-size: 12px !important; background: transparent; border: 1px solid rgba(255, 255, 255, 0.16); color: #bdbdbd; }
.aib-quick button:hover { border-color: var(--aib-cyan); color: var(--aib-cyan); }
.aib-err { color: #ff6b6b; font-size: 13px !important; margin-top: 6px; min-height: 1em; }

.aib-picks { display: flex; flex-direction: column; gap: 6px; }
.aib-pickline { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; }
.aib-pickline .aib-img { width: 40px; height: 40px; background: #050505; display: flex; align-items: center; justify-content: center; }
.aib-pickline .aib-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aib-pickline .aib-pn { font-size: 13px !important; color: #fff; line-height: 1.3; }
.aib-pickline .aib-pr { font-size: 12px !important; color: #8c8c8c; line-height: 1.4; }
.aib-pickline .aib-pc { font-size: 11px !important; letter-spacing: 1px; text-transform: uppercase; color: var(--aib-cyan); }

.aib-perf { width: 100%; border-collapse: collapse; margin-top: 8px; }
.aib-perf th, .aib-perf td { padding: 6px 8px; font-size: 12.5px !important; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.aib-perf th { color: #7a7a7a; font-weight: 400 !important; border-top: 0; }
.aib-perf td:first-child, .aib-perf th:first-child { text-align: start; color: #fff; }

.aib-chat-foot { padding: 10px 16px 14px; border-top: 1px solid var(--aib-line); background: var(--aib-panel-2); min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.aib-chat-foot small { font-size: 12px !important; color: #7a7a7a; }

/* ---------- Tablet / mobile: chat full screen, products strip on top while working ---------- */
@media (max-width: 900px) {
    .aib-root.aib-visible { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .aib-left { order: 1; padding: 0; height: 0; overflow: hidden; }
    .aib-root[data-state="scan"] .aib-left { height: 38vh; padding: 12px 12px 4px; }
    .aib-root[data-state="done"] .aib-left { height: 34vh; padding: 12px 12px 4px; }
    .aib-chat { order: 2; border-inline-start: 0; border-top: 1px solid var(--aib-line); box-shadow: none; }
    .aib-stagehead { margin-bottom: 6px; }
    .aib-stagehead h3 { font-size: 15px !important; }
    .aib-think-icon { width: 52px; height: 52px; }
    .aib-think-icon i { font-size: 34px !important; }
    .aib-think-title { font-size: 14px !important; letter-spacing: 2px; }
    .aib-think-sub { margin-bottom: 8px; font-size: 10px !important; }
    .aib-think-status { font-size: 12px !important; }
    .aib-think-main { gap: 8px; }
    .aib-chips { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; }
    .aib-chip { white-space: nowrap; padding: 4px 9px; font-size: 11px !important; }
    .aib-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
    .aib-card { padding: 7px; gap: 3px; }
    .aib-card .aib-img { height: 58px; }
    .aib-card .aib-name { font-size: 11px !important; min-height: 30px; }
    .aib-card .aib-price { font-size: 12px !important; }
    .aib-card .aib-brand { font-size: 9px !important; }
    .aib-tag { font-size: 10px !important; padding: 4px 6px; }
    .aib-sumrow { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px; }
    .aib-sumrow .aib-img { width: 48px; height: 42px; }
    .aib-sumrow .aib-name { font-size: 12px !important; }
    .aib-sumtotal { padding: 10px 12px; }
    .aib-sumtotal strong { font-size: 18px !important; }
    .aib-sumtotal .aib-actions { display: none; }
    .aib-sumtotal br { display: none; }
    .aib-sumtotal > div:first-child { display: flex; align-items: baseline; gap: 10px; }
    .aib-bubble { max-width: 98%; }
    .aib-bubble.aib-wide { width: 98%; }
    .aib-chat-head { padding: 8px 12px; gap: 8px; }
    .aib-avatar { width: 32px; height: 32px; }
    .aib-chat-head .aib-t b { font-size: 13px !important; white-space: nowrap; }
    .aib-chat-head .aib-t span { display: none; }
    .aib-hbtn .aib-bt { display: none; }
    .aib-hbtn { width: 40px; height: 38px; padding: 0; }
    .aib-hbtn i { margin: 0 !important; line-height: 1; }
    .aib-msgs { padding: 12px 10px; gap: 10px; }
    .aib-bubble { padding: 9px 11px; font-size: 13px !important; }
    .aib-chat-foot { min-height: 40px; padding: 6px 12px; }
    /* mobile: no "manual build" button; an arrow moves the chat down so all the parts can be seen */
    #aib-close { display: none; }
    .aib-root[data-state="scan"] .aib-minbtn, .aib-root[data-state="done"] .aib-minbtn { display: inline-flex; align-items: center; justify-content: center; }
    .aib-root.aib-min.aib-visible { grid-template-rows: minmax(0, 1fr) auto; }
    .aib-root.aib-min .aib-left { height: auto !important; padding: 12px 12px 4px; }
    .aib-root.aib-min .aib-msgs, .aib-root.aib-min .aib-chat-foot { display: none; }
    .aib-root.aib-min .aib-minbtn i { transform: rotate(180deg); }
    /* lift the minimized bar clear of the phone's rounded corners / home indicator */
    .aib-root.aib-min .aib-chat { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }
    .aib-root.aib-min .aib-sumtotal .aib-actions { display: flex; width: 100%; }
    .aib-root.aib-min .aib-sumtotal .aib-actions .aib-btn { flex: 1; padding: 10px 8px; font-size: 11.5px !important; }
    .aib-options, .aib-budget { width: 100%; }
}

/* Floating button that brings the AI Build chat (and the finished build) back after "Customize in builder" */
.aib-pill {
    display: none; position: fixed; z-index: 1450; bottom: 84px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    align-items: center; gap: 8px; padding: 11px 18px;
    background: #000; color: #00ffff; border: 1px solid rgba(0, 255, 255, 0.6);
    font-family: 'Outfit', 'Cairo', sans-serif; font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0.8px; text-transform: uppercase; cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), 0 10px 30px rgba(0, 0, 0, 0.7);
}
.aib-pill.aib-show { display: inline-flex; }
.aib-pill:hover { background: #062326; }
.aib-pill i { font-size: 15px !important; }
@media (max-width: 900px) { .aib-pill { bottom: 96px; padding: 10px 14px; font-size: 12px !important; } }
