/* ==========================================================================
   "Try It Now" GUEST MODE — overlay chrome for the REAL workspace (only /try).
   Namespaced `gl-`; scoped to body.guest-mode. Styles the injected meter bar,
   hard wall, cursor tooltip, toast, and the locked-affordance treatment on
   [data-guest-locked]. Does NOT touch the authed workspace (not loaded there).
   ========================================================================== */

:root {
  --gl-cyan: #00f2fe;
  --gl-purple: #764ba2;
  /* Match the workspace dialog theme so guest chrome feels native:
     .mirror-modal (custom-modals.css) + .nav-item-tooltip (document-writer.css). */
  --gl-modal-1: #0f1729;                       /* .mirror-modal gradient start */
  --gl-modal-2: #1a1f3a;                       /* .mirror-modal gradient end   */
  --gl-modal-border: rgba(0, 242, 254, 0.2);   /* .mirror-modal border         */
  --gl-tip-1: rgba(21, 26, 53, 0.98);          /* .nav-item-tooltip gradient   */
  --gl-tip-2: rgba(30, 37, 64, 0.98);
  --gl-tip-border: rgba(255, 255, 255, 0.08);  /* .nav-item-tooltip border     */
  --gl-tip-title: rgba(0, 242, 254, 0.7);      /* .nav-item-tooltip strong (cyan) */
  --gl-scrim: rgba(10, 14, 39, 0.85);          /* .mirror-modal-overlay        */
  --gl-warn: #fbbf24;                          /* .mirror-modal-icon.alert (meter last dot only) */
  --gl-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Locked affordance treatment --------------------------------------- */
body.guest-mode [data-guest-locked] {
  position: relative;
  opacity: 0.5;
  filter: saturate(0.65);
  cursor: pointer;
  transition: opacity 160ms var(--gl-ease);
}
body.guest-mode [data-guest-locked]:hover,
body.guest-mode [data-guest-locked]:focus-visible {
  opacity: 0.72;
  outline: none;
}
body.guest-mode [data-guest-locked]::after {
  content: "\f023"; /* fa-lock */
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; top: 4px; right: 7px;
  font-size: 9px; color: var(--gl-tip-title); opacity: 0.95; pointer-events: none; z-index: 2;
}
/* Larger surfaces (dashboard cards) get the badge a touch inset. */
body.guest-mode .service-card[data-guest-locked]::after { top: 10px; right: 12px; font-size: 11px; }

/* (The floating service-switcher nav is hidden for guests in guest-lock.js via an
   inline style — no CSS !important, per the project CSS rule.) */

/* Sidebar history teaser (replaces the endless "Loading chats…" spinner). */
body.guest-mode .gl-hist-teaser {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px; font-size: 12px; line-height: 1.4;
  color: rgba(255,255,255,0.45);
}
body.guest-mode .gl-hist-teaser i { color: var(--gl-tip-title); font-size: 12px; }

/* ---- Plans & pricing (guest sidebar) ----------------------------------- */
/* For guests the Recent-chats block is only a teaser, so let it size to its
   content and hand the remaining sidebar height to the plans list (scrolls). */
body.guest-mode .chat-sidebar .sidebar-sessions { flex: none; }
body.guest-mode .gl-plans {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding: 0 12px 6px; overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
body.guest-mode .gl-plans__head { display: flex; flex-direction: column; gap: 3px; padding: 14px 6px 10px; }
body.guest-mode .gl-plans__title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.2px; line-height: 1.25; }
body.guest-mode .gl-plans__sub { font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, 0.48); }
body.guest-mode .gl-plans__list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 11px; padding: 6px 3px 4px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
body.guest-mode .gl-plans__list::-webkit-scrollbar { width: 6px; }
body.guest-mode .gl-plans__list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }

/* Card — calm and confident (restraint). Legible type, generous spacing; the
   accent is reserved for the single recommended plan (.gl-plan--rec) below. */
body.guest-mode .gl-plan {
  position: relative; flex: none; display: flex; flex-direction: column; gap: 8px;
  width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: rgba(255, 255, 255, 0.92);
  padding: 16px 16px 15px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 160ms var(--gl-ease), border-color 160ms var(--gl-ease), background 160ms var(--gl-ease);
}
body.guest-mode .gl-plan:hover {
  transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.04);
}
body.guest-mode .gl-plan__name { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.2; }

/* Price = the dominant element */
body.guest-mode .gl-plan__price { display: flex; align-items: baseline; gap: 6px; }
body.guest-mode .gl-plan__amt { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
body.guest-mode .gl-plan__per { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.45); }

