/* RackApp public demo frame (demo build only, js/embed.js). Built from the same tokens as the app. */

.ra-boot { min-height: 60vh; display: grid; place-items: center; font: 500 15px/1.4 var(--font-body); color: var(--ink-2); }
.is-embed, .is-embed body { height: 100%; overflow: hidden; }
.em { height: 100%; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }

.em-bar { flex: none; display: flex; align-items: center; gap: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: max(8px, env(safe-area-inset-top, 0px)); padding-bottom: 8px;
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.em--wide .em-bar { justify-content: space-between; flex-wrap: wrap; }
.em-brand { display: flex; align-items: center; gap: 8px; }
.em-brand-name { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: 0.01em; }
.em-badge { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.6;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 0 8px; }
.em-views .seg-opt { white-space: nowrap; }
.em-views--grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.em-views--grid .seg-opt { min-height: 44px; font-size: 14px; }
/* a demo iframe beside the page copy is ~720 px wide: keep the bar on one line */
.em-back { margin-right: 6px; }
@media (max-width: 980px) {
  .em-brand-name { display: none; }
  .em--wide .em-restart .btn-label, .em--wide .em-back .btn-label { display: none; }
  .em--wide .em-restart, .em--wide .em-back { padding: 0 10px; }
}

.em-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.em-stage { position: relative; min-width: 0; min-height: 0; overflow: auto; background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1.3px); background-size: 22px 22px; }
.em-stage.stage--app { overflow: hidden; display: flex; }
.em-stage .browser { width: calc(100% - 32px); margin: 16px auto 32px; }
.em-stage--full { flex: 1; overflow: hidden; background: var(--app-bg); background-image: none; }
.em-stage--full.em-stage--scroll { overflow-y: auto; overscroll-behavior: contain; }
.em-stage--full .phone-page .docview { padding-bottom: 32px; }

/* side panel: guided tour · all screens · options, with the call to action underneath */
.em-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.em-tabs { flex: none; margin: 12px 12px 0; }
.em-tabs .seg-opt { min-height: 36px; font-size: 13px; padding: 0 6px; }
.em-side-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 18px; }
.em-cta { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.em-cta-text { font-weight: 600; line-height: 1.4; }
.em-fine { font-size: 12px; color: var(--ink-3); }
.em-side--compact { border: 0; background: none; }
.em-side--compact .em-tabs { margin: 0; }
.em-side--compact .em-side-body { overflow: visible; padding: 16px 0 0; }
.em-side--compact .em-cta { margin-top: 16px; padding: 14px 0 0; background: none; }

/* guided tour */
.em-tasks { display: flex; flex-direction: column; gap: 14px; }
.em-tasks-head { display: flex; flex-direction: column; gap: 6px; }
.em-tasks-title { font-family: var(--font-display); font-weight: 600; font-size: 25px; line-height: 1.08; }
.em-meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.em-meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s ease; }
.em-count { font-size: 13px; color: var(--ink-3); }
.em-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.em-task { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.em-task.is-next { border-color: var(--accent-line); background: var(--accent-soft); }
.em-task.is-done { background: var(--surface-2); }
.em-task.is-done b { color: var(--ink-3); font-weight: 600; }
.em-num { grid-row: span 2; align-self: start; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface-3); color: var(--ink-2); }
.em-task.is-next .em-num { background: var(--accent); color: var(--accent-ink); }
.em-task.is-done .em-num { background: var(--accent-soft); color: var(--accent); }
.em-task-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14.5px; line-height: 1.35; }
.em-hint { color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }
.em-show { grid-column: 2; justify-self: start; font-size: 14px; }

/* all screens */
.em-screens { display: flex; flex-direction: column; gap: 14px; }
.em-group { display: flex; flex-direction: column; gap: 1px; }
.em-group-head { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 2px 8px 4px; }
.em-screen { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-align: left; line-height: 1.25; }
.em-screen:hover { background: var(--surface-2); color: var(--ink); }
.em-screen.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.em-screen svg { flex: none; color: var(--ink-3); }
.em-side--compact .em-screen { min-height: 46px; font-size: 15px; }

