:root {
  color-scheme: light;
  --ink: #18242b;
  --muted: #63717c;
  --line: #e3e8eb;
  --surface: #ffffff;
  --soft: #f6f8f8;
  --teal: #127568;
  --teal-dark: #0d5e54;
  --teal-soft: #eaf5f3;
  --red: #b42318;
  --green: #127568;
  font: 14px/1.5 Inter, Arial, "DejaVu Sans", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; background: var(--surface); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px 16px; display: flex; flex-direction: column; background: #f8faf9; border-right: 1px solid var(--line); }
.brand { min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 34px; display: grid; place-items: center; flex: none; color: var(--teal); }
.brand-mark svg { width: 28px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { min-width: 0; display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 14px; font-weight: 680; letter-spacing: -.01em; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.primary-nav { display: grid; gap: 4px; margin-top: 30px; }
.primary-nav a { height: 38px; display: flex; align-items: center; gap: 11px; padding: 0 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 540; }
.primary-nav a:hover { color: var(--ink); background: #f0f3f2; }
.primary-nav a.active { color: var(--teal-dark); background: var(--teal-soft); font-weight: 640; box-shadow: inset 3px 0 0 var(--teal); }
.primary-nav svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); }
.sidebar-footer p { margin: 0 0 5px; color: #87939b; font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-footer a { display: block; margin-top: 7px; color: var(--teal-dark); font-size: 12px; font-weight: 600; text-decoration: none; }
.sidebar-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

.page-shell { min-width: 0; }
.site-header { position: sticky; top: 0; z-index: 20; height: 64px; padding: 0 clamp(24px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 8px; color: #8a959c; font-size: 12px; white-space: nowrap; }
.breadcrumbs strong { overflow: hidden; color: var(--ink); font-weight: 620; text-overflow: ellipsis; }
.header-action { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 600; text-decoration: none; box-shadow: 0 1px 2px rgba(24, 36, 43, .03); }
.header-action:hover { background: var(--soft); }

main { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 48px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 400px); align-items: end; gap: 28px; }
.intro-copy { max-width: 760px; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 34px); line-height: 1.18; letter-spacing: -.035em; font-weight: 680; }
.intro-copy > p:last-child { max-width: 710px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
code { padding: .12em .32em; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); font: .88em ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.access-note { min-height: 54px; margin: 0; padding: 11px 13px; border: 1px solid #d8e8e5; border-radius: 8px; color: #315d57; background: #f5faf9; font-size: 12px; line-height: 1.5; }

.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 26px; }
.request-panel, .response-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(24, 36, 43, .03); }
.panel-heading, .response-heading { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-heading p, .response-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
h2 { margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: -.015em; font-weight: 660; }
.field { margin-top: 18px; }
label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; font-weight: 630; }
label span { color: #8a959c; font-size: 10px; font-weight: 500; }
select, input, textarea { width: 100%; border: 1px solid #d5dcdf; border-radius: 8px; color: var(--ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
select, input { height: 40px; padding: 0 11px; }
select { appearance: auto; }
input::placeholder, textarea::placeholder { color: #9aa4aa; }
textarea { min-height: 310px; margin: 0; padding: 13px; resize: vertical; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; tab-size: 2; }
select:hover, input:hover, textarea:hover { border-color: #bcc7cb; }
select:focus, input:focus, textarea:focus, button:focus-visible, a:focus-visible, pre:focus-visible { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18, 117, 104, .13); }
.key-field p, .example-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
button { min-height: 40px; padding: 0 15px; border: 1px solid var(--teal); border-radius: 8px; color: #fff; background: var(--teal); font-weight: 630; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
button:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.secondary-button { color: var(--ink); background: #fff; border-color: var(--line); font-weight: 600; }
.secondary-button:hover { color: var(--ink); background: var(--soft); border-color: #c9d1d5; }
.secret-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.secret-row .secondary-button { min-width: 66px; }
button:disabled { cursor: not-allowed; opacity: .55; }
.request-path { min-width: 0; margin-top: 10px; overflow-wrap: anywhere; color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.request-error { margin: 10px 0 0; color: var(--red); font-size: 12px; line-height: 1.5; }

.response-panel { display: flex; flex-direction: column; }
.response-heading { align-items: center; }
.response-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 14px 0 0; }
dl { min-width: 0; margin: 0; }
dl div { min-width: 0; padding: 7px 9px; border-radius: 6px; background: var(--soft); }
dt { color: #89959c; font-size: 9px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
dd { min-width: 0; margin: 1px 0 0; overflow: hidden; color: var(--ink); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
#responseStatus[data-ok="true"] { color: var(--green); }
#responseStatus[data-ok="false"] { color: var(--red); }
pre { flex: 1; min-height: 430px; max-height: 690px; margin: 18px 0 0; padding: 16px; overflow: auto; border: 1px solid #26353d; border-radius: 8px; color: #dce7e5; background: #18242b; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.contract-note { margin-top: 16px; padding: 16px 18px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.note-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: none; border: 1px solid #b9c4c8; border-radius: 50%; color: var(--muted); font-size: 11px; font-weight: 700; }
.contract-note h2 { font-size: 13px; }
.contract-note p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

@media (max-width: 1080px) {
  .intro { grid-template-columns: 1fr; align-items: start; gap: 16px; }
  .access-note { max-width: 760px; }
  .workbench { grid-template-columns: 1fr; }
  pre { min-height: 340px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 11px 14px; flex-direction: row; align-items: center; gap: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand-copy small { display: none; }
  .primary-nav { min-width: 0; display: flex; gap: 3px; margin: 0; overflow-x: auto; }
  .primary-nav a { flex: none; padding: 0 9px; }
  .primary-nav svg { display: none; }
  .sidebar-footer { display: none; }
  .site-header { display: none; }
  main { width: min(100% - 28px, 1320px); padding: 26px 0 36px; }
}

@media (max-width: 540px) {
  .sidebar { align-items: flex-start; gap: 10px; }
  .brand-mark { width: 28px; height: 32px; }
  .brand-copy { display: none; }
  .primary-nav a { height: 34px; font-size: 12px; }
  .request-panel, .response-panel { padding: 17px; }
  .response-heading { align-items: flex-start; }
  .response-meta { grid-template-columns: 1fr 1fr; }
  .actions { align-items: flex-start; flex-direction: column; }
  textarea { min-height: 230px; }
  pre { min-height: 240px; max-height: 520px; }
}

@media (max-width: 540px) { .secret-row { grid-template-columns: 1fr; } .secret-row .secondary-button { justify-self: start; } .response-heading { flex-direction: column; } .response-heading .secondary-button { align-self: flex-start; } }
