/* ============================================================
   Habits interactive demo — demo-only styles.
   Everything visual inside the app viewport comes from app.css
   (the real compiled app stylesheet); this file only styles the
   browser-chrome frame, modal, toasts, and loading animation.
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

/* Tailwind v4 resets buttons to cursor: default — everything clickable
   in the demo should read as clickable. */
button:not(:disabled),
a,
[role='button'],
select,
label[for] {
  cursor: pointer;
}

button:disabled { cursor: not-allowed; }

body {
  background: var(--marketing-background, #0a1628);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  padding: clamp(6px, 1.5vh, 20px) clamp(6px, 1.5vw, 24px);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* ---------- Fake browser chrome frame ---------- */

.demo-frame {
  width: 100%;
  max-width: 1600px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.demo-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: clamp(7px, 1.2vh, 12px) 18px;
  background: #000;
  flex-shrink: 0;
}

.demo-chrome-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #9ca3af;
}

.demo-chrome-nav svg { display: block; }

.demo-chrome-url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 16px;
  color: #e5e7eb;
  font-size: 13px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.demo-chrome-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(109, 210, 51, 0.12);
  border: 1px solid rgba(109, 210, 51, 0.45);
  color: #6dd233;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 150ms ease;
}

.demo-chrome-badge:hover { background: rgba(109, 210, 51, 0.22); }

.demo-chrome-btn {
  display: none;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease;
}

.demo-chrome-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* Persistent exit back to the marketing site — same pill as
   .demo-chrome-btn but always visible (that one is scene-toggled). */
.demo-chrome-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 150ms ease;
}

.demo-chrome-link:hover { background: rgba(255, 255, 255, 0.15); }

.demo-chrome-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6dd233;
  animation: demo-pulse 2s ease-in-out infinite;
}

@keyframes demo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Left-nav skeleton loading state — every sidebar item except Engagement
   Engine (the page the demo actually opens on) shows a shimmering
   placeholder, sized/positioned to match Engagement Engine's real
   36px icon circle and label (measured via getBoundingClientRect,
   not the nominal 48px h-12 -- the app's rem scale renders smaller). */
.nav-skel {
  pointer-events: none;
  cursor: default;
}

.nav-skel .group > * {
  visibility: hidden;
}

.nav-skel .group::before,
.nav-skel .group::after {
  content: '';
  position: absolute;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-skel .group::before {
  left: 0;
  top: 6px;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
}

.nav-skel .group::after {
  left: 48px;
  top: 15px;
  width: 132px;
  height: 16px;
}

.demo-viewport {
  flex: 1;
  min-height: 0;
  background: #000000;
}

/* The app shell markup uses h-screen in the real app; inside the
   frame it should fill the viewport div instead. */
.demo-viewport .app-shell { height: 100%; }

/* The app sidebar has no internal scroll in the real app (it assumes a
   tall h-screen). Inside the flexible frame it must scroll on short
   windows instead of clipping the Support/account buttons. Desktop
   only — at mobile widths the sidebar stacks above the content and
   min-height: 0 would let flexbox collapse it. */
@media (min-width: 768px) {
  #scene-app > div:first-child {
    overflow-y: auto !important;
    min-height: 0;
    scrollbar-width: none;
  }

  #scene-app > div:first-child::-webkit-scrollbar { display: none; }
}

/* ---------- Loading / generation animation ---------- */

.demo-gen {
  border: 1px solid rgba(109, 210, 51, 0.4);
  background: var(--brand-primary-light, #e8f8d9);
  border-radius: 12px;
  padding: 22px 24px;
  margin-top: 12px;
}

.demo-gen-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-text, #f4f4f6);
  font-size: 13px;
  font-weight: 500;
  min-height: 20px;
}

.demo-gen-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(109, 210, 51, 0.25);
  border-top-color: #6dd233;
  animation: demo-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes demo-spin { to { transform: rotate(360deg); } }

.demo-gen-bar {
  margin-top: 16px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.demo-gen-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ea922, #6dd233);
  transition: width 600ms ease;
}

.demo-gen-hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-secondary, #9ca3af);
  opacity: 0.75;
}

