/* MacAutomate v3 One-Page Interactive Stylesheet
   1. Hero Live macOS Desktop Sandbox + Real App Screenshot Switcher
   2. Enchanted Fantasy Cursor Overlay (0,0 hotspot, velocity banking, shockwaves, 8 sparks, aurora trail)
   3. Sticky 4-Chapter Safeguard Walkthrough (Interactive UI <-> Actual macOS Screenshot)
   4. Interactive Before/After Scrubber + Personal Routine Time Calculator
   5. Local-First Data Utilities, FAQs, Closing Conversion & Native <dialog> Legal Sheets
   6. Subtle Desktop One-Page Chapter Rail */

/* Cursor-Tracking Subtle Border Highlight */
.spotlight-surface {
  position: relative;
  --mouse-x: 50%;
  --mouse-y: 0%;
}

.spotlight-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    360px circle at var(--mouse-x) var(--mouse-y),
    rgba(24, 24, 27, 0.24),
    rgba(24, 24, 27, 0.04) 46%,
    transparent 72%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: 5;
}

.spotlight-surface:hover::after {
  opacity: 1;
}

/* Subtle Hero Entrance (once on load, never hides content when JS is slow or reduced-motion is on) */
@keyframes hero-settle {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.hero-enter {
  animation: hero-settle 620ms var(--ease-out) both;
}

.hero-enter--delay {
  animation: hero-settle 680ms 90ms var(--ease-out) both;
}

.hero-enter--stage {
  animation: hero-settle 760ms 150ms var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .hero-enter,
  .hero-enter--delay,
  .hero-enter--stage {
    animation: none;
  }
  .spotlight-surface::after { display: none; }
}

/* --------------------------------------------------------------------------
   FLOATING ONE-PAGE CHAPTER RAIL (Desktop-Only Orientation Ticks)
   -------------------------------------------------------------------------- */
.chapter-rail {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

@media (min-width: 1380px) {
  .chapter-rail { display: flex; }
}

.chapter-rail__btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 5px 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--color-muted-foreground);
  transition: color 150ms ease;
}

.chapter-rail__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  color: var(--color-foreground);
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity 160ms var(--ease-out), transform 180ms var(--ease-out);
  white-space: nowrap;
}

.chapter-rail__btn:hover .chapter-rail__label,
.chapter-rail__btn:focus-visible .chapter-rail__label {
  opacity: 1;
  transform: translateX(0);
}

.chapter-rail__tick {
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #CBD5E1;
  transition: transform 200ms var(--ease-out), background-color 180ms ease;
  transform-origin: right center;
}

.chapter-rail__btn:hover .chapter-rail__tick {
  background: #64748B;
  transform: scaleX(1.35);
}

.chapter-rail__btn[aria-current="location"] .chapter-rail__tick {
  background: var(--color-primary);
  transform: scaleX(1.85);
}

/* --------------------------------------------------------------------------
   STAGE 1: Product-As-Hero + Direct Download Card
   -------------------------------------------------------------------------- */
.hero-section {
  padding: clamp(22px, 3vw, 40px) 0 clamp(56px, 6.5vw, 88px);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: clamp(24px, 3vw, 34px);
}

@media (min-width: 1024px) {
  .hero-top {
    grid-template-columns: minmax(0, 1.32fr) minmax(350px, 0.82fr);
    gap: 38px;
    align-items: center;
  }
}

.hero-copy {
  display: grid;
  gap: 15px;
}

.hero-copy h1 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 3.1vw + 15px, 52px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.032em;
  max-inline-size: 19ch;
  text-wrap: balance;
}

.hero-lead {
  font-size: clamp(16px, 0.3vw + 15px, 18.5px);
  line-height: 1.54;
  color: var(--color-secondary);
  max-width: 58ch;
}

.hero-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-muted-foreground);
}

.hero-trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-trust-strip svg {
  width: 15px;
  height: 15px;
  color: var(--status-ok);
  flex: none;
}

/* Single-Goal Conversion Card Above the Fold */
.download-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: clamp(18px, 2.2vw, 24px);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 14px;
}

.download-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.download-card__badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--status-ok-bg);
  color: var(--status-ok);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.download-card__ver {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted-foreground);
  white-space: nowrap;
}

.download-card .btn-cta {
  width: 100%;
}

.reassure-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 9px;
  font-size: 12.5px;
  color: var(--color-muted-foreground);
}

.sha-copy-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--color-border-strong);
  background: #FAFAFA;
  color: var(--color-secondary);
  font-size: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.sha-copy-btn:hover { background: #F4F4F5; border-color: var(--color-border-control); }
.sha-copy-btn__hash { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sha-copy-btn__label { font-weight: 600; color: var(--color-foreground); }
.sha-copy-btn__action { font-weight: 600; color: var(--color-primary); flex: none; }

/* --------------------------------------------------------------------------
   SHARED NATIVE MACOS SEGMENTED VIEW SWITCH (Interactive UI <-> Real Screenshot)
   -------------------------------------------------------------------------- */
.view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 9px;
  background: #E4E4E7;
  border: 1px solid rgba(9, 9, 11, 0.08);
  gap: 2px;
}

.view-switch__btn {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.view-switch__btn:hover {
  color: var(--color-foreground);
}

.view-switch__btn[aria-pressed="true"] {
  background: #FFFFFF;
  color: var(--color-foreground);
  box-shadow: 0 1px 3px rgba(9, 9, 11, 0.12);
}

/* Real macOS Screenshot Frame inside Interactive Windows */
.real-shot-stage {
  display: grid;
  gap: 14px;
  align-content: start;
}

.real-shot-stage[hidden] {
  display: none;
}

.real-shot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.real-shot-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.real-shot-frame {
  border-radius: 12px;
  border: 1px solid var(--color-border-strong);
  background: #F4F4F6;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(9, 9, 11, 0.08);
}

.real-shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  margin-inline: auto;
  background: #FFFFFF;
}

.real-shot-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  align-items: start;
}

