/* George AI widget for Globbing Web (resources/views/george.blade.php). All classes are prefixed with .gai- so they never clash with the site. */
.gai-root {
  --gai-dark: #101012;
  --gai-orange: #F28A30;
  --gai-orange-soft: #FDE6D5;
  --gai-ink: #1A1A1A;
  --gai-muted: #6E6862;
  --gai-sheet: #F7F4F1;
  --gai-row: #FBF9F7;
  --gai-line: #EFEAE6;
  --gai-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-family: var(--gai-font);
  color: var(--gai-ink);
  -webkit-font-smoothing: antialiased;
}
.gai-root *, .gai-root *::before, .gai-root *::after { box-sizing: border-box; }
:where(.gai-root) button { font: inherit; color: inherit; cursor: pointer; }
.gai-root [hidden] { display: none !important; }
.gai-root svg { flex-shrink: 0; }

/* ---------- hero George trigger (first screen) ---------- */
.gai-hero-trigger { cursor: pointer; transition: transform .25s ease, filter .25s ease; transform-origin: 70% 90%; }
.gai-hero-trigger:hover, .gai-hero-trigger:focus-visible { transform: rotate(-4deg) scale(1.04); filter: drop-shadow(0 0 18px rgba(242,138,48,.55)); outline: none; }
.gai-hero-tip {
  position: absolute; right: 100%; top: 28%; margin-right: 8px; white-space: nowrap;
  background: #fff; color: var(--gai-ink); font: 700 14px/1 var(--gai-font); padding: 10px 14px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transform: translateX(6px); transition: .2s ease; pointer-events: none;
}
.gai-hero-trigger:hover .gai-hero-tip, .gai-hero-trigger:focus-visible .gai-hero-tip { opacity: 1; transform: none; }

/* ---------- floating button (after scroll) ---------- */
.gai-fab {
  position: fixed; right: 50px; bottom: 132px; z-index: 2147483000;
  display: flex; align-items: center; gap: 12px; height: 64px; padding: 4px 20px 4px 4px;
  background: var(--gai-dark); border: 2px solid var(--gai-orange); border-radius: 32px;
  box-shadow: 0 8px 28px rgba(242,138,48,.35); color: #fff;
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s ease, transform .2s ease, padding .25s ease;
}
.gai-fab.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.gai-fab img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.gai-fab__text { display: flex; flex-direction: column; text-align: left; max-width: 220px; overflow: hidden; transition: max-width .25s ease, opacity .2s ease; }
.gai-fab__title { font-weight: 800; font-size: 16px; line-height: 1.2; }
.gai-fab__sub { font-size: 12px; opacity: .72; white-space: nowrap; }
.gai-fab__spark { color: var(--gai-orange); transition: opacity .2s; }
.gai-fab.is-mini { padding: 4px; }
.gai-fab.is-mini .gai-fab__text { max-width: 0; opacity: 0; }
.gai-fab.is-mini .gai-fab__spark { display: none; }
.gai-fab.is-mini:hover { padding: 4px 20px 4px 4px; }
.gai-fab.is-mini:hover .gai-fab__text { max-width: 220px; opacity: 1; }
.gai-fab.is-mini:hover .gai-fab__spark { display: block; }

