/* ElevenLabs-style product demos — https://elevenlabs.io/ */

:root {
  --demo-accent: var(--highlight);
  --demo-accent-soft: var(--highlight-soft);
  --demo-accent-pale: var(--highlight-pale);
  --demo-accent-glow: rgba(135, 172, 186, 0.35);
  --demo-accent-highlight: rgba(135, 172, 186, 0.18);
  --demo-accent-tag: rgba(135, 172, 186, 0.12);
}

.platforms-section {
  padding-top: 0;
  isolation: isolate;
}

.platforms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  background: #efefef;
  align-items: stretch;
  min-width: 0;
  position: relative;
  border-bottom: var(--grid-line);
}

.platforms-grid::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: var(--border);
}

@media (max-width: 1023px) {
  .platforms-grid::after {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    transform: translateY(-50%);
  }
}

@media (min-width: 1024px) {
  .platforms-grid {
    grid-template-columns: 1fr 1fr;
  }

  .platforms-grid::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
  }
}

.platform-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  border: none;
  height: auto;
  min-height: 0;
  min-width: 0;
  max-height: none;
  flex-shrink: 0;
  padding: 20px 20px 0;
  gap: 0;
  box-sizing: border-box;
  transition: background 220ms var(--ease);
}

.platforms-grid .platform-card:hover {
  background: #e7ebf8;
}

@media (hover: hover) {
  .platforms-grid .platform-card .nexus-demo,
  .platforms-grid .platform-card .dex-demo {
    filter: grayscale(1);
    transition: filter 320ms var(--ease);
  }

  .platforms-grid .platform-card:hover .nexus-demo,
  .platforms-grid .platform-card:hover .dex-demo {
    filter: none;
  }
}

.platform-card-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 4px 20px;
  align-items: flex-start;
  flex: 0 0 auto;
  height: auto;
  min-height: 96px;
  max-height: none;
  box-sizing: border-box;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
}

@media (min-width: 1024px) {
  .platform-card {
    padding: 24px 24px 0;
  }
}

/* legacy cards that still use head-on-top */
.platform-card-head {
  display: flex;
  gap: 12px;
  padding: 28px 28px 0;
  align-items: flex-start;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .platform-card-head {
    padding: 40px 40px 0;
  }
}

.platform-card-icon {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--white);
  opacity: 0.9;
}

.platform-card-foot .platform-card-icon {
  margin-top: 2px;
}

.platform-card-logo {
  flex-shrink: 0;
  width: auto;
  height: 28px;
  display: block;
  margin-top: 2px;
}

.platform-card-foot .platform-card-logo {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.platform-card-title {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.platform-card-desc {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: rgba(252, 252, 252, 0.52);
  max-width: none;
}

.platform-card-foot .platform-card-title {
  font-family: var(--font-sans);
  font-size: var(--text-title-card);
  font-weight: 500;
  letter-spacing: var(--tracking-sans);
  margin-bottom: 8px;
  color: var(--black);
}

.platform-card-foot .site-section-label {
  display: block;
  margin-bottom: 12px;
}

.platform-card-foot .platform-card-desc {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--text-muted);
}

/* ─── Nexus Automations app demo ─── */

.nexus-demo,
.dex-demo {
  z-index: 3;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  height: clamp(460px, 36vw, 624px);
  min-height: 460px;
  max-height: 624px;
  padding: 0;
  display: flex;
  box-sizing: border-box;
  background: var(--white);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.nexus-app,
.dex-app {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  background: var(--white);
  color: var(--black);
  box-shadow: none;
  display: flex;
}

.nexus-app {
  font-size: 10px;
  line-height: 1.4;
}

.nexus-sidebar {
  width: 168px;
  min-width: 168px;
  background: #f4f4f4;
  border-right: 1px solid #ebebeb;
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  gap: 6px;
}

.nexus-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.nexus-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(24, 24, 24, 0.08);
  background: rgba(252, 252, 252, 0.9);
  color: var(--text-light);
  font-size: 9px;
  margin-bottom: 4px;
}

.nexus-search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(24, 24, 24, 0.1);
  background: var(--white);
  color: var(--text-muted);
}

.nexus-nav {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  mask-image: linear-gradient(to bottom, var(--black) 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, var(--black) 82%, transparent 100%);
}

.nexus-day {
  display: flex;
  flex-direction: column;
}

.nexus-nav-label {
  font-size: 9px;
  color: var(--text-light);
  padding: 8px 8px 4px;
}

.nexus-nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nexus-nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-nav-item svg {
  flex-shrink: 0;
  opacity: 0.55;
}

.nexus-nav-item.is-active {
  background: rgba(24, 24, 24, 0.07);
  color: var(--black);
  font-weight: 500;
}

.nexus-nav-item.is-active svg {
  opacity: 0.85;
}

.nexus-badge {
  margin-left: auto;
  font-style: normal;
  font-size: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e8e8e8;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nexus-sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}

.nexus-user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 9px;
  background: transparent;
}

.nexus-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4d4d4, #a3a3a3);
  color: var(--white);
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}

