/* The Lube Connoisseur 0.1.0 "Liquid Glass" theme, matched to tenderlovincare.co (Tender Lovin' Care): brand purple
   #503AA8, blush #F6CFF4, sunshine #FFEE58, cream #FBFAF3, ink #111111, ocean teal #54b5cd, over the brand's ocean photo.
   Frosted white glass panels (backdrop-filter + -webkit- for iOS; near-solid cream fallback). Manrope is the brand font:
   used when the device has it, else system fonts (no external font/CDN requests; CSP stays 'self'). Text meets WCAG AA. */
:root {
  --purple: #503AA8; --purple-d: #3f2d8a; --pink: #2f7f95; --teal: #54b5cd; --blush: #F6CFF4; --sun: #FFEE58; --cream: #FBFAF3;
  --ink: #111111; --muted: #3d3a4a; --green: #2e7d4f;
  --glass: rgba(255,255,255,.55); --glass-strong: rgba(255,255,255,.8); --solid: #FBFAF3;
  --edge: rgba(255,255,255,.7); --edge-dim: rgba(80,58,168,.18); --shadow: 0 12px 44px rgba(17,17,40,.22), 0 2px 8px rgba(17,17,40,.10);
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { background: #2b6f86 url("ocean-bg.webp") center / cover no-repeat fixed; }
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.b1 { width: 46vmax; height: 46vmax; left: -14vmax; top: -12vmax; background: #F6CFF4; opacity: .35; }
.b2 { width: 40vmax; height: 40vmax; right: -12vmax; bottom: -14vmax; background: #503AA8; opacity: .28; }
.b3 { width: 28vmax; height: 28vmax; right: 18vmax; top: 10vmax; background: #54b5cd; opacity: .3; }

/* glass surfaces */
.glass, .msg.bot, .chip, .pill-btn, .ghost-btn, .composer, .disclaimer, .controls, .hello-bubble {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--edge);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .msg.bot, .chip, .pill-btn, .ghost-btn, .composer, .disclaimer, .controls, .hello-bubble { background: var(--solid); }
}
.lc { max-width: 780px; height: calc(100% - 32px); margin: 16px auto; display: flex; flex-direction: column; border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.lc-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--edge-dim); background: rgba(255,255,255,.35); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 40px; height: 40px; flex: 0 0 40px; }
h1 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -.2px; background: linear-gradient(120deg, var(--purple), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tagline strong { color: var(--purple-d); }
.muted { color: var(--muted); font-size: 13px; }

/* welcome (tap to start, returning visitor) */
.welcome { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 22px; gap: 10px; }
.hero-avatar { width: 112px; height: 112px; border-radius: 24px; display: block; object-fit: cover; box-shadow: 0 8px 24px rgba(80,58,168,.35); }
.hello-bubble { margin: 0; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 4px 14px rgba(40,30,90,.12); }
.hero-title { margin: 6px 0 0; font-size: clamp(26px, 5vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -.6px; background: linear-gradient(120deg, var(--purple), var(--pink), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 520px; margin: 4px auto 10px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.hero-sub.strong { color: var(--ink); font-weight: 700; font-size: 18px; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; }
.hero-chips span { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.8); color: var(--ink); box-shadow: 0 2px 8px rgba(40,30,90,.08); }
#startBox, #resumeBox { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.primary-btn { border: 0; cursor: pointer; color: #fff; font-weight: 700; font-size: 17px; padding: 14px 30px; border-radius: 999px; background: linear-gradient(120deg, var(--purple), var(--pink)); box-shadow: 0 10px 26px rgba(190,24,93,.32), inset 0 1px 0 rgba(255,255,255,.35); min-height: 48px; }
.primary-btn:hover { filter: brightness(1.06); } .primary-btn:active { transform: scale(.98); }
.ghost-btn { cursor: pointer; color: var(--purple-d); font-weight: 700; font-size: 15px; padding: 11px 22px; border-radius: 999px; min-height: 44px; }

/* top controls: save / delete / end */
.controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px; border-width: 0 0 1px; border-color: var(--edge-dim); border-radius: 0; background: rgba(255,255,255,.28); }
.pill-btn { cursor: pointer; color: var(--ink); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; min-height: 32px; }
.pill-btn[aria-pressed="true"] { background: rgba(63,143,55,.14); border-color: rgba(63,143,55,.45); color: #1d4f19; }
.pill-btn.danger { color: #9f1239; }
.pill-btn:focus-visible, .chip:focus-visible, .primary-btn:focus-visible, .ghost-btn:focus-visible, .talk-btn:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.disclaimer { margin: 6px 16px 8px; padding: 9px 14px; border-radius: var(--r-sm); font-size: .84rem; line-height: 1.4; color: var(--ink); }
.progress { display: flex; align-items: center; gap: 10px; padding: 8px 18px; font-size: 12px; color: var(--muted); }
.progress .bar { flex: 1; height: 6px; background: rgba(80,58,168,.12); border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width .3s; }

/* chat */
.log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.msg { max-width: 85%; padding: 11px 15px; border-radius: var(--r-md); line-height: 1.5; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; border-top-left-radius: 6px; box-shadow: 0 2px 10px rgba(40,30,90,.08); color: var(--ink); }
.msg.bot .who { display: block; font-size: 11px; font-weight: 800; letter-spacing: .3px; color: var(--purple-d); margin-bottom: 3px; text-transform: uppercase; }
.msg.user { align-self: flex-end; color: #fff; border-top-right-radius: 6px; background: linear-gradient(135deg, var(--purple), #2f7f95); box-shadow: 0 4px 14px rgba(80,58,168,.25); }
.msg.typing { color: var(--muted); font-style: italic; }
.msg a { color: var(--purple-d); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 10px; }
.chip { cursor: pointer; color: var(--purple-d); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px; min-height: 40px; box-shadow: 0 2px 8px rgba(40,30,90,.08); transition: transform .12s, background .12s; }
.chip:hover { background: rgba(255,255,255,.9); transform: translateY(-1px); }
.chip:active { transform: scale(.97); }

.composer { display: flex; gap: 8px; margin: 0 14px 10px; padding: 8px; border-radius: 999px; box-shadow: 0 4px 18px rgba(40,30,90,.1); }
.composer input { flex: 1; min-width: 0; padding: 11px 14px; border: 0; background: transparent; font-size: 16px; outline: none; color: var(--ink); font-family: var(--font); }
.composer input::placeholder { color: #6b5e80; }
.mic, .send { border: 0; border-radius: 999px; cursor: pointer; font-size: 15px; min-height: 44px; }
.mic { width: 46px; flex: 0 0 46px; background: rgba(80,58,168,.1); } .mic.listening { background: #F6CFF4; animation: pulse 1s infinite; }
.mic:disabled { opacity: .4; cursor: not-allowed; }
.send { flex: 0 0 auto; padding: 0 20px; color: #fff; font-weight: 700; background: linear-gradient(120deg, var(--purple), var(--pink)); }
.footnote { margin: 0; padding: 0 20px 10px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.footnote summary { cursor: pointer; list-style: none; display: inline-block; opacity: .85; text-decoration: underline; text-underline-offset: 2px; }
.footnote summary::-webkit-details-marker { display: none; }
.footnote p { margin: 6px 0 0; }

/* talk button + video panel */
.header-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.talk-btn { cursor: pointer; border: 0; color: #fff; font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 999px; white-space: nowrap; background: linear-gradient(120deg, var(--purple), var(--pink)); box-shadow: 0 6px 18px rgba(190,24,93,.28); min-height: 40px; }
.talk-btn.on { background: rgba(255,255,255,.85); color: var(--pink); box-shadow: inset 0 0 0 2px var(--pink); }
.mini-btn { background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--ink); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.talk-mic { margin-right: 6px; } .talk-mic[aria-pressed="true"] { background: #F6CFF4; }
.avatar-panel { position: relative; height: 280px; flex: 0 0 auto; margin: 12px 16px 0; border-radius: var(--r-md); overflow: hidden; display: flex; align-items: center; justify-content: center; background: #1d4f60 url("ocean-bg.webp") center / cover no-repeat; box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.35); }
/* 0.2.2: video and the chroma-keyed canvas sit in the same box; when .keyed the canvas (green removed) shows and the video
   keeps playing underneath at near-zero opacity (never display:none, so iOS Safari keeps decoding frames). */
.avatar-panel video, .avatar-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.avatar-canvas { display: none; pointer-events: none; }
.avatar-panel.keyed .avatar-canvas { display: block; }
.avatar-panel.keyed video { opacity: .01; }
.avatar-panel .ai-label, .avatar-panel .avatar-status, .avatar-panel .avatar-bar { z-index: 2; }
.ai-label, .avatar-status, .countdown { color: #fff; background: rgba(20,8,40,.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; }
.ai-label { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 4px 10px; letter-spacing: .3px; }
.avatar-status { position: absolute; font-size: 14px; padding: 7px 14px; } .avatar-status:empty { display: none; }
.avatar-bar { position: absolute; bottom: 10px; left: 10px; right: 10px; display: flex; gap: 6px; align-items: center; }
.countdown { font-size: 12px; padding: 4px 10px; margin-right: auto; }

.summary-card { align-self: stretch; border-radius: var(--r-md); padding: 16px 18px; background: var(--glass-strong); white-space: normal; }

@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(84,181,205,.35); } }
@media (prefers-reduced-motion: reduce) { .chip, .primary-btn { transition: none; } .mic.listening { animation: none; } }
@media (max-width: 640px) {
  .lc { margin: 0; height: 100%; border-radius: 0; border: 0; }
  .lc-header { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
  h1 { font-size: 16px; } .tagline { font-size: 11.5px; } .logo { width: 32px; height: 32px; flex-basis: 32px; }
  .talk-btn { padding: 8px 12px; font-size: 13px; }
  .msg { max-width: 92%; }
  .avatar-panel { height: 220px; margin: 10px 10px 0; }
  .composer { margin: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .controls { padding: 6px 10px; }
}
body:not(.started) .log, body:not(.started) .chips, body:not(.started) .header-btns, body:not(.started) .progress { display: none !important; }
@media (max-width: 640px) {
  .disclaimer { margin: 4px 10px 6px; font-size: 12px; padding: 7px 11px; }
  body.started .footnote { font-size: 10.5px; padding-bottom: 6px; }
}

/* Tender Lovin' Care header: dark glass bar with the white TLC logo */
.lc-header { background: rgba(17,17,30,.55); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); border-bottom: 1px solid rgba(255,255,255,.18); }
.lc-header h1 { background: none; color: #fff; -webkit-text-fill-color: #fff; }
.lc-header .tagline, .lc-header .tagline .muted { color: rgba(255,255,255,.86); }
.lc-header .tagline strong { color: var(--sun); }
.lc-header .logo { width: auto; height: 34px; flex: 0 0 auto; }
.lc-header .menu-btn { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
.hero-title { background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); }
.hero-title .accent { color: var(--purple); -webkit-text-fill-color: var(--purple); }
.primary-btn, .send, .talk-btn, .cta { background: linear-gradient(120deg, var(--purple), #2f7f95); }
.hero-logo { height: 56px; width: auto; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); }
.welcome .hello-bubble { background: rgba(255,238,88,.92); color: var(--ink); border-color: rgba(255,255,255,.8); }
/* "Would you like to talk to a woman or a man?" picker (before any video starts) */
.host-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(440px, 100%); margin: 6px 0 4px; }
.host-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px 14px; border-radius: 22px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border: 1px solid var(--edge); box-shadow: 0 8px 26px rgba(40,30,90,.18); transition: transform .12s, box-shadow .12s; font-family: var(--font); color: var(--ink); }
.host-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(40,30,90,.26); }
.host-card:active { transform: scale(.98); }
.host-card:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.host-card img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(40,30,90,.25); background: var(--blush); }
.host-card .host-label { font-size: 19px; font-weight: 800; }
.host-card .host-sub { font-size: 12.5px; color: var(--muted); }
.age-note { margin: 6px 0 0; font-size: 12.5px; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.75); padding: 6px 12px; border-radius: 999px; }
#textOnlyBtn[aria-pressed="true"] { background: rgba(80,58,168,.12); border-color: rgba(80,58,168,.45); }
@media (max-width: 640px) { .host-card img { width: 92px; height: 92px; } .host-pick { gap: 10px; } .lc-header .logo { height: 28px; } }

/* 0.1.2 closing store button(s) */
.msg.bot.stores { display: flex; flex-wrap: wrap; gap: 8px; background: transparent !important; box-shadow: none !important; border: 0 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; padding: 2px 0; }
.msg.stores .store-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 9px 16px; border-radius: 999px; background: var(--purple, #6b3fa0); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: 0 2px 8px rgba(40,30,90,.15); }
.msg.stores .store-btn:hover { filter: brightness(1.08); }
.msg.stores .store-btn:focus-visible { outline: 3px solid var(--purple-d, #3b1f66); outline-offset: 2px; }

/* 0.1.7 "Find my lube" quiz: big emoji cards, Back / Skip / Done, result card with code box */
#chips.quiz-mode { display: block; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 4px 0 8px; }
.quiz-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 12px 8px; border-radius: 18px; border: 2px solid rgba(107,63,160,.25); background: #fff; color: var(--purple-d, #3b1f66); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 3px 10px rgba(40,30,90,.10); transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.quiz-card:hover { transform: translateY(-2px); border-color: var(--purple, #6b3fa0); }
.quiz-card:focus-visible { outline: 3px solid var(--purple-d, #3b1f66); outline-offset: 2px; }
.quiz-card.picked { background: linear-gradient(135deg, #f3eaff, #ffe8ef); border-color: var(--purple, #6b3fa0); }
.quiz-emoji { font-size: 34px; line-height: 1; }
.quiz-label { text-align: center; line-height: 1.2; }
.quiz-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.quiz-nav .quiz-done { background: var(--purple, #6b3fa0); color: #fff; }
.quiz-nav .quiz-done:disabled { opacity: .45; cursor: default; }
.msg.bot.quiz-result { max-width: 520px; padding: 18px 18px 12px; border-radius: 22px; background: linear-gradient(160deg, #fff 0%, #f7efff 60%, #ffeef3 100%); border: 2px solid rgba(107,63,160,.2); }
.quiz-result .qr-top { text-align: center; }
.quiz-result .qr-emoji { font-size: 54px; line-height: 1.1; }
.quiz-result .qr-name { margin: 4px 0 2px; font-size: 24px; color: var(--purple-d, #3b1f66); }
.quiz-result .qr-tag { margin: 0 0 8px; font-style: italic; opacity: .85; }
.quiz-result .qr-type { font-weight: 800; margin: 8px 0 4px; }
.quiz-result .qr-h { font-weight: 700; margin: 8px 0 2px; }
.quiz-result .qr-reasons { margin: 0 0 8px; padding-left: 20px; }
.quiz-result .qr-recap { margin: 6px 0; }
.quiz-result .qr-recap dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; font-size: 14px; }
.quiz-result .qr-recap dt { font-weight: 600; opacity: .8; }
.quiz-result .qr-recap dd { margin: 0; }
.quiz-result .quiz-stores { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.quiz-result .store-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 9px 16px; border-radius: 999px; background: var(--purple, #6b3fa0); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.quiz-result .qr-promo { margin: 8px 0; padding: 10px 12px; border: 2px dashed var(--purple, #6b3fa0); border-radius: 14px; background: #fff; }
.quiz-result .qr-promo-text { margin: 0 0 6px; font-weight: 600; }
.quiz-result .qr-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quiz-result .qr-code { font-size: 20px; font-weight: 800; letter-spacing: 2px; padding: 4px 10px; border-radius: 8px; background: #f3eaff; color: var(--purple-d, #3b1f66); user-select: all; }
.quiz-result .qr-save { margin-top: 4px; }
.quiz-result .qr-foot { margin: 10px 0 0; font-size: 12px; opacity: .75; text-align: center; }
.quiz-result.health { background: #fbf8ff; }
@media (prefers-reduced-motion: reduce) { .quiz-card { transition: none; } .quiz-card:hover { transform: none; } }

.chip.quiz-offer { font-weight: 700; border-width: 2px; }
