:root {
  --bg: #0f0f0f;
  --panel: #1b1b1d;
  --panel-inner: #18181a;
  --active: #202022;
  --row: rgba(255, 255, 255, .02);
  --row-active: rgba(255, 255, 255, .03);
  --text: rgba(255, 255, 255, .8);
  --text-muted: rgba(255, 255, 255, .5);
  --text-soft: rgba(255, 255, 255, .32);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --ease-deep: cubic-bezier(.16, 1, .3, 1);
  --ease-calm: cubic-bezier(.2, .82, .24, 1);
  --motion-fast: .42s;
  --motion-content: .78s;
  --motion-capsule: .82s;
  --motion-row: 1.16s;
  --motion-rail: .66s;
  --motion-sequence: .96s;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  line-height: 23px;
  font-weight: 300;
  font-synthesis-weight: none;
  overflow: hidden;
}

body.logic-style-page,
body.design-system-page {
  overflow: auto;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

a {
  text-decoration: none;
}

.logic-board {
  min-height: 100vh;
  width: max-content;
  min-width: 100%;
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 26px 26px 64px;
  background: var(--bg);
}

.logic-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.logic-stack {
  display: grid;
  align-content: start;
  gap: 20px;
}

.logic-label {
  width: 529px;
  margin: 0;
  padding: 0 24px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 23px;
  font-weight: 300;
}

.logic-nav {
  width: 100%;
  min-width: 1120px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 14px;
}

.logic-link {
  height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border-radius: 100px;
  color: var(--text-muted);
  background: var(--panel);
  font-size: 14px;
  line-height: 16.99px;
  font-weight: 300;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--ease-calm),
    color var(--motion-content) var(--ease-calm),
    background var(--motion-content) var(--ease-calm);
}

.logic-link:hover,
.logic-link.is-active {
  color: var(--text);
  background: var(--active);
}

.logic-link:active {
  transform: scale(.985);
}

.meta-list-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 60px;
  left: 0;
  width: 100%;
  transform: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 0;
  padding-top: 60px;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.scenario-switch {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  margin-top: -60px;
  padding: 60px max(24px, calc((100vw - 1377px) / 2)) 0;
  pointer-events: auto;
  overflow-x: auto;
  overflow-y: visible;
  scroll-padding-inline: max(24px, calc((100vw - 1377px) / 2));
  scrollbar-width: none;
}

.scenario-switch::-webkit-scrollbar {
  display: none;
}

body.logic-style-page [data-design-scenarios].scenario-switch,
body.logic-style-page [data-logic-scenarios].scenario-switch,
body.logic-style-page [data-rules-scenarios].scenario-switch {
  --scenario-edge-gutter: 0px;
}

body.logic-style-page [data-design-scenarios].scenario-switch::before,
body.logic-style-page [data-design-scenarios].scenario-switch::after,
body.logic-style-page [data-logic-scenarios].scenario-switch::before,
body.logic-style-page [data-logic-scenarios].scenario-switch::after,
body.logic-style-page [data-rules-scenarios].scenario-switch::before,
body.logic-style-page [data-rules-scenarios].scenario-switch::after {
  content: "";
  flex: 0 0 var(--scenario-edge-gutter);
  width: var(--scenario-edge-gutter);
  min-width: var(--scenario-edge-gutter);
  height: 1px;
  pointer-events: none;
}

.scenario-pill {
  position: relative;
  width: 320px;
  min-width: 320px;
  min-height: 102px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 28px;
  border-radius: 39px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  line-height: 23px;
  font-weight: 300;
  pointer-events: auto;
  cursor: pointer;
  overflow: visible;
  transition:
    background var(--motion-content) var(--ease-calm),
    color var(--motion-content) var(--ease-calm),
    opacity var(--motion-content) var(--ease-calm),
    transform var(--motion-content) var(--ease-calm);
}

.scenario-pill.is-active {
  opacity: 1;
}

.scenario-pill:not(.is-active) {
  opacity: .82;
}

.scenario-pill:active {
  transform: scale(.992);
}