.nexus-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nexus-user-meta strong {
  font-size: 10px;
  font-weight: 500;
}

.nexus-user-meta small {
  font-size: 8px;
  color: var(--text-light);
}

.nexus-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 0;
  background: var(--white);
}

.nexus-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.nexus-crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.nexus-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 4px;
}

.nexus-sub {
  font-size: 10px;
  color: var(--text-light);
  max-width: 280px;
  line-height: 1.45;
}

.nexus-head-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 18px;
}

.nexus-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid rgba(24, 24, 24, 0.1);
  background: var(--white);
  color: var(--black);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nexus-btn--primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.nexus-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #f0f0f0;
  margin-bottom: 10px;
  align-self: flex-start;
  flex-shrink: 0;
}

.nexus-tab {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.nexus-tab.is-active {
  background: var(--white);
  color: var(--black);
  box-shadow: 0 1px 2px rgba(24, 24, 24, 0.08);
}

.nexus-feed {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  mask-image: linear-gradient(to bottom, var(--black) 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, var(--black) 86%, transparent 100%);
}

.nexus-feed::-webkit-scrollbar {
  display: none;
}

.nexus-day-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--black);
  padding: 8px 0 4px;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 360ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nexus-day.is-visible .nexus-day-label {
  opacity: 1;
  transform: translateY(0);
}

.nexus-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(24, 24, 24, 0.07);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 260ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    background 300ms var(--ease);
}

[data-nexus-demo].is-animating .nexus-row:not(.is-visible) {
  opacity: 0;
  transform: translateY(8px);
}

[data-nexus-demo].is-animating .nexus-day:not(.is-visible) .nexus-day-label {
  opacity: 0;
  transform: translateY(4px);
}

