/* ngx-mcp-apps documentation.

   One rule shapes the theme: what people read is set on paper, what machines read (code, the
   protocol log, the line for agents) is set in mono on dark ink, in both themes.

   Two colours carry meaning and are used for nothing else: raspberry is the app speaking,
   teal is the host speaking. Buttons and navigation use ink. */
:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --ink: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --app: #6639ba;
  --host: #08664d;
  --accent: #6639ba;
  --code-bg: #f6f8fa;
  /* The dark panels: the protocol log, the developer block */
  --pit: #0d1117;
  --pit-ink: #e6edf3;
  --pit-muted: #9198a1;
  --pit-line: #30363d;
  --app-lit: #c297ff;
  --host-lit: #56d4b0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 3px 12px rgba(31, 35, 40, 0.06);
  --shadow-lg: 0 8px 24px rgba(31, 35, 40, 0.12), 0 2px 6px rgba(31, 35, 40, 0.06);
  --display: 'Mona Sans', 'Segoe UI', system-ui, sans-serif;
  --body: 'Mona Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0d1117;
  --surface: #151b23;
  --ink: #f0f6fc;
  --muted: #9198a1;
  --line: #30363d;
  --app: #b392f0;
  --host: #56d4b0;
  --accent: #b392f0;
  --code-bg: #151b23;
  --pit: #010409;
  --pit-line: #262c36;
  --shadow: 0 0 0 1px rgba(240, 246, 252, 0.04), 0 3px 12px rgba(1, 4, 9, 0.6);
  --shadow-lg: 0 0 0 1px rgba(240, 246, 252, 0.05), 0 12px 32px rgba(1, 4, 9, 0.7);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-text-size-adjust: 100%;
}
::selection {
  background: var(--ink);
  color: var(--bg);
}
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 0.09em;
  text-decoration-color: var(--app);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 0.16em;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}
code {
  font-family: var(--mono);
  font-size: 0.84em;
}
button {
  font: inherit;
  color: inherit;
}

/* The line for automated readers: quiet for people, first in the document for agents */
.for-agents {
  margin: 0;
  padding: 0.45rem 1.25rem;
  font: 400 0.7rem/1.6 var(--mono);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.for-agents.is-agent {
  padding-block: 0.7rem;
  font-size: 0.84rem;
  color: var(--pit-ink);
  background: var(--pit);
  border-bottom-color: var(--pit-line);
}
.for-agents.is-agent a {
  text-decoration-color: var(--host-lit);
}
.for-agents.is-agent :focus-visible {
  outline-color: var(--pit-ink);
}

/* Shell: navigation on the left, content on the right */
.shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  max-width: 86rem;
  margin: 0 auto;
}
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 2.5rem 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}
.brand {
  font: 700 1.08rem/1.2 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  display: block;
  margin-top: 0.3rem;
  font: 400 0.68rem var(--mono);
  letter-spacing: 0;
  color: var(--muted);
}
.side ul {
  list-style: none;
  margin: 0 0 0 -0.65rem;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.side nav a {
  display: block;
  padding: 0.32rem 0.65rem;
  border-radius: 5px;
  font-size: 0.96rem;
  color: var(--muted);
  text-decoration: none;
}
.side nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.side nav a[aria-current='page'] {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
.side-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
  font-size: 0.88rem;
}
.side-foot button,
.wire button {
  cursor: pointer;
  padding: 0.22rem 0.65rem;
  font-size: 0.84rem;
  border-radius: 5px;
  background: transparent;
  border: 1px solid currentColor;
}
.side-foot button:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

main {
  min-width: 0;
  padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem) 5rem;
}