@media (min-width: 900px) {
  .real-shot-split {
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.65fr);
  }
}

.real-shot-split[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   HERO LIVE MACOS DESKTOP SANDBOX
   -------------------------------------------------------------------------- */
.desktop-sandbox-shell {
  display: grid;
  gap: 12px;
}

.sandbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.sandbox-toolbar__left,
.sandbox-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 13px;
  border-radius: 9px;
  border: 1px solid var(--color-border-strong);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-foreground);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-spring), background-color 140ms ease, border-color 140ms ease;
}

.sb-btn:hover { background: #F4F4F5; border-color: var(--color-border-control); }
.sb-btn:active { transform: scale(0.97); }

.sb-btn--record[aria-pressed="true"] {
  background: var(--rec-red-bg);
  border-color: #FCA5A5;
  color: #991B1B;
}

.sb-rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rec-red);
  flex: none;
}

.sb-btn--record[aria-pressed="true"] .sb-rec-dot {
  animation: rec-pulse 1s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.45; }
}

.sb-btn--play {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.sb-btn--play:hover { background: #27272A; color: #FFFFFF; border-color: #27272A; }

.sb-btn--stop {
  background: #FAFAFA;
}

.sb-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-secondary);
}

.sb-mode-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-ok);
  flex: none;
}

/* Simulated macOS Desktop Frame */
.mac-desktop {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(9, 9, 11, 0.12);
  box-shadow: var(--shadow-mac);
  background:
    radial-gradient(900px 380px at 18% 0%, rgba(228, 228, 231, 0.65), transparent 70%),
    linear-gradient(180deg, #F4F4F6 0%, #EAEAEF 100%);
  overflow: hidden;
  isolation: isolate;
}

/* Native macOS Top Menu Bar inside Sandbox */
.os-menubar {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 5px 14px;
  background: rgba(24, 24, 27, 0.94);
  color: #F4F4F5;
  font-size: 12px;
  user-select: none;
}

.os-menubar__left,
.os-menubar__right {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.os-menubar__menus {
  display: inline-flex;
  gap: 12px;
  color: #CBD5E1;
}

@media (max-width: 680px) {
  .os-menubar__menus { display: none; }
}

.os-TrayBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms ease;
}

.os-TrayBtn:hover,
.os-TrayBtn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.22);
}

.os-TrayBtn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
}

.os-TrayBtn[data-tray-state="recording"] .os-TrayBtn__dot {
  background: #F87171;
  animation: rec-pulse 900ms infinite;
}

.os-TrayBtn[data-tray-state="playing"] .os-TrayBtn__dot {
  background: #34D399;
}

/* Authentic Menu Bar Dropdown Popover (Matches MenuModel.swift & 01-menu-bar-menu.png) */
.menubar-popover {
  position: absolute;
  top: 40px;
  right: 14px;
  width: min(312px, calc(100% - 28px));
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(9, 9, 11, 0.14);
  box-shadow: 0 18px 40px rgba(9, 9, 11, 0.22);
  padding: 8px;
  z-index: 38;
  display: grid;
  gap: 3px;
}

.menubar-popover[hidden] {
  display: none;
}

.popover-section-label {
  padding: 5px 8px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popover-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 6px;
}

.popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-foreground);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.popover-item:hover {
  background: #F4F4F5;
}

.popover-status {
  padding: 4px 9px;
  font-size: 11.5px;
  color: var(--color-muted-foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Desktop Split Canvas: Left = Simulated Mac Apps, Right = MacAutomate Live Drawer */
.desktop-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  min-height: 440px;
}

.desktop-workspace[hidden] {
  display: none;
}

@media (min-width: 980px) {
  .desktop-workspace {
    grid-template-columns: minmax(0, 1.18fr) minmax(350px, 0.92fr);
    align-items: stretch;
  }
}

.desktop-apps-stage {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  align-content: start;
}

.mini-app-win {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid rgba(9, 9, 11, 0.1);
  box-shadow: 0 6px 18px rgba(9, 9, 11, 0.06);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.mini-app-win.is-focused {
  border-color: var(--color-primary);
  box-shadow: 0 10px 26px rgba(9, 9, 11, 0.12);
}

.mini-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  background: #F8F8FA;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
}

.mini-app-bar__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-lights { display: inline-flex; gap: 5px; flex: none; }
.mini-lights i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.mini-lights i:nth-child(1) { background: var(--mac-red); }
.mini-lights i:nth-child(2) { background: var(--mac-yellow); }
.mini-lights i:nth-child(3) { background: var(--mac-green); }

.mini-app-bundle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted-foreground);
  white-space: nowrap;
}

