/* Datil design system. See /docs/brand.html for the full guide. */

:root {
  --rust:#A8523A; --rust-soft:#C97D5B; --rust-deep:#7C3A20; --rust-text:#5C2A18;
  --rust-tint:#F1E2D6; --rust-tint2:#EAD2BF; --rust-line:#D8B89F;
  --burgundy:#9F3C50; --burgundy-deep:#6F2638;
  --ochre:#B8852C; --ochre-soft:#D29F4F; --ochre-deep:#88621D; --ochre-text:#5C4218;
  --ochre-tint:#F1E5C7; --ochre-tint2:#F8F0D7; --ochre-line:#DDC79F;
  --moss:#5E8055; --moss-soft:#94B086; --moss-tint:#E2E8D8; --moss-tint2:#EDF1E5;
  --forest:#36603E; --forest-deep:#1F4127; --forest-line:#A8C0A2;
  --steel:#62789A; --steel-deep:#2D3D5E; --steel-tint:#E0E5EE;
  --steel-tint2:#EAEEF5; --steel-line:#BAC5D6; --steel-soft:#8B9CB0;
  --plum:#6E4673; --plum-soft:#8E6995; --plum-deep:#4A2D52;
  --rose:#A75561; --rose-deep:#7C394A; --rose-text:#5C2A33;
  --rose-tint:#F1DCDF; --rose-line:#D8B0B5;
  --teal:#3D7878;
  --sienna:#B5734A;
  --stone:#928D7A; --quiet:#7A7361;

  --paper:        #FAF6EC;
  --paper-line:   #E0D7C5;
  --paper-hover:  #ECE3D0;
  --surface:      #FBFAF6;

  --ink:          #241F18;
  --ink-mute:     #6B6457;
  --ink-faint:    #9C9586;

  --n-0:#FFFFFF;  --n-25:#FAFAF7;  --n-50:#F7F6F2;  --n-75:#F2F1EB;
  --n-100:#EAE9E2; --n-150:#DDDBD2; --n-200:#D2CFC4; --n-250:#B5B1A4;
  --n-300:#94908B; --n-350:#7B776F; --n-400:#615D54; --n-500:#494535;
  --n-600:#332F25; --n-700:#1F1B12; --n-750:#1A160E; --n-800:#13100A; --n-900:#0A0805;

  /* Per-product override: forest = Facturación, purple = POS, teal = Identidad. */
  --accent:       #36603E;
  --accent-deep:  #1F4127;
  --accent-line:  rgba(54,96,62,.35);
  --accent-tint:  rgba(54,96,62,.10);

  --r-xs:2px; --r-sm:3px; --r-md:4px; --r-lg:6px; --r-xl:8px; --r-pill:9999px;

  --fs-3xs:10px; --fs-2xs:11px; --fs-xs:12px; --fs-sm:13px; --fs-md:15px;
  --fs-lg:16px; --fs-xl:17px; --fs-2xl:19px; --fs-3xl:22px; --fs-display:32px;

  --tok-k:  #c2966c;
  --tok-s:  #a3b977;
  --tok-n:  #d2b878;
  --tok-b:  #82a8d8;
  --tok-c:  #7b776f;
  --tok-fn: #d29f4f;
  --tok-m:  #c97d5b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum';
}

body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(36,31,24,.025) 1px, transparent 0);
  background-size: 18px 18px;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--n-250); }
a:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }

p { margin: 0 0 14px; color: var(--n-500); }
.prose p strong { color: var(--ink); font-weight: 600; }

code, .mono { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-feature-settings: 'tnum'; }
code {
  font-size: .92em;
  background: var(--n-75);
  border: 1px solid var(--n-150);
  padding: 1px 5px;
  border-radius: var(--r-sm);
  color: var(--n-700);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,246,236,.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--paper-line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; border-bottom: none; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; flex: 0 0 auto; display: block; }
.brand:hover { color: var(--ink); }
.brand-name {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.012em;
  line-height: 1;
}
.brand-tag {
  font-size: 16px;
  font-weight: 400;
  color: var(--accent-deep);
  line-height: 1;
}
.brand-tag::before {
  content: "/";
  color: var(--accent);
  font-weight: 400;
  margin-right: 12px;
  margin-left: 4px;
}
.topbar-nav { display: flex; gap: 18px; }
.topbar-nav a {
  font-size: 14px;
  color: var(--ink-mute);
  border-bottom: none;
}
.topbar-nav a:hover { color: var(--accent); }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1320px;
  margin: 0 auto;
  background: transparent;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px 18px 32px 28px;
  border-right: 1px solid var(--paper-line);
}

