/* KingPepe API docs page — original styling (dark, responsive, RTL). Reuses tokens from style.css. */
.apx-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #1a2029, #151a21); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; gap: 10px; }
.apx-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; }
.apx-brand img { border-radius: 8px; }
.apx-brand b { color: var(--green); }
.apx-top-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apx-link { color: var(--blue); text-decoration: none; padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.apx-link:hover { background: var(--card); }
.apx-btn { background: var(--card2); border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.apx-btn:hover { border-color: var(--green-dim); }
.apx-btn.primary { background: var(--green-dim); color: #06210b; border-color: var(--green-dim); font-weight: 600; }
.apx-btn.primary:hover { background: var(--green); }
.apx-btn.sm { padding: 4px 10px; font-size: 12px; }

.apx-wrap { max-width: 1080px; margin: 0 auto; padding: 20px 18px 60px; }
.apx-hero { margin: 8px 0 20px; }
.apx-hero h1 { margin: 0 0 6px; font-size: 26px; }
.apx-hero h1 b { color: var(--green); }
.apx-base { margin-top: 10px; font-size: 13px; color: var(--muted); }
.apx-base code { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; color: var(--green); font-family: var(--mono); }
.apx-copy { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 11px; }

/* status bar */
.apx-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.apx-scard { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.apx-slbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.apx-scard b { font-size: 16px; font-variant-numeric: tabular-nums; }
.apx-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.apx-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.apx-dot.off { background: var(--red); }

.apx-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.apx-card h2 { margin: 0 0 12px; font-size: 16px; }
.apx-section-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 26px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }

/* search + explorer */
.apx-searchrow, .apx-explorer { display: flex; gap: 8px; flex-wrap: wrap; }
.apx-searchrow input, .apx-explorer select, .apx-param input { background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 9px 12px; border-radius: 8px; outline: none; font-size: 14px; }
.apx-searchrow input { flex: 1; min-width: 200px; }
.apx-explorer select { flex: 1; min-width: 220px; }
.apx-params { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.apx-param { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.apx-searchout, .apx-searchhit { margin-top: 10px; font-size: 14px; }

/* endpoint cards */
.apx-endpoints { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.apx-ep { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
.apx-ep.na { opacity: .6; }
.apx-ep-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.apx-method { background: rgba(78,201,90,.15); color: var(--green); border: 1px solid rgba(78,201,90,.4); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.apx-method.na { background: var(--card2); color: var(--muted); border-color: var(--border); }
.apx-path { font-family: var(--mono); font-size: 12.5px; color: var(--text); word-break: break-all; }
.apx-ep-desc { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.apx-ex { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; overflow-x: auto; }
.apx-url { font-family: var(--mono); font-size: 11.5px; color: var(--blue); white-space: nowrap; }
.apx-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.apx-result { margin-top: 8px; }

/* meta + json */
.apx-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; }
.apx-pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--bg2); border: 1px solid var(--border); color: var(--muted); }
.apx-pill.ok { color: var(--green); border-color: rgba(78,201,90,.4); }
.apx-pill.bad { color: var(--red); border-color: rgba(255,92,108,.4); }
.apx-jsonhead { display: flex; gap: 6px; margin-bottom: 4px; }
.apx-mini { background: var(--card2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 2px 9px; font-size: 11px; cursor: pointer; }
.apx-json { background: #0a0f0c; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12px; max-height: 360px; overflow: auto; white-space: pre; color: #cfe8d4; }
.apx-json.hidden, .apx-code.hidden { display: none; }
.apx-fields { margin-top: 8px; } .apx-fields summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.apx-fields table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.apx-fields td { padding: 3px 8px; border-bottom: 1px solid var(--border); }
.apx-err { color: var(--red); font-size: 13px; }

/* code examples */
.apx-code { margin-top: 8px; }
.apx-codetabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.apx-ctab { background: var(--card2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 3px 9px; font-size: 11px; cursor: pointer; }
.apx-ctab.active { background: var(--green-dim); color: #06210b; border-color: var(--green-dim); }
.apx-codeblock { background: #0a0f0c; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre; color: #cfe8d4; }

/* linking */
.apx-linkrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.apx-linkrow label { min-width: 90px; font-size: 13px; color: var(--muted); }
.apx-linkrow input { background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 8px; min-width: 160px; }
.apx-lkurl { font-family: var(--mono); font-size: 11.5px; color: var(--blue); flex: 1; min-width: 180px; word-break: break-all; }
.apx-qr { margin: 4px 0 12px; } .apx-qr svg { width: 132px; height: 132px; border-radius: 6px; }

.apx-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; flex-wrap: wrap; gap: 8px; }

/* light theme override */
body[data-theme="light"] { background: #f3f7f4; color: #123021; }
body[data-theme="light"] .apx-json, body[data-theme="light"] .apx-codeblock { background: #0f1a12; }

@media (max-width: 620px) {
  .apx-endpoints { grid-template-columns: 1fr; }
  .apx-linkrow { flex-direction: column; align-items: stretch; }
}