.mini-app-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.app-target-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--color-border-strong);
  background: #FAFAFA;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 150ms var(--ease-spring), background-color 140ms ease, border-color 140ms ease;
}

.app-target-btn:hover { background: #F4F4F5; border-color: var(--color-primary); }
.app-target-btn.is-pressed { transform: translateY(1px) scale(0.94); background: #E4E4E7; border-color: var(--color-primary); }

.notes-paper {
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #FEFCE8;
  border: 1px solid #EAB308;
  font-size: 13px;
  line-height: 1.45;
  color: #18181B;
  display: grid;
  gap: 4px;
  align-content: start;
}

.notes-paper__title {
  font-weight: 700;
  font-size: 13px;
}

.notes-paper__line {
  color: #3F3F46;
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 18px;
  word-break: break-word;
}

.safari-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.safari-tabs-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.safari-tab-chip {
  padding: 3px 9px;
  border-radius: 6px;
  background: #F4F4F5;
  border: 1px solid var(--color-border);
  font-size: 11.5px;
  color: var(--color-secondary);
  transition: opacity 220ms ease;
}

.safari-tab-chip.is-archived {
  opacity: 0.42;
  text-decoration: line-through;
}

/* Quick Interactive Type Text & Real SensitiveTextClassifier Bar */
.quick-type-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--color-border);
}

.quick-type-input {
  flex: 1 1 170px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1.5px solid var(--color-border-control);
  background: #FFFFFF;
  font-size: 13.5px;
}

/* Right Side of Desktop: MacAutomate Live Scenario Editor / Scenario Manager Drawer */
.recorder-drawer {
  background: #FFFFFF;
  border-radius: 13px;
  border: 1px solid rgba(9, 9, 11, 0.12);
  box-shadow: 0 10px 28px rgba(9, 9, 11, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.recorder-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--color-border);
}

.recorder-drawer__title {
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.step-count-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-muted);
  color: var(--color-secondary);
}

.drawer-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.drawer-pane[hidden] {
  display: none;
}

.live-step-list {
  padding: 10px;
  display: grid;
  gap: 7px;
  align-content: start;
  max-height: 310px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}

.live-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--color-border);
  background: #FAFAFA;
  font-size: 12px;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms var(--ease-out);
}

.live-step-item.is-replaying {
  background: #18181B;
  color: #FFFFFF;
  border-color: #18181B;
  transform: translateX(3px);
}

.live-step-item.is-replaying .live-step-meta {
  color: #D4D4D8;
}

.live-step-item.is-done {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.live-step-item.is-secret {
  background: #FFFBEB;
  border-color: #F59E0B;
}

.live-step-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.live-step-label {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-step-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--color-muted-foreground);
  overflow-wrap: anywhere;
}

.step-secret-btn {
  margin-top: 4px;
  width: fit-content;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #D97706;
  background: #FEF3C7;
  color: #78350F;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.step-del-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--color-muted-foreground);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.step-del-btn:hover {
  background: #E4E4E7;
  color: var(--color-foreground);
}

/* Compact Real Scenario Manager Table inside Drawer Tab */
.mgr-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.mgr-mini-table th {
  text-align: left;
  padding: 7px 10px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  background: #FAFAFA;
  border-bottom: 1px solid var(--color-border);
}

.mgr-mini-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.mgr-mini-table tr:last-child td {
  border-bottom: 0;
}

.mgr-mini-name {
  font-weight: 600;
  display: block;
  color: var(--color-foreground);
}

.mgr-mini-sub {
  font-size: 11.5px;
  color: var(--color-muted-foreground);
  display: block;
}

.mgr-run-mini {
  min-width: 28px;
  min-height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border-strong);
  background: #FFFFFF;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
}

.mgr-run-mini:hover {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.recorder-drawer__foot {
  padding: 9px 12px;
  background: #FAFAFA;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--color-secondary);
}

/* Emergency Stop & Status Toast Overlay inside Desktop */
.abort-hud {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  max-width: calc(100% - 28px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.95);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(9, 9, 11, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-spring);
  z-index: 45;
  text-align: center;
}

.abort-hud.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   PHASE 2: ENCHANTED FANTASY PRECISION CURSOR OVERLAY
   Zero human finger — (0,0) star-diamond hotspot, iridescent emerald/pearl/champagne
   -------------------------------------------------------------------------- */
.gesture-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 42;
  overflow: hidden;
}

.fantasy-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0;
  transform-origin: 0 0;
  transform: translate3d(-120px, -120px, 0) rotate(0deg) scale(1);
  transition: opacity 200ms var(--ease-out);
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 16px rgba(9, 9, 11, 0.28));
}

.fantasy-cursor.is-visible {
  opacity: 1;
}

.fantasy-cursor__aura {
  position: absolute;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(248, 250, 252, 0.82) 0%,
    rgba(16, 185, 129, 0.34) 36%,
    rgba(6, 182, 212, 0.16) 62%,
    rgba(252, 211, 77, 0) 78%
  );
  transform: scale(0.9);
  transition: transform 140ms var(--ease-out), opacity 140ms ease;
}

.fantasy-cursor.is-casting .fantasy-cursor__aura {
  transform: scale(1.65);
  background: radial-gradient(
    circle,
    rgba(254, 243, 199, 0.92) 0%,
    rgba(16, 185, 129, 0.5) 38%,
    rgba(6, 182, 212, 0.24) 64%,
    transparent 78%
  );
}

