/* Rev Assistant — in-app overlay styles (v10.9.223-INT).
   Prototype design law carried over: black stage, white + orange
   lettering, primary text in the upper band, Rev aspect-true.
   Everything is scoped under #revOverlay / .revask- so nothing leaks
   into the app shell (or the shell into Rev). */

/* ---- entry point: "Ask Rev" button in the shows toolbar ---- */
.rev-ask-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid #ff7a1a; color: #ffb03a; background: #17171c;
  font-weight: 800;
}
.rev-ask-btn img { width: 20px; height: 20px; object-fit: contain; }

/* ---- full-screen overlay ---- */
#revOverlay {
  position: fixed; inset: 0; z-index: 320;
  background: #0a0a0c; color: #f5f5f5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#revOverlay[hidden] { display: none; }
#revOverlay .revask-stage {
  max-width: 560px; margin: 0 auto; min-height: 100%;
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom));
}
#revOverlay .revask-topband { text-align: center; position: relative; }
#revOverlay .revask-brand { font-weight: 800; letter-spacing: .14em; font-size: 15px; }
#revOverlay .revask-brand span { color: #ff7a1a; }
#revOverlay .revask-close {
  /* Gary, 2026-11-13: the old 38px dark circle was camouflaged on the
     black stage ("no one notices the x"). Now a labeled brand-orange
     pill — the word CLOSE, a 44px+ hit height, impossible to miss. */
  position: absolute; right: 0; top: -6px;
  background: #ff7a1a; color: #141414; border: 0;
  border-radius: 999px; min-width: 96px; height: 44px; padding: 0 16px;
  font-size: 15px; font-weight: 800; letter-spacing: .05em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
#revOverlay .revask-status { margin: 10px 0 0; font-size: 17px; font-weight: 600; }
#revOverlay .revask-reply {
  margin: 10px auto 0; max-width: 46ch; min-height: 2.6em;
  font-size: 19px; line-height: 1.35; font-weight: 700;
}
#revOverlay .revask-reply:empty { min-height: 0; }
#revOverlay .revask-heard { margin: 6px 0 0; font-size: 14px; color: #9a9aa2; min-height: 1.2em; }
#revOverlay .revask-heard:empty { min-height: 0; }

/* ---- Rev stage: one big tap target, poses cross-fade, never squished ---- */
#revOverlay .revask-btn {
  position: relative; flex: 1 1 auto; min-height: 300px;
  margin: 8px 0 4px; padding: 0;
  background: none; border: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#revOverlay .revask-pose {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  opacity: 0; transition: opacity .28s ease; pointer-events: none;
}
#revOverlay .revask-pose.is-on { opacity: 1; }
#revOverlay .revask-pose img {
  height: 100%; max-height: 100%; width: auto; max-width: 100%;
  object-fit: contain; /* contain, always — Rev is never stretched */
}
#revOverlay .revask-ring {
  position: absolute; left: 50%; top: 46%;
  width: 240px; height: 240px; margin: -120px 0 0 -120px;
  border-radius: 50%; border: 3px solid #ff7a1a;
  opacity: 0; pointer-events: none;
}
#revOverlay .revask-btn.is-listening .revask-ring { animation: revask-pulse 1.4s ease-out infinite; }
@keyframes revask-pulse {
  0% { opacity: .85; transform: scale(.72); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ---- result cards ---- */
#revOverlay .revask-cards {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 6px 2px 10px; scrollbar-width: thin;
}
#revOverlay .revask-cards:empty { padding: 0; }
#revOverlay .revask-card {
  flex: 0 0 200px; display: block;
  background: #17171c; border: 1px solid #2a2a33; border-top: 3px solid #ff7a1a;
  border-radius: 12px; padding: 12px 14px;
  color: #f5f5f5; text-decoration: none; text-align: left; cursor: pointer;
}
#revOverlay .revask-card .revask-name { display: block; font-weight: 800; font-size: 16px; line-height: 1.25; }
#revOverlay .revask-card .revask-meta { display: block; margin-top: 6px; font-size: 13.5px; color: #9a9aa2; line-height: 1.45; }
#revOverlay .revask-card .revask-meta b { color: #f5f5f5; font-weight: 600; }

/* ---- ask bar ---- */
#revOverlay .revask-ask { display: flex; gap: 8px; margin-top: 4px; }
#revOverlay .revask-ask input {
  flex: 1 1 auto; min-width: 0;
  background: #17171c; color: #f5f5f5;
  border: 1px solid #2a2a33; border-radius: 999px;
  padding: 13px 16px; font-size: 16px;
}
#revOverlay .revask-ask input::placeholder { color: #9a9aa2; }
#revOverlay .revask-ask button {
  flex: 0 0 auto; background: #ff7a1a; color: #16100a;
  border: 0; border-radius: 999px; padding: 13px 20px;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
