/* Self-contained copy of the Geist Variable latin woff2 (same file the root
   layout loads via next/font/local). Iframes have their own FontFaceSet and
   cannot inherit the parent document's @font-face rule, and next/font emits a
   hashed URL that a static asset cannot reference — so the demos vendor their
   own copy at a stable sibling path. */
@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  /* NOT `swap`. These simulations are dense, fixed-height reproductions of real
     product chrome, laid out to Geist's metrics — a fallback frame is wide
     enough to wrap toolbar rows and burst their fixed heights, which reads as a
     glitched frame mid-animation. `block` holds the text for one short period
     instead; the file is a 29 KB single fetch on the first demo mount and a
     cache hit for every demo after it. */
  font-display: block;
  font-weight: 100 900;
  src: url("./geist-latin-wght-normal.woff2") format("woff2-variations");
}

/* UI vNext asset exception: self-contained third-party interface simulation; third-party colors, branding, and geometry are preserved at this static iframe asset boundary. */
/* A compact but even type scale shared by every simulated site. */
:root {
  --font-geist-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-sans);
  --text-caption: 0.5rem;
  --text-caption--line-height: 0.6875rem;
  --text-label: 0.5625rem;
  --text-label--line-height: 0.78125rem;
  --text-body: 0.625rem;
  --text-body--line-height: 0.875rem;
  --text-title: 0.75rem;
  --text-title--line-height: 1rem;
  --text-heading: 0.8125rem;
  --text-heading--line-height: 1.0625rem;
  --text-micro: 0.4rem;
  --text-micro--line-height: 0.55rem;
  --text-xs: 0.525rem;
  --text-xs--line-height: 0.7rem;
  --text-sm: 0.6125rem;
  --text-sm--line-height: 0.875rem;
  --text-base: 0.7rem;
  --text-base--line-height: 1.05rem;
  --text-lg: 0.7875rem;
  --text-lg--line-height: 1.225rem;
  --text-xl: 0.875rem;
  --text-xl--line-height: 1.225rem;
  --text-2xl: 1.05rem;
  --text-2xl--line-height: 1.4rem;
  --text-3xl: 1.3125rem;
  --text-3xl--line-height: 1.575rem;
  --text-4xl: 1.575rem;
  --text-4xl--line-height: 1.75rem;
  --text-5xl: 2.1rem;
  --text-5xl--line-height: 2.1rem;
  --text-6xl: 2.625rem;
  --text-6xl--line-height: 2.625rem;
  --text-7xl: 3.15rem;
  --text-7xl--line-height: 3.15rem;
  --text-8xl: 4.2rem;
  --text-8xl--line-height: 4.2rem;
  --text-9xl: 5.6rem;
  --text-9xl--line-height: 5.6rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 650;
  --chrome-surface: rgba(244, 247, 252, 0.48);
  --chrome-line: rgba(24, 24, 27, 0.1);
  --sidebar-width: 304px;
}

/* The browser contains two primary surfaces: the website and the Actionbook
   sidebar. Keeping those as separate cards makes the agent boundary obvious. */
.chrome-shell {
  display: grid;
  width: 760px;
  height: 400px;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  grid-template-rows: 20px minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: var(--chrome-surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.16);
  backdrop-filter: blur(16px) saturate(1.16);
  font-family: var(--font-sans);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

/* Dots-only header strip across the full window; no tabs, no address row. */
.chrome-tab-strip {
  grid-area: 1 / 1 / 2 / -1;
  display: flex;
  min-width: 0;
  padding: 0 10px;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #5f6570;
  visibility: hidden;
}

.chrome-window-controls {
  display: flex;
  width: 38px;
  height: 100%;
  align-items: center;
  gap: 4px;
}

.chrome-window-controls i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chrome-window-controls i:nth-child(1) {
  background: #ff5f57;
}

.chrome-window-controls i:nth-child(2) {
  background: #febc2e;
}

.chrome-window-controls i:nth-child(3) {
  background: #28c840;
}

/* Flattened so the page and the sidebar sit on the shell grid. */
.chrome-workspace {
  display: contents;
}

.chrome-shell .chrome-page {
  position: relative;
  grid-area: 2 / 1 / 3 / 2;
  margin: 0 0 10px 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #f4f2ee;
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.05);
}

/* The live product marks the page itself as agent-controlled. Its blue state
   washes inward from the viewport edges instead of sitting outside the page
   as a glowing border. */