.fantasy-cursor.is-sliding .fantasy-cursor__aura {
  transform: scale(1.35);
}

.fantasy-cursor__svg {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 58px;
  height: 58px;
  display: block;
  overflow: visible;
}

.fantasy-cursor__star {
  transform-box: fill-box;
  transform-origin: center;
  animation: star-pulse 2.4s ease-in-out infinite;
}

.fantasy-cursor.is-casting .fantasy-cursor__star {
  transform: scale(1.32) rotate(45deg);
}

@keyframes star-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.96; }
  50% { transform: scale(1.16) rotate(12deg); opacity: 1; }
}

/* Dual Concentric Crystalline Shockwave Rings */
.gesture-ripple,
.gesture-ripple-outer {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0) scale(0.35);
  will-change: transform, opacity;
}

.gesture-ripple {
  border: 2px solid rgba(16, 185, 129, 0.72);
  background: radial-gradient(circle, rgba(248, 250, 252, 0.55) 0%, rgba(16, 185, 129, 0.16) 52%, transparent 72%);
}

.gesture-ripple-outer {
  border: 1.5px solid rgba(6, 182, 212, 0.58);
}

.gesture-ripple.is-burst { animation: spell-ring-inner 480ms var(--ease-out) forwards; }
.gesture-ripple-outer.is-burst { animation: spell-ring-outer 620ms 45ms var(--ease-out) forwards; }

@keyframes spell-ring-inner {
  0% { opacity: 0.9; transform: translate3d(var(--rx), var(--ry), 0) scale(0.32); }
  100% { opacity: 0; transform: translate3d(var(--rx), var(--ry), 0) scale(2.1); }
}

@keyframes spell-ring-outer {
  0% { opacity: 0.72; transform: translate3d(var(--rx), var(--ry), 0) scale(0.5); }
  100% { opacity: 0; transform: translate3d(var(--rx), var(--ry), 0) scale(2.85); }
}

/* 8 GPU-Accelerated Starlight Micro-Sparks & 10 Aurora Trail Motes */
.spell-spark,
.trail-mote {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  opacity: 0;
  display: inline-grid;
  place-items: center;
  transform: translate3d(-120px, -120px, 0);
  will-change: transform, opacity;
  filter: drop-shadow(0 0 4px currentColor);
}

/* Enchanted Aurora / Stardust Ribbon Trail for slideAcross */
.gesture-comet {
  position: absolute;
  top: 0;
  left: 0;
  height: 14px;
  width: 140px;
  margin-top: -7px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(252, 211, 77, 0) 0%,
    rgba(252, 211, 77, 0.28) 28%,
    rgba(6, 182, 212, 0.36) 62%,
    rgba(16, 185, 129, 0.52) 86%,
    rgba(248, 250, 252, 0.92) 100%
  );
  filter: blur(2.5px);
  opacity: 0;
  transform-origin: right center;
  transform: translate3d(-220px, -100px, 0);
  transition: opacity 150ms ease;
  will-change: transform, opacity;
}

.gesture-comet.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .gesture-layer { display: none; }
}

/* --------------------------------------------------------------------------
   SHARED NATIVE MACOS WINDOW CHROME (Walkthrough & Local Utilities)
   -------------------------------------------------------------------------- */
.mac-window {
  position: relative;
  container-type: inline-size;
  background: var(--color-card);
  border-radius: 16px;
  box-shadow: var(--shadow-mac);
  overflow: hidden;
  border: 1px solid rgba(9, 9, 11, 0.09);
  isolation: isolate;
}

.mac-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 44px;
  padding: 8px 14px;
  background: rgba(244, 244, 246, 0.94);
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 680px) {
  .mac-titlebar { flex-wrap: nowrap; }
}

.mac-titlebar__left { display: inline-flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 auto; }
.mac-titlebar__right { display: inline-flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; }
.mac-lights { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.mac-light { width: 11px; height: 11px; border-radius: 50%; }
.mac-light--red { background: var(--mac-red); }
.mac-light--yellow { background: var(--mac-yellow); }
.mac-light--green { background: var(--mac-green); }

.mac-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-secondary);
  white-space: nowrap;
}

.demo-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-ok); }
.demo-pill[data-mode="user"] .demo-pill__dot { background: var(--color-primary); }

.demo-resume-btn {
  border: 0;
  background: transparent;
  padding: 0 3px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.mac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 7px;
  background: #F4F4F5;
  border: 1px solid #D4D4D8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-spring), background-color 140ms ease, border-color 140ms ease;
}