.nexus-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.nexus-row.is-listed .nexus-row-main {
  animation: nexusRowSpit 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nexus-status svg {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 340ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-nexus-demo].is-animating .nexus-row.is-listed:not(.is-ticked) .nexus-status svg {
  opacity: 0;
  transform: scale(0.2);
}

[data-nexus-demo].is-animating .nexus-row.is-listed:not(.is-ticked) .nexus-status {
  background: rgba(24, 24, 24, 0.05);
  color: transparent;
  animation: nexusStatusWait 0.9s ease-in-out infinite;
}

[data-nexus-demo].is-animating .nexus-row.is-listed:not(.is-ticked) .nexus-status--err {
  background: rgba(200, 60, 60, 0.07);
}

.nexus-row.is-ticked .nexus-status {
  animation: none;
}

.nexus-row.is-ticked .nexus-status svg {
  opacity: 1;
  transform: scale(1);
}

@keyframes nexusRowSpit {
  from {
    opacity: 0;
    transform: translateY(5px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes nexusStatusWait {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.9;
    transform: scale(1);
  }
}

.nexus-row.is-highlight {
  background: rgba(79, 112, 197, 0.05);
  border-radius: 8px;
  padding-inline: 6px;
  margin-inline: -6px;
}

.nexus-status {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nexus-status--ok {
  background: rgba(24, 24, 24, 0.06);
  color: rgba(24, 24, 24, 0.42);
}

.nexus-status--err {
  background: rgba(200, 60, 60, 0.1);
  color: #b83232;
}

.nexus-row-main {
  flex: 1;
  min-width: 0;
}

.nexus-row-top {
  display: grid;
  grid-template-columns: minmax(112px, 31%) minmax(0, 1fr) minmax(112px, 30%) 42px;
  column-gap: 10px;
  align-items: center;
  min-width: 0;
}

.nexus-row-title {
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-row-desc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 9px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-row-desc-icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  opacity: 0.42;
}

.nexus-row-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 3px 7px 3px 4px;
  border-radius: 999px;
  border: 1px solid rgba(24, 24, 24, 0.08);
  background: #f7f7f7;
  font-size: 8px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-row-time {
  justify-self: end;
  font-size: 9px;
  color: var(--text-light);
  white-space: nowrap;
}

.nexus-row-tag-icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  display: block;
}

.nexus-row-tag-icon--cal { background: linear-gradient(145deg, var(--highlight-pale) 0%, var(--highlight-soft) 52%, var(--highlight) 100%); }
.nexus-row-tag-icon--mail { background: linear-gradient(145deg, var(--highlight-soft) 0%, #edd9b4 58%, var(--highlight) 100%); }
.nexus-row-tag-icon--wave { background: linear-gradient(145deg, var(--highlight-soft) 0%, #e8d8b0 55%, var(--highlight) 100%); }
.nexus-row-tag-icon--pulse { background: linear-gradient(145deg, var(--highlight-pale), var(--highlight-soft) 45%, var(--highlight)); }
.nexus-row-tag-icon--deal { background: linear-gradient(145deg, var(--highlight-pale), var(--highlight)); }
.nexus-row-tag-icon--chart { background: linear-gradient(145deg, var(--highlight-soft), var(--highlight)); }

/* ─── Dex sidebar + browser chrome demo ─── */

.dex-browser-scene {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #e4e4e4;
}

.dex-browser-page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #ebebeb;
}

.dex-chrome-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 5px;
  background: #e8e8e8;
}

.dex-chrome-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.dex-chrome-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c4c4c4;
}

.dex-chrome-dots span:nth-child(1) { background: #e8957a; }
.dex-chrome-dots span:nth-child(2) { background: #e8c87a; }
.dex-chrome-dots span:nth-child(3) { background: #7ac88a; }

.dex-chrome-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 6px 6px 0 0;
  background: var(--white);
}

.dex-chrome-tab-icon {
  display: block;
  width: auto;
  height: 10px;
  flex-shrink: 0;
}

.dex-chrome-tab--muted {
  background: transparent;
  color: var(--text-light);
  opacity: 0.75;
}

.dex-chrome-tab.is-active {
  font-weight: 500;
  color: var(--black);
}

.dex-chrome-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--white);
  border-bottom: 1px solid #e5e5e5;
}

.dex-chrome-nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dex-chrome-nav span {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #f0f0f0;
}

.dex-chrome-url {
  flex: 1;
  min-width: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 9px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dex-chrome-content {
  flex: 1;
  min-height: 0;
  padding: 14px 16px;
  background: var(--white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dex-chrome-label {
  display: block;
  width: 36px;
  height: 7px;
  border-radius: 3px;
  background: var(--highlight-pale);
  margin-bottom: 10px;
}

.dex-chrome-site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dex-chrome-site-logo {
  display: block;
  width: auto;
  height: 14px;
  flex-shrink: 0;
}

.dex-chrome-site-actions {
  display: flex;
  gap: 6px;
}

.dex-chrome-site-actions span {
  width: 44px;
  height: 18px;
  border-radius: 999px;
  background: #f0f0f0;
}

.dex-chrome-site-actions span:last-child {
  background: var(--black);
  opacity: 0.85;
}

.dex-chrome-hero-line {
  height: 10px;
  border-radius: 4px;
  background: #ededed;
  margin-bottom: 6px;
  max-width: 78%;
  flex-shrink: 0;
}

.dex-chrome-hero-line--mid {
  max-width: 62%;
  height: 9px;
}

.dex-chrome-hero-line--short {
  max-width: 44%;
  height: 8px;
  margin-bottom: 10px;
}

.dex-chrome-cta-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dex-chrome-cta {
  display: block;
  width: 56px;
  height: 20px;
  border-radius: 999px;
  background: var(--black);
  opacity: 0.88;
}

.dex-chrome-cta--ghost {
  width: 48px;
  background: #f0f0f0;
  opacity: 1;
  border: 1px solid #e8e8e8;
}

.dex-chrome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
  align-items: stretch;
}

.dex-chrome-card {
  min-height: 72px;
  height: 100%;
  border-radius: 8px;
  background: #f5f5f5;
  border: 1px solid #ececec;
}

.dex-chrome-card--tall {
  min-height: 72px;
  height: 100%;
  background: #fafafa;
}

.dex-chrome-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  mask-image: linear-gradient(to bottom, var(--black) 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, var(--black) 70%, transparent 100%);
}

.dex-chrome-list-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}

.dex-chrome-list-row span:first-child {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #ececec;
  justify-self: center;
}

.dex-chrome-list-row span:last-child {
  min-width: 0;
  height: 8px;
  border-radius: 3px;
  background: #f0f0f0;
  max-width: 100%;
}

.dex-chrome-list-row--short span:last-child {
  max-width: 55%;
}

.dex-chrome-card--gradient {
  background: linear-gradient(145deg, rgba(180, 210, 160, 0.9) 0%, rgba(160, 190, 220, 0.85) 45%, rgba(220, 200, 160, 0.9) 100%);
  border-color: transparent;
  position: relative;
  overflow: hidden;
}

.dex-chrome-card--gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.14'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.dex-browser-scene .dex-app {
  flex: 0 1 42%;
  width: 42%;
  max-width: 42%;
  min-width: 0;
  border-left: 1px solid #dedede;
  box-shadow: -10px 0 36px rgba(24, 24, 24, 0.1);
  z-index: 2;
  font-size: 10px;
}

.dex-browser-scene .dex-app-bar,
.dex-browser-scene .dex-app-nav {
  padding-inline: 10px;
}

.dex-browser-scene .dex-app-brand {
  font-size: 13px;
}

.dex-browser-scene .dex-app-logo {
  height: 18px;
}

.dex-browser-scene .dex-app-thread {
  padding: 10px 12px;
}

.dex-browser-scene .dex-reply-lead {
  font-size: 11px;
}

.dex-browser-scene .dex-reply-list li {
  font-size: 9px;
}

.dex-browser-scene .dex-compose {
  margin: 0 8px 8px;
  padding: 8px 10px;
}

/* ─── Dex agent panel demo ─── */

.dex-app {
  flex-direction: column;
  font-size: 11px;
  line-height: 1.5;
}

.dex-app-bar,
.dex-app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(24, 24, 24, 0.07);
  flex-shrink: 0;
}

.dex-app-bar {
  padding-top: 12px;
}

.dex-app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.dex-app-logo {
  width: auto;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.dex-app-bar-actions,
.dex-app-nav-left,
.dex-app-nav-right,
.dex-compose-icons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dex-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  background: transparent;
  border: none;
}

.dex-app-nav {
  padding-block: 8px;
}

.dex-app-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.dex-thought,
.dex-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 11px;
  color: var(--text-light);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 350ms var(--ease), transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dex-thought.is-visible,
.dex-tool-pill.is-visible,
.dex-user-msg.is-visible,
.dex-reply-actions.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dex-user-msg {
  align-self: flex-end;
  max-width: 90%;
  padding: 7px 10px;
  border-radius: 10px 10px 4px 10px;
  background: #f0f0f0;
  font-size: 10px;
  color: var(--black);
  line-height: 1.45;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 350ms var(--ease), transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dex-reply--followup {
  padding-top: 2px;
}

.dex-reply--followup .dex-reply-lead {
  font-size: 11px;
}

.dex-tool-pill {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(24, 24, 24, 0.08);
  background: #f5f5f5;
  color: var(--text-muted);
  font-size: 10px;
}

.dex-reply {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dex-reply-lead {
  font-size: 12px;
  color: var(--black);
  min-height: 1.4em;
  line-height: 1.5;
}

.dex-reply-lead.is-streaming::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--highlight);
  animation: dexCursor 900ms step-end infinite;
}

@keyframes dexCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.dex-reply-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dex-reply-list li {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms var(--ease), transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dex-reply-list li.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dex-reply-list strong {
  color: var(--black);
  font-weight: 600;
}

.dex-reply-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 350ms var(--ease), transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dex-reply-actions button {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  background: transparent;
  border: none;
}

.dex-compose {
  flex-shrink: 0;
  margin: 0 14px 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 24, 24, 0.1);
  background: var(--white);
  box-shadow: 0 4px 20px rgba(24, 24, 24, 0.07);
}

.dex-compose-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.dex-compose-at {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(24, 24, 24, 0.1);
  background: var(--white);
  font-size: 10px;
  color: var(--text-muted);
}

.dex-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  background: #f0f0f0;
  font-size: 8px;
  color: var(--text-muted);
  animation: dexPillPulse 2.4s ease-in-out infinite;
}

@keyframes dexPillPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 112, 197, 0); }
  50% { box-shadow: 0 0 0 3px rgba(79, 112, 197, 0.12); }
}

