/* Product detail pages. This file adds layouts only and consumes the shared
   design system values already loaded by every launch page. */

.product-lockup { width: auto }
[data-theme="dark"] .product-lockup { filter: invert(1) }
.footer .product-lockup { height: 21px; filter: invert(1) }
.footer-mark.product-watermark { opacity: .035; filter: invert(1) }
.product-label {
  font-family: var(--mono); font-size: var(--t-meta); font-weight: 500;
  letter-spacing: .02em; text-transform: lowercase;
}

.product-hero { padding-block: clamp(64px, 8vw, 112px) clamp(72px, 9vw, 128px) }
.product-hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr);
  justify-items: center; gap: clamp(var(--sp6), 4vw, var(--sp8));
}
.product-hero-copy {
  display: flex; flex-direction: column; align-items: center;
  width: min(60rem, 100%); min-width: 0; margin-inline: auto; text-align: center;
}
.product-hero-copy .eyebrow { margin-bottom: var(--sp2) }
.product-hero .display { max-width: 15ch; margin-inline: auto }
.product-page-runtime .product-hero .display { max-width: 19ch }
.product-hero .lead { max-width: 54ch; margin-inline: auto }
.product-hero .cta-row { justify-content: center }
.product-hero-art { width: 100%; max-width: 1232px; min-width: 0; margin-inline: auto }
.product-surfaces {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp2); margin-top: var(--sp5);
}
.product-surfaces span {
  display: inline-flex; align-items: center; min-height: var(--control-h-xs);
  padding-inline: var(--sp3); border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--s1);
  font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-muted);
}

.product-frame {
  position: relative; display: flex; align-items: stretch; justify-content: stretch;
  width: 100%; aspect-ratio: var(--plate-ar); min-width: 0;
  container: mkstage / inline-size; isolation: isolate;
  overflow: clip; padding: var(--plate-pad);
  border: 1px solid var(--line); border-radius: var(--plate-r);
  background-color: var(--plate-mid);
  background-image: linear-gradient(180deg, var(--plate-hi) 0%, var(--plate-mid) 55%, var(--plate-lo) 100%);
  background-position: center; background-repeat: no-repeat; background-size: cover;
  box-shadow: inset 0 1px 0 var(--plate-lip);
}
.product-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--plate-dot) 1px, transparent 1px);
  background-size: var(--plate-grid) var(--plate-grid);
}
.product-frame > * { position: relative; z-index: 1 }
.product-frame.compact { padding: var(--plate-pad) }
.product-page-router { --product-backdrop: url("../art/backdrops/router-textured.webp"); --product-backdrop-position: 38% 52% }
.product-page-studio { --product-backdrop: url("../art/backdrops/studio-textured.webp"); --product-backdrop-position: 64% 46% }
.product-page-runtime { --product-backdrop: url("../art/backdrops/runtime-textured.webp"); --product-backdrop-position: 56% 50% }
.product-theme-router { --product-backdrop: url("../art/backdrops/router-textured.webp"); --product-backdrop-position: 38% 52% }
.product-theme-studio { --product-backdrop: url("../art/backdrops/studio-textured.webp"); --product-backdrop-position: 64% 46% }
.product-theme-runtime { --product-backdrop: url("../art/backdrops/runtime-textured.webp"); --product-backdrop-position: 56% 50% }
.product-page .product-frame {
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--s1) 14%, transparent), color-mix(in srgb, var(--s1) 4%, transparent)),
    var(--product-backdrop);
  background-position: center, var(--product-backdrop-position);
}
.product-page .product-frame::before { display: none }
[data-theme="dark"] .product-page .product-frame {
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 38%, transparent), color-mix(in srgb, var(--bg) 48%, transparent)),
    var(--product-backdrop);
}
.product-frame.product-hero-frame {
  min-height: 0; aspect-ratio: var(--plate-ar);
}
.product-frame > :where(.product-window, .product-detail-card, .mk-mini-window, .product-code-view) {
  width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0;
}
.product-window {
  position: relative; display: flex; flex-direction: column;
  width: 100%; height: 100%; min-width: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  background: var(--s1); box-shadow: var(--mk-lift);
}
.product-window-bar {
  display: flex; align-items: center; gap: var(--sp3); min-height: var(--header-h);
  padding: 0 var(--sp4); border-bottom: 1px solid var(--line);
  font-size: var(--t-small); color: var(--ink-muted);
}
.product-window-bar .meta {
  margin-left: auto; font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint);
}
.product-ui-brand {
  display: inline-flex; align-items: center; gap: var(--sp2); min-width: 0;
  font-family: var(--mono); font-size: var(--t-meta); color: var(--ink); white-space: nowrap;
}
.product-ui-brand strong, .product-ui-brand b { font-weight: 500 }
.product-ui-brand img { width: 12px; height: 13px; flex: 0 0 auto; object-fit: contain }
[data-theme="dark"] .product-ui-brand img { filter: invert(1) }
.product-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}
.product-window-body {
  flex: 1; min-height: 0; padding: var(--sp4); overflow: hidden;
}
.product-window-body.flush { padding: 0 }