.mac-btn:hover { background: #E4E4E7; border-color: var(--color-border-control); }
.mac-btn--solid { background: var(--color-primary); color: #FFFFFF; border-color: var(--color-primary); }
.mac-btn--solid:hover { background: #27272A; border-color: #27272A; }

.mac-btn.is-pressed,
.app-flip-card.is-pressed {
  transform: translateY(2px) scale(0.95) !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-muted);
  color: var(--color-secondary);
  white-space: nowrap;
}

.status-pill--ok { background: var(--status-ok-bg); color: var(--status-ok); }
.status-pill--warn { background: var(--status-warn-bg); color: var(--status-warn); }
.status-pill--active { background: var(--color-primary); color: #FFFFFF; }

/* --------------------------------------------------------------------------
   STAGE 2: 4-Chapter Interactive Safeguard Walkthrough
   -------------------------------------------------------------------------- */
.story-section {
  position: relative;
  padding: clamp(56px, 7vw, 96px) 0;
  border-top: 1px solid var(--color-border);
}

.section-header {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(28px, 4vw, 44px);
  max-width: 66ch;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(26px, 2.5vw + 14px, 40px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.section-header p {
  font-size: clamp(16px, 0.25vw + 15px, 18px);
  color: var(--color-secondary);
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (min-width: 1024px) {
  .story-layout {
    grid-template-columns: minmax(310px, 0.82fr) minmax(0, 1.38fr);
    gap: 40px;
  }
  .story-stage-col {
    position: sticky;
    top: 82px;
  }
}

.story-chapters {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 24px;
}

.story-spine {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 6px;
  width: 3px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.story-spine__fill {
  width: 100%;
  height: 100%;
  transform-origin: top center;
  transform: scaleY(var(--story-progress, 0.25));
  background: linear-gradient(180deg, #09090B 0%, #15803D 100%);
  transition: transform 140ms linear;
}

.chapter-card {
  position: relative;
  text-align: left;
  width: 100%;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 180ms ease, box-shadow 200ms ease, opacity 200ms ease, transform 200ms var(--ease-out);
}

@media (min-width: 1024px) {
  .story-chapters { gap: 24px; padding-bottom: 120px; }
  .chapter-card { min-height: 210px; align-content: center; opacity: 0.62; }
  .chapter-card.is-active { opacity: 1; border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateX(4px); }
}

.chapter-card::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-card);
  border: 2px solid #94A3B8;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms var(--ease-out);
}

.chapter-card.is-active::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.2);
}

.chapter-tag { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--color-muted-foreground); }
.chapter-card.is-active .chapter-tag { color: var(--color-foreground); }
.chapter-card h3 { font-family: var(--font-heading); font-size: clamp(19px, 0.55vw + 16px, 22px); font-weight: 600; line-height: 1.22; }
.chapter-card p { font-size: 14.5px; color: var(--color-secondary); }

.stage-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.stage-tab {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease, color 140ms ease;
}

.stage-tab:hover { color: var(--color-foreground); background: #F4F4F5; }
.stage-tab[aria-selected="true"] { background: var(--color-primary); color: #FFFFFF; }

.stage-viewport {
  position: relative;
  min-height: 480px;
  padding: 20px;
  background: #FFFFFF;
}

.stage-panel { display: none; }
.stage-panel.is-active { display: grid; gap: 16px; align-content: start; animation: panel-enter 220ms var(--ease-out); }

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .stage-panel.is-active { animation: none; }
}

/* Chapter 01: 3D App Flip Grid */
.flip-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flip-stage-head p { font-size: 13px; color: var(--color-muted-foreground); }

.app-flip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  perspective: 1200px;
}

@media (max-width: 520px) {
  .app-flip-grid { grid-template-columns: minmax(0, 1fr); }
}

.app-flip-card {
  position: relative;
  height: 152px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  perspective: 1200px;
  touch-action: manipulation;
  transition: transform 300ms var(--ease-out), opacity 300ms ease;
}

.app-flip-grid.has-selection .app-flip-card:not(.is-flipped) {
  transform: scale(0.97);
  opacity: 0.64;
}

.app-flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 640ms var(--ease-spring);
}

.app-flip-card.is-flipped .app-flip-card__inner { transform: rotateY(180deg); }

.app-flip-face {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  padding: 15px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.app-flip-face--front { background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%); box-shadow: var(--shadow-sm); }
.app-flip-face--back { background: #18181B; color: #FAFAFA; border-color: #27272A; transform: rotateY(180deg); }

.app-tile-top { display: flex; align-items: center; gap: 11px; }
.app-glyph { width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; font-family: var(--font-heading); font-size: 13.5px; font-weight: 700; border: 1px solid rgba(9, 9, 11, 0.08); flex: none; }
.app-glyph--notes { background: #FEF9C3; color: #854D0E; }
.app-glyph--safari { background: #E0F2FE; color: #075985; }
.app-glyph--textedit { background: #F4F4F5; color: #18181B; }
.app-glyph--vscode { background: #E4E4E7; color: #18181B; }

.app-tile-name { font-family: var(--font-heading); font-size: 15.5px; font-weight: 600; display: block; }
.app-tile-bundle { font-family: var(--font-mono); font-size: 11px; color: var(--color-muted-foreground); display: block; overflow-wrap: anywhere; }
.app-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--color-muted-foreground); }
.flip-cue { font-weight: 600; color: var(--color-foreground); white-space: nowrap; }

.app-back-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.app-back-badge { font-family: var(--font-mono); font-size: 11.5px; padding: 2px 7px; border-radius: 999px; background: rgba(39, 201, 63, 0.18); color: #86EFAC; }
.app-back-rows { display: grid; gap: 5px; font-size: 11.5px; color: #D4D4D8; }
.app-back-row { display: flex; justify-content: space-between; gap: 8px; }
.app-back-row strong { color: #FFFFFF; font-weight: 500; text-align: right; }

.synced-step-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border-radius: 10px;
  background: #FAFAFA;
  border: 1px solid var(--color-border);
  font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
  .app-flip-card__inner { transform: none !important; transition: none; }
  .app-flip-face--back { transform: none !important; opacity: 0; pointer-events: none; }
  .app-flip-card.is-flipped .app-flip-face--front { opacity: 0; }
  .app-flip-card.is-flipped .app-flip-face--back { opacity: 1; pointer-events: auto; }
  .app-flip-grid.has-selection .app-flip-card:not(.is-flipped) { transform: none; }
}

/* Chapter 02: Aurora Slide-to-Type + 16-Action Library & Schema v2 JSON */
.slide-presets { display: flex; flex-wrap: wrap; gap: 7px; }

.preset-chip {
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--color-border-control);
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.preset-chip:hover { background: #F4F4F5; }

.preset-chip[aria-pressed="true"] {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.slide-input-box {
  border: 1.5px solid #D4D4D8;
  border-radius: 12px;
  background: #FAFAFA;
  padding: 14px;
  display: grid;
  gap: 9px;
}

.slide-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-muted-foreground);
}

.slide-meta-row strong { color: var(--color-foreground); }

.slide-track-field {
  position: relative;
  min-height: 52px;
  padding: 11px 14px;
  border-radius: 9px;
  background: #FFFFFF;
  border: 1.5px solid var(--color-border-control);
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}

.slide-track-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.11) 0%, rgba(6, 182, 212, 0.05) 65%, rgba(252, 211, 77, 0.04) 100%);
  transform-origin: left center;
  transform: scaleX(var(--slide-progress, 0));
  pointer-events: none;
}

.slide-track-beam {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #18181B 0%, #10B981 65%, #06B6D4 100%);
  transform-origin: left center;
  transform: scaleX(var(--slide-progress, 0));
  pointer-events: none;
}

.slide-tokens-wrap { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; font-size: 14.5px; font-weight: 500; }
.slide-token { display: inline-block; opacity: 0; filter: blur(5px); transform: translate3d(0, 4px, 0); transition: opacity 200ms var(--ease-out), filter 220ms var(--ease-out), transform 220ms var(--ease-spring); }
.slide-token.is-revealed { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0); }

.mac-caret { display: inline-block; width: 2px; height: 18px; background: var(--color-foreground); animation: caret-blink 950ms steps(1) infinite; }
@keyframes caret-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .slide-token { opacity: 1; filter: none; transform: none; transition: none; }
  .mac-caret { animation: none; }
}

.action-builder-box {
  border: 1px solid var(--color-border);
  border-radius: 11px;
  padding: 12px;
  background: #FFFFFF;
  display: grid;
  gap: 10px;
}

.catalog-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.catalog-list-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.catalog-pill {
  padding: 3px 8px;
  border-radius: 6px;
  background: #F4F4F5;
  border: 1px solid var(--color-border);
  font-size: 11.5px;
  color: var(--color-secondary);
}

.action-catalog-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.add-step-chip {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px dashed var(--color-border-control);
  background: #FAFAFA;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease, border-style 140ms ease;
}

.add-step-chip:hover { background: #F4F4F5; border-style: solid; border-color: var(--color-primary); }

.slide-output-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  background: #18181B;
  color: #F4F4F5;
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 195px;
  overflow: auto;
  scrollbar-width: thin;
}

/* Chapter 03: Display & Capture Review + Schedule Details */
.monitor-sim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 560px) {
  .monitor-sim-grid { grid-template-columns: minmax(0, 1fr); }
}

.monitor-card {
  border-radius: 12px;
  border: 1.5px solid var(--color-border-strong);
  background: #FAFAFA;
  padding: 13px;
  display: grid;
  gap: 6px;
  transition: opacity 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.monitor-card.is-unplugged {
  opacity: 0.72;
  border-style: dashed;
  border-color: #D97706;
  background: #FFFBEB;
}

.preflight-alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #86EFAC;
  background: #F0FDF4;
  font-size: 13px;
  color: #14532D;
  display: grid;
  gap: 4px;
}

.preflight-alert[data-pf-state="blocked"] {
  border-color: #F59E0B;
  background: #FFFBEB;
  color: #78350F;
}

.sched-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #FAFAFA;
}