.dex-context-pill-logo {
  width: auto;
  height: 13px;
  display: block;
  flex-shrink: 0;
}

.dex-compose-placeholder {
  font-size: 9px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.dex-compose-foot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dex-compose-send-prep {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight-pale);
  color: var(--highlight);
  border: none;
}

.dex-compose-icons {
  margin-left: auto;
}

.dex-compose-send {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight-soft);
  color: var(--white);
  border: none;
}

.platform-card.is-inview .nexus-demo,
.platform-card.is-inview .dex-demo,
.platform-card.is-inview .creative-demo,
.platform-card.is-inview .creative-editor,
.platform-card.is-inview .agents-phone {
  animation: cardRise 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

.platform-card--agents.is-inview .dex-demo,
.platform-card--agents.is-inview .agents-phone {
  animation-delay: 100ms;
}

/* ─── Legacy Nexus knowledge editor ─── */

.creative-demo {
  z-index: 3;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  height: clamp(460px, 36vw, 624px);
  min-height: 460px;
  max-height: 624px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--white);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .creative-demo {
    padding: 24px;
  }
}

.creative-demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
  min-height: 36px;
}

.creative-pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(24, 24, 24, 0.08);
  background: rgba(252, 252, 252, 0.94);
  color: var(--black);
  font-size: 13px;
  font-weight: 500;
}

.creative-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  border-radius: 22px;
  background: var(--white);
  color: var(--text-muted);
  box-shadow:
    0 0 1px rgba(24, 24, 24, 0.12),
    0 8px 24px rgba(24, 24, 24, 0.08);
  overflow: hidden;
}

.creative-editor-scroll {
  flex: 1;
  overflow: hidden;
  padding: 18px 20px 0;
  font-size: 13px;
  line-height: 1.65;
}

.creative-script {
  white-space: pre-wrap;
}

.creative-word {
  display: inline;
  border-radius: 3px;
  padding: 1px 0;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}

.creative-word.is-spoken {
  background: var(--demo-accent-tag);
  color: var(--black);
}

.creative-word.is-active {
  background: var(--demo-accent-highlight);
  color: var(--black);
}

.creative-tag {
  display: inline;
  margin: 0 2px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(135, 172, 186, 0.4);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), background 300ms var(--ease);
}

.creative-tag.is-active {
  transform: scale(1.03);
  background: rgba(135, 172, 186, 0.08);
  box-shadow: 0 0 0 3px rgba(135, 172, 186, 0.14);
}