.demo-fade-in { animation: demo-fade-in 500ms ease both; }

@keyframes demo-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Toast ---------- */

.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 16px);
  background: var(--brand-navy, #002153);
  border: 1px solid rgba(109, 210, 51, 0.35);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.45;
  border-radius: 12px;
  padding: 12px 18px;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 110;
}

.demo-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Email gate modal ---------- */

.demo-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay, rgba(0, 0, 0, 0.65));
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  padding: 20px;
}

.demo-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.demo-modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--theme-modal-bg, #121c2e);
  border: 1px solid var(--theme-modal-border, rgba(255, 255, 255, 0.08));
  border-radius: 20px;
  padding: 30px 32px 28px;
  color: var(--theme-modal-text, #f4f4f6);
  position: relative;
  transform: translateY(14px) scale(0.98);
  transition: transform 220ms ease;
}

.demo-modal-overlay.open .demo-modal { transform: translateY(0) scale(1); }

#demo-welcome .demo-modal {
  text-align: center;
}

#demo-gate-step-form h3,
#demo-gate-step-form > p,
#demo-gate-step-done h3,
#demo-gate-step-done > p {
  text-align: center;
}

.demo-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--marketing-text-secondary, #9ca3af);
  cursor: pointer;
  padding: 6px;
  line-height: 0;
  border-radius: 8px;
}

.demo-modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.demo-modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Nudge these two titles up slightly within their modal (Brandon). */
#demo-welcome-title,
#demo-gate-title {
  margin-top: -8px;
}

.demo-modal p {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--marketing-text-secondary, #9ca3af);
}

.demo-modal input[type="email"] {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--modal-input-border, rgba(255, 255, 255, 0.08));
  background: var(--modal-input-bg, rgba(255, 255, 255, 0.04));
  color: var(--modal-input-text, #f4f4f6);
  font-size: 15px;
  font-family: inherit;
  padding: 0 16px;
  outline: none;
  margin-bottom: 12px;
}