/* ---------- popup ---------- */
.gai-pop {
  position: fixed; right: 32px; bottom: 24px; z-index: 2147483001;
  width: 390px; height: min(800px, calc(100vh - 48px)); border-radius: 28px; overflow: hidden;
  background: var(--gai-sheet); box-shadow: 0 24px 64px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(24px) scale(.98); transform-origin: bottom right; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.gai-pop.is-open { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 600px) {
  .gai-pop { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .gai-fab { right: 16px; bottom: 96px; }
}
.gai-screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* top controls */
.gai-top { position: absolute; top: 16px; left: 12px; right: 12px; display: flex; align-items: center; gap: 4px; z-index: 5; }
.gai-top__spacer { flex: 1; }
.gai-icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; display: grid; place-items: center; }
.gai-icon-btn--glass { background: rgba(255,255,255,.14); }
.gai-icon-btn:hover { background: rgba(255,255,255,.2); }
.gai-icon-btn:focus-visible, .gai-root button:focus-visible { outline: 2px solid var(--gai-orange); outline-offset: 2px; }
/* text fields sit in their own rounded pill: no square focus outline (the caret shows the focus) */
.gai-root input[type=text]:focus, .gai-root input[type=text]:focus-visible { outline: none; box-shadow: none; }

/* George video (black background → screen blend) */
.gai-george { position: absolute; mix-blend-mode: screen; object-fit: cover; pointer-events: none; }
.gai-glow { position: absolute; border-radius: 50%; background: #F27A28; filter: blur(70px); opacity: .85; pointer-events: none; }

/* --- start --- */
.gai-start { background: linear-gradient(180deg, #0F0F11 0%, #121013 40%, #4B392E 55%, #D7BFAE 64%, #F4ECE5 72%, #F8F4F0 100%); color: #fff; }
.gai-start .gai-glow { right: -110px; top: 250px; width: 200px; height: 380px; }
.gai-start .gai-george { left: 12px; top: 18px; width: 360px; height: 480px; }
.gai-brand { position: absolute; left: 24px; top: 26px; display: flex; align-items: center; gap: 10px; z-index: 5; }
.gai-brand__name { font-weight: 800; font-size: 28px; position: relative; }
.gai-brand__name svg { position: absolute; right: -12px; top: -6px; color: var(--gai-orange); }
.gai-beta { margin-left: 10px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 14px; }
.gai-start__hello { position: absolute; left: 24px; right: 24px; top: 342px; }
.gai-start__hello h2 { margin: 0; font-size: 44px; line-height: 1.06; font-weight: 800; }
.gai-start__hello p { margin: 10px 0 0; font-size: 16px; opacity: .85; }
.gai-start__cards { position: absolute; left: 16px; right: 16px; bottom: 32px; display: flex; flex-direction: column; gap: 16px; }
.gai-card { display: flex; align-items: center; gap: 16px; padding: 18px 16px; border-radius: 28px; border: 1px solid rgba(255,255,255,.8); text-align: left; color: var(--gai-ink); box-shadow: 0 8px 24px rgba(0,0,0,.07); transition: transform .15s ease, box-shadow .15s; }
.gai-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.1); }
.gai-card--warm { background: #FBF1EA; }
.gai-card--cool { background: #EEF5F7; }
.gai-card__icon { width: 56px; height: 56px; border-radius: 20px; display: grid; place-items: center; }
.gai-card--warm .gai-card__icon { background: #FDE3D0; }
.gai-card--cool .gai-card__icon { background: #D2ECF3; }
.gai-card__text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.gai-card__text b { font-size: 16px; font-weight: 800; }
.gai-card__text span { font-size: 13.5px; color: var(--gai-muted); line-height: 1.35; }

/* --- shared hero + sheet --- */
.gai-hero { position: relative; flex-shrink: 0; background: var(--gai-dark); overflow: hidden; }
.gai-hero .gai-glow { right: -100px; top: 10px; width: 200px; height: 260px; }
.gai-bubble {
  position: absolute; z-index: 4; color: #fff; padding: 16px 18px 16px 20px; border-radius: 26px;
  background: rgba(43,27,18,.6); border: 1.2px solid rgba(242,138,48,.6); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  font-size: 15px; line-height: 1.35;
}
.gai-bubble b { display: block; font-size: 22px; line-height: 1.2; margin-bottom: 2px; }
.gai-bubble::after { content: ''; position: absolute; left: -14px; bottom: 18px; width: 22px; height: 18px; background: inherit; clip-path: path('M22 0C16 8 9 14 0 18c8-1 16-4 22-10z'); border: 0; }
.gai-bubble__spark { position: absolute; right: 12px; top: 12px; color: #FFB45C; }
.gai-sheet {
  position: relative; flex: 1; min-height: 0; margin-top: -32px; z-index: 3; display: flex; flex-direction: column;
  background: var(--gai-sheet); border-radius: 32px 32px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.1);
}
.gai-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 14px 12px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.gai-label { font-size: 16px; font-weight: 700; color: #5B5753; padding: 4px 8px 2px; }

/* --- chat --- */
.gai-chat .gai-hero { height: 262px; }
.gai-chat .gai-george { left: -14px; top: -6px; width: 240px; height: 320px; }
.gai-chat .gai-bubble { left: 198px; right: 12px; top: 74px; }
.gai-q { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px 8px 10px; border-radius: 26px; border: 1px solid var(--gai-line); background: var(--gai-row); text-align: left; font-size: 15px; font-weight: 500; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.gai-q:hover { background: #fff; }
.gai-q > span:not(.gai-dot) { flex: 1; }
.gai-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--gai-orange-soft); display: grid; place-items: center; flex: none; }
.gai-msg-user { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.gai-msg-user__bubble { max-width: 76%; background: #D6E1E8; border-radius: 22px 22px 6px 22px; padding: 12px 16px; font-size: 15px; line-height: 1.35; white-space: pre-wrap; }
.gai-avatar-user { width: 36px; height: 36px; border-radius: 50%; background: #E4E2E0; display: grid; place-items: center; flex-shrink: 0; }
.gai-msg-bot { display: flex; gap: 10px; align-items: flex-start; }
.gai-msg-bot > img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.gai-msg-bot__col { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gai-msg-bot__bubble { background: #FCFAF8; border: 1px solid #F0EBE6; border-radius: 22px 22px 22px 6px; padding: 14px 16px; font-size: 15px; line-height: 1.4; }
.gai-msg-bot__bubble p { margin: 0 0 10px; } .gai-msg-bot__bubble p:last-child { margin: 0; }
.gai-demo-tag { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--gai-muted); }
.gai-link-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 0; border-radius: 20px; padding: 12px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.07); text-align: left; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--gai-ink); }
.gai-link-card img { width: 56px; height: 40px; object-fit: contain; }
.gai-link-card span { flex: 1; }
.gai-typing { display: inline-flex; gap: 4px; padding: 14px 16px; background: #FCFAF8; border: 1px solid #F0EBE6; border-radius: 22px 22px 22px 6px; }
.gai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #B8B0A8; animation: gai-blink 1s infinite; }
.gai-typing i:nth-child(2) { animation-delay: .15s; } .gai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gai-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.gai-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gai-chip { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px 6px 8px; border-radius: 26px; border: 1px solid var(--gai-line); background: var(--gai-row); font-size: 13.5px; font-weight: 500; text-align: left; line-height: 1.2; }

/* composer */
.gai-composer { display: flex; align-items: center; gap: 10px; margin: 8px 12px 16px; padding: 10px; background: #fff; border-radius: 33px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.gai-composer__attach { width: 46px; height: 46px; border: 0; border-radius: 50%; background: #F1EFED; display: grid; place-items: center; color: #3D3B39; }
.gai-composer input { flex: 1; min-width: 0; height: 46px; border: 0; border-radius: 23px; background: #F1EFED; padding: 0 18px; font: 500 15px var(--gai-font); color: var(--gai-ink); outline: none; }
.gai-composer input::placeholder { color: #8E8984; }
.gai-send { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--gai-orange); color: #fff; display: grid; place-items: center; transition: transform .15s; }
.gai-send:hover { transform: scale(1.05); }
.gai-send--dark { background: #1F1F1F; }

/* --- search --- */
.gai-search .gai-hero { height: 380px; }
.gai-search .gai-glow { top: 80px; height: 320px; }
.gai-search .gai-george { left: 15px; top: 20px; width: 360px; height: 480px; }
.gai-search .gai-sheet { margin-top: -40px; border-radius: 40px 40px 0 0; background: linear-gradient(180deg, #F3F2F1, #FAF3EE); }
.gai-search__body { padding: 56px 22px 20px; display: flex; flex-direction: column; gap: 36px; }
.gai-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gai-mode { height: 88px; border: 0; border-radius: 24px; background: #EFEEED; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; font-weight: 500; }
.gai-mode:hover { background: #E8E6E4; }
.gai-mode.is-active { background: #FFE7D6; }
.gai-searchbar { display: flex; align-items: center; padding: 8px; background: #fff; border-radius: 34px; box-shadow: 0 8px 28px rgba(0,0,0,.09); }
.gai-searchbar__in { flex: 1; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 4px 0 16px; border-radius: 26px; background: #F4F2F1; color: #55504B; }
.gai-searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: 500 16px var(--gai-font); color: var(--gai-ink); outline: none; }
.gai-searchbar .gai-send { width: 46px; height: 46px; }
.gai-hint { font-size: 12.5px; color: var(--gai-muted); text-align: center; margin-top: -20px; }

/* --- results --- */
.gai-results { background: #F4F4F4; }
.gai-results .gai-hero { height: 222px; background: linear-gradient(180deg, #141414 0%, #2E2E2E 55%, #D6D6D6 100%); }
.gai-results .gai-george { left: 40px; top: -18px; width: 165px; height: 220px; }
.gai-results .gai-bubble { left: 182px; right: 12px; top: 92px; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.45); }
.gai-results .gai-bubble b { font-size: 18px; }
.gai-results .gai-bubble__spark { color: #fff; }
.gai-results .gai-sheet { background: #F4F4F4; }
.gai-results .gai-scroll { padding: 16px 12px 12px; gap: 10px; }
.gai-results .gai-msg-user__bubble { background: #E6E6E6; }
.gai-offer { position: relative; display: grid; grid-template-columns: 162px 1fr; background: #fff; border-radius: 26px; box-shadow: 0 4px 18px rgba(0,0,0,.06); padding: 10px 10px 8px; gap: 0 14px; }
.gai-offer__img { position: relative; height: 96px; display: flex; align-items: flex-end; border-right: 1px solid #E8E8E8; padding-right: 10px; }
.gai-offer__img img { width: 100%; height: 76px; object-fit: contain; }
.gai-best { position: absolute; left: 2px; top: 0; display: flex; align-items: center; gap: 5px; background: #1F1F1F; color: #fff; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 14px; }
.gai-offer__info { position: relative; display: flex; flex-direction: column; padding-top: 4px; }
.gai-offer__store { font-size: 14px; color: #333; }
.gai-offer__name { font-size: 16px; font-weight: 800; margin-top: 2px; }
.gai-offer__price { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.gai-offer__price s { color: #9A9A9A; font-size: 16px; }
.gai-offer__price { flex-wrap: wrap; row-gap: 0; }
.gai-offer__price b { font-size: 24px; font-weight: 800; line-height: 1.15; }
.gai-offer__ext { position: absolute; right: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: #F3F3F3; display: grid; place-items: center; color: #333; }
.gai-offer__bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 10px; padding: 0 10px; height: 38px; border-radius: 19px; background: #F3F3F3; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.gai-offer__bar span { display: flex; align-items: center; gap: 4px; }
.gai-offer__bar i { display: none; } /* the dividers are drawn by the parts themselves, see below */
.gai-offer__bar b { font-weight: 800; }
.gai-flag { width: 22px; height: 15px; border-radius: 3px; overflow: hidden; display: block; }
.gai-skel { height: 154px; border-radius: 26px; background: linear-gradient(90deg, #ECECEC 25%, #F7F7F7 37%, #ECECEC 63%); background-size: 400% 100%; animation: gai-shimmer 1.2s ease infinite; }
@keyframes gai-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.gai-info-pop { position: absolute; top: 64px; right: 16px; z-index: 6; width: 250px; background: #fff; color: var(--gai-ink); border-radius: 16px; padding: 14px 16px; font-size: 13px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

@media (prefers-reduced-motion: reduce) {
  .gai-root *, .gai-hero-trigger { transition: none !important; animation: none !important; }
}

/* ---------- live data (API) ---------- */
.gai-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gai-flag--code { width: auto; min-width: 22px; padding: 0 3px; background: #DADADA; color: #333; font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; }
.gai-offer__ph { width: 100%; height: 76px; display: grid; place-items: center; color: #B8B2AC; }
.gai-offer__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 36px; }
.gai-offer__store { padding-right: 36px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gai-msg-user__photo { display: block; max-width: 140px; max-height: 140px; border-radius: 14px; margin-bottom: 6px; object-fit: cover; }
.gai-msg-bot__bubble a { color: #C25E0B; font-weight: 600; }
.gai-options { display: flex; flex-wrap: wrap; gap: 8px; }
.gai-option { border: 1px solid var(--gai-line); background: #fff; border-radius: 18px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; }
.gai-option:hover { border-color: var(--gai-orange); }
.gai-error { background: #FFF1E8; border: 1px solid #F8D3BB; border-radius: 20px; padding: 14px 16px; font-size: 14.5px; line-height: 1.4; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.gai-error p { margin: 0; }
.gai-retry { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 16px; padding: 8px 14px; background: var(--gai-dark); color: #fff !important; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.gai-send:disabled { opacity: .45; cursor: default; }
button.gai-link-card { width: 100%; cursor: pointer; }


/* ================= v2 (George AI fixes 1) ================= */
/* inputs: the placeholder (and the search icon) go away while typing */
.gai-root input:focus::placeholder { color: transparent; }
.gai-searchbar__in:focus-within > svg:first-child { display: none; }
.gai-searchbar__in:focus-within { padding-left: 18px; }

/* George is never cropped: each video sits whole in its box (3:4, top at the box top) */
.gai-root .gai-george { object-fit: contain; object-position: center top; aspect-ratio: 3 / 4; }

/* start: George at the size of the "Ask" screen, higher up; Favorites / My searches under the cards */
.gai-start { display: flex; flex-direction: column; }
.gai-start__stage { position: relative; flex: 0 1 300px; min-height: 150px; margin-top: 66px; }
.gai-start .gai-george { left: 8px; top: 0; width: auto; height: 100%; }
.gai-start .gai-glow { top: 120px; }
.gai-start__hello { position: relative; left: auto; right: auto; top: auto; margin: -28px 24px 0; z-index: 2; }
.gai-start__hello h2 { font-size: 40px; }
.gai-start__cards { position: relative; left: auto; right: auto; bottom: auto; margin: auto 16px 18px; padding-top: 16px; gap: 12px; }
.gai-start__links { display: flex; gap: 10px; }
.gai-pill { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 23px; border: 1px solid #fff; background: rgba(255,255,255,.72); color: var(--gai-ink); font-size: 14px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.gai-pill:hover { background: #fff; }
.gai-pill svg { color: var(--gai-orange); }

/* "Ask" and "Find a product": the same dark area, George the same size */
.gai-chat .gai-hero, .gai-search .gai-hero { height: 300px; }
.gai-chat .gai-george, .gai-search .gai-george { top: 0; width: 225px; height: 300px; }
.gai-chat .gai-george { left: -4px; }
/* search: George where he is on "Ask" (neck out of the left edge) */
.gai-search .gai-george { left: -4px; }
.gai-chat .gai-bubble { left: 206px; top: 70px; }
.gai-search .gai-sheet { margin-top: -32px; border-radius: 32px 32px 0 0; overflow-y: auto; }
.gai-search__body { padding: 32px 22px 20px; gap: 30px; }

/* quick picks under the search bar */
.gai-quick { display: flex; flex-direction: column; gap: 12px; margin-top: -12px; }
.gai-quick .gai-options { justify-content: center; }
.gai-quick__brand.is-active { border-color: var(--gai-orange); background: #FFE7D6; }
.gai-quick__types { display: flex; flex-direction: column; gap: 8px; }
.gai-quick__label { font-size: 12.5px; color: var(--gai-muted); text-align: center; }

/* results: George whole */
/* results: head and the check mark whole at the top, the neck runs out of the left and bottom edges */
.gai-results .gai-george { top: 0; left: -14px; width: 202px; height: 270px; }

/* offer card: bigger photo in a fixed box, flag only, Buy For Me + product link */
.gai-offer { grid-template-columns: 120px 1fr; padding: 10px 10px 10px; }
.gai-offer__img { width: 120px; height: 120px; align-items: center; justify-content: center; padding: 0 10px 0 0; }
.gai-offer__img img, .gai-offer__ph { width: 100%; height: 100%; object-fit: contain; }
.gai-best { left: 14px; top: -11px; z-index: 2; font-size: 11px; padding: 4px 9px; gap: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.gai-offer.is-best { margin-top: 12px; }
.gai-offer__info { justify-content: center; min-width: 0; padding-right: 38px; }
.gai-offer__name, .gai-offer__store { padding-right: 0; }
.gai-fav { position: absolute; right: 0; top: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #F3F3F3; color: #333; display: grid; place-items: center; }
.gai-fav.is-on { color: #E5484D; background: #FDECEC; }
.gai-fav:disabled { opacity: .5; }
/* flag | shipping | duty: what doesn't fit goes to the next line inside the pill, an amount never breaks.
   Each part draws the divider on its own left edge; at the start of a line it falls outside the pill
   and is clipped, so no divider is left hanging. */
.gai-offer__bar { position: relative; flex-wrap: wrap; justify-content: flex-start; align-content: center; gap: 0; height: auto; min-height: 38px; padding: 8px 2px 8px 0; overflow: hidden; font-size: 11.5px; }
.gai-offer__bar > span { position: relative; flex-wrap: wrap; max-width: 100%; min-height: 20px; margin-left: -1px; padding: 0 10px 0 12px; }
.gai-offer__bar > span::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: #DADADA; }
/* the flag stands beside both lines, in the middle */
.gai-offer__bar:has(> span > .gai-flag) { padding-left: 45px; }
.gai-offer__bar > span:has(> .gai-flag) { position: absolute; left: 12px; top: 0; bottom: 0; margin: 0; padding: 0; }
.gai-offer__bar > span:has(> .gai-flag)::before { display: none; }
.gai-offer__actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.gai-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border-radius: 21px; border: 0; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.gai-btn--primary { background: var(--gai-orange); color: #fff !important; }
.gai-btn--primary:hover { background: #E67C20; }
.gai-btn--ghost { background: #F3F3F3; color: var(--gai-ink) !important; }
.gai-btn--ghost:hover { background: #EAEAEA; }

/* Favorites / My searches */
.gai-hero--bar { height: 140px; background: linear-gradient(180deg, #141414 0%, #2E2E2E 100%); }
.gai-list__title { position: absolute; left: 24px; bottom: 40px; margin: 0; color: #fff; font-size: 26px; font-weight: 800; }
.gai-list .gai-sheet { margin-top: -28px; }
.gai-row { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 20px; padding: 10px; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.gai-row--btn { width: 100%; border: 0; text-align: left; gap: 12px; }
.gai-row__main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.gai-row__img { width: 64px; height: 64px; flex: none; display: grid; place-items: center; color: #B8B2AC; }
.gai-row__img img { width: 100%; height: 100%; object-fit: contain; }
.gai-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.gai-row__text b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gai-row__store { display: flex; align-items: center; gap: 6px; color: var(--gai-muted); font-size: 12.5px; }
.gai-row__price { font-weight: 800; font-size: 16px; }
.gai-row__del { color: #8E8984; flex: none; }
.gai-row__del:hover { background: #F3F3F3; }
.gai-skel--row { height: 84px; border-radius: 20px; }
.gai-empty { margin: 24px 12px; text-align: center; color: var(--gai-muted); font-size: 14.5px; line-height: 1.45; }

/* ================= v3 (George AI fixes 2) ================= */
/* screen changes slide in (forward from the right, back from the left) */
@keyframes gai-in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes gai-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.gai-enter-fwd { animation: gai-in-fwd .26s cubic-bezier(.2,.8,.2,1) both; }
.gai-enter-back { animation: gai-in-back .26s cubic-bezier(.2,.8,.2,1) both; }

/* progress while searching */
.gai-progress { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: #fff; border-radius: 20px; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.gai-progress__track { height: 8px; border-radius: 4px; background: #EEEAE6; overflow: hidden; }
.gai-progress__track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #F7A65A, var(--gai-orange)); transition: width .4s linear; position: relative; overflow: hidden; }
.gai-progress__track i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: gai-shine 1.4s ease-in-out infinite; }
@keyframes gai-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.gai-progress__label { font-size: 14px; font-weight: 700; }
.gai-progress__note { font-size: 12px; color: var(--gai-muted); }

/* barcode / QR scanner */
.gai-scan { background: #0C0C0E; color: #fff; }
.gai-scan__view { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.gai-scan__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gai-scan__view.is-off .gai-scan__video { display: none; }
.gai-scan__frame { position: relative; width: 72%; max-width: 280px; aspect-ratio: 1.4; border-radius: 22px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); border: 3px solid var(--gai-orange); }
.gai-scan__frame::after { content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: rgba(242,138,48,.9); box-shadow: 0 0 12px var(--gai-orange); animation: gai-scanline 1.8s ease-in-out infinite; }
@keyframes gai-scanline { 0%, 100% { transform: translateY(-34px); } 50% { transform: translateY(34px); } }
.gai-scan__view.is-off .gai-scan__frame { box-shadow: none; border-style: dashed; opacity: .6; }
.gai-scan__panel { flex-shrink: 0; padding: 18px 22px 24px; background: var(--gai-sheet); color: var(--gai-ink); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.gai-scan__panel b { font-size: 16px; }
.gai-scan__status { margin: 0 0 6px; font-size: 13.5px; color: var(--gai-muted); }
.gai-scan .gai-top { z-index: 6; }
.gai-scan__panel .gai-btn { flex: none; height: 48px; }

@media (prefers-reduced-motion: reduce) {
  .gai-enter-fwd, .gai-enter-back, .gai-progress__track i::after, .gai-scan__frame::after { animation: none !important; }
}

/* ================= v4: one George size on every screen ================= */
/* One box for George everywhere (start, Ask, Find, searching, results, Favorites, My searches,
   errors): same size, same place, so he never jumps between screens. 224px tall (3:4) fits the start
   screen with the title, greeting, both cards and the two buttons in a 720px popup, with nothing cut. */
.gai-root {
  --gai-george-h: 224px;
  --gai-george-w: calc(var(--gai-george-h) * 3 / 4);
  --gai-george-top: 64px;   /* below the top bar (back / info / close) */
  --gai-george-left: 4px;
  --gai-hero-h: calc(var(--gai-george-top) + var(--gai-george-h) - 4px); /* the sheet covers only the neck */
}
.gai-root .gai-hero .gai-george {
  top: var(--gai-george-top); left: var(--gai-george-left);
  width: var(--gai-george-w); height: var(--gai-george-h); transform: none;
}
.gai-start__stage { flex: none; height: var(--gai-george-h); min-height: 0; margin-top: var(--gai-george-top); }
.gai-start .gai-george { top: 0; left: var(--gai-george-left); width: var(--gai-george-w); height: var(--gai-george-h); }
.gai-start { overflow-y: auto; } /* very short phones: scroll rather than squeeze George */

.gai-chat .gai-hero, .gai-search .gai-hero, .gai-results .gai-hero, .gai-list .gai-hero { height: var(--gai-hero-h); }
.gai-results .gai-hero, .gai-list .gai-hero { background: var(--gai-dark); }
/* speech bubble right of George, at the height of his head */
.gai-chat .gai-bubble, .gai-results .gai-bubble, .gai-list .gai-bubble {
  left: calc(var(--gai-george-left) + var(--gai-george-w) - 6px); right: 12px; top: calc(var(--gai-george-top) + 28px);
}
.gai-list .gai-bubble { background: rgba(43,27,18,.6); border-color: rgba(242,138,48,.6); }
.gai-list__title { position: static; margin: 0; font-size: 22px; font-weight: 800; color: #fff; }
.gai-list .gai-sheet { margin-top: -32px; }

/* ================= v5: long text, popular searches, other site widgets ================= */
/* long words / links never leave their bubble */
.gai-msg-user__bubble, .gai-msg-bot__bubble, .gai-error p, .gai-row__text b { overflow-wrap: anywhere; word-break: break-word; }
/* header bubble: at most two lines of the query, then "…" */
.gai-bubble b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
/* "Популярные запросы" above the chips; the hint line only shows when it has a message (Snap / Upload) */
.gai-quick__title { font-size: 13px; font-weight: 700; color: var(--gai-muted); text-align: center; text-transform: none; }
.gai-hint:empty { display: none; }
/* above other floating widgets of the site (chat buttons use high z-index too) */
.gai-fab { z-index: 2147483646; }
.gai-pop { z-index: 2147483647; }
/* phones: the composer stays above the home indicator */
@media (max-width: 600px) {
  .gai-composer { margin-bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px)); }
}

/* ================= v6: one boundary for every screen, big George as in the design ================= */
/* The George zone ends at --gai-zone on every screen; the content (sheet, or on the start screen the
   greeting) starts exactly there. George is one 3:4 box everywhere: 300 x 400, 40px from the top, head
   about 60% of the popup width; below the zone only his neck runs on, behind the content. */
.gai-root {
  --gai-zone: 340px;
  --gai-george-w: 300px;
  --gai-george-h: 400px;
  --gai-george-top: 40px;
  --gai-george-left: calc(50% - var(--gai-george-w) / 2);   /* centered */
  --gai-george-left-bubble: -40px;                           /* screens with a speech bubble on the right */
  --gai-hero-h: calc(var(--gai-zone) + 32px);                /* the sheet overlaps the zone by its 32px radius */
}
.gai-root .gai-hero .gai-george, .gai-start .gai-george {
  top: var(--gai-george-top); left: var(--gai-george-left); width: var(--gai-george-w); height: var(--gai-george-h); transform: none;
}
.gai-chat .gai-hero .gai-george, .gai-results .gai-hero .gai-george, .gai-list .gai-hero .gai-george { left: var(--gai-george-left-bubble); }
.gai-chat .gai-hero, .gai-search .gai-hero, .gai-results .gai-hero, .gai-list .gai-hero { height: var(--gai-hero-h); }
.gai-chat .gai-sheet, .gai-search .gai-sheet, .gai-results .gai-sheet, .gai-list .gai-sheet { margin-top: -32px; }
/* speech bubble right of George's head, under the top buttons */
.gai-chat .gai-bubble, .gai-results .gai-bubble, .gai-list .gai-bubble {
  left: calc(var(--gai-george-left-bubble) + var(--gai-george-w) - 60px); right: 12px; top: 170px; padding: 14px 16px;
}
.gai-chat .gai-bubble { font-size: 14px; }
.gai-chat .gai-bubble b { font-size: 20px; }

/* start screen (Figma 28): title row, big centered George, greeting on the boundary, cards right after */
.gai-start { background: linear-gradient(180deg, #0F0F11 0%, #121013 44%, #3E3029 54%, #B99A84 64%, #EFE4DA 72%, #F8F4F0 100%); }
.gai-start__stage { position: relative; flex: none; height: var(--gai-zone); min-height: 0; margin-top: 0; }
.gai-start .gai-george { z-index: 0; }
.gai-start .gai-glow { top: 160px; right: -90px; }
.gai-start__hello { position: relative; margin: 0 24px; z-index: 2; }
.gai-start__hello h2 { font-size: 40px; }
.gai-start__hello p { margin-top: 8px; }
.gai-start__cards { margin: 16px 16px 18px; padding-top: 0; gap: 10px; }
.gai-card { padding: 14px 16px; border-radius: 24px; }
.gai-card__icon { width: 50px; height: 50px; border-radius: 18px; }
.gai-start__links .gai-pill { height: 42px; }
.gai-chat .gai-bubble, .gai-results .gai-bubble, .gai-list .gai-bubble { padding-right: 34px; }
.gai-list .gai-list__title { font-size: 19px; line-height: 1.2; }

/* ================= v7: the neck comes in from the popup's edge and fades under the text ================= */
/* George's 3:4 frame starts at the popup's left edge, so the neck (it leaves the video frame on the
   left, at about 2/3 of its height) comes in from behind the edge instead of ending in mid-air. The
   head keeps its size and height. On the start screen the neck runs on under the greeting and fades
   out with a gradient, so the video has no hard bottom edge. */
.gai-root { --gai-george-left: 0px; }
.gai-start .gai-george {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0,0,0,.35) 84%, transparent 97%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0,0,0,.35) 84%, transparent 97%);
}
/* the greeting stays readable over the neck */
.gai-start__hello h2, .gai-start__hello p { text-shadow: 0 2px 16px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.35); }
/* a warm glow low on the left, where the neck enters, as in the design */
.gai-start::before { content: ''; position: absolute; left: -80px; top: 250px; width: 220px; height: 220px; border-radius: 50%; background: #F27A28; filter: blur(80px); opacity: .45; pointer-events: none; }

/* ================= v8: iPhone Safari ================= */
/* George on the WebGL canvas has real transparency: no blending needed (iOS ignores it on <video>) */
canvas.gai-george { mix-blend-mode: normal; display: block; }
/* the shared source video: decoded in the page, never seen */
.gai-george-src { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; z-index: -1; }
/* 16px text fields: iOS Safari zooms the page into smaller ones */
.gai-composer input, .gai-searchbar input { font-size: 16px; }
@media (max-width: 600px) {
  .gai-pop { height: 100vh; height: 100dvh; }               /* dvh: the visible height between Safari's bars */
  .gai-top { top: calc(16px + env(safe-area-inset-top)); }  /* notch, when the site runs full screen */
  .gai-brand { top: calc(26px + env(safe-area-inset-top)); }
  .gai-pop, .gai-screen { overflow-x: hidden; }
}

/* ================= v9: instant George ================= */
/* .gai-george is a box: the pose's still (WebP with alpha) shows at once, the animation canvas fades
   in over it at its first frame and the still fades out, so there is never an empty or black hero */
span.gai-george { display: block; mix-blend-mode: normal; }
.gai-george__still, .gai-george__anim { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gai-george__anim { opacity: 0; transition: opacity .28s ease; }
.gai-george__still { opacity: 1; transition: opacity .28s ease .05s; }
.gai-george.is-live .gai-george__anim { opacity: 1; }
.gai-george.is-live .gai-george__still { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .gai-george__anim, .gai-george__still { transition: none; } }

/* ================= scrolled content stays inside the sheet ================= */
/* The sheet's top corners are rounded but it didn't clip its content, and the scroll area inside has
   square corners: scrolled cards showed as a white strip above the sheet's rounded top edge. Now the
   sheet clips along its own radius, and the list fades out softly just under the top edge. The sheet
   still starts at the common George boundary (it only clips, nothing moves). */
.gai-sheet { overflow: hidden; isolation: isolate; }
.gai-scroll {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
}

/* ---- a product search is one thread: question, cards, next question, cards … ---- */
.gai-turn { display: flex; flex-direction: column; gap: 10px; }
.gai-turn + .gai-turn { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--gai-line); }
.gai-newchat { display: flex; justify-content: center; padding: 4px 0 2px; }
.gai-option--new { display: inline-flex; align-items: center; gap: 6px; background: var(--gai-dark); border-color: var(--gai-dark); color: #fff; }
.gai-option--new:hover { border-color: var(--gai-orange); }

/* a running search: the magnifier looks around, a ring turns around it */
.gai-lupa { display: grid; place-items: center; animation: gai-lupa 1.6s linear infinite; }
.gai-row.is-running .gai-dot { position: relative; }
.gai-row.is-running .gai-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--gai-orange); border-right-color: var(--gai-orange); animation: gai-ring 1s linear infinite; }
.gai-row.is-running .gai-row__store { color: var(--gai-orange); font-weight: 600; }
.gai-pill .gai-lupa { display: none; }
.gai-pill.is-running .gai-lupa { display: grid; }
.gai-pill.is-running > svg { display: none; }
@keyframes gai-lupa { 0% { transform: translate(2px, 0); } 25% { transform: translate(0, 2px); } 50% { transform: translate(-2px, 0); } 75% { transform: translate(0, -2px); } 100% { transform: translate(2px, 0); } }
@keyframes gai-ring { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gai-lupa, .gai-row.is-running .gai-dot::after { animation: none; } }

/* ================= answers from the knowledge base: tables, tip boxes, lists, link buttons ================= */
.gai-msg-bot__bubble ol, .gai-msg-bot__bubble ul { margin: 0 0 10px; padding-left: 20px; }
.gai-msg-bot__bubble li { margin: 2px 0; }
.gai-msg-bot__bubble li.gai-md-sub { margin-left: 16px; list-style-type: circle; }
.gai-md-table { overflow-x: auto; margin: 0 0 10px; border-radius: 12px; border: 1px solid var(--gai-line); }
.gai-md-table table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.3; }
.gai-md-table th, .gai-md-table td { padding: 7px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--gai-line); }
.gai-md-table th { background: #F7F2EE; font-weight: 700; white-space: nowrap; }
.gai-md-table tr:last-child td { border-bottom: 0; }
.gai-md-tip { margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: var(--gai-orange-soft); font-size: 14px; }
.gai-md-btn { display: flex; width: 100%; margin: 4px 0 10px; height: auto; min-height: 42px; padding: 10px 14px; white-space: normal; text-align: center; }
.gai-msg-bot__bubble > :last-child { margin-bottom: 0; }

/* ================= v10: one entry, one input ================= */
/* start screen: one big card "Спросите или найдите товар" (it becomes the input on the next screen) */
.gai-card--one { background: #fff; border-color: #fff; padding: 16px 14px 16px 16px; box-shadow: 0 10px 30px rgba(60,30,10,.12); view-transition-name: gai-entry; }
.gai-card--one .gai-card__icon { background: var(--gai-orange-soft); color: var(--gai-orange); }
.gai-card--one .gai-card__text b { font-size: 17px; }
.gai-card__go { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--gai-orange); color: #fff; display: grid; place-items: center; }
.gai-card--one:active { transform: scale(.985); }

/* search screen: only the input line, then the chip rows */
.gai-searchbar { view-transition-name: gai-entry; }
.gai-search__body { gap: 22px; }
.gai-searchbar__in { gap: 10px; padding: 0 4px 0 14px; transition: padding .2s ease; }
.gai-searchbar__field { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; }
.gai-searchbar__field input { width: 100%; }
.gai-searchbar__field input::placeholder { color: transparent; }
/* the rotating example: fades and lifts out, the next one fades in */
.gai-ph { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); font: 500 16px var(--gai-font); color: #9A928B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; transition: opacity .26s ease, transform .26s ease; }
.gai-ph.is-out { opacity: 0; transform: translateY(calc(-50% - 6px)); }
.gai-searchbar__field input:not(:placeholder-shown) + .gai-ph { opacity: 0; transition: none; }
/* photo / upload / scan: hidden until the input has the focus, then they slide in next to it */
.gai-tools { display: flex; align-items: center; gap: 2px; max-width: 0; opacity: 0; transform: translateX(10px); overflow: hidden; pointer-events: none;
  transition: max-width .2s ease, opacity .2s ease, transform .2s ease; }
.gai-searchbar:focus-within:not(.has-text) .gai-tools, .gai-searchbar.is-focus:not(.has-text) .gai-tools { max-width: 120px; opacity: 1; transform: none; pointer-events: auto; }
.gai-tool { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: transparent; color: #6B635C; display: grid; place-items: center; transition: background .15s, color .15s; }
.gai-tool:hover, .gai-tool:active { background: #fff; color: var(--gai-orange); }
.gai-searchbar:focus-within .gai-searchbar__in, .gai-searchbar.is-focus .gai-searchbar__in { background: #fff; box-shadow: inset 0 0 0 1.5px var(--gai-orange); }
.gai-searchbar.is-focus .gai-searchbar__in > svg:first-child { display: none; }
.gai-hint { margin-top: -12px; }

/* "Часто ищут" / "Частые вопросы": a title on the left, one row of chips that scrolls sideways */
.gai-quick { margin-top: 0; gap: 10px; }
.gai-quick__title { text-align: left; font-size: 13px; letter-spacing: .01em; }
.gai-options--row { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity;
  margin: 0 -22px; padding: 2px 22px 4px; scroll-padding-inline: 22px; justify-content: flex-start !important;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
.gai-options--row::-webkit-scrollbar { display: none; }
.gai-options--row .gai-option { flex: none; white-space: nowrap; scroll-snap-align: start; }
.gai-quick--faq .gai-option { background: #FFF8F2; border-color: #F6DCC6; }

/* under an answer: "Найти … по лучшей цене" / "Рассчитать доставку" */
.gai-option--go { display: inline-flex; align-items: center; gap: 6px; background: var(--gai-orange); border-color: var(--gai-orange); color: #fff; }
.gai-option--go:hover { background: #E87F25; border-color: #E87F25; }
.gai-live--dots .gai-typing { padding: 14px 16px; }

/* the start card turning into the input: one smooth move (View Transitions), the rest crossfades */
::view-transition-group(gai-entry) { animation-duration: .34s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(gai-entry), ::view-transition-new(gai-entry) { animation-duration: .2s; height: 100%; object-fit: cover; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .gai-tools, .gai-ph, .gai-searchbar__in { transition: none; }
}

/* phones: nothing of the page under George, also when the keyboard opens (the popup follows the
   visible area in JS; the fill covers any gap while Safari moves things) */
@media (max-width: 600px) {
  .gai-pop.is-open { box-shadow: 0 0 0 100vmax #F7F4F1; }
  .gai-pop, .gai-sheet, .gai-scroll, .gai-screen { overscroll-behavior: contain; }
}
html.gai-locked, html.gai-locked body { overscroll-behavior: none; }
/* keyboard open (little height left): the search screen's George area shrinks, the input moves up */
.gai-search .gai-hero { transition: height .22s ease; }
.gai-pop.is-short .gai-search .gai-hero { height: 150px; }
.gai-pop.is-short .gai-search .gai-george { opacity: .0; transition: opacity .18s ease; }
.gai-pop.is-short .gai-search .gai-search__body { padding-top: 22px; }
@media (prefers-reduced-motion: reduce) { .gai-search .gai-hero, .gai-pop.is-short .gai-search .gai-george { transition: none; } }

/* ---- start screen: no brand row / info button; the card and the two buttons sit at the bottom ---- */
.gai-start__cards { margin-top: 0; }

/* the example under the cursor goes away as soon as the input has the focus */
.gai-searchbar:focus-within .gai-ph, .gai-searchbar.is-focus .gai-ph { opacity: 0; transform: translateY(-50%); transition: opacity .12s ease; }
.gai-composer input:focus::placeholder, .gai-composer.is-focus input::placeholder { color: transparent; }
.gai-composer.is-focus .gai-composer__in { background: #fff; box-shadow: inset 0 0 0 1.5px var(--gai-orange); }

/* the input under answers and results: one field with the photo / upload / scan buttons inside */
.gai-composer__in { flex: 1; min-width: 0; display: flex; align-items: center; height: 46px; border-radius: 23px; background: #F1EFED; padding-right: 4px; }
.gai-composer__in:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--gai-orange); }
.gai-composer__in input { flex: 1; min-width: 0; height: 100%; background: transparent; border-radius: 23px; }
.gai-composer .gai-tools { max-width: 120px; opacity: 1; transform: none; pointer-events: auto; }
.gai-composer.has-text .gai-tools { max-width: 0; opacity: 0; pointer-events: none; }
.gai-composer .gai-tool:hover, .gai-composer .gai-tool:active { background: #F1EFED; }

/* ---- start screen: the greeting a little lower ---- */
.gai-start__hello { margin-top: auto; margin-bottom: auto; } /* the greeting in the middle between George and the card: the same gap above and below */

/* ---- search screen: "Часто ищут" as wrapped chips, "Частые вопросы" as rows; together they fill the
   lower part (the sheet scrolls when a phone is short), with room between the two ---- */
.gai-search__body { gap: 20px; padding-bottom: 20px; }
.gai-quick--faq { margin-top: 8px; }
.gai-quick { gap: 12px; }
.gai-quick .gai-options--wrap { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.gai-options--wrap .gai-option { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gai-faq-list { display: flex; flex-direction: column; gap: 7px; }
.gai-q--faq { min-height: 46px; padding: 5px 12px 5px 7px; background: #fff; border-color: #F1E6DC; font-size: 14.5px; box-shadow: 0 2px 8px rgba(60,30,10,.04); }
.gai-q--faq .gai-dot { width: 34px; height: 34px; }
.gai-q--faq > svg:last-child { color: #B9AEA4; flex: none; }
.gai-q--faq:active { transform: scale(.99); }
/* the greeting now sits low, right above the card: the background stays dark behind it and turns light under the card */
.gai-start { background: linear-gradient(180deg, #0F0F11 0%, #121013 42%, #3E3029 60%, #4E3B30 74%, #B99A84 83%, #EFE4DA 89%, #F8F4F0 100%); }

/* nothing in the popup scrolls sideways (George's glow reaches past the right edge) */
.gai-pop, .gai-screen, .gai-sheet, .gai-scroll { overflow-x: hidden; }
.gai-start { touch-action: pan-y; }

/* the round button: the same 66 px circle as the site's chat button under it, on the same line */
.gai-fab { height: 66px; }
.gai-fab.is-mini { width: 66px; padding: 4px; gap: 0; justify-content: center; }
.gai-fab.is-mini:hover { width: auto; padding: 4px 20px 4px 4px; gap: 12px; }
.gai-fab img { width: 54px; height: 54px; flex: none; }
/* the start screen's glow stays inside the popup: only its visible part, so nothing is wider than the screen */
.gai-start .gai-glow { right: 0; width: 110px; border-radius: 160px 0 0 160px; }

/* ---- the badge over the hero giraffe: always visible, a soft float; its tail points at George's head ---- */
.gai-hero-tip {
  left: auto; right: 0; top: auto; bottom: calc(100% + 14px); margin: 0; transform: none; /* over the head, inside the giraffe's box: never past the window's edge */
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif; /* outside the popup: George's font variable isn't there */
  display: flex; align-items: center; gap: 9px; padding: 8px 16px 8px 10px; border-radius: 999px;
  background: rgba(22, 19, 21, .9); color: #fff; border: 1.5px solid #F28A30;
  box-shadow: 0 10px 28px rgba(242, 138, 48, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  opacity: 1; pointer-events: none; animation: gai-badge-float 3.2s ease-in-out infinite;
  transition: transform .2s ease; /* not its place: the fit to the window applies at once */
}
.gai-hero-tip::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px;
  background: rgba(22, 19, 21, .95); border-right: 1.5px solid #F28A30; border-bottom: 1.5px solid #F28A30; transform: rotate(45deg); }
.gai-hero-tip__spark { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #F28A30; color: #fff; }
.gai-hero-tip__text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.gai-hero-tip__text b { font: 800 15px/1.1 inherit; font-family: inherit; letter-spacing: .01em; }
.gai-hero-tip__text small { font-size: 11.5px; font-weight: 500; line-height: 1.2; color: rgba(255, 255, 255, .72); margin-top: 2px; }
.gai-hero-trigger:hover .gai-hero-tip, .gai-hero-trigger:focus-visible .gai-hero-tip { opacity: 1; transform: scale(1.05); animation-play-state: paused; }
@keyframes gai-badge-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .gai-hero-tip { animation: none; } }

/* ---- the floating button is only the round George (no text pill, also not on hover) ---- */
.gai-fab, .gai-fab.is-mini, .gai-fab.is-mini:hover, .gai-fab:hover { width: 66px; padding: 4px; gap: 0; justify-content: center; }
.gai-fab .gai-fab__text, .gai-fab .gai-fab__spark, .gai-fab.is-mini:hover .gai-fab__text, .gai-fab.is-mini:hover .gai-fab__spark { display: none; }


/* ---- embedded (george-embed.blade.php: an iframe / WebView, the mobile app): George is the whole frame on
   any width, already open, no floating button; the notch and the home indicator are kept clear ---- */
.gai-root.is-embed .gai-fab { display: none !important; }
.gai-root.is-embed .gai-pop { inset: 0; width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; transform: none; transition: none; }
.gai-root.is-embed .gai-pop, .gai-root.is-embed .gai-screen { overflow-x: hidden; }
.gai-root.is-embed .gai-pop, .gai-root.is-embed .gai-sheet, .gai-root.is-embed .gai-scroll, .gai-root.is-embed .gai-screen { overscroll-behavior: contain; }
.gai-root.is-embed .gai-top { top: calc(16px + env(safe-area-inset-top)); }
.gai-root.is-embed .gai-composer { margin-bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px)); }

/* ---- tables in answers: words are never cut ("Алма / ты"); a wide table scrolls inside its own frame ---- */
.gai-md-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gai-md-table table { width: max-content; min-width: 100%; }
.gai-md-table th, .gai-md-table td { overflow-wrap: normal; word-break: normal; hyphens: manual; max-width: 210px; }
.gai-md-table td:first-child { white-space: nowrap; }

/* ---- the start screen: the input right away; "Частые вопросы" on its own row above Избранное / Мои поиски ---- */
.gai-start__cards .gai-searchbar { margin: 0; }
.gai-start__links { flex-wrap: wrap; }
.gai-start__links .gai-pill { flex: 1 1 0; white-space: nowrap; }

/* ---- the start screen: the input lifted towards the middle between the greeting and Избранное / Мои поиски ---- */
/* (the lift itself is measured by placeStartBar() in george-ai.js) */
.gai-start__cards .gai-searchbar { position: relative; }