#revOverlay .revask-hint { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: #9a9aa2; }

/* ---- wake mode ---- */
#revOverlay .revask-wake-row { margin-top: 14px; text-align: center; }
#revOverlay .revask-wake-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#revOverlay .revask-wake-toggle input {
  width: 20px; height: 20px; margin: 0; accent-color: #ff7a1a; cursor: pointer;
}
#revOverlay .revask-wake-toggle input:disabled { cursor: default; opacity: .45; }
#revOverlay .revask-wake-note { margin: 7px auto 0; max-width: 44ch; font-size: 13px; color: #ff7a1a; }
#revOverlay .revask-wake-note[hidden] { display: none; }

/* ---- mode pill: which way is Rev listening right now ----
   ASK = hard flash (Gary, 2026-11-10: "a flashing Ask Rev" so nobody
   has to guess whether to talk or say the wake word).
   WAKE = steady and dim. Speaking/idle = hidden. */
#revOverlay .revask-modepill {
  margin: 12px auto 0; width: fit-content; max-width: 92%;
  padding: 9px 22px; border-radius: 999px; text-align: center;
  font-size: 17px; font-weight: 900; letter-spacing: .14em;
}
#revOverlay .revask-modepill[hidden] { display: none; }
#revOverlay .revask-modepill.is-ask {
  background: #ff7a1a; color: #16100a;
  animation: revask-flash 0.85s steps(2, start) infinite;
}
#revOverlay .revask-modepill.is-wake {
  background: rgba(255,255,255,.10); color: #fff; font-weight: 800;
  animation: revask-flash 1.25s steps(2, start) infinite;
}
@keyframes revask-flash { 50% { opacity: .25; } }

/* navigation handoff (v10.9.232-INT) */
#revOverlay .revask-drive{display:inline-block;margin-top:6px;padding:3px 10px;border:1px solid #ff8c1a;border-radius:999px;color:#ffb066;font-size:12px;font-weight:700}
#revOverlay .revask-drivebig{display:block;margin:0 0 12px;padding:18px 14px;border-radius:14px;background:linear-gradient(180deg,#ffa53a,#ff8c1a);color:#14100c;font-size:27px;font-weight:900;letter-spacing:1.5px;text-align:center;text-decoration:none;box-shadow:0 0 22px 5px rgba(255,140,26,.8),0 0 55px 14px rgba(255,140,26,.4);animation:revRollGlow 1.5s ease-in-out infinite alternate}@keyframes revRollGlow{from{box-shadow:0 0 15px 3px rgba(255,140,26,.6),0 0 38px 9px rgba(255,140,26,.28)}to{box-shadow:0 0 30px 9px rgba(255,140,26,.95),0 0 72px 22px rgba(255,140,26,.5)}}
#revOverlay .revask-num{color:#ff8c1a;font-weight:800}

/* ---- first-use pictorial (v10.9.109, prod port addition) ----
   Three picture steps + a "what to say" strip, shown once per member
   (localStorage.revPictorialSeen) in front of the assistant's first
   open. Scoped under #revOverlay like everything else in this file.
   Sequence corrected 2026-11-12 (Gary): the Double Tap is Tap 1
   "Ask Rev" (panel 1 pictures the button in its Shows toolbar) ->
   say the show or the town -> Tap 2 "LET'S ROLL" into maps; the card
   header carries the locked tagline "Only 2 taps to a show." */
#revOverlay #revPictorial {
  position: absolute; inset: 0; z-index: 5;
  background: #0a0a0c; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#revOverlay #revPictorial[hidden] { display: none; }
#revOverlay .revpic-card {
  max-width: 560px; margin: 0 auto; text-align: center;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}