.creative-editor-fade {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  height: 44px;
  background: linear-gradient(to top, var(--white) 0%, rgba(252, 252, 252, 0) 100%);
}

.creative-editor-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 16px 14px;
  background: var(--white);
  border-top: 1px solid rgba(24, 24, 24, 0.06);
  flex-shrink: 0;
  min-height: 52px;
  box-sizing: border-box;
}

.creative-char-count {
  position: absolute;
  right: 62px;
  bottom: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(24, 24, 24, 0.35);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.creative-editor.is-playing .creative-char-count {
  opacity: 1;
}

.creative-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: #9ca3af;
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 150ms var(--ease);
}

.creative-play svg {
  width: 18px;
  height: 18px;
}

.creative-play:not(:disabled) {
  color: var(--text);
  cursor: pointer;
}

.creative-play.is-playing {
  background: var(--black);
  color: var(--white);
}

/* ─── Dex agent demo ─── */

.agents-demo-wrap {
  display: flex;
  flex-direction: column;
  height: 380px;
  min-height: 380px;
  max-height: 380px;
  flex-shrink: 0;
  padding: 0 20px 28px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .agents-demo-wrap {
    padding: 0 36px 32px;
  }
}

.agents-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.agents-stat {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(252, 252, 252, 0.1);
  background: rgba(252, 252, 252, 0.05);
}

.agents-stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(252, 252, 252, 0.42);
  margin-bottom: 6px;
}

.agents-stat-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}

.agents-stat-value span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--demo-accent);
  margin-left: 4px;
}

.agents-chart {
  grid-column: 1 / -1;
  padding: 14px 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(252, 252, 252, 0.1);
  background: rgba(252, 252, 252, 0.04);
}

.agents-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.agents-chart-title {
  font-size: 12px;
  font-weight: 500;
}

.agents-chart-metric {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--demo-accent);
}

.agents-chart-svg {
  width: 100%;
  height: 56px;
  display: block;
}

.agents-chart-line {
  fill: none;
  stroke: var(--demo-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 2s var(--ease);
}

.platform-card.is-inview .agents-chart-line {
  stroke-dashoffset: 0;
}

.agents-chart-area {
  opacity: 0;
  transition: opacity 1.2s var(--ease) 0.4s;
}

.platform-card.is-inview .agents-chart-area {
  opacity: 1;
}

.agents-demo {
  position: relative;
  display: flex;
  justify-content: center;
  height: 232px;
  min-height: 232px;
  max-height: 232px;
  flex-shrink: 0;
  overflow: hidden;
}

.agents-phone {
  z-index: 1;
  width: 100%;
  max-width: 400px;
  height: 232px;
  min-height: 232px;
  max-height: 232px;
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(252, 252, 252, 0.12);
  border-bottom: none;
  padding: 0 14px;
  backdrop-filter: blur(16px);
  background: rgba(252, 252, 252, 0.06);
  mask-image: linear-gradient(to bottom, transparent 5rem, var(--white) 9rem);
  -webkit-mask-image: linear-gradient(to bottom, transparent 5rem, var(--white) 9rem);
  overflow: hidden;
  box-sizing: border-box;
}

.agents-phone-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding-bottom: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.agents-call-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.agents-timer {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(252, 252, 252, 0.42);
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

.agents-orb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 10px;
}

.agents-orb-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--demo-accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 400ms var(--ease);
}

.agents-phone.is-live .agents-orb-glow {
  opacity: 1;
}

.agents-orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    var(--demo-accent-soft) 12deg,
    var(--demo-accent) 45deg,
    var(--white) 90deg,
    #6a909e 135deg,
    var(--demo-accent) 180deg,
    var(--demo-accent-soft) 225deg,
    var(--white) 270deg,
    var(--demo-accent) 315deg,
    var(--demo-accent-soft) 360deg
  );
  animation: agentsOrbSpin 10s linear infinite;
}

.agents-phone.is-live .agents-orb {
  animation: agentsOrbSpin 2.5s linear infinite, agentsOrbPulse 1.4s ease-in-out infinite;
}

.agents-orb-inner {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(252, 252, 252, 0.15), rgba(24, 24, 24, 0.2));
  z-index: 1;
}

@keyframes agentsOrbSpin {
  to { transform: rotate(360deg); }
}

@keyframes agentsOrbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.agents-call-meta {
  text-align: center;
}

.agents-call-meta strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
}

.agents-call-meta span {
  font-size: 11px;
  color: rgba(252, 252, 252, 0.42);
}

.agents-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.agents-bubble {
  max-width: 90%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 450ms var(--ease), transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agents-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.agents-bubble--agent {
  align-self: flex-start;
  background: rgba(252, 252, 252, 0.1);
  color: rgba(252, 252, 252, 0.92);
  border-bottom-left-radius: 4px;
}

.agents-bubble--user {
  align-self: flex-end;
  background: rgba(252, 252, 252, 0.94);
  color: var(--black);
  border-bottom-right-radius: 4px;
}

.agents-typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(252, 252, 252, 0.1);
  margin-left: 2px;
  flex-shrink: 0;
  min-height: 37px;
  box-sizing: border-box;
}