/* Text pages */
.prose {
  max-width: 45rem;
}
.prose:has(.stage) {
  max-width: none;
}
.prose:has(.stage) > :not(.stage, pre, .shiki) {
  max-width: 45rem;
}
h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.12;
  text-wrap: balance;
}
.prose h1 {
  font-size: 2.7rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
}
.prose h2 {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 3.5rem 0 0.85rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.prose h3 {
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.2rem 0 0.5rem;
}
.anchor {
  color: inherit;
  text-decoration: none;
}
.anchor:hover {
  text-decoration: underline;
  text-decoration-color: var(--app);
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}
.prose ul {
  padding-left: 1.2rem;
  list-style: square;
}
.prose li {
  margin-bottom: 0.35rem;
}
.prose li::marker {
  color: var(--muted);
}
:not(pre) > code {
  padding: 0.14em 0.36em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
blockquote {
  margin: 0 0 1rem;
  padding: 0.1rem 1rem;
  border-left: 3px solid var(--ink);
  color: var(--muted);
}

/* Code blocks are dark in both themes; the copy button is added by site.js */
pre {
  position: relative;
  margin: 0 0 1.4rem;
  padding: 1.05rem 1.2rem;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--pit-line);
  background: var(--pit) !important;
  color: var(--pit-ink);
  font: 400 0.78rem/1.7 var(--mono);
  tab-size: 2;
  scrollbar-color: var(--pit-line) transparent;
}
pre code {
  font-size: inherit;
}
pre :focus-visible,
.wire :focus-visible {
  outline-color: var(--pit-ink);
}
.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.12rem 0.6rem;
  font: 0.76rem var(--body);
  cursor: pointer;
  border-radius: 5px;
  border: 1px solid var(--pit-line);
  background: var(--pit);
  color: var(--pit-muted);
}
.copy:hover {
  color: var(--pit-ink);
  border-color: var(--pit-muted);
}

.table {
  overflow-x: auto;
  margin: 0 0 1.4rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  line-height: 1.5;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 1.25rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 700;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
td:first-child code {
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Home: the idea in plain words on the left, the idea itself playing on the right */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  gap: 2.5rem 3.5rem;
  align-items: center;
  padding-top: 0.5rem;
}
.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.5rem, 1.1rem + 4.4vw, 4.6rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}
.lede {
  font-size: 1.18rem;
  line-height: 1.55;
  max-width: 33rem;
  margin: 0 0 1.75rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
}

/* The scene: an anonymous chat window. Everything the app draws is raspberry. */
.scene {
  min-width: 0;
}
.chatwin {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1.45;
}
:root[data-theme='dark'] .chatwin {
  border-color: var(--muted);
  box-shadow: var(--shadow-lg);
}
.chatwin-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
}
.face {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--ink);
  box-shadow:
    inset 0 0 0 0.3rem var(--ink),
    inset 0 0 0 1rem var(--surface);
}
.chatwin-body {
  position: relative;
  display: grid;
  height: 21rem;
  padding: 1rem 1rem 0;
  overflow: hidden;
}
.story {
  grid-area: 1 / 1;
  display: none;
  align-content: start;
  gap: 0.7rem;
}
.story.is-on {
  display: grid;
}
.story p {
  margin: 0;
}
.ask {
  justify-self: end;
  max-width: 88%;
  padding: 0.45rem 0.9rem;
  border-radius: 16px 16px 4px 16px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}
