
:root {
  --brand:       #0d5c4e;
  --brand-light: #e8f4f1;
  --brand-mid:   #b8d9d2;
  --ink:         #1a2330;
  --muted:       #5b6675;
  --border:      #e3e8ee;
  --bg:          #ffffff;
  --side-bg:     #f7f9fb;
  --code-bg:     #f2f4f7;
  --row-alt:     #fafbfc;
  --get:         #0a7d4f;
  --post:        #1a5fd0;
  --patch:       #7b3fbf;
  --warn-bg:     #fff8e6;
  --warn-border: #e8c96a;
  --mono:        "SF Mono", Consolas, "Cascadia Code", Menlo, monospace;
  --banner-h:    0px;
}

/* ============================================================
   DRAFT BANNER
   ============================================================ */
.draft-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #7c2d12;
  color: #fef2f2;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.draft-banner strong {
  letter-spacing: 0.08em;
  margin-right: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
nav {
  width: 296px;
  flex-shrink: 0;
  background: var(--side-bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--banner-h);
  height: calc(100vh - var(--banner-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-top { flex-shrink: 0; }

nav .logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
nav .logo a { color: inherit; text-decoration: none; }
nav .logo b  { display: block; font-size: 16px; color: var(--brand); }
nav .logo span { font-size: 11.5px; color: var(--muted); }

/* Sidebar search */
.nav-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--side-bg);
}
.nav-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px 6px 28px;
  font-size: 13px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 8px center;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
.nav-search:focus { border-color: var(--brand); }
.nav-search::placeholder { color: var(--muted); }

/* Scrollable nav body */
.nav-scroll { flex: 1; overflow-y: auto; padding-bottom: 24px; }

nav h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--muted);
  margin: 18px 20px 4px;
  padding: 0;
  border: none;
  background: none;
}
nav ul { list-style: none; margin: 0; padding: 0; }
nav li a {
  display: block;
  padding: 5px 20px;
  font-size: 13px;
  color: var(--ink);
  border-left: 3px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .1s;
}
nav li a:hover {
  background: var(--brand-light);
  border-left-color: var(--brand-mid);
  text-decoration: none;
}
nav li a.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
}

/* Method badges in sidebar */
nav li a .m {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  margin-right: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  color: #fff;
  vertical-align: middle;
}
.m.get   { background: var(--get); }
.m.post  { background: var(--post); }
.m.patch { background: var(--patch); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
  flex: 1;
  max-width: 920px;
  padding: 44px 60px 120px;
  min-width: 0;
}

h1 { font-size: 28px; margin: 0 0 6px; font-weight: 700; }
h2 {
  font-size: 22px;
  margin: 64px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-weight: 700;
}
h3 { font-size: 16px; margin: 36px 0 8px; font-weight: 600; }

/* Section headings: Request / Response / Errors / Sample — make them stand out */
h4 {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin: 36px 0 12px;
  padding: 0 0 7px;
  border-bottom: 2px solid var(--border);
  background: none;
}

p, li { font-size: 14.5px; }
.sub { color: var(--muted); font-size: 15px; margin-bottom: 22px; }

/* ============================================================
   ENDPOINT BADGE
   ============================================================ */
.endpoint {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand-mid);
  border-radius: 8px;
  padding: 11px 16px;
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink);
  font-weight: 500;
}
.endpoint .m {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: .04em;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0 22px;
  font-size: 13.5px;
}

/* Column headers */
th {
  text-align: left;
  background: var(--side-bg);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 8px 11px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

td {
  border: 1px solid var(--border);
  padding: 8px 11px;
  vertical-align: top;
}

/* Alternating rows */
tbody tr:nth-child(even) td { background: var(--row-alt); }
tbody tr:hover td { background: var(--brand-light); transition: background .1s; }

/* Group header rows — <tr><td colspan="N"><b>Section</b></td></tr> */
td[colspan] {
  background: #e8edf4 !important;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #3a4f63;
  border-top: 2px solid #ccd5e0;
  padding: 6px 11px;
}
tbody tr:hover td[colspan] { background: #dce5f0 !important; }

/* Inline code in table cells / prose */
td code, p code, li code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ============================================================
   REQUIRED / OPTIONAL BADGES
   ============================================================ */
.req {
  display: inline-block;
  color: #b42318;
  font-weight: 700;
  font-size: 10.5px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  line-height: 1.5;
}
.opt {
  display: inline-block;
  color: var(--muted);
  font-size: 10.5px;
  background: var(--side-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  line-height: 1.5;
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.code-block-wrap { position: relative; margin: 14px 0; }

.code-block-wrap .copy-btn {
  position: absolute;
  top: 9px;
  right: 10px;
  font-size: 11px;
  font-family: var(--mono);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: #96a7b8;
  padding: 2px 9px;
  cursor: pointer;
  transition: all .15s;
  z-index: 1;
}
.code-block-wrap .copy-btn:hover {
  background: rgba(255,255,255,.16);
  color: #dce4ee;
  border-color: rgba(255,255,255,.32);
}
.code-block-wrap .copy-btn.copied {
  color: #6ee7b7;
  border-color: rgba(110,231,183,.4);
}

pre {
  background: #0f1720;
  color: #dce4ee;
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}
pre code { background: none; border: none; color: inherit; padding: 0; font-size: inherit; }

/* ---- <code-sample> web component ---- */
.code-sample { position: relative; }
.code-sample .copy {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px; background: rgba(255,255,255,.08);
  padding: 2px 9px; cursor: pointer; color: #96a7b8;
}
.code-sample .copy:hover { color: #dce4ee; }

/* ============================================================
   CALLOUT BOXES
   ============================================================ */
.note {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin: 18px 0;
  font-size: 14px;
}
.warn {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-border);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin: 18px 0;
  font-size: 14px;
}

/* ============================================================
   PILL BADGE
   ============================================================ */
.pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  padding: 0 7px;
  color: #8a6d1a;
  white-space: nowrap;
}

/* ============================================================
   JOURNEY BOX
   ============================================================ */
.journey { border: 1px solid var(--border); border-radius: 8px; padding: 4px 20px 14px; margin: 18px 0; }

/* ============================================================
   FOOTER
   ============================================================ */
footer { margin-top: 80px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* ============================================================
   PREV / NEXT
   ============================================================ */
.pagenav { display: flex; justify-content: space-between; margin-top: 60px; gap: 12px; }
.pagenav a { border: 1px solid var(--border); border-radius: 8px; padding: 11px 16px; font-size: 14px; flex: 1; }
.pagenav a:hover { background: var(--brand-light); text-decoration: none; }
.pagenav .next { text-align: right; }
.pagenav small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }

/* ============================================================
   FIRST-CHILD RESETS
   ============================================================ */
main > h1:first-child { margin-top: 0; }
main > h2:first-child,
.page > h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
p.error { background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px 20px; color: #664d03; }
.page > div.journey:first-child { border: none; padding: 0; margin: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  nav { display: none; }
  main { padding: 24px 20px; }
}