.agents-typing[hidden] {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.agents-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(252, 252, 252, 0.5);
  animation: typingDot 1.2s ease-in-out infinite;
}

.agents-typing span:nth-child(2) { animation-delay: 0.15s; }
.agents-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.platform-card.is-inview .creative-editor,
.platform-card.is-inview .agents-phone {
  animation: cardRise 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stack panel embed */
.stack-visual .platform-card {
  height: 360px;
  min-height: 360px;
  max-height: 360px;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
}

.stack-visual .nexus-demo,
.stack-visual .dex-demo,
.stack-visual .creative-demo,
.stack-visual .agents-demo-wrap {
  padding: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 1;
}

.stack-visual .agents-demo {
  height: 140px;
  min-height: 140px;
  max-height: 140px;
}

.stack-visual .agents-phone {
  height: 140px;
  min-height: 140px;
  max-height: 140px;
}

.stack-visual .platform-card-head {
  padding: 20px 20px 0;
}

.stack-visual .platform-card-title {
  font-size: 17px;
}

.stack-visual .platform-card-desc {
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.feature-visual .platform-card {
  height: 340px;
  min-height: 340px;
  max-height: 340px;
  border-radius: 10px;
}

.feature-visual .nexus-demo,
.feature-visual .dex-demo,
.feature-visual .creative-demo {
  height: 260px;
  min-height: 260px;
  max-height: 260px;
  padding: 12px;
}

.feature-visual .platform-card-head {
  padding: 16px 16px 0;
}

.feature-visual .platform-card-title {
  font-size: 16px;
}

.feature-visual .platform-card-desc {
  display: none;
}

.feature-visual:has(.platform-card) {
  padding: 0;
  background: transparent;
  border: none;
  height: 340px;
  min-height: 340px;
  max-height: 340px;
}

/* Stack panel product UI — Judgment-style demos */
.stack-visual .stack-ui {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  text-transform: none;
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
  font-family: var(--font-sans);
}

.stack-ui--light {
  background: var(--white);
  color: var(--black);
}

.stack-ui--light .stack-ui__metric-card {
  border: 1px solid var(--border);
  background: var(--bg-hover);
}

.stack-ui--light .stack-ui__metric-card span {
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__metric-card strong {
  color: var(--black);
}

.stack-ui--light .stack-ui__pill {
  color: var(--highlight);
  background: var(--highlight-pale);
}

.stack-ui--light .stack-ui__pill.is-changing {
  animation: skillPillFlashLight 500ms ease;
}

.stack-ui--light .stack-ui__thread {
  background: var(--white);
  border-top: var(--grid-line);
  border-bottom: var(--grid-line);
  overflow: hidden;
  justify-content: flex-end;
}

.stack-ui--light .stack-ui__msg--user {
  background: var(--highlight-pale);
  color: var(--black);
  border: 1px solid rgba(79, 112, 197, 0.12);
}

.stack-ui--light .stack-ui__msg--agent {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--border);
}

.stack-ui--light .stack-ui__msg--system {
  background: var(--highlight-pale);
  border: 1px solid rgba(79, 112, 197, 0.2);
  color: var(--black);
}

.stack-ui--light .stack-ui__msg-label {
  color: var(--highlight);
}

.stack-ui--light .stack-ui__typing {
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.stack-ui--light .stack-ui__typing span {
  background: var(--text-muted);
}

.stack-ui--light .stack-ui__eval-head {
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__eval-track {
  background: var(--border);
}

.stack-ui--light .stack-ui__chart-block {
  border: 1px solid var(--border);
  background: var(--bg-hover);
}

.stack-ui--light .stack-ui__chart-head span:first-child {
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__chart-crosshair {
  border-left-color: rgba(24, 24, 24, 0.22);
}

.stack-ui--light .stack-ui__chart-dot {
  border-color: var(--white);
}

.stack-ui--light .stack-ui__chart-tooltip {
  background: rgba(252, 252, 252, 0.98);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(24, 24, 24, 0.08);
}

.stack-ui--light .stack-ui__chart-tooltip-label {
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__links {
  border-top: var(--grid-line);
}

.stack-ui--light .stack-ui__links-head {
  border-bottom: var(--grid-line);
}

.stack-ui--light .stack-ui__links-head span:first-child {
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__link-row {
  border-bottom: var(--grid-line);
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__link-row.is-active {
  background: rgba(79, 112, 197, 0.08);
  color: var(--black);
}

.stack-ui--light .stack-ui__link-to {
  color: var(--text-muted);
}

.stack-ui--light .stack-ui__link-row.is-active .stack-ui__link-to {
  color: var(--black);
}

@keyframes skillPillFlashLight {
  0%, 100% {
    background: var(--highlight-pale);
    color: var(--highlight);
    transform: scale(1);
  }
  45% {
    background: var(--highlight);
    color: var(--white);
    transform: scale(1.05);
  }
}

.stack-ui--dark {
  background: var(--black);
  color: var(--white);
}

.stack-ui__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: var(--grid-line);
  background: var(--bg-hover);
  flex-shrink: 0;
}

.stack-ui__dots {
  display: flex;
  gap: 5px;
}

.stack-ui__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.stack-ui__dots span:first-child { background: #d4d4d4; }
.stack-ui__dots span:nth-child(2) { background: #e0e0e0; }
.stack-ui__dots span:nth-child(3) { background: #ebebeb; }

.stack-ui__path {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-ui__badge,
.stack-ui__pill,
.stack-ui__live {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.stack-ui__badge {
  color: var(--highlight);
  background: var(--highlight-pale);
}

.stack-ui__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}

.stack-ui__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: var(--grid-line);
}

.stack-ui__panel:last-child { border-right: none; }

.stack-ui__panel--accent {
  background: var(--highlight-pale);
  position: relative;
  z-index: 1;
}

.stack-ui__panel-head,
.stack-ui__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: var(--grid-line);
  flex-shrink: 0;
}

.stack-ui__panel-head span:first-child,
.stack-ui__header > span:first-child {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stack-ui--dark .stack-ui__header {
  border-bottom-color: rgba(252, 252, 252, 0.1);
}

.stack-ui--dark .stack-ui__header > span:first-child {
  color: rgba(252, 252, 252, 0.55);
}

.stack-ui__metric,
.stack-ui__chart-metric {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--highlight);
}

.stack-ui__live {
  color: var(--highlight);
  background: rgba(79, 112, 197, 0.15);
}

.stack-ui__pill {
  color: var(--white);
  background: var(--highlight);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}

.stack-ui__pill.is-changing {
  animation: skillPillFlash 500ms ease;
}

.stack-ui__metric-card strong.is-updating {
  color: var(--highlight);
  transition: color 200ms ease;
}

.stack-ui__msg--system.is-skill-update {
  border-color: var(--highlight);
  box-shadow: 0 0 0 1px rgba(79, 112, 197, 0.25);
}

@keyframes skillPillFlash {
  0%, 100% {
    background: var(--highlight);
    color: var(--white);
    transform: scale(1);
  }
  45% {
    background: var(--highlight-soft);
    color: var(--black);
    transform: scale(1.05);
  }
}

.stack-ui__trace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.stack-ui__trace-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: var(--grid-line);
  font-size: 11px;
  flex-shrink: 0;
}

.stack-ui__trace-row.is-active {
  background: rgba(79, 112, 197, 0.08);
  position: relative;
  z-index: 1;
}

.stack-ui__trace-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.stack-ui__trace-label {
  font-family: var(--font-sans);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-ui__trace-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-light);
}

.stack-ui__trace-row.is-active .stack-ui__trace-tag {
  background: var(--highlight-pale);
  color: var(--highlight);
}

.stack-ui__flow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.stack-ui__flow-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  position: relative;
  z-index: 1;
}

.stack-ui__flow-node {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.stack-ui__flow-node.is-entering {
  animation: stackFlowIn 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stackFlowIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stack-ui__flow-node.is-active {
  border-color: var(--highlight);
  background: var(--white);
  color: var(--highlight);
  box-shadow: 0 0 0 1px rgba(79, 112, 197, 0.18);
}

.stack-ui__flow-node.is-highlight {
  border-color: var(--highlight);
  background: var(--white);
  color: var(--highlight);
}

.stack-ui__flow-arrow {
  font-size: 12px;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
  transition: color 200ms ease;
}

.stack-ui__flow-arrow.is-active {
  color: var(--highlight);
}

.stack-ui__flow-node:not(.is-revealed),
.stack-ui__flow-arrow:not(.is-revealed) {
  display: none;
}

.stack-ui__stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-top: var(--grid-line);
}

.stack-ui__stat {
  padding: 12px 14px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stack-ui__stat span {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.stack-ui__stat strong {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--black);
}

.stack-ui__header {
  padding: 14px 16px;
}

.stack-ui__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
}

.stack-ui__metrics--compact {
  grid-template-columns: 1fr 1fr;
}

.stack-ui__metric-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(252, 252, 252, 0.1);
  background: rgba(252, 252, 252, 0.04);
}

.stack-ui__metric-card span {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(252, 252, 252, 0.42);
  margin-bottom: 4px;
}

.stack-ui__metric-card strong {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stack-ui__metric-card strong[data-stack-skill-name] {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-ui__delta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--highlight);
  margin-left: 3px;
}

.stack-ui__chart-block {
  margin: 0 14px 10px;
  padding: 10px 12px 8px;
  border-radius: 10px;
  border: 1px solid rgba(252, 252, 252, 0.1);
  background: rgba(252, 252, 252, 0.04);
  flex-shrink: 0;
}

.stack-ui__chart-interactive {
  position: relative;
  z-index: 1;
  cursor: crosshair;
  touch-action: none;
}

.stack-ui__chart-interactive .stack-ui__chart {
  display: block;
  width: 100%;
  height: 48px;
}

.stack-ui__chart-interactive.is-hovering .stack-ui__chart-line {
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px rgba(79, 112, 197, 0.35));
}

.stack-ui__chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed rgba(252, 252, 252, 0.38);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}

.stack-ui__chart-crosshair[hidden] {
  display: none;
}

.stack-ui__chart-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--highlight);
  border: 1.5px solid rgba(252, 252, 252, 0.92);
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.stack-ui__chart-dot[hidden] {
  display: none;
}

.stack-ui__chart-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(24, 24, 24, 0.94);
  border: 1px solid rgba(252, 252, 252, 0.12);
  box-shadow: 0 4px 16px rgba(24, 24, 24, 0.45);
  pointer-events: none;
  white-space: nowrap;
  z-index: 3;
  text-transform: uppercase;
}

.stack-ui__chart-tooltip[hidden] {
  display: none;
}

.stack-ui__chart-tooltip-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--highlight);
  line-height: 1.2;
}