.card {
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
:root[data-theme='dark'] .card {
  border-color: var(--line);
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font: 600 1.05rem/1.2 var(--display);
  letter-spacing: -0.015em;
}
.sample {
  font: 400 0.62rem/1.2 var(--mono);
  letter-spacing: 0;
  color: var(--muted);
}
/* What is hidden before its turn; shown as soon as it gets the class "on" */
.ask,
.say,
.card,
.booked {
  opacity: 0;
  translate: 0 0.6rem;
}
.card {
  translate: 0 1.6rem;
}
.ask.on,
.say.on,
.card.on,
.booked.on {
  opacity: 1;
  translate: 0 0;
}

/* Story one: a list to tick */
.ticks {
  list-style: none;
  margin: 0.7rem 0 0.8rem;
  padding: 0;
  display: grid;
  gap: 0.42rem;
}
.ticks li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ticks li::before {
  content: '';
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent center / 0.8rem no-repeat;
}
.ticks li.on {
  color: var(--muted);
  text-decoration: line-through;
}
.ticks li.on::before {
  border-color: var(--app);
  background-color: var(--app);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme='dark'] .ticks li.on::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230b1514' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.meter {
  height: 0.45rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  overflow: hidden;
}
.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--app);
}
[data-packed='1'] .meter span {
  width: 25%;
}
[data-packed='2'] .meter span {
  width: 50%;
}
.card-note {
  margin-top: 0.4rem !important;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Story two: a chart that draws itself */
.bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  height: 10.2rem;
  margin-top: 0.5rem;
}
.bar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  text-align: center;
}
.bar i {
  height: calc(var(--h) * 0.72);
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  transform: scaleY(0);
  transform-origin: bottom;
}
.bars.on .bar i {
  transform: scaleY(1);
}
.bar.hot i {
  background: var(--app);
}
.bar b {
  padding-top: 0.3rem;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
}
.bar em {
  margin-bottom: 0.2rem;
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 600;
  color: var(--app);
  opacity: 0;
}
.bar.hot em {
  opacity: 1;
}

/* Story three: a time to pick */
.slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.8rem 0 0.9rem;
}
.slots span {
  padding: 0.5rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}
.slots .picked {
  border-color: var(--app);
  background: var(--app);
  color: var(--bg);
}
.booked {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  color: var(--app);
}
.booked::before {
  content: '';
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--app)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 0.85rem no-repeat;
}
:root[data-theme='dark'] .booked::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5' fill='none' stroke='%230b1514' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.pointer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  overflow: visible;
  opacity: 0;
  transform: translate(18rem, 20rem);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35));
}
.pointer path {
  fill: var(--ink);
  stroke: var(--surface);
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.pointer.on {
  opacity: 1;
}

.composer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.9rem 1rem 1rem;
  padding: 0.4rem 0.4rem 0.4rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--bg);
}
.typed {
  flex: 1;
  min-width: 0;
  min-height: 1.45em;
  white-space: nowrap;
  overflow: hidden;
}
.typed:empty::before {
  content: 'Ask anything';
  color: var(--muted);
}
.typed:not(:empty)::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--ink);
}
.send {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 12.5v-9m-3.5 3.5L8 3.5l3.5 3.5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 1rem no-repeat;
}

