/* The developers page (components/site/demo_stage/developers/): the code card every scene and panel shares, the four
   scenes (events, api, sdk, mcp) and the four section panels. Only what this page adds to demo_stage.css. */
.demo-stage .code {
  min-width: 0; display: flex; flex-direction: column; overflow: auto; border-radius: 20px; padding: 18px 20px;
  background: var(--ds-bezel); color: rgb(255 255 255 / .78); box-shadow: 0 18px 40px -26px rgb(0 0 0 / .45);
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.55;
  .call { color: #fff; font-weight: 600; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid rgb(255 255 255 / .14); overflow-wrap: anywhere; }
  .call.next { margin-top: 18px; }
  .call.prose { font-family: Geist, ui-sans-serif, system-ui, sans-serif; font-size: 14px; }
  .src span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 4ch; text-indent: -4ch; }
  .src .new, .src .new span { color: #fff; }
  .src .gap { padding-top: 1.55em; }
  .reply { display: grid; gap: 2px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / .14); }
  .reply small { font-family: Geist, ui-sans-serif, system-ui, sans-serif; font-size: 12.5px; color: rgb(255 255 255 / .62); margin-bottom: 2px; }
  .reply + .grow .reply, .grow + .grow .reply { margin-top: 10px; }
  .status { color: #7ddcb0; font-weight: 600; }
  .out { white-space: pre-wrap; overflow-wrap: anywhere; }
  .tabs-row { display: flex; gap: 20px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid rgb(255 255 255 / .14); font-family: Geist, ui-sans-serif, system-ui, sans-serif; font-size: 13.5px; }
  .tabs-row .on { color: #fff; font-weight: 600; text-decoration: underline 2px; text-underline-offset: 8px; }
}
.dark .demo-stage .code { outline: 1px solid color-mix(in oklab, var(--foreground) 22%, transparent); }

/* The record card's earlier rows, already there when a scene starts. */
.demo-stage .event.before :is(b, small) { color: var(--muted-foreground); }

/* A shop page on the phone: the product, the chat button, the messenger and the floating search bar. */
.demo-stage :is([data-demo-scene=sdk], .panel.dv-store) {
  .phone { height: 600px; }
  .address { margin: 14px auto 0; width: max-content; font-size: 12px; color: var(--muted-foreground); background: var(--ds-panel); border-radius: 99px; padding: 3px 14px; }
  .product { display: grid; gap: 4px; padding: 16px; font-size: 13.5px; }
  .product img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--muted); margin-bottom: 8px; }
  .product b { font-size: 17px; font-weight: 600; line-height: 1.25; }
  .product .price { font-variant-numeric: tabular-nums; }
  .product p { color: var(--muted-foreground); line-height: 1.45; margin: 4px 0 8px; }
  .product :is(.buy, .ask) { display: block; text-align: center; border-radius: 99px; padding: 10px 0; font-weight: 500; margin-top: 6px; transition: transform .15s var(--ds-ease), background-color .2s, color .2s; }
  .product .buy { background: var(--foreground); color: var(--background); }
  .product .ask { background: var(--muted); }
  .product .ask.picked { background: var(--brand); color: var(--brand-foreground); transform: scale(.97); }

  .launcher { position: absolute; right: 14px; bottom: 14px; width: 52px; height: 52px; border-radius: 99px; background: var(--brand); color: var(--brand-foreground); display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgb(0 0 0 / .45); opacity: 0; transform: scale(.6); transition: opacity .3s var(--ds-ease), transform .3s var(--ds-ease); }
  .launcher svg { width: 24px; height: 24px; }
  .launcher.on { opacity: 1; transform: none; }
  .launcher.on.off { opacity: 0; transform: scale(.6); }

  .messenger { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; background: var(--card); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .3s var(--ds-ease), transform .3s var(--ds-ease); }
  .messenger.on { opacity: 1; transform: none; }
  .messenger header { padding: 18px 18px 12px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; }
  .messenger header small { display: block; font-size: 12px; font-weight: 400; color: var(--muted-foreground); }
  .talk { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px 14px; }
  .bubble { max-width: 84%; width: fit-content; border-radius: 17px; padding: 9px 13px; font-size: 13.5px; line-height: 1.4; margin-bottom: 8px; }
  .bubble.me { margin-left: auto; background: var(--brand); color: var(--brand-foreground); border-bottom-right-radius: 5px; }
  .bubble.them { background: var(--muted); border-bottom-left-radius: 5px; }
  .inbox { display: none; flex: 1; min-height: 0; padding: 18px; }
  .inbox > b { display: block; font-size: 22px; font-weight: 600; margin-bottom: 12px; }
  .thread-row { padding: 12px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
  .thread-row b { display: block; font-weight: 500; }
  .thread-row small { display: block; font-size: 12.5px; line-height: 1.4; color: var(--muted-foreground); }
  .tabs { display: none; justify-content: space-around; padding: 14px 8px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-foreground); }
  .tabs .on { color: var(--foreground); font-weight: 600; }
  .messenger.list :is(.inbox, .tabs) { display: block; }
  .messenger.list .tabs { display: flex; }
  .messenger.list .talk { display: none; }

  .finder { position: absolute; left: 10px; right: 10px; top: 44px; z-index: 4; opacity: 0; transform: translateY(-10px); transition: opacity .3s var(--ds-ease), transform .3s var(--ds-ease); }
  .finder.on { opacity: 1; transform: none; }
  .bar { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; border-radius: 99px; background: var(--card); box-shadow: 0 10px 28px -14px rgb(0 0 0 / .4); font-size: 14px; }
  .bar svg { width: 16px; height: 16px; flex: none; color: var(--muted-foreground); }
  .drop { margin-top: 8px; padding: 4px 14px 6px; border-radius: 18px; background: var(--card); box-shadow: 0 18px 40px -20px rgb(0 0 0 / .45); opacity: 0; transform: translateY(-6px); transition: opacity .3s var(--ds-ease), transform .3s var(--ds-ease); }
  .drop.on { opacity: 1; transform: none; }
  .hit { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .hit img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--muted); }
  .hit b { display: block; font-weight: 500; line-height: 1.25; }
  .hit small { display: block; font-size: 12px; color: var(--muted-foreground); line-height: 1.3; }
  .hit > span { font-variant-numeric: tabular-nums; }
  .ask-row { padding: 12px 0 8px; font-size: 13.5px; font-weight: 500; color: var(--brand); }
}