#revOverlay .revpic-brand { font-weight: 800; letter-spacing: .14em; font-size: 15px; }
#revOverlay .revpic-brand span { color: #ff7a1a; }
#revOverlay .revpic-title { margin: 10px 0 16px; font-size: 19px; font-weight: 700; }
#revOverlay .revpic-step {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: #17171c; border: 1px solid #2a2a33; border-top: 3px solid #ff7a1a;
  border-radius: 12px; padding: 12px 14px; margin: 0 0 10px;
}
#revOverlay .revpic-visual { flex: 0 0 108px; display: flex; align-items: center; justify-content: center; }
#revOverlay .revpic-visual img { width: 108px; height: 84px; object-fit: contain; }
#revOverlay .revpic-visual svg { width: 108px; height: 84px; }
#revOverlay .revpic-roll {
  display: inline-block; padding: 10px 8px; border-radius: 10px;
  background: linear-gradient(180deg, #ffa53a, #ff8c1a); color: #14100c;
  font-size: 15px; font-weight: 900; letter-spacing: .02em; white-space: nowrap;
}
#revOverlay .revpic-caption { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
#revOverlay .revpic-say { margin: 16px 0 4px; }
#revOverlay .revpic-say-title { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .14em; color: #ff7a1a; }
#revOverlay .revpic-phrase { margin: 0 0 6px; font-size: 15.5px; }
#revOverlay .revpic-ok {
  display: block; width: 100%; margin-top: 14px;
  background: #ff7a1a; color: #16100a; border: 0; border-radius: 999px;
  padding: 14px 20px; font-size: 17px; font-weight: 800; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Corrected Double Tap panels (Gary, 2026-11-12) */
/* Panel 1: the Ask Rev button in its Shows-toolbar home — a slim bar
   strip mirroring the real toolbar (search, Filters, + Post a show),
   with the Ask Rev replica highlighted. Replica is class-only (no id)
   and non-functional; it pictures the real #btnAskRev, styled to
   match .rev-ask-btn above. */
#revOverlay .revpic-step--bar { flex-direction: column; align-items: stretch; }
#revOverlay .revpic-step--bar .revpic-visual { flex: none; width: 100%; }
#revOverlay .revpic-step--bar .revpic-caption { margin-top: 10px; text-align: center; }
#revOverlay .revpic-bar {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: #101014; border: 1px solid #2a2a33; border-radius: 10px; padding: 7px 8px;
}
#revOverlay .revpic-bar-search {
  flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-align: left;
  color: #8a8a94; background: #17171c; border: 1px solid #2a2a33;
  border-radius: 999px; padding: 5px 9px; font-size: 11.5px;
}
#revOverlay .revpic-bar-chip {
  flex: 0 0 auto; white-space: nowrap; color: #a7a7b0; background: #1d1d23;
  border: 1px solid #2a2a33; border-radius: 8px; padding: 5px 7px; font-size: 11.5px; font-weight: 600;
}
#revOverlay .revpic-askrev {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  border: 1px solid #ff7a1a; color: #ffb03a; background: #17171c; font-weight: 800;
  font-size: 12.5px; border-radius: 8px; padding: 5px 8px;
  box-shadow: 0 0 0 2px rgba(255, 122, 26, .35), 0 0 14px rgba(255, 122, 26, .45);
}
#revOverlay .revpic-bar .revpic-askrev img { width: 20px; height: 20px; object-fit: contain; }
/* Panel 2: Rev listening, with a speech bubble under the art carrying
   one of the battery-verified example phrases. */
#revOverlay .revpic-step--say .revpic-visual { flex: 0 0 168px; flex-direction: column; gap: 6px; }
#revOverlay .revpic-step--say .revpic-visual img { width: 96px; height: 64px; }
#revOverlay .revpic-bubble {
  position: relative; display: inline-block; max-width: 168px; text-align: center;
  background: #f5f5f5; color: #16100a; border-radius: 10px; padding: 5px 8px;
  font-size: 12px; font-weight: 700; line-height: 1.25;
}
#revOverlay .revpic-bubble::before {
  content: ""; position: absolute; top: -6px; left: 50%; margin-left: -5px;
  border: 5px solid transparent; border-top: 0; border-bottom: 6px solid #f5f5f5;
}
/* Panel 3: the second tap — LET'S ROLL with a small map/route. */
#revOverlay .revpic-step--roll .revpic-visual { flex: 0 0 118px; flex-direction: column; gap: 8px; }
#revOverlay .revpic-visual .revpic-mapmini { width: 64px; height: 48px; }

/* ---- THE DON — CarShowMafia persona (v10.9.252-INT, appint-proven; ported to PROD v10.9.112 on Gary’s order 2026-11-13) ----
   Every selector is gated on html.brand-csm, the class the index.html
   bootstrap sets for CarShowMafia sessions — the Show & Shine face can
   never match one. The Don's art is a square bust on a black ground
   (Gary's master, cropped square — never redrawn): the toolbar icon
   goes round like a coin, and the stage portrait gets a framed square
   fit in place of Rev's full-stage contain. */
html.brand-csm .rev-ask-btn img { object-fit: cover; border-radius: 50%; }
html.brand-csm #revOverlay .revask-pose img {
  width: min(80%, 400px); height: auto; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 22px;
}