.product-studio-hero-frame { display: block }
.product-studio-shell-window {
  width: 100%; height: 100%; max-width: none; aspect-ratio: auto; margin: 0;
}
.product-studio-shell {
  position: relative; inset: auto; width: 100%; height: 100%;
}
.product-studio-projection-pane {
  min-width: 0; min-height: 0; overflow: hidden;
  container: studiopane / inline-size;
}
.product-studio-projections { flex: 1 1 auto; min-height: 0; overflow: hidden }
.product-studio-view { width: 100%; height: 100%; min-height: 0; overflow: hidden }
.product-studio-view .product-canvas,
.product-studio-view .product-steps-view,
.product-studio-view .product-code-view { height: 100% }
.product-studio-view[data-studio-view="canvas"] .product-canvas {
  flex: 1 1 auto; height: auto; min-height: 0;
}
.studio-module-window {
  --studio-compact-type: var(--t-meta);
  width: 100%; height: 100%; font-size: var(--studio-compact-type);
}
.studio-module-window.studio-module-window :where(
  .sapiom-ui-brand, .meta, .mk-tab, .mk-msg, .mk-msg.think, .mk-msg.tool,
  .mk-answer .ttl, .mk-answer p, .mk-chat-composer .ph, .mk-cmd code,
  .mk-mini-row, .mk-mini-row code
) {
  font-size: var(--studio-compact-type); line-height: 1.45;
}
.studio-module-chat { flex: 1 1 auto }
.studio-module-chat .mk-chat-composer { margin-bottom: var(--sp4) }
.studio-module-projection {
  --studio-compact-type: var(--t-meta);
  display: flex; flex-direction: column; width: 100%; height: 100%;
  container: studiocompact / inline-size; font-size: var(--studio-compact-type);
}
.studio-module-projection.studio-module-projection :where(
  .sapiom-ui-brand, .mk-tab, .product-step-row .ord, .product-step-row b,
  .product-step-row code, .product-step-cost, .product-step-context b, .product-step-context code
) {
  font-size: var(--studio-compact-type); line-height: 1.45;
}
.studio-module-projection .sapiom-ui-bar .mk-tabrow { margin-left: auto }
.studio-module-projection .hero-studio-views { flex: 1 1 auto }
@container studiocompact (max-width: 420px) {
  .studio-module-projection > .sapiom-ui-bar {
    flex-wrap: wrap; align-content: center; gap: var(--sp1);
    min-height: 0; padding: var(--sp2);
  }
  .studio-module-projection > .sapiom-ui-bar > .sapiom-ui-brand,
  .studio-module-projection > .sapiom-ui-bar > .mk-tabrow {
    flex-basis: 100%; width: 100%;
  }
  .studio-module-projection > .sapiom-ui-bar > .mk-tabrow { margin-left: 0 }
  .studio-module-projection > .sapiom-ui-bar .sapiom-ui-brand { gap: var(--sp1) }
  .studio-module-projection > .sapiom-ui-bar .mk-tab { padding-inline: var(--sp1) }
  .studio-module-projection .product-step-context span {
    flex-direction: row; align-items: baseline; gap: var(--sp1);
  }
}
.product-router-body { display: flex; flex-direction: column; justify-content: flex-start; padding: clamp(var(--sp4), 4vw, var(--sp8)) }
.product-router-body .product-command, .product-router-body .product-route-list { width: min(900px, 100%); margin-right: auto; margin-left: auto }