/* Scenes with a code card, Zellwo's view and the record card. */
.demo-stage :is([data-demo-scene=events], [data-demo-scene=api]) {
  .thread.top { justify-content: flex-start; padding-top: 18px; }
  .idle { font-size: 14px; color: var(--muted-foreground); padding: 4px 2px; }
  .work { font-size: 14px; }
  .fact { display: grid; gap: 2px; padding: 12px 2px; border-top: 1px solid var(--border); font-size: 15px; }
  .work + .grow .fact, .grow:has(.work) + .grow .fact { border-top: 0; }
  .fact small { font-size: 12.5px; color: var(--muted-foreground); }
  .fact b { color: var(--brand); font-weight: 600; }
  .ref { border-radius: 6px; padding: 0 4px; margin: 0 -4px; transition: background-color .3s, color .3s; }
  .ref.lit { background: color-mix(in oklab, var(--brand) 14%, transparent); color: var(--brand); font-weight: 500; }
  .once { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted-foreground); padding: 4px 0 10px; }
  .once::before, .once::after { content: ''; flex: 1; height: 1px; background: var(--border); }
}

.demo-stage [data-demo-scene=mcp] {
  .assistant { display: flex; flex-direction: column; padding: 0; }
  .server { padding: 16px 22px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted-foreground); }
  .linked:not(:empty)::before { content: '· '; }
  .talk { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 22px 8px; }
  .bubble { margin-left: auto; max-width: 84%; width: fit-content; min-height: 1.45em; border-radius: 18px; padding: 10px 15px; margin-bottom: 16px; background: var(--muted); font-size: 15px; line-height: 1.45; }
  .said p { font-size: 16px; line-height: 1.5; margin-bottom: 10px; }
  .grow:has(.said) + .grow:has(.bubble) .bubble { margin-top: 10px; }
  .tools-pane { display: flex; flex-direction: column; }
  :is(.consent, .calls) { padding: 22px; }
  :is(.consent, .calls) > b { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
  :is(.consent, .calls) > small { display: block; font-size: 13px; color: var(--muted-foreground); margin: 2px 0 14px; }
  .choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
  .choice small { font-size: 14px; color: var(--muted-foreground); }
  .box-tick { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--muted-foreground); }
  .allow { display: block; margin-top: 16px; text-align: center; border-radius: 12px; padding: 11px 0; background: var(--brand); color: var(--brand-foreground); font-weight: 500; font-size: 14px; transition: transform .15s var(--ds-ease); }
  .allow.picked { transform: scale(.97); }
  .call-row { display: grid; gap: 3px; padding: 14px 0; border-top: 1px solid var(--border); }
  .call-row code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 14px; font-weight: 600; }
  .call-row span { font-size: 13px; color: var(--muted-foreground); line-height: 1.4; }
  .wait-row { padding: 14px 0 2px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--brand); }
}

