/* ==========================================================================
   Unclick product layout (loaded after app.css). One scrolling page, three states:
   body.state-empty   landing (hero, examples, how it works, proof)
   body.state-running sticky stepper, live browser, activity feed, sponsor cards as they appear
   body.state-result  the API page, with "How it was built" below
   Colors/fonts only via theme.css variables.
   ========================================================================== */
body { overflow: visible; overflow-x: clip; }
.app { height: auto; min-height: 100vh; max-width: 1880px; padding: 12px 28px 56px; gap: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: rgb(var(--ink)); color: rgb(var(--white)); }
.skip:focus { left: 12px; }
.small { font-size: 12.5px; white-space: nowrap; }
:focus-visible { outline: 3px solid rgb(var(--accent) / .5); outline-offset: 2px; }
.field input:focus-visible { outline: none; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.topbar { position: sticky; top: 0; z-index: 40; margin: -12px -28px 0; padding: 10px 28px 8px; background: rgb(var(--bg) / .9); backdrop-filter: blur(12px) saturate(1.1); }
.run-id { color: rgb(var(--text-2)); }

/* ---------------------------------------------------------------- landing */
.landing { width: 100%; max-width: 940px; margin: clamp(16px, 7vh, 80px) auto 0; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; animation: reveal 1s var(--ease-reveal) both; }
.landing .headline { font-size: clamp(42px, 6.2vw, 88px); line-height: .98; }
.lede { margin: 0; max-width: 62ch; font-size: 17px; line-height: 1.55; color: rgb(var(--text-2)); }
.lede-sm { margin: 0; max-width: 72ch; font-size: 15px; line-height: 1.5; }
.landing .hero-form { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto; text-align: left; }
.examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.example { height: 36px; padding: 0 14px; border-radius: 99px; font-size: 14px; font-weight: 500; color: rgb(var(--text)); background: rgb(var(--surface)); border: 1px solid rgb(var(--border) / .14);
  transition: background .2s var(--ease-ui), border-color .2s var(--ease-ui), transform .15s var(--ease-ui); }
.example:hover { border-color: rgb(var(--accent) / .5); background: rgb(var(--accent) / .05); transform: translateY(-1px); }
.how { list-style: none; margin: 18px 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: left; }
.how li { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: rgb(var(--surface)); border: 1px solid rgb(var(--border) / .1); box-shadow: var(--shadow-card); }
.how .how-n { width: 30px; height: 30px; flex-shrink: 0; margin-top: 1px; line-height: 1; border-radius: 99px; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: rgb(var(--ink)); color: rgb(var(--white)); }
.how b { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 20px; letter-spacing: -.01em; line-height: 1.2; }
.how li > div > span { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: rgb(var(--text-3)); }
.proof { margin: 4px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 48px; }
.proof div { display: flex; flex-direction: column; align-items: center; }
.proof dt { font-family: var(--font-serif); font-weight: 300; font-size: 38px; letter-spacing: -.02em; line-height: 1; }
.proof dd { margin: 4px 0 0; font-size: 14px; color: rgb(var(--text-3)); }
body:not(.state-empty) .landing { display: none; }

/* ---------------------------------------------------------------- run bar */
.runbar { display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 16px; background: rgb(var(--surface)); border: 1px solid rgb(var(--border) / .1); box-shadow: var(--shadow-card); animation: reveal .8s var(--ease-reveal) both; }
.runbar-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; overflow: hidden; white-space: nowrap; }
.runbar-k { flex-shrink: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--accent-soft)); }
body.state-result .runbar-k { color: rgb(var(--ok)); }
.runbar-url { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; color: rgb(var(--text)); }
.runbar-task { flex-shrink: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: rgb(var(--text-2)); }
.runbar .btn { height: 40px; }

/* ---------------------------------------------------------------- sticky stepper */
.stepper-wrap { position: sticky; top: 56px; z-index: 30; margin: -6px -28px 0; padding: 6px 28px; background: rgb(var(--bg) / .88); backdrop-filter: blur(12px) saturate(1.1); }
.step-pill { display: none; }