.scene-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}
.scene-controls[hidden] {
  display: none;
}
.scene-controls button {
  cursor: pointer;
  padding: 0.28rem 0.75rem;
  font-size: 0.84rem;
  border-radius: 2rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.scene-controls button:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.scene-controls button[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.scene-controls .toggle {
  min-width: 4.2rem;
  margin-right: 0.35rem;
  border-color: var(--ink);
  border-radius: 5px;
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .ask,
  .say,
  .card,
  .booked {
    transition:
      opacity 0.35s ease,
      translate 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .ticks li::before,
  .slots span,
  .bar em {
    transition: all 0.2s ease;
  }
  .meter span {
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .bar i {
    transition:
      transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
      background-color 0.25s ease;
  }
  .bar:nth-child(2) i {
    transition-delay: 0.08s, 0s;
  }
  .bar:nth-child(3) i {
    transition-delay: 0.16s, 0s;
  }
  .bar:nth-child(4) i {
    transition-delay: 0.24s, 0s;
  }
  .bar:nth-child(5) i {
    transition-delay: 0.32s, 0s;
  }
  .bar:nth-child(6) i {
    transition-delay: 0.4s, 0s;
  }
  .pointer {
    transition:
      transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1),
      opacity 0.25s ease;
  }
  .pointer.tap path {
    animation: tap 0.28s ease;
    transform-origin: 2px 2px;
  }
  @keyframes tap {
    40% {
      transform: scale(0.8);
    }
  }
}

.install {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}
.install pre {
  margin: 0;
  width: 100%;
  padding: 0.85rem 4.6rem 0.85rem 1.1rem;
  font-size: 0.84rem;
}
.install code::before {
  content: '$ ';
  color: var(--pit-muted);
}
.go {
  display: inline-flex;
  align-items: center;
  padding: 0 1.3rem;
  min-height: 3rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
}
.go:hover {
  background: transparent;
  color: var(--ink);
}
.go.quiet {
  background: transparent;
  color: var(--ink);
}
.go.quiet:hover {
  background: var(--ink);
  color: var(--bg);
}

/* The stage: a piece of conversation on paper, and the wire as a sequence diagram on ink.
   The app sits on the left of the wire, the host on the right; every message is an arrow. */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  margin: 0 0 2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
:root[data-theme='dark'] .stage {
  border-color: var(--pit-line);
}
.chat {
  padding: 1.4rem 1.4rem 1.5rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}
.chat p {
  margin: 0;
}
.bubble {
  justify-self: end;
  max-width: 85%;
  padding: 0.5rem 0.95rem;
  border-radius: 16px 16px 4px 16px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  overflow-wrap: anywhere;
}
.bubble.assistant {
  justify-self: start;
  border-radius: 16px 16px 16px 4px;
  background: transparent;
  border: 1px solid var(--line);
}
/* What the user can say next: the conversation goes on, the app stays the same */
.rounds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  min-height: 2.4rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.rounds:empty {
  display: none;
}
/* What the page can make the host do: a scenario of host.js fills it */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--host);
}
.actions-row:empty {
  display: none;
}
.actions-row span {
  flex-basis: 100%;
  font-weight: 600;
}
.actions-row button {
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--host) 50%, var(--line));
  background: transparent;
  color: var(--ink);
}
.actions-row button[aria-pressed='true'] {
  background: var(--host);
  color: var(--surface);
  font-weight: 600;
}
.actions-row button:hover:not([aria-pressed='true']) {
  background: color-mix(in srgb, var(--host) 14%, transparent);
}
.rounds button {
  cursor: pointer;
  padding: 0.4rem 0.95rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
.toolcall {
  font-size: 0.88rem;
  color: var(--host);
}
.toolcall code {
  background: color-mix(in srgb, var(--host) 12%, transparent);
}
/* The iframe border itself, drawn in the colour of the app */
.frame {
  position: relative;
  margin-top: 0.45rem;
  border: 1px dashed color-mix(in srgb, var(--app) 55%, var(--line));
  border-radius: 10px;
  background: var(--bg);
}
.frame::before {
  content: 'iframe';
  position: absolute;
  top: -0.62rem;
  left: 0.9rem;
  padding: 0 0.4rem;
  font: 500 0.66rem/1.2rem var(--mono);
  color: var(--app);
  background: var(--surface);
}
.frame iframe {
  display: block;
  width: 100%;
  height: 22rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color-scheme: inherit;
}
.frame.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.frame.is-fullscreen::before {
  content: none;
}
.frame.is-fullscreen iframe {
  height: 100% !important;
  border-radius: 0;
}
[data-chat-extra] {
  display: grid;
  gap: 0.6rem;
}
.context {
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.context .label {
  display: block;
  font-weight: 600;
  color: var(--app);
}

.wire {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--pit);
  color: var(--pit-ink);
}
.wire-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.9rem;
}
.stage .wire h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.wire button {
  color: var(--pit-muted);
}
.wire button:hover {
  color: var(--pit-ink);
}
/* The two ends of the wire */
.ends {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0 1.1rem 0.45rem;
  font: 500 0.7rem/1.4 var(--mono);
}
.ends span:first-child {
  color: var(--app-lit);
}
.ends span:last-child {
  color: var(--host-lit);
}
.wire ol {
  --rail: color-mix(in srgb, var(--pit-ink) 22%, transparent);
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.1rem 1rem;
  flex: 1 1 0;
  min-height: 14rem;
  max-height: 36rem;
  overflow-y: auto;
  scrollbar-color: var(--pit-line) transparent;
  font: 400 0.72rem/1.55 var(--mono);
  /* The two lifelines stay in place while the messages scroll */
  background:
    linear-gradient(var(--rail), var(--rail)) 1.1rem 0 / 1px 100% no-repeat,
    linear-gradient(var(--rail), var(--rail)) calc(100% - 1.1rem) 0 / 1px 100% no-repeat;
}
.wire li {
  display: grid;
  padding: 0.8rem 0 0.1rem;
}
.wire li.out {
  color: var(--app-lit);
}
.wire li.in {
  color: var(--host-lit);
}
/* The words "app → host" stay for screen readers; the eye gets the arrow */
.wire .who {
  position: relative;
  display: block;
  height: 0.7rem;
  margin-bottom: 0.15rem;
  font-size: 0;
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat;
  transform-origin: left center;
}
.wire li.in .who {
  transform-origin: right center;
}
.wire .who::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.55rem;
  height: 0.6rem;
  translate: 0 -50%;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.wire li.in .who::after {
  right: auto;
  left: 0;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.wire li code,
.wire .detail {
  padding: 0 0.9rem;
}
.wire li code {
  border-radius: 0;
  background: none;
  font-size: inherit;
  font-weight: 500;
  color: var(--pit-ink);
  overflow-wrap: anywhere;
}
.wire li.in code,
.wire li.in .detail {
  text-align: right;
}
.wire .detail {
  color: var(--pit-muted);
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: no-preference) {
  .wire .who {
    animation: cross 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }
  @keyframes cross {
    from {
      transform: scaleX(0);
    }
  }
}

/* Home: what it is good for, in plain words */
.uses {
  margin: 5.5rem 0 0;
}
.uses > h2,
.dev h2 {
  margin: 0 0 1.5rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.uses-lede {
  max-width: 44rem;
  margin: -0.5rem 0 2rem;
  font-size: 1.1rem;
}
.uses-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 2.5rem;
}
.uses-list div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.uses-list h3 {
  margin: 0 0 0.5rem;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.uses-list p {
  margin: 0;
  color: var(--muted);
}

/* Home: the technical part, on ink like everything else machines read */
.dev {
  --bg: var(--pit);
  --surface: var(--pit);
  --ink: var(--pit-ink);
  --muted: var(--pit-muted);
  --line: var(--pit-line);
  --app: var(--app-lit);
  margin: 5.5rem 0 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--pit-line);
  border-radius: 16px;
  background: var(--pit);
  color: var(--pit-ink);
  scroll-margin-top: 1rem;
}
.dev-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: end;
}
.dev h2 {
  margin-bottom: 1rem;
}
.dev-head p {
  margin: 0;
  max-width: 36rem;
}
.dev pre {
  background: color-mix(in srgb, var(--pit-ink) 7%, var(--pit)) !important;
}
.dev .copy {
  background: transparent;
}
.facts {
  margin: 3rem 0 0;
  border-bottom: 1px solid var(--line);
}
.facts div {
  display: grid;
  grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: 0.25rem 2.5rem;
  align-items: baseline;
  padding: 1.1rem 0 1.2rem;
  border-top: 1px solid var(--line);
}
.facts h3 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.facts h3 code {
  font-weight: 500;
  letter-spacing: 0;
}
.facts p {
  margin: 0;
  color: var(--muted);
}
.next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
  margin: 2.5rem 0 0;
}
.next a {
  display: block;
  color: var(--muted);
  font-size: 0.96rem;
  text-decoration: none;
}
.next strong {
  display: block;
  margin-bottom: 0.3rem;
  font: 600 1.12rem/1.2 var(--display);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-decoration-color: var(--app);
  text-underline-offset: 0.22em;
}
.next a:hover strong {
  text-decoration-thickness: 0.16em;
}
.dev :focus-visible {
  outline-color: var(--pit-ink);
}
.disclaimer {
  max-width: 45rem;
  margin: 2.5rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

@media (max-width: 68rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .scene {
    max-width: 25rem;
  }
  .dev-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .install {
    max-width: 36rem;
  }
}
@media (max-width: 60rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem 0.6rem;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .brand span {
    display: inline;
    margin-left: 0.3rem;
  }
  .side nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }
  .side ul {
    display: flex;
    gap: 0.2rem;
    margin: 0 -1.25rem;
    padding: 0.15rem 1.25rem 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .side nav a {
    white-space: nowrap;
  }
  .side-foot {
    margin-top: 0;
    flex-wrap: nowrap;
    gap: 0.7rem;
    font-size: 0.84rem;
  }
  main {
    padding-top: 1.75rem;
  }
  .chatwin {
    box-shadow: 0.3rem 0.3rem 0 var(--ink);
    margin-right: 0.3rem;
  }
  .scene-controls {
    gap: 0.3rem;
  }
  .scene-controls button {
    padding: 0.28rem 0.6rem;
    font-size: 0.78rem;
  }
  .scene-controls .toggle {
    min-width: 0;
    margin-right: 0.15rem;
  }
  .install pre {
    padding-right: 3.8rem;
    font-size: 0.74rem;
  }
  .uses,
  .dev {
    margin-top: 3.5rem;
  }
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat {
    padding: 1.1rem 0.9rem 1.2rem;
  }
  .wire ol {
    max-height: 19rem;
  }
  .uses-list,
  .facts div,
  .next {
    grid-template-columns: minmax(0, 1fr);
  }
  .prose h1 {
    font-size: 2.05rem;
  }
  .prose h2 {
    font-size: 1.35rem;
  }
}

/* Components: a list to choose from. Each row is one link to the page with the code. */
.pick {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  border-top: 1px solid var(--line);
}
.prose .pick li {
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.pick a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1.25rem;
  align-items: baseline;
  padding: 0.85rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
}
.pick a:hover,
.pick a:focus-visible {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.pick strong {
  font-size: 1.08rem;
}
.pick span {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.95rem;
}
.prose .pick code {
  grid-column: 2;
  grid-row: 1;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
@media (max-width: 40rem) {
  .pick a {
    grid-template-columns: minmax(0, 1fr);
  }
  .prose .pick code {
    grid-column: 1;
    grid-row: auto;
  }
}
.prose ul.pick {
  list-style: none;
  padding: 0;
}

/* The Components section: its own menu beside the text, as in a component library */
.with-menu {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 0 2.5rem;
  align-items: start;
}
.menu {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  border-left: 1px solid var(--line);
}
.menu ul,
.menu-fold ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu a,
.menu-fold a {
  display: block;
  padding: 0.32rem 0.9rem;
  margin-left: -1.5px;
  border-left: 1.5px solid transparent;
  color: var(--muted);
  font-size: 0.93rem;
  text-decoration: none;
}
.menu a:hover,
.menu-fold a:hover {
  color: var(--ink);
}
.menu a[aria-current='page'],
.menu-fold a[aria-current='page'] {
  color: var(--ink);
  font-weight: 650;
  border-left-color: var(--app);
}
.menu-fold {
  display: none;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.menu-fold summary {
  cursor: pointer;
  padding: 0.7rem 0.95rem;
  font-weight: 650;
}
.menu-fold ul {
  padding: 0 0.5rem 0.6rem;
  border-top: 1px solid var(--line);
}
.menu-fold a {
  padding: 0.5rem 0.6rem;
}
/* A component alone: the preview is small, the wire stays readable */
.stage.is-preview .frame iframe {
  height: 9rem;
}
.stage.is-preview .wire ol {
  min-height: 9rem;
  max-height: 18rem;
}
@media (max-width: 75rem) {
  .with-menu {
    grid-template-columns: minmax(0, 1fr);
  }
  .menu {
    display: none;
  }
  .menu-fold {
    display: block;
  }
}

/* Preview / Code */
.tabs {
  margin: 0 0 2rem;
}
.tablist {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--line);
}
.tablist[hidden] {
  display: none;
}
.tablist button {
  cursor: pointer;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}
.tablist button[aria-selected='true'] {
  background: var(--ink);
  color: var(--bg);
}
.panel > :last-child {
  margin-bottom: 0;
}

/* "On this page": the headings of a long page, beside the text on a wide screen, folded on a phone */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.toc {
  display: none;
}
.toc-fold {
  margin: 0 0 1.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.94rem;
}
.toc-fold summary {
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
}
.toc-fold ul,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0 0.9rem 0.7rem;
  display: grid;
  gap: 0.3rem;
}
.toc-fold a,
.toc a {
  color: var(--muted);
  text-decoration: none;
}
.toc-fold a:hover,
.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--app);
}
@media (min-width: 80rem) {
  .doc {
    grid-template-columns: minmax(0, 1fr) 12rem;
    gap: 0 3rem;
    align-items: start;
  }
  .toc-fold {
    display: none;
  }
  .toc {
    display: block;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
    font-size: 0.88rem;
    line-height: 1.4;
  }
  .toc p {
    margin: 0.2rem 0 0.7rem;
    font-weight: 600;
    color: var(--ink);
  }
  .toc ul {
    padding: 0;
    gap: 0.55rem;
  }
}