.product-command {
  position: relative; display: flex; align-items: center; min-height: var(--sp8);
  padding: var(--sp4) 64px var(--sp4) var(--sp4);
  border-radius: var(--r-xl); background: var(--s2);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.product-command code {
  display: block; flex: 1 1 auto; min-width: 0; overflow: hidden;
  font-family: var(--mono); font-size: clamp(11px, 1.2vw, 13px);
  line-height: 1.65; color: var(--ink); text-overflow: ellipsis;
  white-space: nowrap; overflow-wrap: normal; word-break: normal;
}
.product-command code span { display: inline }
.product-command .mk-copy { top: var(--sp4); right: var(--sp4) }
.product-command--curl {
  flex: 1 1 auto; align-items: stretch; min-height: 0; padding: var(--sp3) 52px var(--sp3) var(--sp3);
}
.product-command--curl pre {
  width: 100%; min-width: 0; margin: 0; overflow: auto;
}
.product-command--curl code {
  overflow: visible; font-size: clamp(9px, 1.05vw, 12px); line-height: 1.5;
  text-overflow: clip; white-space: pre-wrap; overflow-wrap: anywhere;
}
.product-command--curl .mk-copy { top: var(--sp3); right: var(--sp3) }

.product-route-list { display: flex; flex-direction: column; margin-top: var(--sp2) }
.product-route {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) max-content;
  align-items: center; gap: var(--sp3); min-height: var(--control-h-2xs); padding: 0 var(--sp3);
  border-top: 1px solid var(--line); font-size: var(--t-small);
}
.product-route:first-child { border-top: 0 }
.product-route .route-name { font-weight: 500; color: var(--ink) }
.product-route code { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-muted) }
.product-route .route-state { color: var(--ink-faint) }