.session-pill {
  width: 305px;
  justify-content: flex-start;
  gap: 13px;
  padding-inline: 34px;
}

.session-pill > span {
  min-width: 154px;
  opacity: .8;
}

.contract-pill > span {
  opacity: .8;
}

.plan-pill > span {
  opacity: .8;
}

.meta-role-pill > span {
  opacity: .8;
}

.chat-pill {
  height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border-radius: 100px;
  color: var(--text);
  background: #000;
  font-size: 14px;
  line-height: 16.99px;
  font-weight: 300;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--ease-calm),
    color var(--motion-fast) var(--ease-calm),
    background var(--motion-content) var(--ease-calm);
}

.chat-pill:active {
  transform: scale(.985);
}

.audit-control-zone {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 10px);
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 172px;
  padding: 0 30px 18px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .48s var(--ease-calm),
    transform .64s var(--ease-calm);
}

.scenario-pill:hover .audit-control-zone,
.scenario-pill:focus-within .audit-control-zone,
.scenario-pill.is-audit-hover .audit-control-zone,
.audit-control-zone:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-2px);
}

.audit-action-pill,
.audit-info-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  font-size: 14px;
  line-height: 16.99px;
  font-weight: 300;
  white-space: nowrap;
  cursor: pointer;
  transition:
    opacity .46s var(--ease-calm),
    transform .58s var(--ease-calm),
    background .58s var(--ease-calm),
    color .58s var(--ease-calm);
}

.audit-action-pill {
  height: 47px;
  padding: 15px 24px;
  color: var(--text);
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
  pointer-events: auto;
}

.audit-action-pill:active,
.audit-info-pill:active {
  transform: scale(.985);
}

.audit-info-pill {
  height: 41px;
  padding: 12px 18px;
  color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .08);
  opacity: 0;
  transform: translateY(5px);
  pointer-events: none;
}

.audit-control-zone:hover .audit-info-pill,
.audit-control-zone.is-info-hover .audit-info-pill,
.audit-control-zone:focus-within .audit-info-pill {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.flow-viewport {
  position: absolute;
  inset: 0;
  overflow-x: auto;
  overflow-y: auto;
  padding-top: 282px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.flow-viewport::-webkit-scrollbar {
  display: none;
}

.flow-stage {
  position: relative;
  width: 100%;
  min-height: 1580px;
  padding-top: 36px;
  padding-left: 0;
  padding-right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
}

.flow-column {
  width: 575px;
  flex: 0 0 575px;
  display: grid;
  align-content: start;
  gap: 20px;
  scroll-margin-left: 314px;
  transform: translateX(var(--scenario-offset, 0px));
  transition: transform var(--motion-capsule) var(--ease-calm);
}

.flow-card {
  position: relative;
  width: 575px;
  display: grid;
  align-content: start;
  align-items: start;
  justify-items: center;
  gap: 0;
  padding: 15px 23px 28px;
  border-radius: 39px;
  background: var(--panel);
}

.logic-expand-all-control {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 92px;
  height: 92px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 39px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease-calm);
}

.logic-expand-all-control:hover {
  color: var(--text);
  background: var(--panel-inner);
}

.logic-expand-all-control:focus-visible {
  outline: none;
}

.logic-expand-all-control.is-active {
  color: var(--text-muted);
  background: transparent;
}

.logic-expand-all-control.is-active:hover {
  color: var(--text);
  background: var(--panel-inner);
}

.logic-expand-all-control:active {
  transform: scale(.985);
}

.flow-card.is-all-expanded-flat .flow-row.is-collapsible {
  cursor: default;
}

.flow-card.is-all-expanded-flat .flow-row.is-collapsible.is-open {
  background: transparent;
  color: var(--text);
}

.flow-card.is-all-expanded-flat .flow-row.is-collapsible:focus-visible {
  box-shadow: none;
}

.flow-card.is-height-animating {
  transition: height var(--motion-row) var(--ease-deep);
  will-change: height;
}

.flow-card.is-height-measuring .flow-row.is-collapsible,
.flow-card.is-height-measuring .flow-row.is-collapsible.is-open,
.flow-card.is-height-measuring .flow-row-content,
.flow-card.is-height-measuring .flow-row-content-inner {
  transition: none !important;
}

.flow-card--modules {
  opacity: 1;
  transition: none;
}

.flow-card--modules.is-content-leaving,
.flow-card--modules.is-content-enter {
  opacity: 1;
}

.flow-card--modules.is-content-leaving > .segment-shell .segment-button,
.flow-card--modules.is-content-leaving > .flow-list .flow-row-inner,
.flow-card--modules.is-content-enter > .segment-shell .segment-button,
.flow-card--modules.is-content-enter > .flow-list .flow-row-inner {
  opacity: 1;
}

.flow-card--modules.is-sequence-enter > .segment-shell .segment-button,
.flow-card--modules.is-sequence-enter > .flow-list .flow-row-inner {
  opacity: 1;
  animation: none;
}

.flow-card--modules.is-sequence-enter > .segment-shell .segment-button {
  animation-delay: var(--sequence-delay, 180ms);
}

.flow-card--modules.is-sequence-enter > .flow-list .flow-row-inner {
  animation-delay: calc(var(--sequence-delay, 180ms) + 95ms);
}

.flow-title {
  width: 529px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 24px;
  border-radius: 34px;
  color: var(--text);
  text-align: center;
  font-size: 14px;
  line-height: 23px;
  font-weight: 300;
  margin: 0 0 10px;
  opacity: 1;
  transition: opacity .76s var(--ease-calm);
}

.segment-shell {
  --active-left: 7px;
  --active-top: 6px;
  --active-width: 0px;
  --active-height: 47px;
  width: min(529px, 100%);
  height: 59px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 7px;
  border-radius: 100px;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--panel-inner);
  scrollbar-width: none;
}