/* Previous and next page, at the bottom of every page */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 45rem;
  margin: 4.5rem 0 0;
}
.pager a {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1.1rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.pager span {
  font-size: 0.85rem;
  color: var(--muted);
}
.pager strong {
  font: 600 1.05rem/1.3 var(--display);
  letter-spacing: -0.01em;
}
.pager .to-prev:hover {
  border-color: var(--ink);
}
.pager .to-next {
  grid-column: 2;
  text-align: right;
  border: 1px solid var(--line);
}
.pager .to-next strong {
  font-size: 1.15rem;
}
.pager a:focus-visible {
  outline-offset: 3px;
}
.pager .to-next:hover {
  background: var(--ink);
  color: var(--bg);
}
.pager .to-next:hover span {
  color: inherit;
}
@media (max-width: 40rem) {
  .pager {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
  }
  .pager .to-next {
    grid-column: 1;
    grid-row: 1;
  }
  .pager > span:empty {
    display: none;
  }
}

/* Home: questions, one line each until opened */
.faq {
  max-width: 46rem;
  margin: 5rem 0 0;
}
.faq h2 {
  margin: 0 0 1rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 600;
  font-size: 1.05rem;
}
.faq details p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* The stage, chat first: the app and the conversation in one column, the messages between the app and the host
   folded underneath, for who wants to see them. */
.stage {
  grid-template-columns: minmax(0, 1fr);
  max-width: 48rem;
}
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.stage-title {
  font-weight: 600;
}
.stage-bar button {
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
}
.stage-bar button:hover {
  border-color: var(--ink);
}
/* What the model will read: one line, replaced at each update */
.chat .context {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.55rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-left: 3px solid var(--app);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--app) 7%, transparent);
  font-size: 0.85rem;
  line-height: 1.45;
}
.chat .context[hidden] {
  display: none;
}
.chat .context .label {
  display: inline;
  flex: none;
  font-weight: 600;
}
.chat .context.is-new {
  animation: context-new 0.9s ease-out;
}
@keyframes context-new {
  from {
    background: color-mix(in srgb, var(--app) 22%, transparent);
  }
}
/* The conversation after the app has a height of its own, so the page does not grow with every turn */
.conversation {
  max-height: 20rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.conversation:empty {
  display: none;
}
/* The messages between the app and the host, folded */
details.wire {
  display: block;
  border-top: 1px solid var(--line);
}
:root[data-theme='dark'] details.wire {
  border-top-color: var(--pit-line);
}
details.wire > summary {
  cursor: pointer;
  padding: 0.8rem 1.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--pit-ink);
  list-style-position: inside;
}
details.wire > summary:hover {
  color: #fff;
}
details.wire[open] > summary {
  padding-bottom: 0.6rem;
}
details.wire .ends {
  padding-inline: 1.4rem;
}
details.wire ol {
  flex: none;
  min-height: 0;
  max-height: 22rem;
  padding-inline: 1.4rem;
  background:
    linear-gradient(var(--rail), var(--rail)) 1.4rem 0 / 1px 100% no-repeat,
    linear-gradient(var(--rail), var(--rail)) calc(100% - 1.4rem) 0 / 1px 100% no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .chat .context.is-new {
    animation: none;
  }
}

