/* ==========================================================================
   VirtuReal Chatbot v2 (Pilot) — widget styles
   Ported from the approved chatbot_v2/static/preview.html look & feel.

   EVERYTHING is scoped under .vr-v2-widget so nothing bleeds into (or gets
   clobbered by) the WordPress/Elementor host theme. The legacy plugin's
   progress.md documents real theme-conflict pain (icons shrunk to dots, pink
   launcher, iOS input auto-zoom, background scroll) — the guards at the bottom
   of this file are the lessons from that.
   ========================================================================== */

/* ---- design tokens (kept on the root so they cannot leak to the page) ---- */
.vr-v2-widget {
  /* Site-theme match (owner feedback): virtureal.in is white + red — the widget wears the
     same brand red for its primary surfaces. Semantic colors (green=download, amber=note,
     blue=citation links) stay distinct on purpose. */
  --brand:#C40B00; --brand-2:#a30900; --ink:#12212e; --muted:#5f7183; --line:#e9e2e1;
  --bg:#faf6f5; --panel:#ffffff; --bot:#f8f3f2; --user:#C40B00;
  --blue:#2d6cb5; --blue-bg:#e7f0fb; --amber:#b26a00; --amber-bg:#fbefd9;
  --grey:#5f7183; --grey-bg:#eef2f6; --green:#1f7a4d; --err:#b3261e; --radius:14px;

  display:block;
  color:var(--ink);
  font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-text-size-adjust:100%;
  text-align:left;
}
.vr-v2-widget, .vr-v2-widget * { box-sizing:border-box; }

/* ---- the card shell ---- */
.vr-v2-widget .vr-card {
  width:100%; max-width:460px; margin:0 auto;
  height:min(760px,82vh);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 24px 60px rgba(18,33,46,.18);
  display:flex; flex-direction:column; overflow:hidden;
  position:relative;   /* toast (mint fallbacks) anchors to the card */
}