.sidebar nav ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
.sidebar nav li { margin: 0; }

.sidebar nav a {
  display: block;
  padding: 5px 12px;
  margin-left: -14px;
  font-size: var(--fs-md);
  color: var(--ink-mute);
  border-left: 2px solid transparent;
  border-bottom: none;
  transition: color .12s ease, border-color .12s ease;
}
.sidebar nav a:hover { color: var(--ink); }
.sidebar nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar nav a code {
  background: transparent; border: none; padding: 0;
  color: inherit; font-size: inherit;
}

.nav-section {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 6px;
}
.nav-section:first-child { margin-top: 0; }

/* ============================================================
   CONTENT
   ============================================================ */
.content {
  padding: 0;
  min-width: 0;
}

.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  padding: 56px 32px;
  border-bottom: 1px solid var(--paper-line);
  position: relative;
}
.section:last-of-type { border-bottom: none; }
.section .prose { min-width: 0; }
.section .code   { min-width: 0; position: sticky; top: 80px; align-self: start; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--fs-display); line-height: 1.15; margin: 0 0 14px; }
h2 { font-size: var(--fs-3xl);     line-height: 1.2;  margin: 0 0 12px; }
h3 { font-size: var(--fs-xl);      line-height: 1.3;  font-weight: 600;
     margin: 28px 0 8px; }
h4 { font-size: var(--fs-md);      line-height: 1.3;  font-weight: 600;
     margin: 20px 0 6px;
     display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
h4 code { font-size: inherit; }
h4 .subtitle {
  font-weight: 400;
  color: var(--ink-mute);
  font-size: var(--fs-sm);
}

.lead { font-size: var(--fs-lg); color: var(--n-500); font-weight: 400; }
.muted { color: var(--ink-faint); }
.small { font-size: var(--fs-sm); }

.endpoint-method {
  display: block;
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-md);
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0;
}
.endpoint-method .verb { font-weight: 600; }
.endpoint-method .path { color: var(--ink-mute); font-weight: 500; }

.url {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--n-200);
  padding: 8px 12px;
  font-size: var(--fs-md);
  border-radius: var(--r-md);
  color: var(--ink);
}

/* ============================================================
   FEATURE LIST (intro checklist)
   ============================================================ */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--paper-line);
}
.feature-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 12px 4px;
  border-bottom: 1px solid var(--paper-line);
  color: var(--n-500);
  font-size: var(--fs-md);
}
.feature-list li > span:first-child {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.feature-list li > span:first-child::before { content: "["; color: var(--ink-faint); margin-right: 2px; }
.feature-list li > span:first-child::after  { content: "]"; color: var(--ink-faint); margin-left: 2px; }

ul.bullet { list-style: none; padding: 0; margin: 6px 0 14px; }
ul.bullet li { position: relative; padding-left: 18px; margin-bottom: 8px; color: var(--n-500); }
ul.bullet li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent); font-weight: 600;
}
ul.bullet li strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   TABLES
   ============================================================ */
table.params {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: var(--fs-sm);
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}
table.params th, table.params td {
  text-align: left; vertical-align: top; padding: 10px 12px;
  border-bottom: 1px solid var(--n-100);
}
table.params tr:last-child td { border-bottom: none; }
table.params th {
  font-weight: 700;
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-faint);
  background: var(--n-50);
}
table.params td { color: var(--n-500); }
table.params td code {
  white-space: normal;
  overflow-wrap: break-word;
}

.req {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 400;
  font-style: italic;
  color: var(--ink-faint);
  margin-left: 6px;
}
code.ok   { background: var(--moss-tint2);  border-color: var(--forest-line); color: var(--forest); }
code.warn { background: var(--ochre-tint2); border-color: var(--ochre-line);  color: var(--ochre-deep); }
code.err  { background: var(--rust-tint);   border-color: var(--rust-line);   color: var(--rust-deep); }

