/* Reuse the exact Geist Variable asset emitted by the foundation font import.
   Iframes have their own FontFaceSet and cannot inherit the parent document's
   @font-face rule, even though both documents use the same family token. */
@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 parent document requests this exact URL, so by the time an
     iframe mounts it is a cache hit and the block period is imperceptible. */
  font-display: block;
  font-weight: 100 900;
  src: url("/_next/static/media/geist-latin-wght-normal.e574545b.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. */
/* Miniature simulation type mirrors the foundation scale at 70% */
: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.525rem;
  --text-caption--line-height: 0.7rem;
  --text-label: 0.56875rem;
  --text-label--line-height: 0.7875rem;
  --text-body: 0.6125rem;
  --text-body--line-height: 0.875rem;
  --text-title: 0.7rem;
  --text-title--line-height: 1.05rem;
  --text-heading: 0.7875rem;
  --text-heading--line-height: 1.05rem;
  --text-micro: 0.35rem;
  --text-micro--line-height: 0.4375rem;
  --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: 700;
  --chrome-surface: #f6f7f9;
  --chrome-line: rgba(24, 24, 27, 0.1);
  --sidebar-width: 320px;
}

/* Card composition: a gray chrome base with the page and the sidebar
   stacked on top as rounded white cards, no divider lines. */
.chrome-shell {
  display: grid;
  width: 760px;
  height: 440px;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  grid-template-rows: 20px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(24, 24, 27, 0.13);
  border-radius: 8px;
  background: var(--chrome-surface);
  font-family: var(--font-sans);
  box-shadow: none;
}

/* 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;
}

.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);
}

/* 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 .browser-page,
.chrome-shell .page-stack {
  position: absolute;
  inset: 0;
  top: 0;
  bottom: 0;
}

.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);
}

.chrome-shell .panel-brand {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: #232428;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
}

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

/* Chat thread: user message on the right, agent work and reply on the left. */
.chrome-shell .run-overview {
  height: calc(100% - 40px);
  display: flex;
  padding: 12px 14px;
  flex-direction: column;
  gap: 10px;
}

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

.chrome-shell .run-flow {
  padding: 9px 11px;
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: 10px;
  background: #fff;
  opacity: 0;
  transform: translateY(4px);
}

.chrome-shell .run-flow-title {
  margin-bottom: 5px;
  color: #8b8e95;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
}

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

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

.chrome-shell .run-step-indicator {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  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-bold);
}

.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: #303238;
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-label--line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Agent reply: summary line plus the delivery card, revealed together at 100%. */
.chrome-shell .chat-agent {
  display: grid;
  gap: 8px;
  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: 29px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 9px;
  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: 27px;
  height: 29px;
  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-label {
  display: block;
  color: #8a8d94;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.chrome-shell .run-delivery b {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  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;
}

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