/* Keyboard: the first stop of every page jumps over the navigation */
.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 0.75rem;
}
main:focus {
  outline: none;
}

/* ---------------------------------------------------------------- refined theme
   Calm surfaces, 1px lines, soft depth, one violet accent, Mona Sans. */
body {
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'ss01';
}
h1,
h2,
h3 {
  font-weight: 650;
  letter-spacing: -0.025em;
}
a {
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: inherit;
}

/* Navigation: quiet, the current page marked by a soft fill and a bar */
.side nav a[aria-current='page'] {
  position: relative;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}
.side nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -0.55rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.side-foot button {
  border-color: var(--line);
  border-radius: 6px;
}
.side-foot button:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  border-color: var(--muted);
}

/* Code: light on light, dark on dark, like the rest of the page */
pre {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg) !important;
  color: var(--ink);
  font-size: 0.82rem;
}
.shiki,
.shiki span {
  color: var(--shiki-light);
}
:root[data-theme='dark'] .shiki,
:root[data-theme='dark'] .shiki span {
  color: var(--shiki-dark);
}
pre :focus-visible {
  outline-color: var(--accent);
}
.copy {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
}
.copy:hover {
  color: var(--ink);
  border-color: var(--muted);
}
:not(pre) > code {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border-radius: 6px;
}