.router-hero-composite {
  --router-overlap: var(--header-h);
  position: relative; width: 100%; height: 100%; min-height: 0;
}
.router-hero-card {
  position: absolute; display: flex; flex-direction: column;
  width: min(680px, 62%); height: calc((100% + var(--router-overlap)) / 2);
  min-width: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  background: var(--s1); box-shadow: var(--mk-lift);
}
.router-connect-card { top: 0; left: 0; z-index: 1 }
.router-capability-card {
  top: calc((100% - var(--router-overlap)) / 2); right: 0; bottom: auto; z-index: 2;
}
.router-hero-card .product-window-bar { flex: 0 0 auto }
.router-hero-card .product-router-body { justify-content: flex-start; padding: var(--sp4) }
.router-hero-card .product-command, .router-hero-card .product-route-list { width: 100% }
.router-connect-card .product-router-body { min-height: 0 }
.router-capability-grid {
  display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column;
  justify-content: center; gap: var(--sp2); overflow: hidden;
  padding-block: var(--sp3);
  -webkit-mask-image: linear-gradient(to right, transparent, black var(--sp6), black calc(100% - var(--sp6)), transparent);
  mask-image: linear-gradient(to right, transparent, black var(--sp6), black calc(100% - var(--sp6)), transparent);
}
.router-capability-row { display: flex; width: 100%; overflow: hidden }
.router-capability-track {
  display: flex; flex: 0 0 auto; width: max-content; gap: var(--sp2);
  animation: router-capabilities 34s linear infinite paused; will-change: auto;
}
.motion-live .router-capability-track { animation-play-state: running; will-change: transform }
.router-capability-row.reverse .router-capability-track { animation-direction: reverse; animation-duration: 39s }
.router-capability-track > span {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: var(--sp2);
  min-height: var(--control-h-xs); padding-inline: var(--sp3);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--s1);
  font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-muted); white-space: nowrap;
}
.router-capability-track svg {
  width: 14px; height: 14px; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
@keyframes router-capabilities {
  to { transform: translate3d(calc(-50% - var(--sp1)), 0, 0) }
}
@media (prefers-reduced-motion: reduce) {
  .router-capability-track { animation-play-state: paused }
}

.product-tabs {
  display: flex; align-items: center; justify-content: center; gap: var(--sp2);
  min-height: var(--header-h); padding: 0 var(--sp4); overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.product-tabs .mk-tabrow { flex: 0 1 auto }
.product-tabs > .meta { flex: 0 0 auto; margin-left: auto }
.product-projection {
  flex: 1; width: 100%; min-height: 0; overflow: hidden; opacity: 1; transform: translateX(0);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease);
}
.product-projection > * { width: 100%; min-height: 0 }
.product-projection[hidden] { display: none }
.product-projection.studio-enter { opacity: 0; transform: translateX(var(--sp3)) }
.product-projection.studio-leave { opacity: 0; transform: translateX(calc(-1 * var(--sp3))); pointer-events: none }
.product-canvas {
  position: relative; display: grid; place-items: start center; height: 100%; min-height: 0;
  padding-top: var(--sp4); overflow: hidden;
  background-image: radial-gradient(var(--flow-grid-dot) 1px, transparent 1px);
  background-size: var(--sp4) var(--sp4);
}
.product-page-studio [data-studio-view="canvas"] .product-canvas {
  place-items: center; padding: var(--sp4);
}
.product-node-stack { display: flex; flex-direction: column; align-items: center; width: min(520px, 78%) }
.product-node {
  display: grid; grid-template-columns: var(--icon-sm) minmax(0, 1fr) max-content;
  align-items: center; gap: var(--sp2); width: 100%; min-height: var(--row-h);
  padding: 0 var(--sp3); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  background: var(--s1); box-shadow: var(--shadow-soft);
}
.product-node-icon {
  display: grid; place-items: center; width: var(--icon-sm); height: var(--icon-sm);
  border: 1px solid var(--line); border-radius: var(--r-xl); color: var(--ink-muted);
}
.product-node-icon svg { width: 14px; height: 14px }
.product-node-main { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.product-node-title { display: flex; align-items: center; gap: var(--sp2); min-width: 0 }
.product-node-state { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50% }
.product-node-state.live { background: var(--green) }
.product-node-cost {
  font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint); white-space: nowrap;
}
.product-node b { font-size: var(--t-small); font-weight: 500 }
.product-node code { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint) }
.product-connector { width: 1px; height: var(--sp5); background: var(--line-2) }
.product-hero-frame .product-node { min-height: var(--row-h-sm) }
.product-hero-frame .product-connector { height: var(--sp3) }
.product-steps-view {
  display: flex; flex-direction: column; justify-content: flex-start;
  height: 100%; padding: var(--sp4); overflow: hidden;
}
.product-studio-projection-pane .product-steps-view,
.studio-module-projection .product-steps-view { padding: 0 }
.product-step-item {
  flex: 0 0 auto; min-width: 0; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.product-step-item.is-open { background: var(--active-shade) }
.product-step-item:last-child { border-bottom: 0 }
.product-step-row {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) max-content;
  align-items: center; gap: var(--sp3); min-height: 0;
  padding: var(--sp2) var(--sp3);
}
.product-step-item.is-open > .product-step-row,
.product-step-item.is-open > .product-step-context { background: transparent }
.product-step-row .ord { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint) }
.product-step-main { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.product-step-title { display: flex; align-items: center; gap: var(--sp2); min-width: 0 }
.product-step-cost { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink); white-space: nowrap }
.product-step-row b { font-size: var(--t-small); font-weight: 500 }
.product-step-row code { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-muted) }
.product-step-context {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp3);
  padding: var(--sp3) var(--sp3) var(--sp3) calc(2rem + (2 * var(--sp3)));
  background: var(--s2);
}
.product-step-context span { display: flex; min-width: 0; flex-direction: column; gap: 2px }
.product-step-context b {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--ink-faint); text-transform: lowercase;
}
.product-step-context code {
  min-width: 0; overflow: hidden; font-family: var(--mono); font-size: 10px;
  color: var(--ink); text-overflow: ellipsis; white-space: nowrap;
}
@container studiopane (max-width: 440px) {
  .product-node-stack { width: calc(100% - var(--sp4)) }
  .product-node {
    grid-template-columns: var(--icon-sm) minmax(0, 1fr);
    grid-template-rows: auto auto; column-gap: var(--sp2); row-gap: 0;
    padding: var(--sp2);
  }
  .product-node-icon { grid-column: 1; grid-row: 1 / 3 }
  .product-node-main { grid-column: 2; grid-row: 1 }
  .product-node-main code { display: none }
  .product-node b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  .product-node-cost { grid-column: 2; grid-row: 2; justify-self: start }
  .product-step-row {
    grid-template-columns: 1.25rem minmax(0, 1fr) max-content;
    gap: var(--sp2); min-height: 0; padding: var(--sp2);
  }
  .product-step-context {
    grid-template-columns: minmax(0, 1fr); gap: var(--sp2);
    padding: var(--sp2) var(--sp2) var(--sp2) calc(1.25rem + (2 * var(--sp2)));
  }
  .product-step-main code { display: none }
  .product-step-cost, .product-node-cost { font-size: 10px }
}
.product-code-view { position: relative; flex: 1; min-height: 0; height: 100%; padding: var(--sp4); background: var(--s2); overflow: hidden }
.product-code-view pre {
  height: 100%; margin: 0; padding: var(--sp4) 56px var(--sp4) var(--sp4);
  overflow: auto; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--s1); font-family: var(--mono); font-size: 12px;
  line-height: 1.7; color: var(--ink-muted); white-space: pre;
}
.product-code-view .mk-copy { top: var(--sp6); right: var(--sp6) }
.product-code-view .code-key { color: var(--ink); font-weight: 500 }
.product-code-view .code-call { color: var(--ink) }
.product-page-studio [data-studio-view="code"] .product-code-view {
  padding: 0; background: var(--s1);
}
.product-page-studio [data-studio-view="code"] .product-code-view pre {
  padding: var(--sp4) 56px var(--sp4) var(--sp4);
  border: 0; border-radius: 0; background: transparent;
}
.product-page-studio [data-studio-view="code"] .product-code-view .mk-copy {
  top: var(--sp3); right: var(--sp3);
}