/* Chapter 04: Run Logs & Observed Actions */
.exec-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.telemetry-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.telemetry-card { background: #FAFAFA; border: 1px solid var(--color-border); border-radius: 10px; padding: 11px 12px; display: grid; gap: 4px; }
.telemetry-card__label { font-size: 11.5px; color: var(--color-muted-foreground); }
.telemetry-card__val { font-family: var(--font-mono); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.telemetry-bar { height: 4px; border-radius: 999px; background: var(--color-border); overflow: hidden; }
.telemetry-bar__fill { height: 100%; width: 100%; background: var(--color-primary); transform-origin: left center; transform: scaleX(0); transition: transform 480ms var(--ease-out), background-color 220ms ease; }
.telemetry-bar__fill.is-done { background: var(--status-ok); }

.exec-steps { display: grid; gap: 7px; }
.exec-step { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--color-border); background: #FFFFFF; font-size: 12.5px; transition: border-color 180ms ease, background-color 180ms ease, transform 200ms var(--ease-out); }
.exec-step.is-running { border-color: var(--color-primary); background: #FAFAFA; transform: translateX(3px); }
.exec-step.is-done { border-color: #BBF7D0; background: #F0FDF4; }
.exec-step__left { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.exec-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #D4D4D8; display: inline-grid; place-items: center; flex: none; color: transparent; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 200ms var(--ease-spring); }
.exec-step.is-done .exec-check { background: var(--status-ok); border-color: var(--status-ok); color: #FFFFFF; transform: scale(1.06); }
.exec-step__ms { font-family: var(--font-mono); font-size: 12px; color: var(--color-muted-foreground); white-space: nowrap; }

.outcome-truth-note {
  font-size: 12px;
  color: var(--color-muted-foreground);
  padding: 8px 11px;
  border-radius: 8px;
  background: #FAFAFA;
  border: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   STAGE 3: Drag Time-Scrubber + Personal Routine Calculator
   -------------------------------------------------------------------------- */
.compare-section {
  padding: clamp(56px, 7vw, 96px) 0;
  border-top: 1px solid var(--color-border);
}

.roi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .roi-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 32px;
  }
}

.scrub-shell {
  position: relative;
  border-radius: var(--r-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: 290px;
  background: #FFFFFF;
  user-select: none;
}

.scrub-pane {
  padding: clamp(22px, 3vw, 34px) clamp(22px, 3vw, 34px) 68px;
  display: grid;
  gap: 20px;
  height: 100%;
  min-height: 300px;
  align-content: center;
}

.scrub-pane--after { background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 68%); }
.scrub-pane--before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #18181B 0%, #27272A 100%);
  color: #FAFAFA;
  clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
  z-index: 2;
}

.scrub-pane__badge { display: inline-flex; width: fit-content; max-width: 100%; white-space: nowrap; padding: 4px 11px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.scrub-pane__badge--ok { background: var(--status-ok-bg); color: var(--status-ok); }
.scrub-pane__badge--warn { background: rgba(254, 243, 199, 0.16); color: #FDE68A; }

.scrub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 640px) {
  .scrub-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .scrub-shell, .scrub-pane { min-height: 360px; }
}

.scrub-metric { display: grid; gap: 3px; }
.scrub-metric__num { font-family: var(--font-heading); font-size: clamp(21px, 1.6vw + 14px, 28px); font-weight: 700; line-height: 1.1; }
.scrub-metric__sub { font-size: 13px; opacity: 0.88; }

.scrub-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 6; touch-action: pan-y; }
.scrub-divider { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(9, 9, 11, 0.2), 0 0 16px rgba(9, 9, 11, 0.3); z-index: 5; pointer-events: none; }
.scrub-handle { position: absolute; bottom: 16px; left: 50%; width: 38px; height: 38px; margin: 0 0 0 -19px; border-radius: 50%; background: #FFFFFF; color: var(--color-foreground); border: 1.5px solid var(--color-border-strong); box-shadow: 0 6px 18px rgba(9, 9, 11, 0.22); display: grid; place-items: center; }

/* Personal Routine Time Calculator Card */
.roi-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 16px;
  align-content: space-between;
}

.roi-slider-group { display: grid; gap: 6px; }
.roi-slider-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; font-weight: 600; }
.roi-slider-label .mono { white-space: nowrap; flex: none; }
.roi-slider-input { width: 100%; min-height: 36px; accent-color: var(--color-primary); cursor: pointer; touch-action: pan-y; }

.roi-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.roi-stat {
  padding: 12px;
  border-radius: 10px;
  background: #FAFAFA;
  border: 1px solid var(--color-border);
  display: grid;
  gap: 2px;
}

.roi-stat__val { font-family: var(--font-heading); font-size: 25px; font-weight: 700; color: var(--status-ok); }
.roi-stat__lbl { font-size: 12px; color: var(--color-muted-foreground); }
.roi-formula-note { font-size: 12px; color: var(--color-muted-foreground); }

/* --------------------------------------------------------------------------
   STAGE 4 & 5: Local Utilities, Practice Button, FAQs, Closing CTA & Legal Modals
   -------------------------------------------------------------------------- */
.proof-section,
.safety-section {
  padding: clamp(56px, 7vw, 96px) 0;
  border-top: 1px solid var(--color-border);
}

.proof-grid,
.safety-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (min-width: 1024px) {
  .proof-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr); gap: 36px; }
  .safety-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 36px; }
}