/* Buttons: the primary one solid, the others outlined */
.go {
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.go.quiet {
  box-shadow: none;
}

/* The home: a soft glow behind the hero, the chat window floating */
.hero {
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -6rem -10rem auto auto;
  width: 46rem;
  height: 32rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
    radial-gradient(
      closest-side at 30% 70%,
      color-mix(in srgb, var(--host) 14%, transparent),
      transparent
    );
  filter: blur(20px);
}
.chatwin {
  border-radius: 16px;
}
.dev {
  border-radius: 16px;
  border: 1px solid var(--pit-line);
  box-shadow: var(--shadow-lg);
}

/* Cards and boxes: one radius, one line, soft depth */
.stage {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pager a {
  border-radius: 10px;
  border-color: var(--line);
}
.pager a:hover,
.pager a:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--ink);
}
.pager .to-next {
  border-color: var(--line);
}
.pager .to-next:hover span {
  color: var(--muted);
}
.pager .to-next strong {
  color: var(--ink);
}
.prose h2 {
  border-top-color: var(--line);
}
.chatwin,
:root[data-theme='dark'] .chatwin {
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
}
@media (max-width: 60rem) {
  /* On a phone the navigation is a row: the bar of the current page goes under it */
  .side nav a[aria-current='page']::before {
    left: 0.65rem;
    right: 0.65rem;
    top: auto;
    bottom: -0.05rem;
    width: auto;
    height: 2px;
  }
}
/* The glow behind the hero is decoration: it never widens the page */
main {
  overflow-x: clip;
}