/* Section panels: their boxes keep their frames (demo_stage.css flattens a panel's other children for the scenes). */
.demo-stage .panel.still > :is(.box, .code) { display: block; }
.demo-stage .panel.still > .code { display: flex; }
.demo-stage .panel.still > .phone { display: block; }
.demo-stage .panel.dv-events {
  .types > b { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
  .types > small { display: block; font-size: 13px; color: var(--muted-foreground); margin: 2px 0 10px; }
  .type-row { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px 18px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--border); font-size: 14px; }
  .type-row code { grid-column: 1 / -1; font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; overflow-wrap: anywhere; }
  .type-row span { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
}
.demo-stage .panel.dv-reference {
  .about { display: grid; gap: 8px; align-content: start; padding: 22px; }
  .about code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; color: var(--muted-foreground); }
  .about b { font-size: 20px; font-weight: 600; line-height: 1.3; }
  .about p { font-size: 15px; line-height: 1.5; color: var(--muted-foreground); }
}
.demo-stage .panel.dv-store {
  .phone { height: 560px; }
  .record { align-self: center; padding: 22px; }
}
.demo-stage .panel.dv-tokens {
  .access { padding: 22px 24px; }
  .access > b { display: block; font-size: 18px; font-weight: 600; }
  .access > small { display: block; font-size: 13px; color: var(--muted-foreground); margin: 2px 0 10px; }
  .grant { display: grid; gap: 2px; padding: 14px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted-foreground); }
  .grant b { font-size: 15px; font-weight: 500; color: var(--foreground); }
}

@media (min-width: 1024px) {
  .demo-stage :is([data-demo-scene=events], [data-demo-scene=api]) {
    .desk { grid-template-columns: 410px minmax(0, 1fr) 290px; gap: 16px; height: 600px; align-items: start; }
    .side { height: auto; }
  }
  .demo-stage [data-demo-scene=events] {
    .desk, .code, .ticket { height: 520px; }
  }
  .demo-stage [data-demo-scene=sdk] {
    .desk { grid-template-columns: minmax(0, 1fr) 334px; gap: 40px; height: 600px; align-items: center; }
    .code { height: auto; max-height: 600px; }
    .canvas .phone { position: relative; left: auto; bottom: auto; width: 334px; }
  }
  .demo-stage [data-demo-scene=mcp] {
    .desk { grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; height: 600px; align-items: start; }
  }
  .demo-stage .panel.still:is(.dv-events, .dv-reference, .dv-store) { display: grid; }
  .demo-stage .panel.dv-events { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
  .demo-stage .panel.dv-events .type-row { grid-template-columns: minmax(0, 1fr) auto auto; justify-content: stretch; }
  .demo-stage .panel.dv-events .type-row code { grid-column: auto; }
  .demo-stage .panel.dv-reference { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch; }
  .demo-stage .panel.dv-store { grid-template-columns: 334px minmax(0, 420px); justify-content: center; gap: 48px; }
  .demo-stage .panel.dv-tokens { padding: 32px; }
  .demo-stage .panel.dv-tokens .grant { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; gap: 16px; }
}
