/* Fortal Partner API docs — readable light documentation theme */

@font-face{font-family:"Noto Sans";src:url("fonts/noto-sans-latin-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Noto Sans";src:url("fonts/noto-sans-latin-500.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Noto Sans";src:url("fonts/noto-sans-latin-600.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Noto Sans";src:url("fonts/noto-sans-latin-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Noto Sans Thai";src:url("fonts/noto-sans-thai-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}
@font-face{font-family:"Noto Sans Thai";src:url("fonts/noto-sans-thai-500.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}
@font-face{font-family:"Noto Sans Thai";src:url("fonts/noto-sans-thai-600.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}
@font-face{font-family:"Noto Sans Thai";src:url("fonts/noto-sans-thai-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}
@font-face{font-family:"IBM Plex Sans";src:url("fonts/ibm-plex-sans-latin-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";src:url("fonts/ibm-plex-sans-latin-600.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";src:url("fonts/ibm-plex-sans-latin-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans Thai";src:url("fonts/ibm-plex-sans-thai-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}
@font-face{font-family:"IBM Plex Sans Thai";src:url("fonts/ibm-plex-sans-thai-600.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}
@font-face{font-family:"IBM Plex Sans Thai";src:url("fonts/ibm-plex-sans-thai-700.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0E00-0E7F,U+200C-200D,U+25CC}

:root {
  --bg: #f7f4ee;
  --bg-sidebar: #f1ece3;
  --bg-elev: #fffcf7;
  --bg-hover: #eae3d6;
  --bg-code: #16130f;
  --bg-code-head: #1e1a15;
  --text: #1b1814;
  --text-secondary: #3f3a33;
  --text-muted: #6a6358;
  --border: #e4dccf;
  --border-strong: #cfc5b4;
  --brand: #8d6a28;
  --brand-soft: #b59656;
  --brand-bg: rgba(181, 150, 86, 0.14);
  --link: #8a6420;
  --get: #0b7a72;
  --get-bg: rgba(11, 122, 114, 0.12);
  --post: #1d4ed8;
  --post-bg: rgba(29, 78, 216, 0.1);
  --danger: #b42318;
  --danger-bg: rgba(180, 35, 24, 0.08);
  --warn: #8a5a10;
  --warn-bg: rgba(181, 150, 86, 0.16);
  --info: #0f6e73;
  --info-bg: rgba(15, 110, 115, 0.08);
  --ok: #0f7a4a;
  --shadow: 0 1px 2px rgba(28, 22, 14, 0.04), 0 8px 24px rgba(28, 22, 14, 0.06);
  --topbar-h: 56px;
  --sidebar-w: 292px;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Noto Sans", "Noto Sans Thai", "IBM Plex Sans Thai", "IBM Plex Sans", Tahoma, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-color: rgba(138, 100, 32, 0.35); text-underline-offset: 3px; }
a:hover { color: #6e4e16; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--brand-bg); color: var(--text); }

.skip {
  position: absolute; left: 12px; top: -40px; z-index: 80;
  background: var(--text); color: #fff; padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 8px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px 0 12px;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-btn {
  display: none;
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-btn:hover { background: var(--bg-hover); }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none; min-width: 0;
}
.brand:hover { text-decoration: none; color: inherit; }
.brand .logo { width: 28px; height: 28px; display: block; border-radius: 6px; }
.brand .wordmark { height: 18px; width: auto; display: block; }
.brand .product {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  border-left: 1px solid var(--border-strong); padding-left: 10px;
  letter-spacing: 0.02em; white-space: nowrap;
}
.topbar-meta { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Shell ───────────────────────────────────────────── */
.shell { display: flex; align-items: flex-start; min-height: calc(100vh - var(--topbar-h)); }
.backdrop { display: none; }

.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--sidebar-w); flex-shrink: 0;
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  z-index: 30;
}
.search-wrap { padding: 12px 12px 8px; }
.search-wrap input {
  width: 100%; height: 36px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-elev); color: var(--text);
  font: inherit; font-size: 13px; padding: 0 10px 0 32px;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236a6358' stroke-width='1.8' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3-3'/></svg>");
  background-repeat: no-repeat; background-position: 10px 50%;
}
.search-wrap input:focus { border-color: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-bg); }
.search-wrap input::placeholder { color: #9a9286; }

.sidenav {
  flex: 1; overflow: auto; padding: 4px 10px 24px;
  scrollbar-width: thin; scrollbar-color: #d0c6b4 transparent;
}
.nav-group { margin-bottom: 14px; }
.nav-group[hidden], .sidenav a[hidden], .nav-sub[hidden] { display: none !important; }
.nav-label {
  display: block; padding: 6px 10px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.sidenav a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 13.5px; line-height: 1.4; font-weight: 500;
}
.sidenav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sidenav a.active { background: var(--brand-bg); color: var(--brand); font-weight: 650; }
.sidenav .nav-sub { display: flex; flex-direction: column; padding: 2px 0 4px 6px; }
.sidenav .nav-sub a { font-size: 12.5px; font-weight: 450; padding: 5px 10px; color: var(--text-muted); }
.sidenav .nav-sub a.active { background: transparent; color: var(--brand); font-weight: 650; }
.sidenav .path { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sidenav a { min-width: 0; }
.no-results { padding: 10px; font-size: 13px; color: var(--text-muted); }

/* HTTP method badges */
.method {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 10px;
  letter-spacing: 0.04em; line-height: 1;
  min-width: 38px; height: 18px; padding: 0 6px; border-radius: 4px;
  background: var(--brand-bg); color: var(--brand); flex-shrink: 0;
}
.method.get { background: var(--get-bg); color: var(--get); }
.method.post { background: var(--post-bg); color: var(--post); }
.http { font-family: var(--mono); font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--get-bg); color: var(--get); }
.http.bad { background: var(--danger-bg); color: var(--danger); }

/* ── Content ─────────────────────────────────────────── */
.content { flex: 1; min-width: 0; }
.doc {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 48px 96px;
}
.hero {
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 8px;
}
.hero h1, .page-title { font-size: 36px; letter-spacing: -0.03em; max-width: 18em; }
.hero .subtitle { font-size: 20px; font-weight: 600; margin-top: 10px; color: var(--text-secondary); }
.lead { color: var(--text-secondary); font-size: 17px; margin-top: 14px; max-width: 46em; }
.hero .note { color: var(--text-muted); font-size: 15px; margin-top: 10px; max-width: 46em; }

.doc > section {
  padding: 40px 0 12px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.doc > section:last-of-type { border-bottom: 0; }
.doc > section > * + * { margin-top: 16px; }
.doc > footer { margin-top: 48px; }

.section-title { font-size: 26px; }
.section-title a.anchor-link, h3 a.anchor-link, h2 a.anchor-link {
  color: inherit; text-decoration: none; margin-left: 6px;
  opacity: 0; font-weight: 500; color: var(--brand-soft);
}
.section-title:hover a.anchor-link, h3:hover a.anchor-link, h2:hover a.anchor-link { opacity: 1; }
.section-desc { color: var(--text-muted); margin-top: 8px !important; max-width: 46em; }
h3 { font-size: 18px; margin-top: 28px !important; scroll-margin-top: calc(var(--topbar-h) + 16px); }
h3.endpoint-title {
  font-family: var(--font);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 18px;
  padding: 14px 0 4px;
  border-top: 1px dashed var(--border);
  margin-top: 32px !important;
}
section > h3:first-of-type, .section-head + h3 { border-top: 0; padding-top: 4px; }

.muted { color: var(--text-muted); }
.small { font-size: 14.5px; }
.muted.small, p.muted, p.small { max-width: 46em; }

code.inline, p code, li code, td code, th code, figcaption code, h3 code, .callout code {
  font-size: 0.86em;
  padding: 0.1em 0.4em;
  border-radius: 5px;
  background: #efe8db;
  color: #6e4e16;
  border: 1px solid #e6dcc9;
  word-break: break-word;
}

/* Cards / callouts / buttons */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-sm { padding: 12px; border-radius: var(--radius-sm); box-shadow: none; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #fff; border-color: var(--brand-soft); text-decoration: none; }
.btn-primary {
  background: linear-gradient(180deg, #d4b36a, #b59656);
  color: #1b140a; border-color: #c4a45a;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 12px rgba(181,150,86,0.25);
}
.btn-primary:hover { filter: brightness(1.04); color: #1b140a; }
.row, .spread { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #efe8db; color: var(--text-secondary); border: 1px solid var(--border); white-space: nowrap;
}
.badge-gold { background: var(--brand-bg); color: var(--brand); border-color: #e0cf9a; }
.req { color: var(--brand); font-size: 11px; font-weight: 700; }

.callout {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #f3eee4; font-size: 14.5px;
}
.callout strong, .callout b { display: block; margin-bottom: 2px; }
.callout p + p { margin-top: 4px; }
.callout-info { border-color: #b9d4d5; background: var(--info-bg); }
.callout-warn { border-color: #e0cf9a; background: var(--warn-bg); }
.callout-danger { border-color: #f0c0bb; background: var(--danger-bg); }

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.flow-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 4px;
}
.flow-item b { font-size: 14px; }
.flow-item code { font-size: 11.5px; color: var(--brand); background: none; border: 0; padding: 0; }

.check-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 52em; }
.check-list li { display: flex; gap: 10px; }
.check-list li::before { content: "✓"; color: var(--brand); font-weight: 700; flex-shrink: 0; }
ol.steps-ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 52em; }
ol.steps-ol li::marker { color: var(--brand); font-weight: 700; }
ol:not(.steps-ol) { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 52em; }

/* Code panels */
.code {
  border: 1px solid #2a251e; border-radius: var(--radius-sm);
  background: var(--bg-code); overflow: hidden; min-width: 0;
  box-shadow: 0 8px 24px rgba(22, 19, 15, 0.18);
}
.code-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 14px;
  border-bottom: 1px solid #2e2922;
  font-size: 12px; color: #b3aa9c; background: var(--bg-code-head);
}
.code-head .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.code pre {
  margin: 0; padding: 14px 16px; font-size: 12.5px; line-height: 1.65;
  overflow: auto; max-height: 480px; color: #ebe4d8; tab-size: 2;
}
.copy {
  border: 0; background: transparent; color: #b3aa9c;
  font: inherit; font-size: 12px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.copy:hover { background: #ffffff14; color: #fff; }
.copy.copied { color: #8fd6a8; }
.tok-key { color: #e6c07b; }
.tok-str { color: #a8d39a; }
.tok-num { color: #7ec8c4; }
.tok-lit { color: #e8a0a6; }
.tok-com { color: #8a8276; font-style: italic; }
.tok-kw { color: #d6a0e0; }
.tok-fn { color: #8cb8f0; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  color: var(--text-muted); font-weight: 650; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: #f3eee6; white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fbf8f2; }
td:first-child { font-variant-numeric: tabular-nums; }

figure { margin: 0; }
figure img, figure video { display: block; }
figcaption { margin-top: 6px; }

.doc > footer, footer.card {
  background: transparent; box-shadow: none;
  border: 0; border-top: 1px solid var(--border);
  border-radius: 0; padding: 24px 0 0;
  color: var(--text-muted); font-size: 13.5px;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  .topbar-meta { display: none; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 8px 0 32px rgba(28,22,14,0.18); }
  body.nav-open .backdrop {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(28, 22, 14, 0.35); z-index: 25;
  }
  .doc { padding: 24px 18px 72px; }
  .hero h1, .page-title { font-size: 28px; }
  h3.endpoint-title { font-size: 16px; }
}
@media (max-width: 720px) {
  .brand .wordmark { height: 16px; }
  .brand .product { font-size: 12px; }
}

/* Version selection shares the guide's typography and palette. */
[hidden] { display: none !important; }
.version-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  max-width: 1080px; margin: 0 auto; padding: 24px 48px 0;
  border-bottom: 1px solid var(--border);
}
.version-tabs a {
  flex: 1; min-width: 0; padding: 12px 10px;
  border-bottom: 3px solid transparent;
  color: var(--text-muted); font-weight: 600; text-decoration: none;
  text-align: center; line-height: 1.5;
}
.version-tabs a[aria-current="page"] {
  color: var(--brand); border-bottom-color: var(--brand);
  background: var(--brand-bg);
}
.version-tabs a:hover { background: var(--bg-hover); }
.version-tabs a:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.version-note { padding: 12px 18px; }
.doc { overflow-wrap: anywhere; }
.doc pre { overflow-wrap: normal; }
@media (max-width: 980px) {
  .version-tabs { padding: 16px 18px 0; }
  .version-tabs a { font-size: 14px; }
  .version-tabs span { display: block; font-size: 12px; }
}