.demo-modal input[type="email"]:focus { border-color: #6dd233; }

.demo-modal input[type="email"]::placeholder { color: var(--modal-input-placeholder, #6b7280); }

.demo-modal-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--brand-primary, #6dd233);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 150ms ease;
}

.demo-modal-submit:hover { filter: brightness(1.07); }

.demo-modal-skip {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--marketing-text-muted, #6b7280);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px;
}

.demo-modal-skip:hover { color: var(--marketing-text-secondary, #9ca3af); }

.demo-modal-error {
  color: #f87171;
  font-size: 12px;
  margin: -6px 0 10px;
  display: none;
}

.demo-modal-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed rgba(109, 210, 51, 0.5);
  background: rgba(109, 210, 51, 0.08);
  border-radius: 12px;
  padding: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #6dd233;
  margin-bottom: 14px;
  cursor: pointer;
}

/* ---------- LinkedIn / extension scene ---------- */

.demo-linkedin {
  display: flex;
  height: 100%;
  background: #f4f2ee;
  color: #1d1d1d;
  font-family: 'Inter', -apple-system, sans-serif;
  overflow: hidden;
  position: relative;
}

.demo-li-page {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-bottom: 40px;
}

.demo-li-card {
  margin: 16px 24px 0 24px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.demo-li-banner {
  height: 160px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #081a2e 0%, #081a2e 32%, #1d5a96 100%);
}

.demo-li-banner::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -40px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.demo-li-banner::after {
  content: "";
  position: absolute;
  bottom: -110px;
  left: 170px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.demo-li-banner-brand {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
}

.demo-li-banner-line {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  max-width: 360px;
}

.demo-li-banner-line em {
  font-style: normal;
  color: #6dd233;
}

.demo-li-avatar {
  position: absolute;
  top: 102px;
  left: 24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(135deg, #003070, #002153);
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.demo-li-body { padding: 66px 24px 20px; }

.demo-li-body h2 {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-li-degree { font-size: 14px; font-weight: 400; color: #56687a; }
.demo-li-headline { margin: 0 0 6px; font-size: 15px; }
.demo-li-meta { margin: 0 0 2px; font-size: 13px; color: #56687a; }
.demo-li-meta button { background: none; border: none; color: #0a66c2; font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.demo-li-link { margin: 0 0 6px; font-size: 13.5px; color: #0a66c2; font-weight: 600; }
.demo-li-followers { margin: 0 0 14px; font-size: 13.5px; color: #56687a; font-weight: 600; }

.demo-li-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.demo-li-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  border: 1px solid #0a66c2;
  background: #fff;
  color: #0a66c2;
}

.demo-li-btn--primary { background: #0a66c2; color: #fff; }

.demo-li-section { padding: 18px 24px; }
.demo-li-section h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.demo-li-section:last-child { margin-bottom: 16px; }

.demo-li-clamp p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: #1d1d1d; }
.demo-li-clamp p:last-child { margin-bottom: 0; }

/* collapsed state mimics LinkedIn's 3-line truncation */
.demo-li-clamp:not(.demo-li-clamp--open) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.demo-li-more {
  background: none;
  border: none;
  padding: 2px 0 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #56687a;
  cursor: pointer;
}

.demo-li-more:hover { color: #0a66c2; text-decoration: underline; }

/* posts (Featured + Activity) */
.demo-li-activity-followers { margin: -6px 0 10px; font-size: 13px; color: #56687a; }

.demo-li-pills { display: flex; gap: 8px; margin-bottom: 14px; }

.demo-li-pill {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 14px;
  border: 1px solid #56687a;
  background: #fff;
  color: #56687a;
  cursor: pointer;
}

.demo-li-pill--active { background: #01754f; border-color: #01754f; color: #fff; }

.demo-li-post {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 14px 16px 12px;
  margin-bottom: 12px;
}

.demo-li-post:last-of-type { margin-bottom: 0; }

.demo-li-post-head { display: flex; gap: 10px; margin-bottom: 10px; }
.demo-li-post-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.demo-li-post-name { margin: 0; font-size: 14px; font-weight: 600; color: #1d1d1d; }
.demo-li-post-name span { font-weight: 400; color: #56687a; }
.demo-li-post-sub { margin: 0; font-size: 12px; color: #56687a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.demo-li-post-time { margin: 1px 0 0; font-size: 12px; color: #56687a; display: flex; align-items: center; gap: 3px; }

.demo-li-post-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12.5px;
  color: #56687a;
}

.demo-li-reactions { display: inline-flex; align-items: center; gap: 4px; }

/* Reaction pills. The glyph is a white SVG masked over the reaction colour,
   the way LinkedIn draws them — not an emoji, which would render in a
   different style on every OS and be the only emoji on the site. */
.demo-li-reaction {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 9px 9px;
}

.demo-li-reaction--like {
  background-color: #378fe9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z'/%3E%3C/svg%3E");
}

.demo-li-reaction--celebrate {
  margin-left: -7px;
  background-color: #6dae4f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.demo-li-reaction--support {
  margin-left: -7px;
  background-color: #df704d;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

.demo-li-linkcard {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #f8f8f5;
  font-family: inherit;
  cursor: pointer;
}

.demo-li-linkcard:hover { background: #eef3f8; }
.demo-li-linkcard-title { display: block; font-size: 13.5px; font-weight: 600; color: #1d1d1d; }
.demo-li-linkcard-domain { display: block; margin-top: 2px; font-size: 12px; color: #56687a; }

.demo-li-showall {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #56687a;
  cursor: pointer;
}

.demo-li-showall:hover { color: #0a66c2; }

/* experience / education rows */
.demo-li-exp { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.demo-li-exp:last-child { border-bottom: none; padding-bottom: 0; }

.demo-li-exp-logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.demo-li-exp-logo img { width: 100%; height: 100%; object-fit: cover; }

.demo-li-exp-logo--habits { background: #0a1628; }
.demo-li-exp-logo--habits img { width: 26px; height: 26px; object-fit: contain; }

.demo-li-exp-title { margin: 0; font-size: 14px; font-weight: 600; color: #1d1d1d; }
.demo-li-exp-org { margin: 0; font-size: 13px; color: #1d1d1d; }
.demo-li-exp-dates { margin: 1px 0 0; font-size: 12.5px; color: #56687a; }
.demo-li-exp-desc { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: #1d1d1d; }

.demo-li-exp-sub { margin-top: 10px; padding-left: 14px; border-left: 2px solid rgba(0, 0, 0, 0.08); }

.demo-ext-panel {
  width: 400px;
  flex-shrink: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  background: #f4f4f6;
  display: flex;
  flex-direction: column;
}

.demo-ext-panel iframe { flex: 1; width: 100%; border: none; }

@media (max-width: 1100px) {
  .demo-ext-panel { width: 340px; }
}

/* Narrow screens: stack the LinkedIn page and the extension panel,
   letting the scene scroll as one page. */
@media (max-width: 900px) {
  .demo-linkedin {
    flex-direction: column;
    overflow-y: auto;
  }
  .demo-li-page {
    flex: none;
    overflow: visible;
    padding-bottom: 16px;
  }
  .demo-ext-panel {
    width: 100%;
    flex: none;
    height: 70vh;
    min-height: 480px;
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
  }
}

/* ---------- Guided tour ---------- */

.demo-tour-card {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 85;
  width: 340px;
  max-width: calc(100vw - 40px);
  background: var(--brand-primary-light, #e8f8d9);
  border: 1px solid rgba(109, 210, 51, 0.45);
  border-radius: 16px;
  padding: 18px 20px 16px;
  color: var(--marketing-text-primary, #f4f4f6);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  display: none;
}

.demo-tour-card.show { display: block; animation: demo-fade-in 300ms ease; }

/* Flip to the bottom-left when the highlighted control sits on the
   right half of the screen, so the card never covers its own target. */
.demo-tour-card--left {
  right: auto;
  left: 28px;
}

.demo-tour-step {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6dd233;
  font-weight: 700;
}

.demo-tour-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--marketing-text-secondary, #9ca3af);
}

.demo-tour-text b { color: var(--marketing-text-primary, #f4f4f6); font-weight: 600; }

.demo-tour-hint {
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6dd233;
}

.demo-tour-hint.hidden,
.demo-tour-next.hidden { display: none; }

.demo-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.demo-tour-next {
  background: var(--brand-primary, #6dd233);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: filter 150ms ease;
}

.demo-tour-next:hover { filter: brightness(1.07); }

.demo-tour-skip {
  background: none;
  border: none;
  color: var(--marketing-text-muted, #6b7280);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
}

.demo-tour-skip:hover { color: var(--marketing-text-secondary, #9ca3af); }

.demo-tour-left { display: flex; align-items: center; gap: 12px; }

.demo-tour-back {
  background: none;
  border: none;
  color: var(--marketing-text-muted, #6b7280);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
}

.demo-tour-back:hover { color: var(--marketing-text-secondary, #9ca3af); }
.demo-tour-back.hidden { display: none; }

/* Floating highlight ring — tracks the current tour target on screen
   (works across the extension iframe boundary, unlike a CSS class on
   the element) and pulses expanding ripples for motion. */
#demo-tour-ring {
  position: fixed;
  z-index: 84;
  pointer-events: none;
  border: 3px solid #6dd233;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(109, 210, 51, 0.35);
  display: none;
}

#demo-tour-ring.show { display: block; }

#demo-tour-ring::before,
#demo-tour-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  animation: demo-ring-ripple 1.6s ease-out infinite;
}

#demo-tour-ring::after { animation-delay: 0.8s; }

@keyframes demo-ring-ripple {
  0%   { box-shadow: 0 0 0 0 rgba(109, 210, 51, 0.65); }
  100% { box-shadow: 0 0 0 18px rgba(109, 210, 51, 0); }
}

/* ---------- Small fixes inside the app viewport ---------- */

/* Sources rendered without live URLs (placeholder data) */
.demo-source-pending { color: var(--text-secondary, #9ca3af); }

/* Keyboard focus ring consistency inside demo */
.demo-viewport button:focus-visible { outline: 2px solid rgba(109, 210, 51, 0.6); outline-offset: 2px; }

@media (max-width: 900px) {
  body { padding: 0; }
  .demo-frame { border-radius: 0; border: none; }
  .demo-chrome-url { display: none; }
}

/* Tight phone widths: keep the back-to-website pill as an icon so it
   doesn't crowd the "try it free" badge. */
@media (max-width: 560px) {
  .demo-chrome-link .demo-chrome-link-label { display: none; }
  .demo-chrome-link { padding: 6px 9px; }
}

/* Compact sidebar: the real app's sidebar assumes a tall desktop
   screen; denser sizing keeps the full nav, extension card, and
   account button in view and reads more professional. */
@media (min-width: 768px) {
  #scene-app > div:first-child .bg-sidebar-panel { padding: 14px; }

  #scene-app > div:first-child nav > a > div {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  #scene-app > div:first-child nav .h-12 {
    height: 2.25rem;
    width: 2.25rem;
  }

  #scene-app > div:first-child .w-10 { width: 1.9rem; }

  #scene-app > div:first-child span.text-\[28px\] {
    font-size: 21px;
    line-height: 30px;
  }

  #scene-app > div:first-child .h-\[74px\] { height: 52px; }

  #scene-app .sidebar-nav-label { font-size: 13.5px; }

  #scene-app > div:first-child .text-\[15px\] { font-size: 13.5px; }

  #scene-app > div:first-child .text-\[12\.5px\] { font-size: 11.5px; }
}

/* Denser type inside the app scene — the real app's 18px inputs and
   60px field heights eat vertical space the demo frame doesn't have. */
#scene-app .text-\[18px\],
#scene-app .md\:text-\[18px\],
#scene-app .sm\:text-\[16px\] { font-size: 14px !important; }

#scene-app input.h-\[60px\],
#scene-app .md\:h-\[60px\] { height: 42px !important; }

#scene-app textarea.h-\[120px\] { height: 84px !important; }

#scene-app .md\:text-\[32px\] { font-size: 24px !important; }
#scene-app .md\:leading-\[44px\] { line-height: 32px !important; }

#scene-app .h-\[50px\] { height: 40px !important; }
#scene-app .w-\[50px\] { width: 40px !important; }

/* Narrow screens: the app shell stacks sidebar above content (its
   native sub-md layout), so let the whole shell scroll as one page. */
@media (max-width: 767px) {
  #scene-app { overflow-y: auto !important; }
  #dashboard-content { overflow: visible !important; }
}

/* ============================================================
   Mobile handoff — on small screens the demo itself is hidden
   and we show an email-capture panel that sends the visitor
   the demo link to open on desktop.
   ============================================================ */

#demo-handoff { display: none; }

@media (max-width: 899px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
    padding: 24px 20px 40px;
    align-items: flex-start;
  }

  /* hide the demo shell and its overlays */
  .demo-frame,
  #demo-tour-card,
  #demo-welcome,
  #demo-gate,
  #demo-toast,
  #demo-tour-ring { display: none !important; }

  #demo-handoff {
    display: flex;
    justify-content: center;
    width: 100%;
  }
}

.demo-handoff-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.demo-handoff-logo {
  height: 40px;
  width: auto;
  margin: 4px auto 32px;
  display: block;
}

#demo-handoff h1 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--marketing-text-primary, #f4f4f6);
  letter-spacing: -0.02em;
}

#demo-handoff p {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--marketing-text-secondary, #9ca3af);
}

#demo-handoff p strong { color: var(--marketing-text-primary, #f4f4f6); }

.demo-handoff-sub { margin-top: 8px; }

#demo-handoff form { margin: 28px 0 10px; }

#demo-handoff input[type="email"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f0f0f2;
  color: #111111;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  margin-bottom: 14px;
}

#demo-handoff input[type="email"]:focus { border-color: #6dd233; }

#demo-handoff .demo-modal-submit {
  width: 100%;
  display: block;
  text-align: center;
  text-decoration: none;
}

.demo-handoff-back {
  display: inline-block;
  margin-top: 24px;
  font-size: 13px;
  color: var(--marketing-text-muted, #6b7280);
  text-decoration: none;
}

.demo-handoff-back:hover { color: var(--marketing-text-secondary, #9ca3af); }

.demo-handoff-done-cta { margin-top: 6px; }

/* handoff success: centered anchor CTA + copyable demo link */
#demo-handoff .demo-handoff-done-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.demo-handoff-link {
  position: relative;
  user-select: none;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.demo-handoff-link[data-copied]::after {
  content: 'Copied ✓';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #6dd233;
  background: var(--marketing-background, #0a1628);
  padding: 2px 6px;
  border-radius: 6px;
}

/* short phone screens: compress the handoff so it fits without feeling cramped */
@media (max-width: 899px) and (max-height: 760px) {
  .demo-handoff-logo { height: 30px; margin: 0 auto 20px; }
  #demo-handoff h1 { font-size: 20px; margin-bottom: 12px; }
  #demo-handoff p { font-size: 13.5px; margin-bottom: 14px; }
  #demo-handoff form { margin-top: 18px; }
  body { padding-top: 16px; }
}

/* ---------- Sidebar nav: Engagement Engine / Signals active state ---------- */
.demo-nav-icon--active { background: var(--brand-primary) !important; color: var(--sidebar-fg) !important; }
.demo-nav-label--active { color: var(--sidebar-fg) !important; }

.signals-nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.signals-nav-badge.hidden { display: none; }

/* ---------- Signals page ---------- */
.signal-card {
  border: 1px solid var(--ee-card-border, #DCDCE8);
  background: var(--ee-card-bg, #FFFFFF);
  border-radius: 16px;
  padding: 20px 22px;
}

/* Head row splits title (left) and the match tag (top-right of the card,
   Brandon) instead of stacking the tag below the headline. */
.signal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.signal-card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ee-green, #4ccf00); flex-shrink: 0; }
.signal-card-head h3 { font-size: 16px; font-weight: 700; color: var(--ee-text, #111111); margin: 0; }
.signal-meta { font-size: 12.5px; color: var(--ee-text-muted, #555555); margin: 0 0 8px; }
.signal-headline { font-size: 14px; color: var(--ee-text, #111111); line-height: 1.5; margin: 0 0 6px; }

/* Font-size matches .signal-meta (the company name's size), not the old
   12px, and flex-shrink:0 keeps it from squeezing against a long title
   (Brandon). */
.signal-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  border: 1px solid var(--ee-divider, #DCDCE8);
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ee-text-muted, #555555);
}

.signal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.signal-btn {
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--ee-tab-inactive-border, #DCDCE8);
  background: var(--ee-tab-inactive-bg, rgba(0, 33, 83, 0.03));
  color: var(--ee-text-muted, #555555);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.signal-btn:hover { opacity: 0.8; }
.signal-btn--primary {
  border-color: var(--ee-green, #4ccf00);
  background: var(--ee-green, #4ccf00);
  color: #fff;
}

.signals-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ee-text-muted, #555555);
}
.signals-rows { display: flex; align-items: center; gap: 8px; }
.signals-rows-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--ee-divider, #DCDCE8);
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
  color: var(--ee-text, #111111);
}
.signals-pager { display: flex; align-items: center; gap: 10px; }
.signals-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--ee-divider, #DCDCE8);
  background: transparent;
  color: var(--ee-text-muted, #555555);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Nudge the Audience Brief / Company Brief panels' content (title down
   to the nested fieldset) up a little inside their box - override just
   the top inset of the app.css .p-7 padding. */
#intel-panel-people,
#intel-panel-companies {
  padding-top: 20px;
}