.segment-shell.is-compact {
  width: 358px;
}

.segment-shell::-webkit-scrollbar {
  display: none;
}

.segment-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: var(--active-top);
  left: var(--active-left);
  width: var(--active-width);
  height: var(--active-height);
  border-radius: 100px;
  background: var(--active);
  pointer-events: none;
  transition: none;
}

.segment-shell.is-motion-ready::before {
  transition:
    left var(--motion-capsule) var(--ease-soft),
    top var(--motion-capsule) var(--ease-soft),
    width var(--motion-capsule) var(--ease-soft),
    height var(--motion-capsule) var(--ease-soft);
}

.segment-shell.is-portier-tabs::after {
  content: "";
  flex: 0 0 0;
  height: 1px;
}

.segment-shell.is-module-tabs {
  width: max-content;
  max-width: min(529px, 100%);
}

.segment-shell.is-module-tabs.is-compact {
  width: 358px;
  max-width: min(529px, 100%);
}

.segment-button {
  height: 47px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
  line-height: 16.99px;
  font-weight: 300;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition:
    color var(--motion-content) var(--ease-calm),
    opacity var(--motion-content) var(--ease-calm),
    transform var(--motion-fast) var(--ease-calm);
}

.segment-button:active {
  transform: scale(.985);
}

.segment-button.is-active {
  color: var(--text);
  background: transparent;
}

.segment-shell.is-settled .segment-button.is-active {
  color: rgba(255, 255, 255, .88);
}

.flow-rows-slot {
  width: 529px;
  display: grid;
  margin-top: 20px;
  opacity: 1;
  transition: none;
}

.flow-rows-slot.is-content-leaving,
.flow-rows-slot.is-content-enter {
  opacity: 1;
}

.flow-card > .segment-shell + .flow-list {
  margin-top: 20px;
}

.flow-list {
  width: 529px;
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 34px;
  background: var(--row);
  opacity: 1;
  transition:
    opacity .76s var(--ease-calm);
  will-change: opacity;
}

.flow-list.is-inline-swapping {
  opacity: 1;
}