.stack-ui__chart-tooltip-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(252, 252, 252, 0.42);
}

.stack-ui__chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.stack-ui__chart-head span:first-child {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: rgba(252, 252, 252, 0.75);
}

.stack-ui__chart {
  width: 100%;
  height: 48px;
  display: block;
}

.stack-ui__chart-line {
  fill: none;
  stroke: var(--highlight);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stack-ui__links-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.stack-ui__trace-row.is-entering,
.stack-ui__link-row.is-entering {
  animation: stackRowIn 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.stack-ui__flow-arrow.is-pulse,
.stack-ui__flow-node.is-pulse,
.stack-ui__pill.is-pulse {
  animation: stackPulse 700ms ease;
}

@keyframes stackPulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.06); }
}

.stack-ui__flow-arrow.is-pulse {
  color: var(--highlight);
}

.stack-ui__chart-line.is-drawing {
  filter: drop-shadow(0 0 4px rgba(79, 112, 197, 0.45));
}

.stack-ui__typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(252, 252, 252, 0.1);
}

.stack-ui__typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(252, 252, 252, 0.55);
  animation: stackTyping 1.1s ease-in-out infinite;
}

.stack-ui__typing span:nth-child(2) { animation-delay: 0.15s; }
.stack-ui__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes stackTyping {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.stack-ui__stat strong,
.stack-ui__metric-card strong,
.stack-ui__metric {
  transition: color 200ms ease;
}

.stack-ui__stat strong.is-tick,
.stack-ui__metric-card strong.is-tick {
  color: var(--highlight);
}

.stack-ui__links {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(252, 252, 252, 0.08);
  overflow: hidden;
}

.stack-ui__links-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(252, 252, 252, 0.08);
  flex-shrink: 0;
}