.inspector-body { padding: 18px; display: grid; gap: 14px; min-height: 340px; align-content: start; }
.inspector-panel { display: none; }
.inspector-panel.is-active { display: grid; gap: 13px; }

.info-callout { padding: 12px 14px; border-radius: 10px; background: #F8FAFC; border: 1px solid var(--color-border); font-size: 13px; color: var(--color-secondary); }
.info-callout strong { display: block; color: var(--color-foreground); margin-bottom: 3px; }
.backup-list { display: grid; gap: 8px; }
.backup-row, .display-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--color-border); background: #FAFAFA; font-size: 13px; }

/* Built-in Practice Button Simulation inside Local Inspector */
.practice-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: #FAFAFA;
  text-align: center;
}

.practice-target-btn {
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1.5px solid var(--color-border-control);
  background: #FFFFFF;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-foreground);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms var(--ease-spring), background-color 140ms ease, border-color 140ms ease;
}

.practice-target-btn:hover { background: #F4F4F5; border-color: var(--color-primary); }
.practice-target-btn:active { transform: scale(0.98); background: #E4E4E7; }

.json-box { margin: 0; padding: 14px; border-radius: 10px; background: #18181B; color: #E4E4E7; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; max-height: 250px; overflow: auto; scrollbar-width: thin; }

.spec-ledger { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow-sm); }
.spec-row { display: grid; grid-template-columns: minmax(115px, 140px) minmax(0, 1fr); gap: 12px; padding: 13px 6px; border-bottom: 1px solid var(--color-border); align-items: baseline; }
.spec-row:first-child { padding-top: 4px; }
.spec-row:last-child { border-bottom: 0; padding-bottom: 4px; }
.spec-row dt { font-size: 13.5px; font-weight: 500; color: var(--color-muted-foreground); }
.spec-row dd { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

.faq-acc { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--r-xl); padding: 6px 24px; box-shadow: var(--shadow-sm); }
.faq-acc__item { border-bottom: 1px solid var(--color-border); }
.faq-acc__item:last-child { border-bottom: 0; }
.faq-acc__item > summary { list-style: none; min-height: 54px; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 16px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.faq-acc__item > summary::-webkit-details-marker { display: none; }
.faq-acc__chev { width: 18px; height: 18px; flex: none; color: var(--color-secondary); transition: transform 180ms var(--ease-out); }
.faq-acc__item[open] > summary .faq-acc__chev { transform: rotate(180deg); }
.faq-acc__body { padding: 0 0 18px; font-size: 15px; color: var(--color-secondary); }

.trust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .trust-grid { grid-template-columns: minmax(0, 1fr); } }
.trust-card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--r-md); padding: 16px; display: grid; gap: 6px; }
.trust-card__head { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 15px; font-weight: 600; }
.trust-card__head svg { width: 18px; height: 18px; flex: none; }
.trust-card p { font-size: 13.5px; color: var(--color-muted-foreground); }

