:root {
  color-scheme: dark;
  --bg: #090b0e;
  --surface: #0f1318;
  --surface-raised: #141920;
  --surface-soft: #11161c;
  --line: #252c35;
  --line-strong: #343d49;
  --text: #f3f5f7;
  --text-soft: #c3c9d1;
  --muted: #858e9b;
  --accent: #78dc91;
  --accent-strong: #9ae9ad;
  --accent-bg: #14271a;
  --blue: #99bbff;
  --amber: #e6bc79;
  --red: #ff9d9d;
  --radius: 14px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 75% -10%, rgba(66, 121, 77, .13), transparent 31rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, textarea, input, select { font: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.platform-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(44, 52, 62, .8);
  background: rgba(9, 11, 14, .88);
  backdrop-filter: blur(18px);
}
.platform-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.015em;
  white-space: nowrap;
}
.platform-brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #395342;
  border-radius: 9px;
  background: linear-gradient(145deg, #1f3927, #101b14);
  color: var(--accent-strong);
  font: 700 13px var(--mono);
}
.platform-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.platform-nav a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.platform-nav a:hover { color: var(--text); text-decoration: none; background: #151a21; }
.platform-nav a[aria-current="page"] { color: var(--text); background: #1b2129; }
.platform-nav .nav-download { color: #111712; background: var(--accent-strong); margin-left: 6px; }
.platform-nav .nav-download:hover { color: #080c09; background: #b4f2c2; }
.platform-nav .nav-external { border-left: 1px solid var(--line); border-radius: 0; margin-left: 5px; padding-left: 15px; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
main.shell { padding: 72px 0 88px; }
.eyebrow {
  color: var(--accent);
  font: 700 11px/1.3 var(--mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1, h2, h3 { color: var(--text); letter-spacing: -.025em; }
h1 { margin: 13px 0 20px; font-size: clamp(42px, 6.5vw, 76px); line-height: 1; letter-spacing: -.052em; }
h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.18; }
h3 { margin: 0 0 8px; font-size: 16px; }
p { color: var(--text-soft); }
.lede { margin: 0; max-width: 720px; font-size: 18px; line-height: 1.7; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
  gap: 70px;
  align-items: center;
  padding: 36px 0 82px;
}
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #171c23;
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
}
.button:hover { background: #202731; text-decoration: none; }
.button.primary { color: #0c120e; border-color: var(--accent-strong); background: var(--accent-strong); }
.button.primary:hover { background: #b6f2c4; }
.button.ghost { background: transparent; }
.button:disabled { opacity: .45; cursor: default; }

.architecture {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(16, 20, 26, .88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .2);
}
.card-kicker { margin-bottom: 15px; color: var(--muted); font: 700 11px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.arch-node { padding: 12px 14px; border: 1px solid #303945; border-radius: 10px; background: var(--surface-raised); }
.arch-node strong { display: block; font-size: 13px; }
.arch-node span { display: block; color: var(--muted); font: 11.5px/1.5 var(--mono); }
.arch-arrow { height: 26px; width: 1px; margin-left: 22px; background: #3b4653; position: relative; }
.arch-arrow::after { content: ""; position: absolute; bottom: 0; left: -3px; width: 6px; height: 6px; border-right: 1px solid #7f8a98; border-bottom: 1px solid #7f8a98; transform: rotate(45deg); }

.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 25px; }
.section-heading p { max-width: 630px; margin: 0; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
}
.card p { margin: 0; color: var(--muted); }
.card-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid #35513d; border-radius: 9px; color: var(--accent); background: var(--accent-bg); font: 700 12px var(--mono); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

pre {
  margin: 0;
  overflow: auto;
  padding: 16px;
  border: 1px solid #252c35;
  border-radius: 10px;
  background: #080a0d;
  color: #d1d7df;
  font: 12.5px/1.65 var(--mono);
  white-space: pre;
}
code { font-family: var(--mono); }
.inline-code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: #11151a; color: #dbe1e8; font-size: .9em; }
.copy-row { display: flex; gap: 9px; margin-top: 11px; }
.notice { margin-top: 17px; padding: 13px 15px; border: 1px solid #514329; border-radius: 10px; background: #211c14; color: var(--amber); font-size: 13px; }

.platform-footer { border-top: 1px solid var(--line); color: #727b87; }
.footer-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 12px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #8b95a2; }

.page-heading { max-width: 780px; padding: 24px 0 48px; }
.page-heading h1 { font-size: clamp(38px, 5vw, 58px); }
.page-heading p { margin: 0; font-size: 17px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #65707d; }
.status.online { color: var(--accent); border-color: #31543b; background: var(--accent-bg); }
.status.online .status-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(120, 220, 145, .1); }
.status.error { color: var(--red); border-color: #583637; background: #271819; }
.status.error .status-dot { background: var(--red); }

.playground-shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.play-sidebar { position: sticky; top: 82px; display: grid; gap: 14px; }
.meta-list { display: grid; gap: 15px; margin-top: 19px; }
.meta-item span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.meta-item strong { display: block; margin-top: 3px; color: var(--text-soft); font: 12px var(--mono); overflow-wrap: anywhere; }
.play-workspace { padding: 0; overflow: hidden; }
.play-toolbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.play-toolbar strong { font-size: 13px; }
.play-output { min-height: 360px; padding: 26px; white-space: pre-wrap; color: #dce2e9; }
.play-output.empty { color: #6e7783; }
.composer { padding: 18px; border-top: 1px solid var(--line); background: #0d1116; }
.composer label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.composer textarea { width: 100%; min-height: 130px; resize: vertical; padding: 12px; border: 1px solid #303945; border-radius: 10px; background: #090c10; color: var(--text); outline: none; }
.composer textarea:focus { border-color: #566575; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 11px; }
.key-hint { color: #6e7783; font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.dashboard-side { display: grid; gap: 14px; }
.connect-card h2 { margin-bottom: 12px; }
.connect-card > p { margin-bottom: 18px; }
.connect-card pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.connect-card .connection-note { margin: 18px 0 0; font-size: 13px; }
.status-detail { min-height: 3.2em; margin: 14px 0 0 !important; font-size: 13px; }
.dashboard-side .status { max-width: 100%; white-space: normal; }

.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 760px); gap: 58px; justify-content: center; align-items: start; min-width: 0; }
.docs-nav { position: sticky; top: 88px; display: grid; gap: 3px; min-width: 0; }
.docs-content { min-width: 0; }
.docs-nav strong { margin: 0 0 9px 9px; color: #697380; font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.docs-nav a { padding: 6px 9px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.docs-nav a:hover { color: var(--text); background: #131820; text-decoration: none; }
.docs-content section { padding: 0 0 48px; scroll-margin-top: 92px; }
.docs-content section + section { padding-top: 47px; border-top: 1px solid var(--line); }
.docs-content h1 { margin-top: 0; font-size: 48px; }
.docs-content h2 { margin-bottom: 15px; }
.docs-content h3 { margin-top: 28px; }
.docs-content p, .docs-content li { color: var(--text-soft); }
.docs-content ul { padding-left: 20px; }
.docs-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13px; }
.docs-content th, .docs-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-content th { color: var(--muted); font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.docs-content td:first-child { color: #dce2e9; font-family: var(--mono); }
.method { display: inline-block; min-width: 42px; margin-right: 8px; padding: 2px 6px; border: 1px solid #36533e; border-radius: 5px; background: var(--accent-bg); color: var(--accent); font: 700 10px var(--mono); text-align: center; }
.endpoint { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: #e1e6ec; font: 12.5px var(--mono); }

@media (max-width: 900px) {
  .platform-header { padding: 0 16px; gap: 12px; }
  .platform-brand span:last-child { display: none; }
  .platform-nav { overflow-x: auto; }
  .platform-nav .nav-external { display: none; }
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .playground-shell { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .play-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .docs-nav { position: static; display: flex; width: 100%; overflow-x: auto; padding-bottom: 7px; }
  .docs-nav strong { display: none; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1180px); }
  main.shell { padding-top: 42px; }
  .platform-nav .nav-download { display: none; }
  .platform-nav a { padding-inline: 8px; }
  .hero { padding-top: 15px; padding-bottom: 56px; }
  .card-grid, .two-col, .play-sidebar { grid-template-columns: minmax(0, 1fr); }
  .section-heading { display: block; }
  .section-heading p { margin-top: 9px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 18px 0; }
  .play-output { min-height: 280px; }
  .composer-actions { align-items: flex-start; flex-direction: column; }
  .composer-actions .button { width: 100%; }
  .docs-content h1 { font-size: 39px; }
  .docs-content table { display: block; max-width: 100%; overflow-x: auto; }
}

/* Full-height ChatGPT playground, intentionally aligned with the root playground. */
body.chat-playground-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d0f12;
  font-size: 14px;
  line-height: 1.55;
}
.chat-playground-header {
  position: relative;
  flex: 0 0 auto;
  height: 55px;
  padding: 0 20px;
  background: #0d0f12;
  backdrop-filter: none;
}
.play-settings-button { display: none; min-height: 34px; padding: 5px 10px; }
.chat-playground-layout { display: flex; flex: 1; min-height: 0; }
.play-chat-column { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.play-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.play-empty-state {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: #69717c;
  text-align: center;
}
.play-empty-state .brand-mark { margin-bottom: 5px; }
.play-empty-state strong { color: #aeb5be; font-size: 14px; }
.play-empty-state > span:last-child { max-width: 370px; font-size: 12px; }
.play-message { max-width: 780px; margin: 0 auto 16px; }
.play-message-role {
  margin-bottom: 4px;
  color: #8b919a;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.play-message-body { color: #e6e6e6; white-space: pre-wrap; }
.play-message.user .play-message-body {
  padding: 10px 14px;
  border: 1px solid #262e3a;
  border-radius: 10px;
  background: #1a2029;
}
.play-message-body.pending { color: #7a828d; font-size: 13px; font-style: italic; }
.play-message-body.error { color: #f08a8a; }
.play-message-meta { min-height: 1em; margin-top: 6px; color: #565d68; font-size: 11px; }
.play-message-body.md { white-space: normal; }
.play-message-body.md > :first-child { margin-top: 0; }
.play-message-body.md > :last-child { margin-bottom: 0; }
.play-message-body.md p,
.play-message-body.md ul,
.play-message-body.md ol,
.play-message-body.md pre,
.play-message-body.md blockquote,
.play-message-body.md table { margin: 0 0 10px; }
.play-message-body.md h1,
.play-message-body.md h2,
.play-message-body.md h3,
.play-message-body.md h4 { margin: 14px 0 8px; line-height: 1.3; }
.play-message-body.md h1 { font-size: 19px; }
.play-message-body.md h2 { font-size: 17px; }
.play-message-body.md h3 { font-size: 15.5px; }
.play-message-body.md h4 { font-size: 14.5px; }
.play-message-body.md ul,
.play-message-body.md ol { padding-left: 24px; }
.play-message-body.md li { margin-bottom: 3px; }
.play-message-body.md code {
  padding: 1px 5px;
  border: 1px solid #262e3a;
  border-radius: 4px;
  background: #1a2029;
  font: .88em var(--mono);
}
.play-message-body.md pre { padding: 10px 12px; border-radius: 8px; background: #10131a; overflow-x: auto; }
.play-message-body.md pre code { padding: 0; border: 0; background: none; font-size: 12.5px; line-height: 1.5; }
.play-message-body.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid #2a303a; color: #9aa1ab; }
.play-message-body.md a { color: #8ab4f8; }
.play-message-body.md table { display: block; border-collapse: collapse; overflow-x: auto; }
.play-message-body.md th,
.play-message-body.md td { padding: 4px 10px; border: 1px solid #262b33; font-size: 13px; }
.play-message-body.md th { background: #1a2029; }
.play-message-body.md hr { margin: 12px 0; border: 0; border-top: 1px solid #22262e; }
.play-chat-composer { flex: 0 0 auto; padding: 14px 20px 18px; border-top: 1px solid #22262e; }
.play-mode-toggle { max-width: 780px; margin: 0 auto 9px; display: flex; gap: 6px; }
.header-mode-toggle { max-width: none; margin: 0; flex: 0 0 auto; }
.play-mode-toggle .button { min-height: 29px; padding: 4px 13px; font-size: 12px; }
.play-mode-toggle .button.active { border-color: #64748b; background: #263140; color: #fff; }
.play-generated-image { display: block; max-width: min(100%, 640px); max-height: 65vh; border: 1px solid #2a303a; border-radius: 10px; object-fit: contain; background: #080a0d; }
.play-image-download { display: inline-flex; margin-top: 10px; }
.play-composer-inner { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px; }
.play-composer-inner textarea {
  flex: 1;
  width: 100%;
  min-height: 38px;
  max-height: 240px;
  resize: none;
  overflow-y: hidden;
  padding: 8px 10px;
  border: 1px solid #2a303a;
  border-radius: 8px;
  background: #0d0f12;
  color: #e6e6e6;
  line-height: 1.45;
}
.play-composer-inner textarea.scrollable { overflow-y: auto; }
.play-composer-inner textarea:focus { outline: none; border-color: #4a5568; }
.play-send-button { min-height: 38px; padding: 8px 16px; border-color: #e6e6e6 !important; background: #e6e6e6 !important; color: #0d0f12 !important; }
.play-send-button:hover { background: #fff !important; }
.play-params-sidebar {
  width: 320px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid #22262e;
  background: #0d0f12;
}
.play-params-sidebar section { padding-bottom: 16px; border-bottom: 1px solid #1c2027; }
.play-params-sidebar select { width: 100%; padding: 8px 10px; border: 1px solid #2a303a; border-radius: 8px; background: #0d0f12; color: #e6e6e6; }
.play-sidebar-label { display: block; margin-bottom: 5px; color: #8b919a; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.play-field-help { display: block; margin-top: 6px; font-size: 11px; line-height: 1.4; }
.play-sidebar-buttons { margin-top: 10px; gap: 6px; }
.play-sidebar-buttons .button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.play-field-gap { height: 12px; }
.play-field-gap.small { height: 7px; }
.play-checkbox-row { display: flex; align-items: center; gap: 8px; color: #c8cdd6; font-size: 12px; }
.play-checkbox-row input { margin: 0; accent-color: #8fdc9f; }
.play-code {
  margin: 0;
  padding: 10px;
  border: 1px solid #232936;
  border-radius: 8px;
  background: #10131a;
  color: #c8cdd6;
  font: 11.5px/1.5 var(--mono);
  white-space: pre;
  overflow-x: auto;
}
.play-endpoint { white-space: pre-wrap; overflow-wrap: anywhere; }
.play-code-tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.play-code-tabs .button { min-height: 29px; padding: 5px 10px; font-size: 12px; }
.play-code-tabs .button.active { border-color: #3a414c; background: #2a303a; color: #e6e6e6; }
.play-copy-button { min-height: 30px; margin-top: 8px; padding: 5px 10px; font-size: 12px; }
.play-sidebar-footer {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  margin-top: auto;
  padding: 14px 0 18px;
  background: linear-gradient(to bottom, rgba(13,15,18,0), #0d0f12 14px);
}
.play-sidebar-footer .button { width: 100%; }
.play-backdrop { position: fixed; inset: 55px 0 0; z-index: 29; background: rgba(8,10,13,.6); }

@media (max-width: 768px) {
  .chat-playground-header { padding: 0 12px; gap: 8px; }
  .chat-playground-header .platform-brand span:last-child { display: none; }
  .chat-playground-header .platform-nav { overflow-x: auto; }
  .chat-playground-header .platform-nav a { padding-inline: 8px; }
  .chat-playground-header .platform-nav .nav-external { display: none; }
  .play-settings-button { display: inline-flex; margin-left: 2px; }
  .play-thread { padding: 14px 12px; }
  .play-chat-composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
  .play-composer-inner { gap: 8px; }
  .play-composer-inner textarea { font-size: 16px; }
  .play-message-body { font-size: 15px; }
  .play-params-sidebar {
    position: fixed;
    inset: 55px 0 0 auto;
    z-index: 30;
    width: min(85vw, 340px);
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-left-color: #262b33;
    background: #101318;
    transform: translateX(100%);
    transition: transform .22s ease;
  }
  body.play-sidebar-open .play-params-sidebar { transform: translateX(0); }
}

@media (max-width: 480px) {
  .chat-playground-header .platform-nav a:not([aria-current="page"]) { display: none; }
}