.stack-ui__links-head span:first-child {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(252, 252, 252, 0.45);
}

.stack-ui__link-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(252, 252, 252, 0.06);
  font-family: var(--font-sans);
  font-size: 10px;
  color: rgba(252, 252, 252, 0.55);
}

.stack-ui__link-row.is-active {
  background: rgba(79, 112, 197, 0.12);
  color: rgba(252, 252, 252, 0.85);
  position: relative;
  z-index: 1;
}

.stack-ui__link-from {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-ui__link-arrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--highlight);
}

.stack-ui__link-to {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(252, 252, 252, 0.65);
}

.stack-ui__thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.stack-ui__msg {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stack-ui__msg.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stack-ui__msg--user {
  align-self: flex-end;
  background: rgba(252, 252, 252, 0.94);
  color: var(--black);
  border-bottom-right-radius: 4px;
}

.stack-ui__msg--agent {
  align-self: flex-start;
  background: rgba(252, 252, 252, 0.1);
  color: rgba(252, 252, 252, 0.92);
  border-bottom-left-radius: 4px;
}

.stack-ui__msg--system {
  align-self: flex-start;
  background: rgba(79, 112, 197, 0.18);
  border: 1px solid rgba(79, 112, 197, 0.35);
  color: rgba(252, 252, 252, 0.85);
  font-family: var(--font-mono);
  font-size: 10px;
}

.stack-ui__msg-label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--highlight-soft);
  margin-bottom: 3px;
}

.stack-ui__eval-bar {
  padding: 12px 14px 14px;
  flex-shrink: 0;
}

.stack-ui__eval-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(252, 252, 252, 0.45);
}

.stack-ui__eval-head span:last-child {
  color: var(--highlight);
}

.stack-ui__eval-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(252, 252, 252, 0.1);
  overflow: hidden;
}

.stack-ui__eval-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--highlight-soft), var(--highlight));
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1023px) {
  .stack-ui--light,
  .stack-ui--dark {
    border-left: none;
  }

  .stack-ui__split {
    grid-template-columns: 1fr;
  }

  .stack-ui__panel {
    border-right: none;
    border-bottom: var(--grid-line);
  }

  .stack-ui__metrics {
    grid-template-columns: 1fr;
  }
}

/* Legacy stack embed rules */