/* options */
.em-options { display: flex; flex-direction: column; gap: 14px; }
.em-opt { display: flex; flex-direction: column; gap: 6px; }
.em-opt-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.em-opt .seg-opt { min-height: 38px; }

/* welcome card (demo website) and the first-typing notice (embedded demo) */
.em-intro { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow-y: auto; background: var(--scrim);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.em-intro-card { width: min(100%, 460px); display: flex; flex-direction: column; gap: 14px; padding: 28px 24px 22px; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); animation: sheetUp 0.22s ease-out; }
.em-intro-brand { display: flex; align-items: center; gap: 10px; }
.em-intro-name { font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.em-intro-title { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.05; }
.em-intro-text { color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.em-intro-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.em-fine a { color: var(--accent); }
/* the notice is part of the layout, so it never covers the app: a strip under the bar on phones, a card atop the side panel when wide */
.em-notice { flex: none; display: flex; align-items: center; gap: 12px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent-line); }
.em-notice p { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.em-notice a { color: var(--accent); }
.em--compact .em-notice { border-width: 0 0 1px; padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); }
.em-side .em-notice { margin: 12px 12px 0; padding: 12px; border-radius: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
.em-side .em-notice .btn { align-self: flex-end; }

/* focus: only the phone, on the page's own background (racksafetyapp.com's hero) */
.is-focus, .is-focus body { background: transparent; color-scheme: light; }
.em--focus { background: transparent; }
/* room above for the phone's shadow and below for the finger; the shadow may spill (a clipped one draws a box) */
.em-stage--focus { flex: 1; display: flex; overflow: hidden; background: transparent; background-image: none; padding: 26px 0 56px; }
.em-stage--focus .stage-device { padding: 0 6px; overflow: visible; }
.em-stage--focus .device { box-shadow: 0 0 0 1px var(--bezel-edge), 0 14px 30px rgba(14, 23, 38, 0.2); }

/* coach: a finger that taps where to go next (pointer-events none, so it never gets in the way) */
.em-coach { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
/* the fingertip sits at (21, 3.5) of the 60 × 74 icon */
.em-finger { position: absolute; left: 0; top: 0; width: 60px; height: 74px; opacity: 0;
  transform: translate(calc(var(--x, 0px) + 40px), calc(var(--y, 0px) + 110px));
  transition: transform 0.95s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.35s ease; filter: drop-shadow(0 4px 6px rgba(14, 23, 38, 0.35)); }
.em-finger svg { display: block; transform-origin: 21px 4px; }
.em-coach.is-on .em-finger { opacity: 1; transform: translate(calc(var(--x, 0px) - 21px), calc(var(--y, 0px) - 3.5px)); }
.em-coach.is-tap .em-finger svg { animation: emTap 0.62s ease-in-out 2; }
.em-ripple { position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; border: 3px solid #1A4FB5; background: rgba(26, 79, 181, 0.12); opacity: 0; }
.em-coach.is-tap .em-ripple { animation: emRipple 0.62s ease-out 2; }
@keyframes emTap { 0%, 100% { transform: scale(1); } 45% { transform: translateY(3px) scale(0.86); } }
@keyframes emRipple {
  0% { opacity: 0.85; transform: translate(var(--x, 0px), var(--y, 0px)) scale(0.35); }
  100% { opacity: 0; transform: translate(var(--x, 0px), var(--y, 0px)) scale(1.45); }
}
@media (prefers-reduced-motion: reduce) {
  .em-finger { transition: opacity 0.2s ease; }
  .em-coach.is-tap .em-finger svg, .em-coach.is-tap .em-ripple { animation: none; }
}

/* compact: slim bar + sheet */
.em--compact .em-bar { min-height: 52px; }
.em-pill { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink); text-align: left; }
.em-pill-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.em-sheet .drawer { max-height: 92%; }
.em-sheet-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.em-sheet-body { display: flex; flex-direction: column; gap: 16px; }