.closing-section { padding: clamp(56px, 7vw, 96px) 0 max(36px, env(safe-area-inset-bottom)); border-top: 1px solid var(--color-border); }
.install-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 32px; }
@media (max-width: 767px) { .install-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.install-card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 10px; align-content: start; }
.install-num { width: 28px; height: 28px; border-radius: 999px; background: var(--color-muted); font-family: var(--font-mono); font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; }
.install-card h3 { font-family: var(--font-heading); font-size: 18px; font-weight: 600; }
.install-card p { font-size: 14.5px; color: var(--color-secondary); }

.close-cta-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 48px; }
.close-cta-wrap .btn-cta { min-height: 54px; padding: 14px 32px; font-size: 17px; }

.legal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 20px; border-top: 1px solid var(--color-border); font-size: 13.5px; color: var(--color-muted-foreground); }
.legal-links { display: inline-flex; align-items: center; gap: 12px; }

.legal-trigger {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-foreground);
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  text-underline-offset: 3px;
}

.legal-trigger:hover {
  text-decoration: underline;
  background: #F4F4F5;
}

/* --------------------------------------------------------------------------
   PHASE 4: NATIVE ACCESSIBLE MACOS SHEET <dialog class="mac-modal">
   -------------------------------------------------------------------------- */
.mac-modal {
  padding: 0;
  border: 1px solid rgba(9, 9, 11, 0.14);
  border-radius: 16px;
  background: var(--color-card);
  color: var(--color-foreground);
  box-shadow: var(--shadow-mac);
  width: min(640px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  overflow: hidden;
}

.mac-modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-sheet-in 220ms var(--ease-out);
}

.mac-modal::backdrop {
  background: rgba(9, 9, 11, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes modal-sheet-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mac-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: rgba(244, 244, 246, 0.94);
  border-bottom: 1px solid var(--color-border);
  flex: none;
}

.mac-modal__title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
}

.mac-modal__close {
  min-height: 36px;
  min-width: 44px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border-strong);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.mac-modal__close:hover {
  background: #F4F4F5;
  border-color: var(--color-border-control);
}

.mac-modal__body {
  padding: 20px 22px 24px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-secondary);
}

.mac-modal__body h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-foreground);
  margin-top: 6px;
}

.mac-modal__body code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--color-surface-subtle);
  color: var(--color-foreground);
  overflow-wrap: anywhere;
}

.mac-modal__license {
  padding: 14px;
  border-radius: 10px;
  background: #FAFAFA;
  border: 1px solid var(--color-border);
  display: grid;
  gap: 10px;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .mac-modal[open] { animation: none; }
}

/* Mobile Touch Ergonomics (>= 44px tap targets & zero overflow down to 320px) */
@media (max-width: 639px) {
  .hero-copy h1 { font-size: 30px; }
  .stage-viewport { min-height: 0; padding: 14px; }
  .telemetry-strip, .spec-row { grid-template-columns: minmax(0, 1fr); }
  .close-cta-wrap, .close-cta-wrap .btn-cta { width: 100%; }
  .faq-acc { padding: 4px 16px; }
  .sb-btn,
  .stage-tab,
  .preset-chip,
  .mac-btn,
  .app-target-btn,
  .add-step-chip,
  .view-switch__btn {
    min-height: 44px;
  }
  .desktop-workspace { padding: 12px; }
  .quick-type-input { font-size: 16px; min-height: 44px; }
}