/* ============================================================
   CALLOUTS
   ============================================================ */
.callout {
  position: relative;
  border: 1px solid var(--steel-line);
  background: var(--steel-tint2);
  color: var(--steel-deep);
  padding: 12px 14px 12px 40px;
  margin: 16px 0;
  font-size: var(--fs-sm);
  border-radius: var(--r-md);
}
.callout::before {
  content: "i";
  position: absolute; top: 12px; left: 14px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-style: italic;
  color: var(--surface);
  background: var(--steel);
  border-radius: 50%;
}
.callout strong { color: var(--ink); }
.callout-warn {
  border-color: var(--ochre-line);
  background: var(--ochre-tint2);
  color: var(--ochre-text);
}
.callout-warn::before { content: "!"; background: var(--ochre); color: #fff; font-style: normal; }

/* ============================================================
   CODE PANELS — dark slab on warm paper
   ============================================================ */
.code-block {
  position: relative;
  background: var(--n-900);
  color: var(--n-100);
  border: 1px solid var(--n-700);
  margin: 0 0 16px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.code-block::before, .code-block::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  pointer-events: none; z-index: 2;
}
.code-block::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  border-top-left-radius: var(--r-lg);
}
.code-block::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-bottom-right-radius: var(--r-lg);
}

.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  background: var(--n-800);
  border-bottom: 1px solid var(--n-700);
  font-size: var(--fs-2xs);
}
.code-title {
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--n-100);
}
.code-lang {
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  padding-left: 12px;
  margin-left: 12px;
  border-left: 1px solid var(--n-700);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--n-100);
}
.code-block code { background: transparent; border: none; padding: 0; color: inherit; font-size: inherit; }

.tok-k  { color: var(--tok-k); }
.tok-s  { color: var(--tok-s); }
.tok-n  { color: var(--tok-n); }
.tok-b  { color: var(--tok-b); }
.tok-c  { color: var(--tok-c); font-style: italic; }
.tok-fn { color: var(--tok-fn); }
.tok-m  { color: var(--tok-m); font-weight: 600; }

/* ============================================================
   TABS (used by the playground's XML card; reusable elsewhere)
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--n-200);
}
.tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel[hidden] { display: none; }
.tab-panel textarea { width: 100%; }

/* ============================================================
   EMBEDDED PLAYGROUND (lives inside an endpoint section)
   ============================================================ */
.tryit {
  grid-column: 1 / -1;
  margin-top: 48px;
  min-width: 0;
}
.tryit-head { margin-bottom: 18px; }
.tryit-head h3 {
  margin: 0 0 6px;
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-transform: none;
  border: none;
  padding: 0;
}
.tryit-head p {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--ink-mute);
  max-width: 64ch;
  line-height: 1.55;
}

.tryit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .tryit-grid { grid-template-columns: 1fr; }
}

.tryit-panel {
  background: var(--surface);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tryit-panel-out {
  background: var(--paper);
}
.tryit-panel-out #tryit-response {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.tryit-panel-out #tryit-response > .empty-state,
.tryit-panel-out #tryit-response > .response-pre {
  flex: 1 1 auto;
}
.tryit-panel-out #tryit-response > .empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tryit-divider {
  height: 1px;
  background: var(--paper-line);
  margin: 18px -22px;
}

.tryit-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 600px) {
  .tryit-grid-2 { grid-template-columns: 1fr; }
}

.tryit-action {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tryit-action #tryit-send { flex: 0 0 auto; min-width: 120px; }
.tryit-action .tryit-hint {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}
.tryit-action #tryit-clear { flex: 0 0 auto; }

.tryit-resp-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.response-meta-inline {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-sm);
  color: var(--ink);
}

.section-endpoint .code { position: static; }