.product-section-intro { max-width: 54rem }
.product-section-intro .h2 { max-width: 19ch }
.product-section-intro .sub { max-width: 60ch }
.product-chapters { display: flex; flex-direction: column; gap: var(--band) }
.product-chapter {
  display: grid; grid-template-columns: min(420px, 100%) minmax(0, 760px);
  align-items: center; justify-content: center; gap: clamp(var(--sp5), 4vw, var(--sp8));
}
.product-chapter.flip { grid-template-columns: minmax(0, 760px) min(420px, 100%) }
.product-chapter.flip .product-chapter-copy { grid-column: 2; grid-row: 1 }
.product-chapter.flip .product-chapter-art { grid-column: 1; grid-row: 1 }
.product-chapter-copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp3) }
.product-chapter-copy .h2 { max-width: none; font-size: var(--t-title); letter-spacing: -.016em; line-height: 1.25 }
.product-chapter-copy .sub { margin: 0; max-width: 42ch }
.product-chapter-copy .link-arrow { margin-top: var(--sp2) }
.product-chapter-art { min-width: 0 }

.product-detail-card {
  display: flex; flex-direction: column; width: 100%; height: 100%;
  padding: var(--sp6); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); background: var(--s1); box-shadow: var(--mk-lift); overflow: hidden;
}
.product-frame > .product-code-view { border-radius: var(--r-xl); box-shadow: var(--mk-lift) }
.product-detail-head { display: flex; align-items: center; gap: var(--sp3); margin-bottom: var(--sp5) }
.product-detail-head span {
  display: grid; place-items: center; width: var(--icon); height: var(--icon);
  border: 1px solid var(--line); border-radius: var(--r-xl); color: var(--ink-muted);
}
.product-detail-head svg { width: 17px; height: 17px }
.product-detail-head b { font-size: var(--t-small); font-weight: 500 }
.product-detail-head code { margin-left: auto; font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint) }
.product-code-lines {
  position: relative; display: flex; flex-direction: column; justify-content: flex-start; flex: 1;
  padding: var(--sp4) calc(var(--mk-ctl-sm) + var(--sp6)) var(--sp4) var(--sp4); border-radius: var(--r-xl); background: var(--s2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.product-code-lines code { font-family: var(--mono); font-size: clamp(11px, 1.2vw, 13px); color: var(--ink-muted); line-height: 1.9 }
.product-code-lines strong { color: var(--ink); font-weight: 500 }
.product-code-lines .mk-copy { top: var(--sp4); right: var(--sp4) }

.product-attribute-list { display: flex; flex-direction: column; flex: 1; justify-content: flex-start }
.product-attribute {
  display: grid; grid-template-columns: minmax(7rem, .55fr) minmax(0, 1fr);
  align-items: center; gap: var(--sp4); min-height: var(--row-h-sm);
  border-bottom: 1px solid var(--line);
}
.product-attribute:last-child { border-bottom: 0 }
.product-attribute span { font-size: var(--t-small); color: var(--ink-muted) }
.product-attribute code { font-family: var(--mono); font-size: var(--t-small); color: var(--ink) }

.product-lifecycle { display: flex; flex-direction: column; justify-content: flex-start; height: 100% }
.product-life-row {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) max-content;
  align-items: center; gap: var(--sp3); min-height: var(--row-h-sm);
  padding-inline: var(--sp3); border-bottom: 1px solid var(--line);
}
.product-life-row:last-child { border-bottom: 0 }
.product-life-row .status { width: 7px; height: 7px; border-radius: 50%; background: var(--green) }
.product-life-row b { font-size: var(--t-small); font-weight: 500 }
.product-life-row code { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-muted) }

.product-works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2) }
.product-work { padding: var(--sp6) var(--sp5) 0 0 }
.product-work + .product-work { padding-left: var(--sp5); border-left: 1px solid var(--line) }
.product-work .ord { display: block; margin-bottom: var(--sp4); font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint) }
.product-work h3 { margin: 0 0 var(--sp2); font-size: var(--t-title); font-weight: 600; letter-spacing: -.014em }
.product-work p { margin: 0; color: var(--ink-muted); line-height: 1.6 }