.chrome-shell .chrome-page.is-controlled {
  box-shadow:
    inset 0 0 0 1px rgba(125, 211, 252, 0.52),
    inset 0 0 30px 7px rgba(56, 189, 248, 0.18);
  transition: box-shadow 220ms ease;
}

.chrome-shell .chrome-page.is-controlled::after {
  position: absolute;
  inset: 0;
  z-index: 35;
  border-radius: inherit;
  background:
    linear-gradient(
      to right,
      rgba(56, 189, 248, 0.3),
      rgba(186, 230, 253, 0.16) 12px,
      transparent 42px
    ),
    linear-gradient(
      to left,
      rgba(56, 189, 248, 0.3),
      rgba(186, 230, 253, 0.16) 12px,
      transparent 42px
    ),
    linear-gradient(
      to bottom,
      rgba(56, 189, 248, 0.22),
      rgba(186, 230, 253, 0.12) 10px,
      transparent 34px
    ),
    linear-gradient(
      to top,
      rgba(56, 189, 248, 0.34),
      rgba(186, 230, 253, 0.18) 15px,
      transparent 50px
    );
  content: "";
  pointer-events: none;
  animation: page-control-inset 3.4s ease-in-out infinite;
  transition: opacity 220ms ease;
}

@keyframes page-control-inset {
  0%,
  100% {
    filter: brightness(0.94);
  }
  50% {
    filter: brightness(1.08);
  }
}

/* Lucide MousePointer2, kept compact for the scaled miniature UI. */
.chrome-shell .read-pointer {
  position: absolute;
  z-index: 20;
  width: 11px;
  height: 11px;
  opacity: 0;
  pointer-events: none;
}

.chrome-shell .read-pointer .pointer-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #111318;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 0.35px #fff)
    drop-shadow(0 0.7px 0.7px rgba(15, 23, 42, 0.26));
  transform: scale(calc(1 - var(--tap, 0) * 0.08));
  transform-origin: 2px 2px;
}

.chrome-shell .chrome-sidebar {
  position: relative;
  grid-area: 2 / 2 / 3 / 3;
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0 10px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.05);
}

/* Compact control badge, adapted from the real in-page Actionbook state. */
.chrome-shell .page-control-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 40;
  min-height: 25px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 9px;
  border: 1px solid rgba(56, 189, 248, 0.72);
  border-radius: 999px;
  background: rgba(18, 48, 72, 0.96);
  color: #f8fbff;
  box-shadow:
    0 0 0 1px rgba(125, 211, 252, 0.18),
    0 7px 18px rgba(15, 42, 63, 0.25);
  white-space: nowrap;
  transform: translateX(-50%);
  transition:
    opacity 220ms ease,
    visibility 0s linear 0s,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chrome-shell .page-control-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 7px rgba(56, 189, 248, 0.9);
}

.chrome-shell .page-control-label {
  color: inherit;
  font-size: var(--text-label);
  line-height: var(--text-label--line-height);
  font-weight: var(--font-weight-semibold);
}

.chrome-shell .page-control-stop {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.86);
}

.chrome-shell .page-control-stop::before {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

/* Once the output arrives the page is no longer being controlled, so the
   live receipt leaves before the completed artifact takes focus. */
.chrome-shell:has(.chat-agent.is-ready) .page-control-bar {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 5px);
  transition-delay: 0s, 220ms, 0s;
}

.chrome-shell:has(.chat-agent.is-ready) .chrome-page.is-controlled {
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.05);
}

.chrome-shell:has(.chat-agent.is-ready) .chrome-page.is-controlled::after {
  opacity: 0;
}

/* Mobile renders the Actionbook panel as the complete preview instead of
   oversizing and cropping the two-column browser. This keeps the panel truly
   centered and prevents the hidden browser surface from peeking out behind it. */