/* ---------------------------------------------------------------- main grid */
.main { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: var(--gap); align-items: start; min-height: 0; animation: none; }
.content { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.rail { position: sticky; top: 124px; max-height: calc(100vh - 136px); overflow: auto; }
.rail.empty { display: none; }
.rail > .card { animation: reveal .9s var(--ease-reveal) both; }
.rail .card.sb { flex: 0 0 auto; min-height: 0; }
.rail .card.sb > .card-b { overflow: visible; }
.section-h { margin: 18px 0 0; font-family: var(--font-serif); font-weight: 300; font-size: 30px; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- stage */
.stage { container-type: inline-size; min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.stage-top, body.focus-code .stage-top, body.focus-live .stage-top { --side: clamp(300px, 27cqw, 420px); height: auto; display: grid; gap: var(--gap); transition: none;
  grid-template-columns: minmax(0, min(100cqw - var(--side) - var(--gap), (100vh - 290px) * 1.7778)) minmax(0, 1fr); }
body.focus-code .stage-top { grid-template-columns: minmax(0, min(100cqw - var(--side) - var(--gap), (100vh - 290px) * 1.05)) minmax(0, 1fr); }
body.state-result .stage-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stage-left { height: auto; }
.desk, body.focus-live .desk { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.side { position: relative; min-height: 240px; }
.side > .card { position: absolute; inset: 0; }
body.state-result .activity { display: none; }
.agent { flex: none; height: clamp(380px, 56vh, 620px); animation: reveal .9s var(--ease-reveal) both; }

/* ---------------------------------------------------------------- skeletons */
.skel, .skeleton-screen i { background: linear-gradient(90deg, rgb(var(--surface-3)) 0%, rgb(var(--surface-2)) 50%, rgb(var(--surface-3)) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
.skeleton-screen { width: min(320px, 60%); margin: 0 auto 18px; display: grid; gap: 8px; }
.skeleton-screen i { display: block; height: 12px; }
.skeleton-screen i:nth-child(1) { width: 60%; height: 18px; }
.skeleton-screen i:nth-child(3) { width: 85%; }
.skeleton-screen i:nth-child(4) { width: 70%; }
.skel-row { height: 34px; margin: 4px 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- API page */
.apipage { display: flex; flex-direction: column; gap: var(--gap); animation: reveal 1s var(--ease-reveal) both; }
.api-head { position: relative; overflow: hidden; padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; border-color: rgb(var(--accent) / .3);
  box-shadow: 0 0 0 4px rgb(var(--accent) / .06), var(--shadow-float); }
.api-head::before { content: ''; position: absolute; inset: 0 0 auto; height: 180px; pointer-events: none; background: radial-gradient(600px 180px at 10% 0, rgb(var(--accent) / .09), transparent 70%); }
.api-head > * { position: relative; }
.api-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.api-badges .method { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: rgb(var(--white)); background: rgb(var(--ok)); }
.api-name { margin: 0; font-family: var(--font-serif); font-weight: 300; font-size: clamp(30px, 3vw, 46px); letter-spacing: -.025em; line-height: 1.05; overflow-wrap: anywhere; }
.api-src { font-size: 15px; color: rgb(var(--text-2)); overflow-wrap: anywhere; max-width: 72ch; }
.api-src a { color: rgb(var(--text)); text-decoration-color: rgb(var(--border) / .4); text-underline-offset: 3px; }
.api-head .urlbox { margin: 0; }
.api-head .urlbox .u { font-size: 16px; }
.api-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.api-actions .btn { height: 40px; }
.api-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.api-card { display: flex; flex-direction: column; min-width: 0; }
.api-card .card-b { display: flex; flex-direction: column; gap: 12px; }
.codetabs { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgb(var(--surface-2)); border: 1px solid rgb(var(--border) / .08); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.codetabs button { flex-shrink: 0; height: 30px; padding: 0 13px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: rgb(var(--text-3)); transition: background .2s var(--ease-ui), color .2s var(--ease-ui); }
.codetabs button:hover { color: rgb(var(--text)); }
.codetabs button.on { background: rgb(var(--surface)); color: rgb(var(--text)); box-shadow: 0 1px 3px rgb(var(--scrim) / .1); }
.codebox { position: relative; border-radius: 12px; background: rgb(var(--screen) / .55); border: 1px solid rgb(var(--border) / .08); }
.codebox pre { margin: 0; padding: 14px 16px; padding-right: 96px; max-height: 300px; overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre; color: rgb(var(--text)); }
.codebox .copy { position: absolute; top: 8px; right: 8px; }
.code-note { font-size: 13.5px; color: rgb(var(--text-3)); }
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.param { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: rgb(var(--text-2)); }
.param span { font-family: var(--font-mono); font-size: 12.5px; }
.param input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid rgb(var(--border) / .16); background: rgb(var(--surface-2)); font-size: 15px; font-family: var(--font-mono); outline: none;
  transition: border-color .2s var(--ease-ui), box-shadow .2s var(--ease-ui); }
.param input:focus { border-color: rgb(var(--accent) / .6); box-shadow: 0 0 0 3px rgb(var(--accent) / .12); background: rgb(var(--surface)); }
.send-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.send-row .btn { height: 42px; padding: 0 20px; }
.resp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13.5px; color: rgb(var(--text-3)); min-height: 26px; }
.resp-meta b { font-family: var(--font-serif); font-weight: 400; font-size: 20px; color: rgb(var(--text)); }
.resp { border-radius: 12px; background: rgb(var(--screen) / .55); border: 1px solid rgb(var(--border) / .08); min-height: 140px; }
.resp pre { margin: 0; padding: 14px 16px; max-height: 340px; overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: rgb(var(--text-2)); }
.resp .err { padding: 16px; color: rgb(var(--bad)); font-size: 14.5px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.resp .hint { padding: 16px; font-size: 14.5px; color: rgb(var(--text-3)); }
.speedcard { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 22px 24px; }
.speedcard .k { font-family: var(--font-serif); font-style: italic; font-size: 20px; }
.speedcard .x { font-family: var(--font-serif); font-weight: 300; font-size: 56px; line-height: 1; color: rgb(var(--accent-soft)); letter-spacing: -.03em; }
.speedcard .v { font-size: 15px; color: rgb(var(--text-2)); }
.speedcard .v b { color: rgb(var(--text)); font-weight: 600; }

/* ---------------------------------------------------------------- views */
body.view-catalog #studio { display: none; }
.catalog { overflow: visible; flex: none; }
.catalog-title { font-size: clamp(32px, 3.4vw, 46px); }
.cat-empty .btn { margin-top: 14px; }
.success, #apiCard { display: none !important; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1700px) { .hide-narrow { display: none; } }
@media (max-width: 1500px) { .step .cap { max-width: 130px; } }
@media (max-width: 1360px) { .step .cap { display: none; } .stepper { height: 44px; } }

/* 768-1279: one column, sponsor cards as a row under the stage */
@media (max-width: 1279px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
  .rail.empty { display: none; }
  .stage-top, body.focus-code .stage-top, body.state-result .stage-top { grid-template-columns: minmax(0, 1fr); }
  .side { min-height: 0; }
  .side > .card { position: static; max-height: 340px; }
  .api-grid { grid-template-columns: minmax(0, 1fr); }
  .app { padding-left: 20px; padding-right: 20px; }
  .topbar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .stepper-wrap { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 1023px) {
  .landing .hero-form { grid-template-columns: minmax(0, 1fr); }
  .landing .hero-form .btn-lg { width: 100%; }
  .agent { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 860px; }
  .agent-col + .agent-col { border-left: 0; border-top: 1px solid rgb(var(--border) / .09); }
}
/* < 768: stacked, compact step pill */
@media (max-width: 767px) {
  .app { padding: 10px 14px 40px; gap: 14px; }
  .topbar { flex-wrap: wrap; gap: 8px; margin: -10px -14px 0; padding: 8px 14px; }
  .topbar-right { margin-left: 0; }
  .lbl-run, .runmeta .sep { display: none; }
  .landing { gap: 18px; margin-top: 12px; }
  .lede { font-size: 16px; }
  .how { grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
  .proof { gap: 10px 28px; }
  .proof dt { font-size: 30px; }
  .stepper-wrap { top: 98px; margin-left: -14px; margin-right: -14px; padding: 6px 14px; }
  .stepper { display: none; }
  .step-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 99px; background: rgb(var(--surface)); border: 1px solid rgb(var(--border) / .14);
    box-shadow: var(--shadow-card); font-size: 14.5px; font-weight: 600; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .step-pill .n { color: rgb(var(--accent-soft)); }
  .runbar { flex-wrap: wrap; padding: 12px; }
  .runbar-main { flex-basis: 100%; flex-wrap: wrap; white-space: normal; }
  .runbar-url, .runbar-task { white-space: nowrap; max-width: 100%; }
  .runbar .btn { width: 100%; }
  .activity { display: none; }
  .tabs, .pills { overflow-x: auto; scrollbar-width: none; max-width: 100%; flex-shrink: 1; }
  .card-h { flex-wrap: wrap; }
  .agent { height: 900px; }
  .api-head { padding: 18px; }
  .api-actions .btn { flex: 1 1 calc(50% - 8px); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .catalog-h { flex-wrap: wrap; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .desk-bar .seg { display: none; }
  .codebox pre { padding-right: 16px; padding-top: 48px; }
}
/* touch: 44px targets */
@media (pointer: coarse) {
  .btn, .example, .codetabs button, .tab, .pill, .view-btn, .param input { min-height: 44px; }
}