.product-related-head {
  align-items: center; gap: var(--sp2); max-width: 52rem;
  margin-right: auto; margin-left: auto; text-align: center;
}
.product-related-head .eyebrow { margin: 0 }
.product-related-head .h2, .product-related-head .sub { margin-inline: auto }
.product-related {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp4); width: min(1000px, 100%); margin-inline: auto;
}
.product-related-card {
  --related-pad: var(--sp7);
  position: relative; display: flex; flex-direction: column;
  min-width: 0; min-height: 0; height: 100%; padding: 0; gap: 0;
  overflow: hidden; color: inherit; text-decoration: none;
  transition: border-color var(--fast) var(--ease), transform var(--base) var(--ease), box-shadow var(--fast) var(--ease);
}
.product-related-card:focus-within { border-color: var(--ink-faint) }
.product-related-card:has(.product-related-link:focus-visible) {
  outline: 2px solid var(--ink); outline-offset: var(--sp1);
}
.product-related-visual {
  display: flex; align-items: flex-end; aspect-ratio: var(--plate-ar);
  min-height: 0; overflow: hidden;
  padding: var(--related-pad) var(--related-pad) 0; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none;
}
.product-mini-window {
  display: flex; flex-direction: column; width: 100%; height: 100%;
  margin: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--s1); box-shadow: none;
  container: productmini / inline-size;
}
.product-mini-bar {
  display: flex; align-items: center; gap: var(--sp2); min-height: var(--control-h-sm);
  padding-inline: var(--sp3); border-bottom: 1px solid var(--line);
  font-size: var(--t-meta); color: var(--ink-faint);
}
.product-mini-bar b { color: var(--ink); font-weight: 500 }
.product-mini-bar > :last-child { margin-left: auto }
.product-mini-body {
  display: flex; flex: 1; min-height: 0; flex-direction: column;
  justify-content: flex-start; padding: var(--sp4); overflow: hidden;
}
code.product-mini-command {
  display: block; min-width: 0; overflow: hidden; padding: var(--sp2) var(--sp3);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--s2);
  font-family: var(--mono); font-size: 10px; color: var(--ink); text-overflow: ellipsis; white-space: nowrap;
}
.product-mini-body > .mk-cmd {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--control-h-xs);
  align-items: center; gap: var(--sp1); width: 100%;
  min-height: calc(var(--control-h-xs) + var(--sp2)); padding: var(--sp1); flex: 0 0 auto;
  border-radius: var(--r-sm);
}
.product-mini-body > .mk-cmd code {
  overflow: hidden; font-size: var(--t-meta); text-overflow: ellipsis; white-space: nowrap;
}
.product-mini-body > .mk-cmd .mk-copy {
  position: static; inset: auto; align-self: center; justify-self: end;
  margin: 0; transform: none; z-index: 2;
}
.product-mini-rows { display: flex; min-height: 0; flex-direction: column; margin-top: var(--sp2) }
.product-mini-row {
  display: grid; grid-template-columns: 7px minmax(0, 1fr) max-content;
  align-items: center; gap: var(--sp2); min-height: var(--control-h-xs);
  border-top: 1px solid var(--line); font-size: var(--t-meta);
}
.product-mini-row:first-child { border-top: 0 }
.product-mini-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--green) }
.product-mini-row b { min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap }
.product-mini-row code { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint); white-space: nowrap }
@container productmini (max-width: 380px) {
  .product-mini-studio .product-mini-bar > :last-child { display: none }
}
.product-related-copy {
  display: flex; flex: 1; flex-direction: column; gap: var(--sp2); height: 100%; padding: var(--related-pad);
  transition: background-color var(--fast) var(--ease);
}
.product-related-copy .meta { margin: 0 }
.product-related-copy h3 { min-height: 0 }
.product-related-copy p { margin: 0 }
.product-related-copy .link-arrow { margin-top: auto; padding-top: var(--sp3) }
.product-related-link::after { content: ""; position: absolute; inset: 0; z-index: 1 }
.product-related-card .mk-copy { z-index: 2 }
.product-related-link:focus-visible::after { outline: 0 }
.product-related-card:hover,
.product-related-card:focus-within { border-color: var(--ink-faint) }
.product-related-card:hover .product-related-copy,
.product-related-card:focus-within .product-related-copy { background: var(--hl) }
.product-related-card:hover .product-related-link,
.product-related-card:focus-within .product-related-link {
  color: var(--ink); text-decoration: underline; text-underline-offset: var(--sp1);
}
@media (hover: hover) {
  .product-related-card:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(calc(-1 * var(--sp1)));
  }
}
.product-related-card:has(.product-related-link:focus-visible) .product-related-copy { background: var(--hl) }