.flow-row {
  width: 529px;
  display: grid;
  align-items: center;
  min-height: 73px;
  padding: 11px 0;
  border-radius: 20px;
  color: var(--text-muted);
  text-align: left;
  background: transparent;
}

.flow-row.is-link {
  text-decoration: none;
  cursor: pointer;
}

.flow-row.is-link:focus {
  outline: none;
}

.flow-row.is-link .flow-row-inner {
  transition:
    opacity .78s var(--ease-calm),
    background var(--motion-content) var(--ease-calm),
    transform var(--motion-fast) var(--ease-calm);
}

.flow-row.is-link:hover .flow-row-inner,
.flow-row.is-link:focus-visible .flow-row-inner {
  background: var(--row);
}

.flow-row.is-link:focus-visible .flow-row-inner {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .11);
}

.flow-row.is-link:active .flow-row-inner {
  transform: scale(.992);
  background: var(--row-active);
}

.flow-row.is-raised:not(.is-collapsible) {
  background: var(--row-active);
}

.flow-row.is-collapsible {
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 34px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transform: translateZ(0);
  transition: color .62s var(--ease-calm);
}

.flow-row.is-collapsible:focus {
  outline: none;
}

.flow-row.is-collapsible:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .11);
}

.flow-row.is-collapsible:hover {
  color: var(--text);
}

.flow-row.is-collapsible.is-open {
  margin: 0;
  border-radius: 34px;
  background: var(--row-active);
  color: var(--text);
  transition:
    background .88s var(--ease-calm),
    color .62s var(--ease-calm);
}

.flow-row-summary {
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  color: currentColor;
  font-size: 14px;
  line-height: 26px;
  font-weight: 300;
  transition:
    color .62s var(--ease-calm),
    opacity .76s var(--ease-calm);
}

.flow-row-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows var(--motion-row) var(--ease-deep),
    opacity .72s var(--ease-calm);
  will-change: grid-template-rows, opacity;
}

.flow-row.is-open .flow-row-content {
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows var(--motion-row) var(--ease-deep),
    opacity .82s var(--ease-calm) .18s;
}

.flow-row-content-inner {
  min-height: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 0 24px;
  opacity: 0;
  transition:
    padding-bottom var(--motion-row) var(--ease-deep),
    opacity .78s var(--ease-calm);
}

.flow-row.is-open .flow-row-content-inner {
  padding-bottom: 30px;
  opacity: 1;
  transition-delay: 0s, .18s;
}

.flow-rows-slot.is-content-leaving .flow-row:not(.is-intro) .flow-row-inner,
.flow-rows-slot.is-content-leaving .flow-row-summary,
.flow-rows-slot.is-content-leaving .flow-row-content-inner,
.flow-rows-slot.is-content-enter .flow-row:not(.is-intro) .flow-row-inner,
.flow-rows-slot.is-content-enter .flow-row-summary,
.flow-rows-slot.is-content-enter .flow-row-content-inner,
.flow-list.is-inline-swapping .flow-row-inner {
  opacity: 0;
}

.flow-list.is-sequence-enter .flow-row:not(.is-intro) .flow-row-inner,
.flow-list.is-sequence-enter .flow-row-summary,
.flow-list.is-sequence-enter .flow-row-content-inner,
.flow-rows-slot.is-sequence-enter .flow-row:not(.is-intro) .flow-row-inner,
.flow-rows-slot.is-sequence-enter .flow-row-summary,
.flow-rows-slot.is-sequence-enter .flow-row-content-inner {
  opacity: 0;
  animation: sequenceRise var(--motion-sequence) var(--ease-soft) forwards;
  animation-delay: calc(var(--sequence-index, 0) * 125ms);
}