.tryit-fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.tryit-fld label {
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-mute);
}
.tryit-fld input[type=text],
.tryit-fld input[type=password],
.tryit-fld select,
.tryit-fld textarea {
  display: block; width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--n-750);
  font-family: inherit;
  font-size: var(--fs-md);
  transition: border-color .12s, box-shadow .12s;
}
.tryit-fld input::placeholder, .tryit-fld textarea::placeholder { color: var(--n-250); }
.tryit-fld input:focus, .tryit-fld select:focus, .tryit-fld textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.tryit-fld textarea {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-sm);
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}
.tab-panel textarea {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-sm);
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--n-750);
  resize: vertical;
  line-height: 1.5;
}
.tab-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.tryit-fld select {
  -webkit-appearance: none; appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237B776F'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.dropzone {
  display: block;
  border: 2px dashed var(--n-200);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: var(--n-25);
  color: var(--ink-mute);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-deep);
}
.dropzone .dz-default,
.dropzone .dz-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dropzone .dz-default strong,
.dropzone .dz-file strong {
  color: var(--ink);
  font-weight: 700;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropzone .dz-default span,
.dropzone .dz-file > span {
  flex-shrink: 0;
  color: inherit;
  font-size: var(--fs-2xs);
  letter-spacing: .04em;
}
.dropzone.has-file {
  border-style: solid;
  border-color: var(--forest-line);
  background: var(--moss-tint2);
  color: var(--forest);
}
.dropzone.has-file strong { color: var(--forest-deep); }
.dropzone input[type=file] { display: none; }

.chip-grp { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-grp label {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--n-500);
  cursor: pointer;
  background: #fff;
  transition: .12s;
  margin: 0;
  text-align: center;
  min-width: 0;
}
.chip-grp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.chip-grp-grid label:nth-child(5) { grid-column: 1 / -1; }
.chip-grp label:hover {
  border-color: var(--n-300);
  background: var(--n-50);
  color: var(--ink);
}
.chip-grp input[type=checkbox] { display: none; }
.chip-grp label:has(input:checked) {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-lg);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--n-200);
  background: #fff;
  color: var(--n-700);
  font-family: inherit;
  transition: .12s;
}
.btn:hover { border-color: var(--n-300); background: var(--n-50); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-mute); }
.btn-ghost:hover { background: var(--n-75); color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: var(--fs-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
/* When a .btn is rendered as <a>, suppress the global anchor underline so
   it doesn't carry the dotted bottom-border into the button surface. */
a.btn, a.btn:hover { border-bottom-style: solid; text-decoration: none; }
a.btn-primary, a.btn-primary:hover { color: #fff; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.status-pill.ok   { background: var(--moss-tint2);  color: var(--forest-deep); border: 1px solid var(--forest-line); }
.status-pill.warn { background: var(--ochre-tint2); color: var(--ochre-text);  border: 1px solid var(--ochre-line); }
.status-pill.err  { background: var(--rust-tint);   color: var(--rust-text);   border: 1px solid var(--rust-line); }
.status-pill.idle { background: transparent;        color: var(--ink-faint);   border: 1px solid var(--paper-line); }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }

.curl-preview {
  background: var(--n-900);
  color: var(--n-100);
  border: 1px solid var(--n-700);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-sm);
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  position: relative;
}
.curl-preview .copy {
  position: absolute; top: 8px; right: 8px;
  background: var(--n-800); color: var(--n-150);
  border: 1px solid var(--n-700);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-size: var(--fs-3xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.curl-preview .copy:hover { background: var(--accent-deep); color: #fff; border-color: var(--accent-deep); }
.curl-preview .copy.copied { background: var(--forest); color: #fff; border-color: var(--forest); }
.curl-placeholder { color: var(--n-400); font-style: normal; }

.response-pre {
  background: var(--n-900);
  color: var(--n-100);
  border: 1px solid var(--n-700);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--fs-sm);
  line-height: 1.6;
  max-height: 480px;
  overflow: auto;
  margin: 0;
  white-space: pre;
}
.response-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}
.response-meta .latency { font-family: 'IBM Plex Mono', ui-monospace, monospace; color: var(--ink); }

.empty-state {
  padding: 22px;
  text-align: center;
  color: var(--ink-faint);
  font-size: var(--fs-sm);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-lg);
  background: var(--n-25);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 32px;
  border-top: 1px solid var(--paper-line);
  color: var(--ink-faint);
  font-size: var(--fs-2xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .section { grid-template-columns: 1fr; gap: 24px; padding: 44px 22px; }
  .section .code { position: static; }
  .section::before { left: 22px; top: 14px; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--n-200); border: 2px solid transparent; background-clip: padding-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--n-300); background-clip: padding-box; }

::selection { background: var(--accent); color: var(--surface); }