.product-runtime-hero-frame {
  display: flex; align-items: flex-start; justify-content: flex-start;
}
.runtime-hero-composite {
  --runtime-overlap: var(--header-h);
  position: relative; width: 100%; height: 100%; min-height: 0;
}
.runtime-hero-card {
  position: absolute; width: min(680px, 62%);
  height: calc((100% + var(--runtime-overlap)) / 2);
}
.runtime-lifecycle-card { top: 0; left: 0; z-index: 1 }
.runtime-trace-card {
  top: calc((100% - var(--runtime-overlap)) / 2); right: 0; z-index: 2;
}
.runtime-hero-body {
  display: flex; flex-direction: column; justify-content: flex-start;
  gap: var(--sp2); padding: var(--sp3);
}
.runtime-hero-body .product-lifecycle { height: auto }
.runtime-hero-card .product-life-row { min-height: var(--control-h-xs) }
.runtime-waiting {
  display: inline-flex; align-items: center; gap: var(--sp2); margin-left: auto;
  font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-muted);
}
.runtime-waiting i,
.runtime-trace-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber) }
.runtime-trace-body {
  display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column;
  justify-content: space-between; gap: var(--sp2); padding: var(--sp3) var(--sp4);
}
.runtime-trace {
  position: relative; display: flex; min-height: 0; flex-direction: column;
}
.runtime-trace::before {
  content: ""; position: absolute; top: calc(var(--control-h-2xs) / 2); bottom: calc(var(--control-h-2xs) / 2);
  left: 3px; width: 1px; background: var(--line-2);
}
.runtime-trace-row {
  position: relative; display: grid; grid-template-columns: 7px minmax(0, 1fr) max-content;
  align-items: center; gap: var(--sp3); min-height: var(--control-h-2xs);
  font-size: var(--t-small);
}
.runtime-trace-row b { font-weight: 500 }
.runtime-trace-row code { font-family: var(--mono); font-size: var(--t-meta); color: var(--ink-faint) }
.runtime-trace-row.is-complete .runtime-trace-dot { background: var(--green) }
.runtime-trace-row.is-next .runtime-trace-dot {
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--ink-faint);
}
.runtime-trace-dot { position: relative; z-index: 1 }
.runtime-trace-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp2);
  padding-top: var(--sp2); border-top: 1px solid var(--line);
}
.runtime-trace-meta span { display: flex; min-width: 0; flex-direction: column; gap: 2px }
.runtime-trace-meta b {
  font-family: var(--mono); font-size: var(--t-meta); font-weight: 500; color: var(--ink-faint);
}
.runtime-trace-meta code {
  min-width: 0; overflow: hidden; font-family: var(--mono); font-size: var(--t-meta);
  color: var(--ink); text-overflow: ellipsis; white-space: nowrap;
}
.product-studio-chat .mk-sugg:nth-child(n + 3) { display: none }