body[data-proof-layout="mobile"] .chrome-shell {
  width: var(--sidebar-width);
  grid-template-columns: 0 var(--sidebar-width);
  grid-template-rows: 0 minmax(0, 1fr);
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

body[data-proof-layout="mobile"] .chrome-page {
  display: none;
}

body[data-proof-layout="mobile"] .chrome-sidebar {
  width: var(--sidebar-width);
  margin: 0;
  border-radius: 13px;
  box-shadow: none;
}

.chrome-shell .panel-brand {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: #232428;
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
}

.chrome-shell .panel-brand .brand-mark {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

/* Chat thread: user message on the right, agent work and reply on the left. */
.chrome-shell .run-overview {
  height: calc(100% - 38px);
  display: flex;
  padding: 9px 12px 44px;
  box-sizing: border-box;
  flex-direction: column;
  gap: 8px;
}

.chrome-shell .chat-user {
  max-width: 86%;
  align-self: flex-end;
  padding: 6px 9px;
  border-radius: 9px 9px 3px 9px;
  background: #f3f4f6;
  color: #303238;
  font-size: var(--text-label);
  line-height: var(--text-label--line-height);
  opacity: 0;
  transform: translateY(4px);
}

.chrome-shell .run-flow {
  padding: 9px 10px 3px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateY(4px);
}

/* The completion message is the final beat of the same agent run, so it sits
   close to the steps instead of reading as a third, unrelated section. */
.chrome-shell .run-flow + .chat-agent {
  margin-top: -4px;
}

.chrome-shell .run-flow-title {
  margin-bottom: 6px;
  color: #777b84;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-medium);
}

.chrome-shell .run-step {
  position: relative;
  display: grid;
  min-height: 24px;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  opacity: 0;
  transform: translateY(4px);
}

.chrome-shell .run-step:not(:last-child)::after {
  position: absolute;
  top: 20px;
  bottom: -4px;
  left: 7px;
  width: 1px;
  background: #e5e6e9;
  content: "";
}

.chrome-shell .run-step-indicator {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe0e4;
  border-radius: 50%;
  background: #fff;
  color: #8a8d94;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
}

.chrome-shell .run-step.is-active .run-step-indicator {
  border-color: rgba(124, 58, 237, 0.28);
  background: #f5f2ff;
  color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.06);
}

.chrome-shell .run-step.is-done .run-step-indicator {
  border-color: #bfe3d3;
  background: #effaf5;
  color: #147554;
}

.chrome-shell .run-step-copy b {
  display: block;
  overflow: hidden;
  color: #45474d;
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-label--line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-shell .run-step.is-active .run-step-copy b {
  color: #26272b;
  font-weight: var(--font-weight-semibold);
}

.chrome-shell .run-step.is-done .run-step-copy b {
  color: #555860;
}

.chrome-shell .panel-composer {
  position: absolute;
  right: 11px;
  bottom: 10px;
  left: 11px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 10px;
  border: 1px solid rgba(24, 24, 27, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.03);
  color: #9a9da4;
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}

.chrome-shell .panel-composer-action {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #27272a;
  color: #fff;
}

.chrome-shell .panel-composer-action svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* Agent reply: summary line plus the delivery card, revealed together at 100%. */
.chrome-shell .chat-agent {
  display: grid;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition:
    opacity 260ms ease,
    visibility 0s linear 260ms,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chrome-shell .chat-agent.is-ready {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.chrome-shell .chat-agent p {
  margin: 0;
  color: #303238;
  font-size: var(--text-label);
  line-height: var(--text-label--line-height);
}

.chrome-shell .run-delivery {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(24, 24, 27, 0.09);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(24, 24, 27, 0.06);
}

.chrome-shell .run-delivery-icon {
  position: relative;
  width: 24px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f2efff;
  color: #6d28d9;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-bold);
}

.chrome-shell .run-delivery-icon.is-markdown {
  background: #eaf2ff;
  color: #1a73e8;
}

.chrome-shell .run-delivery-icon.is-csv {
  width: 22px;
  height: 27px;
  margin-left: 2px;
  overflow: hidden;
  border: 1px solid #22a06b;
  border-radius: 3px;
  background:
    linear-gradient(#d7f4e7, #d7f4e7) 4px 16px / 14px 1px no-repeat,
    linear-gradient(#d7f4e7, #d7f4e7) 4px 20px / 14px 1px no-repeat,
    linear-gradient(90deg, #d7f4e7, #d7f4e7) 9px 13px / 1px 11px no-repeat,
    #f7fffb;
  color: #147d55;
  font-size: var(--text-micro);
  line-height: var(--text-micro--line-height);
  place-items: start center;
  padding-top: 5px;
}

.chrome-shell .run-delivery-icon.is-csv::before {
  position: absolute;
  top: -1px;
  right: 0;
  width: 7px;
  height: 7px;
  border-bottom: 1px solid #22a06b;
  border-left: 1px solid #22a06b;
  background: #dff7ec;
  content: "";
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.chrome-shell .run-delivery-icon.is-csv::after {
  position: absolute;
  right: 4px;
  bottom: 5px;
  left: 4px;
  height: 8px;
  border: 1px solid #b7e7d1;
  content: "";
}

.chrome-shell .run-delivery b {
  display: block;
  overflow: hidden;
  color: #303238;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-shell .run-delivery-meta {
  display: block;
  margin-top: 2px;
  color: #858890;
  font-size: var(--text-caption);
}

.chrome-shell .run-delivery-state {
  min-width: 38px;
  padding: 4px 6px;
  border: 1px solid #c8e5d8;
  border-radius: 999px;
  background: #f2faf6;
  color: #147554;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

/* Completed artifacts expand into compact dashboards: a familiar document
   header, one explicit trend, and two glanceable outcome metrics. */
.chrome-shell .run-dashboard {
  grid-template-rows: auto 48px;
  gap: 6px 7px;
  padding: 7px;
}

.chrome-shell .run-dashboard .run-delivery-icon {
  width: 24px;
  height: 25px;
  margin-left: 0;
}

.chrome-shell .run-dashboard .run-delivery-meta {
  margin-top: 1px;
  font-size: var(--text-micro);
  line-height: var(--text-micro--line-height);
}

.chrome-shell .run-dashboard-grid {
  min-width: 0;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
  gap: 5px;
}

.chrome-shell .run-dashboard-chart,
.chrome-shell .run-dashboard-stat {
  min-width: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #f6f4ff;
}

.chrome-shell .run-dashboard-chart {
  position: relative;
  padding: 5px 6px;
}

.chrome-shell .run-dashboard-chart span,
.chrome-shell .run-dashboard-stat span {
  display: block;
  overflow: hidden;
  color: #817c8c;
  font-size: var(--text-micro);
  line-height: var(--text-micro--line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-shell .run-dashboard-chart b,
.chrome-shell .run-dashboard-stat b {
  display: block;
  margin-top: 1px;
  color: #302d37;
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  font-weight: var(--font-weight-semibold);
}

.chrome-shell .run-dashboard-chart svg {
  position: absolute;
  right: 5px;
  bottom: 4px;
  left: 5px;
  width: calc(100% - 10px);
  height: 21px;
  overflow: visible;
}

.chrome-shell .run-dashboard-area {
  fill: rgba(109, 40, 217, 0.1);
}

.chrome-shell .run-dashboard-line {
  fill: none;
  stroke: #7c3aed;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chrome-shell .run-dashboard-stat {
  display: grid;
  padding: 5px;
  align-content: center;
}

.chrome-shell .run-dashboard-stat::before {
  width: 13px;
  height: 13px;
  display: grid;
  margin-bottom: 3px;
  place-items: center;
  border-radius: 4px;
  background: rgba(109, 40, 217, 0.11);
  color: #6d28d9;
  content: attr(data-icon);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-bold);
}

.chrome-shell .run-dashboard.is-blue .run-dashboard-chart,
.chrome-shell .run-dashboard.is-blue .run-dashboard-stat {
  background: #f1f6ff;
}

.chrome-shell .run-dashboard.is-blue .run-dashboard-area {
  fill: rgba(26, 115, 232, 0.1);
}

.chrome-shell .run-dashboard.is-blue .run-dashboard-line {
  stroke: #1a73e8;
}

.chrome-shell .run-dashboard.is-blue .run-dashboard-stat::before {
  background: rgba(26, 115, 232, 0.11);
  color: #1a73e8;
}

.chrome-shell .run-dashboard.is-green .run-dashboard-chart,
.chrome-shell .run-dashboard.is-green .run-dashboard-stat {
  background: #f1faf6;
}

.chrome-shell .run-dashboard.is-green .run-dashboard-area {
  fill: rgba(34, 160, 107, 0.1);
}

.chrome-shell .run-dashboard.is-green .run-dashboard-line {
  stroke: #22a06b;
}

.chrome-shell .run-dashboard.is-green .run-dashboard-stat::before {
  background: rgba(34, 160, 107, 0.11);
  color: #147d55;
}

@media (prefers-reduced-motion: reduce) {
  .chrome-shell *,
  .chrome-shell *::before,
  .chrome-shell *::after {
    scroll-behavior: auto !important;
  }
}