@keyframes sequenceRise {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.flow-row-inner {
  width: 529px;
  display: grid;
  gap: 10px;
  padding: 15px 24px;
  border-radius: 34px;
  opacity: 1;
  transition: opacity .78s var(--ease-calm);
}

.flow-row-title,
.flow-row-text {
  width: 481px;
  color: var(--text);
  font-size: 14px;
  line-height: 23px;
  font-weight: 300;
}

.flow-row-text {
  color: var(--text-muted);
  white-space: pre-line;
}

.flow-row-content .flow-row-text {
  width: 481px;
  color: var(--text-muted);
}

.flow-bullet-list {
  width: 481px;
  margin: 0;
  padding: 0 0 0 19px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 23px;
  font-weight: 300;
}

.flow-bullet-list li {
  padding-left: 2px;
}

.flow-bullet-list li + li {
  margin-top: 8px;
}

.flow-bullet-list li::marker {
  color: rgba(255, 255, 255, .42);
}

.flow-row.is-intro .flow-row-text {
  color: var(--text);
}

.flow-row.is-intro .flow-row-inner {
  opacity: 1;
  animation: none;
  transition: none;
}

.bottom-rail {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: 74px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 100px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.bottom-thumb {
  width: 28px;
  height: 7px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .58);
  transform: translateX(0);
  transition:
    transform var(--motion-rail) var(--ease-soft),
    background var(--motion-content) ease;
  will-change: transform;
}

@media (max-width: 900px) {
  body,
  body.logic-style-page,
  body.design-system-page {
    overflow: auto;
  }

  .logic-board {
    width: 100%;
    min-width: 0;
    padding: 16px 16px 48px;
  }

  .logic-nav {
    min-width: 0;
  }

  .logic-row {
    display: grid;
  }

  .logic-label {
    width: 100%;
  }

  .meta-list-app {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .topbar {
    position: relative;
    top: auto;
    width: calc(100vw - 32px);
    margin: 44px auto 0;
    padding-top: 60px;
    transform: none;
  }

  .brand-pill,
  .session-pill,
  .scenario-pill,
  .arrow-shell {
    justify-self: start;
  }

  .scenario-switch {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    justify-content: flex-start;
    margin-top: -60px;
    padding: 60px max(16px, calc((100% - 320px) / 2)) 0;
    scroll-padding-inline: max(16px, calc((100% - 320px) / 2));
    scrollbar-width: none;
  }

  .scenario-switch::-webkit-scrollbar {
    display: none;
  }

  .scenario-pill {
    width: 320px;
    min-width: 320px;
  }

  .flow-viewport {
    position: relative;
    overflow: visible;
    padding-top: 0;
  }

  .flow-stage {
    width: auto;
    min-height: 0;
    padding: 52px 16px 48px;
    display: grid;
    gap: 20px;
  }

  .flow-column,
  .flow-card,
  .flow-title,
  .flow-rows-slot,
  .flow-list,
  .flow-row,
  .flow-row-inner,
  .flow-row-title,
  .flow-row-text,
  .flow-row-content .flow-row-text {
    width: 100%;
  }

  .logic-expand-all-control {
    width: 84px;
    height: 84px;
  }

  .flow-column {
    flex: none;
    transform: none;
  }

  .bottom-rail {
    display: none;
  }
}

/* Generic artifact guardrails.
   Pages with body.logic-style-page are ordinary scrollable artifacts, not the
   fullscreen Meta Agent List shell. These rules intentionally override local
   accidental sticky/fixed/fullscreen behavior. */
body.logic-style-page {
  overflow: auto !important;
}

.logic-style-page .meta-list-app {
  width: 100% !important;
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
}

.logic-style-page .topbar {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  transform: none !important;
}

.logic-style-page .flow-viewport {
  position: relative !important;
  inset: auto !important;
  overflow: visible !important;
  padding-top: 0 !important;
}

.logic-style-page .flow-stage {
  min-height: 0;
}

.logic-style-page .flow-column {
  transform: none !important;
}

.logic-style-page .segment-shell:not(.is-portier-tabs):not(.is-module-tabs):not(.is-fixed-width) {
  width: max-content !important;
  max-width: min(529px, 100%) !important;
}

.logic-style-page .segment-shell,
.logic-style-page .segment-button,
.logic-style-page .flow-card,
.logic-style-page .flow-title,
.logic-style-page .flow-list,
.logic-style-page .flow-row {
  position: relative;
}