@media (max-width: 1000px) {
  .product-related-card { --related-pad: var(--sp6) }
  .product-studio-shell .product-studio-rail { display: none }
  .router-hero-composite { display: flex; flex-direction: column; gap: var(--sp3) }
  .router-hero-card {
    position: relative; inset: auto; width: 100%; height: calc(50% - (var(--sp3) / 2));
  }
  .runtime-hero-composite { display: flex; flex-direction: column; gap: var(--sp3) }
  .runtime-hero-card {
    position: relative; inset: auto; width: 100%; height: calc(50% - (var(--sp3) / 2));
  }
  .product-page-runtime .product-hero-frame { aspect-ratio: 6 / 5 }
  .runtime-lifecycle-card .product-life-row:first-child,
  .runtime-lifecycle-card .product-life-row:last-child { display: none }
  .runtime-hero-body { gap: var(--sp1); padding: var(--sp2) var(--sp3) }
  .runtime-hero-card .product-life-row,
  .runtime-trace-row { min-height: 28px }
  .runtime-trace-body { padding: var(--sp2) var(--sp3) }
  .product-chapter, .product-chapter.flip { grid-template-columns: minmax(0, 1fr); gap: var(--sp6) }
  .product-chapter .product-chapter-copy,
  .product-chapter.flip .product-chapter-copy { grid-column: 1; grid-row: 1 }
  .product-chapter .product-chapter-art,
  .product-chapter.flip .product-chapter-art { grid-column: 1; grid-row: 2 }
  .product-chapter-copy .sub { max-width: 58ch }
  .product-works { grid-template-columns: minmax(0, 1fr) }
  .product-work { padding: var(--sp5) 0 }
  .product-work + .product-work { padding-left: 0; border-left: 0; border-top: 1px solid var(--line) }
  .product-related { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}

@media (max-width: 640px) {
  .product-related-card { --related-pad: var(--sp5) }
  .product-hero { padding-block: var(--sp7) var(--sp8) }
  .product-frame.product-hero-frame { min-height: 0; aspect-ratio: 4 / 5 }
  .product-page-router .product-hero-frame { aspect-ratio: 2 / 3 }
  .product-page-runtime .product-hero-frame { aspect-ratio: 5 / 8 }
  .product-frame.product-studio-hero-frame { aspect-ratio: 2 / 3 }
  .product-studio-shell-window {
    width: 100%; height: 100%; max-width: none; aspect-ratio: auto;
  }
  .product-frame, .product-frame.compact { padding: var(--sp3) }
  .product-window-bar { min-height: var(--row-h-sm); padding-inline: var(--sp3) }
  .product-window-bar .meta { display: none }
  .product-window-body { padding: var(--sp1) }
  .product-command { min-height: var(--row-h-sm); padding: var(--sp2) calc(var(--mk-ctl-sm) + var(--sp5)) var(--sp2) var(--sp3) }
  .product-command code { font-size: 10px; line-height: 1.4 }
  .product-command .mk-copy { top: var(--sp2); right: var(--sp2) }
  .product-route-list { margin-top: var(--sp1) }
  .product-route { grid-template-columns: 3.5rem minmax(0, 1fr); min-height: var(--sp5); padding-inline: var(--sp2) }
  .product-route .route-state { display: none }
  .product-studio-chat .mk-chat-feed,
  .product-studio-chat .mk-chat-sugg { display: none }
  .product-studio-chat .mk-chat-composer { margin: auto var(--sp3) var(--sp2) }
  .product-studio-projection-pane .pane-tabs .acts { display: none }
  .product-studio-projection-pane .pane-tabs { min-height: var(--row-h-sm); height: var(--row-h-sm) }
  .router-hero-card .product-router-body { padding: var(--sp2) }
  .router-capability-card .product-window-bar { display: flex }
  .router-capability-grid { gap: var(--sp1); padding-block: var(--sp2) }
  .router-capability-track > span { min-height: var(--control-h-2xs); padding-inline: var(--sp2); font-size: 10px }
  .product-tabs { min-height: var(--row-h-sm); padding-inline: var(--sp2) }
  .product-tabs .mk-tab { padding-inline: var(--sp2) }
  .product-node-stack { width: 82% }
  .product-node {
    grid-template-columns: var(--icon-sm) minmax(0, 1fr);
    grid-template-rows: auto auto; column-gap: var(--sp2); row-gap: 0;
    padding: var(--sp2);
  }
  .product-node-icon { grid-column: 1; grid-row: 1 / 3 }
  .product-node-main { grid-column: 2; grid-row: 1 }
  .product-node-cost { grid-column: 2; grid-row: 2; justify-self: start }
  .product-node b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  .product-node code { display: none }
  .product-hero-frame .product-node { min-height: var(--control-h-xs) }
  .product-hero-frame .product-connector { height: var(--sp2) }
  .product-canvas { padding-top: var(--sp4) }
  .product-step-row {
    grid-template-columns: 1.5rem minmax(0, 1fr) max-content;
    gap: var(--sp2); min-height: 0; padding: var(--sp2);
  }
  .product-step-row code { display: none }
  .product-steps-view { padding: var(--sp2) }
  .product-step-context {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr);
    gap: var(--sp1); padding: var(--sp1) var(--sp2);
  }
  .product-studio-projection-pane .product-step-context,
  .studio-module-projection .product-step-context {
    padding-left: calc(1.5rem + (2 * var(--sp2)));
  }
  .product-code-view { padding: var(--sp2) }
  .product-code-view pre {
    padding: var(--sp3); font-size: 10px; line-height: 1.6;
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal;
  }
  .product-code-view .mk-copy { top: var(--sp4); right: var(--sp4) }
  .product-related { grid-template-columns: minmax(0, 1fr) }
  .product-related-visual {
    aspect-ratio: var(--plate-ar); padding: var(--related-pad) var(--related-pad) 0;
  }
  .product-detail-card { padding: var(--sp4) }
  .product-detail-head { margin-bottom: var(--sp3) }
  .product-detail-head code { display: none }
  .product-attribute { grid-template-columns: minmax(5.5rem, .55fr) minmax(0, 1fr); min-height: var(--control-h-2xs) }
  .product-life-row { grid-template-columns: 1.5rem minmax(0, 1fr); min-height: var(--control-h-2xs) }
  .product-life-row code { display: none }
  .runtime-hero-card .product-window-bar { min-height: var(--row-h-sm); padding-inline: var(--sp3) }
  .runtime-trace-meta { gap: var(--sp1) }
}

@media (max-width: 420px) {
  .product-surfaces span { padding-inline: var(--sp2) }
  .product-detail-head span { width: var(--icon-sm); height: var(--icon-sm) }
}