body.guest-mode .gl-plan__desc {
  font-size: 12px; line-height: 1.45; color: rgba(255, 255, 255, 0.55);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.guest-mode .gl-plan__feats { display: flex; flex-direction: column; gap: 6px; margin-top: 1px; }
body.guest-mode .gl-plan__feat { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.4; color: rgba(255, 255, 255, 0.72); }
body.guest-mode .gl-plan__feat i { color: var(--gl-cyan); font-size: 10px; margin-top: 3px; flex: none; }

/* CTA — quiet (ghost) by default so the recommended card's filled CTA leads. */
body.guest-mode .gl-plan__cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 6px; padding: 10px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 160ms var(--gl-ease), border-color 160ms var(--gl-ease), box-shadow 160ms var(--gl-ease);
}
body.guest-mode .gl-plan:hover .gl-plan__cta { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
body.guest-mode .gl-plan__cta i { font-size: 10px; transition: transform 160ms var(--gl-ease); }
body.guest-mode .gl-plan:hover .gl-plan__cta i { transform: translateX(3px); }

/* ---- The ONE recommended plan — the single place the accent lives. ---- */
body.guest-mode .gl-plan--rec {
  background: linear-gradient(180deg, rgba(0, 242, 254, 0.06), rgba(0, 242, 254, 0.02));
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 28px rgba(0, 242, 254, 0.14);
}
body.guest-mode .gl-plan--rec:hover {
  border-color: rgba(0, 242, 254, 0.7); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), 0 0 34px rgba(0, 242, 254, 0.2);
}
body.guest-mode .gl-plan--rec .gl-plan__amt {
  background: linear-gradient(135deg, #ffffff 0%, #00f2fe 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
body.guest-mode .gl-plan--rec .gl-plan__cta {
  color: #04121a; background: linear-gradient(135deg, #00f2fe, #4facfe);
  border-color: transparent; box-shadow: 0 6px 16px rgba(0, 242, 254, 0.3);
}
body.guest-mode .gl-plan--rec:hover .gl-plan__cta { box-shadow: 0 9px 24px rgba(0, 242, 254, 0.45); }

/* "Recommended" badge (tab above the card) */
body.guest-mode .gl-plan__badge {
  position: absolute; top: -8px; left: 16px; z-index: 2;
  font-size: 9px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  color: #04121a; background: linear-gradient(135deg, #00f2fe, #4facfe);
  padding: 3px 9px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 242, 254, 0.35);
}

/* Trust line under the plans */
body.guest-mode .gl-plans__trust {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 4px 4px; font-size: 10.5px; color: rgba(255, 255, 255, 0.4);
}
body.guest-mode .gl-plans__trust i { color: rgba(0, 242, 254, 0.6); font-size: 10px; }

/* Hide plans in the collapsed sidebar; reveal on hover-expand (like sessions). */
body.guest-mode.sidebar-collapsed .gl-plans { display: none; }
body.guest-mode.sidebar-collapsed .chat-sidebar:hover .gl-plans { display: flex; }

/* ---- Guest bar (top-center pill row: meter + auth CTAs) ----------------- */
.gl-bar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 4000; display: flex; align-items: center; gap: 12px;
  padding: 7px 10px 7px 14px; border-radius: 9999px;
  background: linear-gradient(135deg, rgba(15, 23, 41, 0.92) 0%, rgba(26, 31, 58, 0.92) 100%);
  border: 1px solid var(--gl-modal-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: 'Inter', -apple-system, sans-serif; max-width: calc(100vw - 24px);
}
.gl-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--gl-cyan); white-space: nowrap; }
.gl-pill i { font-size: 10px; }
.gl-meter { display: inline-flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.12); }
.gl-dots { display: inline-flex; gap: 4px; }
.gl-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.18); transition: all 200ms var(--gl-ease); }
.gl-dot.is-used { background: var(--gl-cyan); box-shadow: 0 0 8px rgba(0,242,254,0.55); }
.gl-dot.is-last { background: var(--gl-warn); box-shadow: 0 0 8px rgba(251,191,36,0.6); }
.gl-meter-label { font-size: 12px; color: rgba(255,255,255,0.66); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gl-meter-label b { color: #fff; font-weight: 650; }
.gl-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; font-size: 12.5px; font-weight: 600; text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.gl-btn i { font-size: 11px; }
.gl-btn--ghost { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.16); }
.gl-btn--ghost:hover { color: #fff; border-color: rgba(0,242,254,0.35); }
.gl-btn--primary { color: #04121a; background: linear-gradient(135deg, var(--gl-cyan), #46c8ff); box-shadow: 0 6px 16px rgba(0,242,254,0.28); }
.gl-btn--primary:hover { transform: translateY(-1px); }

@media (max-width: 700px) {
  .gl-meter-label { display: none; }
  .gl-btn--ghost { display: none; }
  .gl-bar { gap: 9px; padding: 6px 8px 6px 12px; }
}

/* ---- Hard wall --------------------------------------------------------- */
/* Scoped under body.guest-mode (added by guest-lock.js) so this full-viewport
   fixed overlay can never blank the authed workspace even if the stylesheet were
   ever loaded outside guest mode. */
body.guest-mode .gl-wall { position: fixed; inset: 0; z-index: 6000; display: none; align-items: center; justify-content: center; }
body.guest-mode .gl-wall.is-up { display: flex; }
.gl-wall__scrim { position: absolute; inset: 0; background: var(--gl-scrim); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gl-wall__card {
  position: relative; width: min(560px, calc(100% - 40px)); border-radius: 16px;
  padding: 28px 28px 22px; text-align: center;
  background: linear-gradient(135deg, var(--gl-modal-1) 0%, var(--gl-modal-2) 100%);
  border: 1px solid var(--gl-modal-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,242,254,0.1);
  color: rgba(255,255,255,0.9); font-family: 'Inter', -apple-system, sans-serif;
  animation: glWallUp 240ms var(--gl-ease) both;
}
@keyframes glWallUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.gl-wall__orb { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%); display: grid; place-items: center; font-size: 22px; color: #ffffff; box-shadow: 0 0 40px rgba(0,242,254,0.3); }
.gl-wall__card h2 { font-size: 21px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.3px; color: #fff; }
.gl-wall__card p { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.66); margin: 0 auto 16px; max-width: 420px; }
.gl-wall__save { display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 18px; padding: 7px 13px; border-radius: 9999px; font-size: 12.5px; font-weight: 600; color: #34d399; background: rgba(52,211,153,0.10); border: 1px solid rgba(52,211,153,0.28); }
.gl-wall__perks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; text-align: left; max-width: 420px; margin: 0 auto 20px; }
.gl-wall__perk { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255,255,255,0.66); }
.gl-wall__perk i { color: var(--gl-cyan); font-size: 12px; width: 16px; text-align: center; }
.gl-wall__cta { display: flex; flex-direction: column; gap: 9px; }
.gl-wall__primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 700; text-decoration: none; color: #ffffff; background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%); box-shadow: 0 4px 16px rgba(0,242,254,0.3); transition: box-shadow 0.3s ease, transform 0.3s ease; }
.gl-wall__primary:hover { box-shadow: 0 6px 24px rgba(0,242,254,0.4); transform: translateY(-2px); }
.gl-wall__sub { font-size: 13px; color: rgba(255,255,255,0.66); }
.gl-wall__sub a { color: var(--gl-cyan); text-decoration: none; font-weight: 600; }
.gl-wall__fine { margin-top: 12px; font-size: 11px; color: rgba(255,255,255,0.4); }
@media (max-width: 560px) { .gl-wall__perks { grid-template-columns: 1fr; } }

/* ---- Terms & conditions gate (before account creation) ----------------- */
/* The gate reuses the shared landing disclaimer verbatim (disclaimer.css) for an
   exact visual match. Only override the z-index so it sits ABOVE the guest chrome
   (bar z4000, wall z6000) — the landing value (var(--z-modal-backdrop,2000)) would
   otherwise render it behind them on /try. */
body.guest-mode #disclaimerModal.disclaimer-overlay { z-index: 7000; }

/* ---- Cursor tooltip ---------------------------------------------------- */
.gl-tip { position: fixed; z-index: 6500; pointer-events: none; max-width: 300px; padding: 1rem 1.25rem; border-radius: 0.75rem; opacity: 0; transform: translateY(4px); background: linear-gradient(135deg, var(--gl-tip-1) 0%, var(--gl-tip-2) 100%); border: 1px solid var(--gl-tip-border); box-shadow: 0 8px 24px rgba(0,0,0,0.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: 'Inter', -apple-system, sans-serif; transition: opacity 120ms var(--gl-ease), transform 120ms var(--gl-ease); }
.gl-tip.is-on { opacity: 1; transform: none; }
.gl-tip__h { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; letter-spacing: 0.3px; color: var(--gl-tip-title); margin-bottom: 0.5rem; }
.gl-tip__h i { font-size: 12px; }
.gl-tip__b { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.85); }
.gl-tip__cta { margin-top: 0.5rem; font-size: 12.5px; font-weight: 600; color: var(--gl-cyan); }

/* ---- Toast ------------------------------------------------------------- */
.gl-toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); z-index: 6200; padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; color: #f1f5f9; background: linear-gradient(135deg, var(--gl-tip-1) 0%, var(--gl-tip-2) 100%); border: 1px solid var(--gl-modal-border); box-shadow: 0 8px 24px rgba(0,0,0,0.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity 300ms var(--gl-ease), transform 300ms var(--gl-ease); font-family: 'Inter', -apple-system, sans-serif; }
.gl-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .gl-wall__card, .gl-toast, .gl-tip { animation: none !important; transition: none !important; } }