/* ---- header ---- */
.vr-v2-widget .vr-header {
  background:var(--brand); color:#fff; padding:14px 16px;
  display:flex; align-items:center; gap:11px;
}
.vr-v2-widget .logo {
  width:34px; height:34px; border-radius:9px; background:#fff; color:var(--brand);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:14px; letter-spacing:.5px; flex:none;
}
.vr-v2-widget .vr-head-titles { min-width:0; }
.vr-v2-widget .vr-header h1 { font-size:15px; margin:0; font-weight:600; line-height:1.2; color:#fff; }
.vr-v2-widget .vr-header .sub { font-size:11.5px; opacity:.8; margin:0; color:#fff; }

/* ---- signed-in identity + sign out (replaces the old persona switcher) ---- */
.vr-v2-widget .vr-user {
  margin-left:auto; display:flex; align-items:center; gap:8px; min-width:0;
}
.vr-v2-widget .vr-email {
  font-size:11.5px; color:#fff; opacity:.9; max-width:130px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.vr-v2-widget .vr-signout {
  background:rgba(255,255,255,.14); color:#fff; border:1px solid rgba(255,255,255,.28);
  border-radius:9px; padding:6px 10px; font-size:11.5px; font-weight:500;
  cursor:pointer; white-space:nowrap; flex:none;
}
.vr-v2-widget .vr-signout:hover { background:rgba(255,255,255,.24); }

/* ---- access line (accessible sheet count; shown after first reply) ---- */
.vr-v2-widget .accbar { font-size:11px; color:var(--muted); padding:6px 14px 0; display:none; }

/* ---- scroll region ---- */
.vr-v2-widget .vr-scroll { flex:1; overflow-y:auto; padding:16px; background:var(--bg); overscroll-behavior:contain; }
.vr-v2-widget .row { display:flex; margin:0 0 14px; }
.vr-v2-widget .row.user { justify-content:flex-end; }
.vr-v2-widget .msg {
  max-width:88%; padding:11px 14px; border-radius:var(--radius);
  white-space:pre-wrap; word-wrap:break-word; overflow-wrap:anywhere; font-size:14px;
}
.vr-v2-widget .user .msg { background:var(--user); color:#fff; border-bottom-right-radius:5px; }
.vr-v2-widget .bot .msg {
  background:var(--panel); border:1px solid var(--line); border-bottom-left-radius:5px;
  padding:0; max-width:92%; overflow:hidden; color:var(--ink);
}
.vr-v2-widget .bot .msg .body { padding:12px 14px; }

/* ---- drawing card ---- */
.vr-v2-widget .card-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.vr-v2-widget .badge { font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.vr-v2-widget .badge.proj { background:var(--grey-bg); color:var(--grey); }
.vr-v2-widget .badge.rev { background:#e6f4ec; color:var(--green); }
.vr-v2-widget .dname { font-weight:600; font-size:14.5px; line-height:1.35; color:var(--ink); }
.vr-v2-widget .match { font-size:11.5px; color:var(--green); margin-top:6px; }
.vr-v2-widget .fname { font-family:ui-monospace,Menlo,monospace; font-size:11.5px; color:var(--muted); margin:6px 0 2px; word-break:break-all; }
.vr-v2-widget .dl {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; margin-top:11px;
  background:var(--green); color:#fff; text-decoration:none;
  padding:12px 15px; border-radius:10px; font-weight:600; font-size:14px; min-height:48px;
}
.vr-v2-widget .dl:active { transform:scale(.98); }
.vr-v2-widget .older { margin-top:9px; font-size:12px; color:var(--muted); }
.vr-v2-widget .older summary { cursor:pointer; font-weight:500; }
.vr-v2-widget .older div { padding:5px 0 0 4px; font-family:ui-monospace,monospace; font-size:11px; word-break:break-all; }
.vr-v2-widget .verify {
  display:inline-flex; align-items:center; gap:5px; margin-top:11px; font-size:12.5px;
  color:var(--blue); text-decoration:none; font-weight:500;
}
.vr-v2-widget .verify:hover { text-decoration:underline; }
.vr-v2-widget .prov { font-size:11.5px; color:var(--muted); margin-top:9px; }

/* ---- answer card ---- */
.vr-v2-widget .answer { font-size:14px; line-height:1.6; color:var(--ink); }
.vr-v2-widget .answer code,
.vr-v2-widget .cchip {
  background:var(--blue-bg); color:var(--blue); font-family:ui-monospace,monospace; font-size:11.5px;
  padding:1px 6px; border-radius:5px; font-weight:600; text-decoration:none; cursor:pointer;
}
.vr-v2-widget .sources { margin-top:12px; border-top:1px solid var(--line); padding-top:9px; }
.vr-v2-widget .sources .lbl { font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); font-weight:600; margin-bottom:7px; }
.vr-v2-widget .src { padding:8px 10px; border:1px solid var(--line); border-radius:9px; margin-bottom:7px; background:var(--bot); }
.vr-v2-widget .src-head { display:flex; align-items:center; gap:7px; flex-wrap:wrap; font-size:11.5px; color:var(--muted); }
.vr-v2-widget .st { font-size:10.5px; font-weight:700; padding:2px 7px; border-radius:5px; }
.vr-v2-widget .st.Decision { background:var(--blue-bg); color:var(--blue); }
.vr-v2-widget .st.Action { background:var(--amber-bg); color:var(--amber); }
.vr-v2-widget .st.Information { background:var(--grey-bg); color:var(--grey); }
.vr-v2-widget .src .q { font-size:12px; color:var(--ink); margin-top:5px; line-height:1.45; }

/* ---- digest card ---- */
.vr-v2-widget .digest-h { font-weight:600; font-size:13.5px; margin-bottom:2px; color:var(--ink); }
.vr-v2-widget .digest-meta { font-size:11.5px; color:var(--muted); margin-bottom:10px; }
.vr-v2-widget .ditem { display:flex; gap:9px; padding:8px 0; border-top:1px solid var(--line); }
.vr-v2-widget .ditem .when { font-size:10.5px; color:var(--muted); white-space:nowrap; width:58px; flex:none; padding-top:2px; }
.vr-v2-widget .ditem .txt { font-size:12.5px; line-height:1.4; color:var(--ink); }
.vr-v2-widget .ditem .txt .m { font-size:11px; color:var(--muted); font-style:italic; }

/* ---- chips (suggestions + disambiguation) ---- */
.vr-v2-widget .chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.vr-v2-widget .chip {
  border:1px solid var(--line); background:var(--panel); color:var(--brand); border-radius:20px;
  padding:9px 13px; font-size:12.5px; cursor:pointer; font-weight:500; line-height:1.2;
}
.vr-v2-widget .chip:hover { background:var(--blue-bg); border-color:var(--blue-bg); }

/* ---- disclaimer + typing ---- */
.vr-v2-widget .discl { font-size:11px; color:var(--muted); font-style:italic; padding:9px 14px; border-top:1px solid var(--line); background:#fbfcfd; }
.vr-v2-widget .typing { display:inline-flex; align-items:center; flex-wrap:wrap; padding:14px; }
/* staged "thinking" caption — muted 13px beside the dots. Separated from the dots only when
   it actually has text, so the dots-only state (fast answers / pre-500ms) stays flush as before.
   The dots keep their 4px stagger via i+i margins (not container gap), so a leading caption span
   never adds a phantom lead gap; nth-of-type (not nth-child) keeps the animation stagger correct
   now that .vr-think is the first child. */
.vr-v2-widget .vr-think { color:var(--muted); font-size:13px; line-height:1.4; }
.vr-v2-widget .vr-think:not(:empty) { margin-right:6px; }
.vr-v2-widget .typing i { width:7px; height:7px; border-radius:50%; background:#b9c6d3; display:inline-block; animation:vr-bl 1.2s infinite; }
.vr-v2-widget .typing i + i { margin-left:4px; }
.vr-v2-widget .typing i:nth-of-type(2) { animation-delay:.2s; }
.vr-v2-widget .typing i:nth-of-type(3) { animation-delay:.4s; }
@keyframes vr-bl { 0%,60%,100%{ opacity:.3 } 30%{ opacity:1 } }
.vr-v2-widget .err { color:var(--err); font-size:13px; line-height:1.5; }

/* ---- suggestion strip ---- */
.vr-v2-widget .suggest { padding:0 16px 8px; }
.vr-v2-widget .suggest .lbl { font-size:11px; color:var(--muted); margin:2px 0 7px; }

/* ---- footer / composer ---- */
.vr-v2-widget .vr-footer { padding:11px 14px; border-top:1px solid var(--line); display:flex; gap:9px; background:var(--panel); }
.vr-v2-widget .vr-q {
  flex:1; min-width:0; border:1px solid var(--line); border-radius:11px; padding:12px 13px;
  font-size:16px; /* >=16px prevents iOS auto-zoom on focus (see legacy progress.md) */
  outline:none; color:var(--ink); background:#fff;
}
.vr-v2-widget .vr-q:focus { border-color:var(--brand-2); }
.vr-v2-widget .vr-send {
  border:0; background:var(--brand); color:#fff; border-radius:11px; width:48px; min-height:48px;
  font-size:17px; cursor:pointer; flex:none;
}
.vr-v2-widget .vr-send:disabled { opacity:.5; cursor:default; }

/* ---- login hero state ---- */
.vr-v2-widget .vr-hero-body {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:28px 24px; background:var(--bg); gap:6px;
}
.vr-v2-widget .vr-hero-icon { font-size:40px; line-height:1; margin-bottom:6px; }
.vr-v2-widget .vr-hero-body h2 { font-size:18px; margin:0; color:var(--ink); font-weight:600; }
.vr-v2-widget .vr-hero-text { font-size:13.5px; color:var(--muted); margin:4px 0 8px; max-width:300px; line-height:1.5; }
/* eligibility + access-request copy (review punch: match the muted hero idiom, kill default <p> weight) */
.vr-v2-widget .vr-hero-elig { font-size:12.5px; color:var(--muted); margin:0 0 10px; max-width:300px; line-height:1.45; }
.vr-v2-widget .vr-hero-contact { font-size:12px; color:var(--muted); margin:10px 0 0; opacity:.85; }
.vr-v2-widget .vr-hero-note {
  font-size:12.5px; color:var(--amber); background:var(--amber-bg);
  border-radius:9px; padding:8px 12px; margin:0 0 6px; max-width:320px;
}
.vr-v2-widget .vr-login-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--brand); color:#fff; border:0; border-radius:11px;
  padding:13px 22px; font-size:15px; font-weight:600; cursor:pointer;
  min-height:48px; margin-top:4px;
}
.vr-v2-widget .vr-login-btn:hover { background:var(--brand-2); }
.vr-v2-widget .vr-login-btn:active { transform:scale(.98); }
.vr-v2-widget .vr-hero-fine { font-size:11px; color:var(--muted); margin-top:12px; }

/* ---- links baseline ---- */
.vr-v2-widget a { color:var(--blue); }

/* ==========================================================================
   PROJECT SWITCHER BAR (chat) — current scope + Switch, below the header.
   Full-width strip so it always fits the mobile header width; the label
   ellipsis-truncates (like .vr-email) so a long project name never pushes
   "Switch" off-screen.
   ========================================================================== */
.vr-v2-widget .vr-projbar {
  display:flex; align-items:center; gap:8px;
  padding:8px 14px; background:var(--bot); border-bottom:1px solid var(--line);
}
.vr-v2-widget .vr-proj-label {
  min-width:0; display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:600; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.vr-v2-widget .vr-proj-ic { flex:none; opacity:.85; }
.vr-v2-widget .vr-proj-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vr-v2-widget .vr-proj-switch {
  margin-left:auto; flex:none;
  background:var(--panel); color:var(--brand); border:1px solid var(--line);
  border-radius:8px; padding:6px 12px; font-size:12px; font-weight:600; cursor:pointer;
}
.vr-v2-widget .vr-proj-switch:hover { background:var(--blue-bg); border-color:var(--blue-bg); }

/* ---- "What's new" bell (projbar, chat only) ----
   Sits in the projbar's normal flex flow right after the project label — NO auto margin
   (the single margin-left:auto in this bar stays on .vr-proj-switch). The count badge is
   an absolute dot on the button; it is aria-hidden (the button's aria-label carries the
   exact count) and shows only when unread > 0. */
.vr-v2-widget .vr-notif-bell {
  position:relative; flex:none;
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:30px; padding:0;
  background:var(--panel); color:var(--ink);
  border:1px solid var(--line); border-radius:8px;
  font-size:14px; line-height:1; cursor:pointer;
}
.vr-v2-widget .vr-notif-bell:hover { background:var(--blue-bg); border-color:var(--blue-bg); }
.vr-v2-widget .vr-notif-bell-ic { pointer-events:none; }
.vr-v2-widget .vr-notif-badge {
  position:absolute; top:-6px; right:-6px;
  min-width:16px; height:16px; padding:0 4px;
  border-radius:9px; background:var(--brand); color:#fff;
  font-size:10px; font-weight:700; line-height:16px; text-align:center;
  pointer-events:none;
}
/* keep the [hidden] attribute authoritative even though the class styles the element */
.vr-v2-widget .vr-notif-badge[hidden] { display:none; }

/* ==========================================================================
   PROJECT PICKER — the state between login and chat. Rows are >=48px tap targets.
   ========================================================================== */
.vr-v2-widget .vr-pick { flex:1; overflow-y:auto; padding:16px; background:var(--bg); }
.vr-v2-widget .vr-pick-head h2 { font-size:16px; margin:0 0 3px; color:var(--ink); font-weight:600; }
.vr-v2-widget .vr-pick-head .sub2 { font-size:12.5px; color:var(--muted); margin:0 0 14px; line-height:1.45; }
.vr-v2-widget .vr-pick-list { display:flex; flex-direction:column; gap:9px; }
.vr-v2-widget .vr-pick-loading { font-size:13px; color:var(--muted); padding:12px 2px; display:inline-flex; align-items:center; gap:8px; }
.vr-v2-widget .vr-pick-row {
  display:flex; align-items:center; gap:10px; width:100%;
  min-height:60px; padding:12px 14px; text-align:left;
  background:var(--panel); border:1px solid var(--line); border-radius:12px; cursor:pointer;
}
.vr-v2-widget .vr-pick-row:hover { border-color:var(--brand); box-shadow:0 2px 10px rgba(18,33,46,.08); }
.vr-v2-widget .vr-pick-main { display:flex; flex-direction:column; gap:5px; min-width:0; flex:1; }
.vr-v2-widget .vr-pick-name {
  font-size:14.5px; font-weight:600; color:var(--ink); line-height:1.25;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.vr-v2-widget .vr-pick-badges { display:flex; flex-wrap:wrap; gap:6px; }
.vr-v2-widget .vr-pill { font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.vr-v2-widget .vr-pill-dec { background:#e6f4ec; color:var(--green); }
.vr-v2-widget .vr-pill-draw { background:var(--grey-bg); color:var(--grey); }
.vr-v2-widget .vr-pick-go { flex:none; color:var(--muted); font-size:22px; line-height:1; }
.vr-v2-widget .vr-pick-empty, .vr-v2-widget .vr-pick-error { text-align:center; padding:26px 18px; color:var(--muted); }
.vr-v2-widget .vr-pick-empty .vr-hero-icon { font-size:34px; margin-bottom:8px; }
.vr-v2-widget .vr-pick-empty h3 { font-size:15px; color:var(--ink); margin:0 0 6px; font-weight:600; }
.vr-v2-widget .vr-pick-empty p, .vr-v2-widget .vr-pick-error p { font-size:13px; line-height:1.5; margin:0 auto; max-width:300px; }
.vr-v2-widget .vr-pick-retry {
  margin-top:12px; background:var(--brand); color:#fff; border:0; border-radius:10px;
  padding:11px 18px; font-size:13.5px; font-weight:600; cursor:pointer; min-height:44px;
}
.vr-v2-widget .vr-pick-retry:hover { background:var(--brand-2); }

/* ==========================================================================
   RESULTS LIST — d.results envelope: up to 10 drawings, each with a prominent
   primary download + a collapsed "All files" list. NO href comes from the
   envelope; every button mints its URL on click.
   ========================================================================== */
.vr-v2-widget .rl-head { font-weight:600; font-size:14px; color:var(--ink); margin-bottom:2px; }
.vr-v2-widget .rl-banner {
  font-size:12px; color:var(--amber); background:var(--amber-bg);
  border-radius:8px; padding:7px 10px; margin:8px 0 2px; line-height:1.4;
}
.vr-v2-widget .rl-item { padding:12px 0; border-top:1px solid var(--line); }
.vr-v2-widget .rl-badges { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:6px; }
.vr-v2-widget .rl-badges:empty { display:none; }
.vr-v2-widget .rl-name { font-weight:600; font-size:14px; line-height:1.35; color:var(--ink); }
.vr-v2-widget .rl-files { margin-top:9px; font-size:12px; color:var(--muted); }
.vr-v2-widget .rl-files summary { cursor:pointer; font-weight:600; color:var(--blue); }
.vr-v2-widget .rl-frow { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:9px 0 0; }
.vr-v2-widget .rl-fmeta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; min-width:0; flex:1; }
.vr-v2-widget .rl-fname { font-family:ui-monospace,Menlo,monospace; font-size:11.5px; color:var(--muted); word-break:break-all; }
.vr-v2-widget .ext-chip {
  font-size:10px; font-weight:700; letter-spacing:.3px; padding:2px 6px; border-radius:5px;
  background:var(--grey-bg); color:var(--grey); text-transform:uppercase; white-space:nowrap;
}
.vr-v2-widget .rl-frev { font-size:10.5px; font-weight:700; padding:2px 6px; border-radius:5px; background:#e6f4ec; color:var(--green); white-space:nowrap; }
.vr-v2-widget .rl-verify { margin-top:6px; }

/* ---- mint-on-click download button (styled like .dl; 48px tap target) ---- */
.vr-v2-widget .vr-dl-mint {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; margin-top:11px;
  background:var(--green); color:#fff; border:0; cursor:pointer;
  padding:12px 15px; border-radius:10px; font-weight:600; font-size:14px; min-height:48px;
}
.vr-v2-widget .vr-dl-mint:active { transform:scale(.98); }
.vr-v2-widget .vr-dl-mint:disabled, .vr-v2-widget .vr-dl-mint.vr-dl-busy { opacity:.72; cursor:default; }
/* extras (inside "All files"): compact, no top margin, still a 48px tap target */
.vr-v2-widget .rl-frow .vr-dl-mint { margin-top:0; flex:none; padding:10px 12px; font-size:12.5px; }

/* ---- inline mini spinner (mint fetch + picker load; adapts to currentColor) ---- */
.vr-v2-widget .vr-mini-spin {
  display:inline-block; width:13px; height:13px; border-radius:50%;
  border:2px solid currentColor; border-top-color:transparent; opacity:.75;
  animation:vr-spin .7s linear infinite; vertical-align:-2px;
}
@keyframes vr-spin { to { transform:rotate(360deg); } }

/* ---- toast (mint fallbacks) — small, centered near the composer, auto-dismiss ---- */
.vr-v2-widget .vr-toast {
  position:absolute; left:50%; bottom:74px; transform:translateX(-50%);
  max-width:86%; z-index:6;
  background:#12212e; color:#fff; font-size:12.5px; line-height:1.4; text-align:center;
  padding:9px 13px; border-radius:9px; box-shadow:0 6px 20px rgba(18,33,46,.28);
  transition:opacity .26s ease, transform .26s ease;
}
.vr-v2-widget .vr-toast-out { opacity:0; transform:translateX(-50%) translateY(6px); }

/* ==========================================================================
   "WHAT'S NEW" DRAWER — a show/hide overlay appended into .vr-card (same
   appendChild anchor as .vr-toast; the card is position:relative + overflow:
   hidden, so the drawer fills the card face — covering the scroll region —
   with its OWN scroll and inherits the rounded corners). The chat thread
   underneath is never rewritten. z-index 5 keeps it UNDER the toast (z 6) so
   mint fallback toasts stay visible above an open drawer.
   ========================================================================== */
.vr-v2-widget .vr-notif-drawer {
  position:absolute; inset:0; z-index:5;
  background:var(--bg);
  display:none; flex-direction:column;
}
.vr-v2-widget .vr-notif-drawer.vr-notif-open { display:flex; }
.vr-v2-widget .vr-notif-head {
  flex:none; display:flex; align-items:center; gap:10px;
  padding:12px 14px; background:var(--panel); border-bottom:1px solid var(--line);
}
/* flex:1 on the title pushes the close control right WITHOUT any auto margin */
.vr-v2-widget .vr-notif-title {
  flex:1; min-width:0; margin:0;
  font-size:15px; font-weight:600; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.vr-v2-widget .vr-notif-close {
  flex:none; width:30px; height:30px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--panel); color:var(--muted);
  border:1px solid var(--line); border-radius:8px;
  font-size:14px; line-height:1; cursor:pointer;
}
.vr-v2-widget .vr-notif-close:hover { background:var(--blue-bg); border-color:var(--blue-bg); color:var(--ink); }
.vr-v2-widget .vr-notif-fresh {
  flex:none; font-size:11.5px; color:var(--muted); line-height:1.45;
  padding:8px 14px; background:var(--panel); border-bottom:1px solid var(--line);
}
.vr-v2-widget .vr-notif-body { flex:1; overflow-y:auto; padding:12px 14px; overscroll-behavior:contain; }
.vr-v2-widget .vr-notif-sec-h {
  font-size:11px; text-transform:uppercase; letter-spacing:.4px;
  color:var(--muted); font-weight:700; margin:16px 0 2px;
}
.vr-v2-widget .vr-notif-sec-h:first-child { margin-top:2px; }
/* in-drawer dedupe: the dictated section headings + 30-day note replace resultsListCard's
   chat-facing "Found N drawings" head and "refine your search" banner (the card itself is
   still rendered VERBATIM — this only hides its chat chrome inside the drawer) */
.vr-v2-widget .vr-notif-drawer .rl-head,
.vr-v2-widget .vr-notif-drawer .rl-banner { display:none; }
/* muted per-entry context line (server-computed date_line · change_line) */
.vr-v2-widget .vr-notif-line { font-size:11.5px; color:var(--muted); margin-top:3px; }
/* 30-day window note — informational (muted grey), not an alarm banner */
.vr-v2-widget .vr-notif-trunc {
  font-size:12px; color:var(--muted); background:var(--grey-bg);
  border-radius:8px; padding:8px 10px; margin-top:14px; line-height:1.45;
}

/* ---- picker "what's new" pill — CALM muted blue (vr-pill family; never brand crimson) ---- */
.vr-v2-widget .vr-pill-new { background:var(--blue-bg); color:var(--blue); }

/* ==========================================================================
   THEME-BLEED GUARDS (lessons from the legacy plugin's Elementor pain)
   Neutralise host-theme decorations on our controls, without !important-spam.
   ========================================================================== */
.vr-v2-widget button {
  font-family:inherit; letter-spacing:normal; text-transform:none;
  box-shadow:none; text-decoration:none; line-height:normal; -webkit-appearance:none; appearance:none;
}
.vr-v2-widget button::before,
.vr-v2-widget button::after { content:none; } /* kill theme button pseudo-decorations */
.vr-v2-widget input { font-family:inherit; -webkit-appearance:none; appearance:none; box-shadow:none; }
.vr-v2-widget a { box-shadow:none; }
.vr-v2-widget h1, .vr-v2-widget h2 { text-transform:none; letter-spacing:normal; }

/* ==========================================================================
   MOBILE-FIRST (<=768px): the widget fills the viewport, download buttons go
   full-width, and tap targets stay >=48px.
   ========================================================================== */
@media (max-width:768px) {
  .vr-v2-widget .vr-card {
    max-width:100%;
    height:100dvh;            /* fills the viewport */
    border-radius:0;
    border-left:0; border-right:0;
    box-shadow:none;
  }
  .vr-v2-widget .dl { width:100%; }         /* full-width download */
  .vr-v2-widget .vr-dl-mint.primary { width:100%; }   /* full-width primary results download */
  .vr-v2-widget .vr-login-btn { width:100%; max-width:360px; }
  .vr-v2-widget .vr-email { max-width:96px; }
  /* chips (suggestions + disambiguation) get a >=48px tap target on touch */
  .vr-v2-widget .chip { min-height:48px; display:inline-flex; align-items:center; padding:9px 15px; }
  /* project-bar Switch control: same >=48px touch treatment (review punch #1) */
  .vr-v2-widget .vr-proj-switch {
    min-height:48px; display:inline-flex; align-items:center; justify-content:center; padding:9px 16px;
  }
  /* "what's new": bell + drawer close keep house-rule touch targets; the drawer itself is
     inset:0, so inside the full-screen mobile card it is automatically full-width */
  .vr-v2-widget .vr-notif-bell { min-width:48px; min-height:48px; }
  .vr-v2-widget .vr-notif-close { min-width:44px; min-height:44px; }
}

/* dvh fallback for older engines */
@supports not (height:100dvh) {
  @media (max-width:768px) {
    .vr-v2-widget .vr-card { height:100vh; }
  }
}

/* ==========================================================================
   BUBBLE MODE  — opt-in via  [virtureal_chatbot_v2 mode="bubble"]
   A floating launcher + slide-up panel, portaled to <body> by widget.js so it
   escapes any Elementor `transform` ancestor. EVERY rule below is gated on
   [data-vr-v2-mode="bubble"], so the default (inline) widget is byte-for-byte
   unaffected. Geometry + timing mirror the launcher/panel that shipped on the
   live site (react_chatbot_code/src/App.css:40-128, 415-462).
   ========================================================================== */
.vr-v2-widget[data-vr-v2-mode="bubble"] {
  --vr-v2-z:99999;   /* above sticky headers / Elementor overlays */
}

/* ---- floating launcher ----
   A TEXT monogram, never an <img>/<svg>: the legacy plugin's icon collapsed to
   a dot under host `svg{width:1em}` rules (progress.md PR #13). */
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-launcher {
  position:fixed; right:30px; bottom:30px;
  width:60px; height:60px; border-radius:50%;
  /* site-brand red (owner feedback: match virtureal.in, read as a chat button) */
  background-color:#C40B00;
  background-image:none;           /* defend against host-theme gradient bleed */
  border:none; padding:0; margin:0;
  color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 6px 20px rgba(18,33,46,.28);
  z-index:var(--vr-v2-z);
  /* eases back in near the END of the close (delayed), mirroring the legacy launcher */
  opacity:1; transform:scale(1); visibility:visible;
  transition:opacity .22s ease .12s, transform .22s ease .12s, visibility 0s linear 0s;
}
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-launcher:hover { background-color:#a30900; }
/* explicit svg sizing — immune to host-theme icon shrink ("icons as dots" legacy bug) */
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-fab-glyph {
  width:28px; height:28px; display:block; margin:0 auto;
}
/* launcher hides while the panel is open (fades out immediately, no delay) */
.vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-open .vr-v2-launcher {
  opacity:0; transform:scale(.6); visibility:hidden; pointer-events:none;
  transition:opacity .18s ease 0s, transform .18s ease 0s, visibility 0s linear .18s;
}
/* hover tooltip — desktop (hover-capable, wide) pointers only; sits ABOVE the FAB
   so it never clips at the viewport's bottom edge. */
@media (hover:hover) and (min-width:769px) {
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-launcher::after {
    content:"Ask Virtureal AI";
    position:absolute; left:50%; bottom:calc(100% + 10px); transform:translateX(-50%);
    white-space:nowrap; font-size:12px; font-weight:500; letter-spacing:.02em;
    color:#fff; background:#12212e; padding:5px 9px; border-radius:6px;
    opacity:0; transition:opacity .15s ease; pointer-events:none;
  }
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-launcher:hover::after { opacity:1; }
}

/* ---- slide-up panel ---- */
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-panel {
  position:fixed; right:30px; bottom:100px;
  width:min(460px, calc(100vw - 60px));
  height:min(620px, calc(100vh - 140px));
  z-index:var(--vr-v2-z);
  border-radius:12px;
  box-shadow:0 12px 40px rgba(18,33,46,.22);
  transform-origin:bottom right;
  /* closed: faded + scaled toward the launcher, non-interactive */
  opacity:0; transform:scale(.9); visibility:hidden; pointer-events:none;
  transition:opacity .24s ease, transform .24s ease, visibility 0s linear .28s;
}
.vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-open .vr-v2-panel {
  opacity:1; transform:scale(1); visibility:visible; pointer-events:auto;
  /* width/height here (open-state rule) so the expand/restore toggle animates its resize;
     the no-anim guard below still zeroes it out for the restore-on-load frame */
  transition:opacity .24s ease, transform .24s ease, visibility 0s linear 0s, width .24s ease, height .24s ease;
}
/* the card fills the panel (the panel owns size/shadow now) */
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-panel .vr-card {
  height:100%; max-width:none; margin:0;
  border-radius:12px; box-shadow:none;
}

/* ---- desktop maximize (expand) — bubble only, MANDATORY media guard ----
   At >=769px an expanded panel grows toward a comfortable reading size. The @media guard is
   REQUIRED: without it this selector out-specifies the mobile full-screen rule below (it carries
   an extra .vr-v2-expanded class) and would trap the panel at a clamped width → overflow. */
@media (min-width:769px) {
  .vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-expanded .vr-v2-panel {
    width:min(920px, calc(100vw - 60px));
    height:min(744px, calc(100vh - 140px));
  }
  /* cap bot line length so the wider panel stays readable */
  .vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-expanded .vr-v2-panel .bot .msg { max-width:680px; }
}

/* ---- header controls: Expand (⤢/⤡) + Close (✕), styled like .vr-signout; theme-guarded
        by the widget-wide button rules above ---- */
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-close,
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-expand {
  flex:none;
  width:30px; height:30px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14); color:#fff;
  border:1px solid rgba(255,255,255,.28); border-radius:8px;
  font-size:15px; line-height:1; cursor:pointer;
}
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-close:hover,
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-expand:hover { background:rgba(255,255,255,.24); }
/* Right-align the control cluster with EXACTLY ONE auto margin — flexbox splits free space across
   multiple autos and would strand a control mid-header (e.g. the expand button floating in the
   middle of the login/picker header, which has no .vr-user block). Desktop: the expand button owns
   the auto, UNLESS a .vr-user block (chat/picker header) precedes it and already owns one. Mobile
   puts the auto on .vr-v2-close instead, since expand is display:none there (see the mobile block). */
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-expand { margin-left:auto; }
.vr-v2-widget[data-vr-v2-mode="bubble"] .vr-user ~ .vr-v2-expand { margin-left:0; }

/* first-frame guard: suppress the open transition when the panel is restored open
   on load (set + removed by widget.js) so it doesn't animate in on every visit */
.vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-no-anim .vr-v2-panel,
.vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-no-anim .vr-v2-launcher { transition:none !important; }

/* ---- mobile (<=768px): the panel becomes a full-screen overlay (fade only) ---- */
@media (max-width:768px) {
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-panel {
    inset:0; right:0; bottom:0;
    width:100vw; height:100dvh;
    border-radius:0; box-shadow:none;
    transform:none; transform-origin:center;   /* full-screen: no corner-scale */
  }
  .vr-v2-widget[data-vr-v2-mode="bubble"].vr-v2-open .vr-v2-panel { transform:none; }
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-panel .vr-card { border-radius:0; }
  /* maximize is a desktop-only affordance — hide the toggle on the full-screen mobile overlay */
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-expand { display:none; }
  /* expand is hidden here, so the close button owns the single right-push auto (unless .vr-user has it) */
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-close { margin-left:auto; }
  .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-user ~ .vr-v2-close { margin-left:0; }
}
/* dvh fallback for older engines (mobile bubble panel) */
@supports not (height:100dvh) {
  @media (max-width:768px) {
    .vr-v2-widget[data-vr-v2-mode="bubble"] .vr-v2-panel { height:100vh; }
  }
}
