/* Cashmora developer docs (docs.cashmora.co.ug) */
:root {
  --bg: #ffffff; --bg-2: #f7f8fa; --bg-3: #eef1f5; --text: #0f172a; --text-2: #475569; --text-3: #8391a7;
  --border: #e5e8ee; --brand: #0a7fe6; --brand-2: #22c55e; --brand-soft: #e8f3fd;
  --code-bg: #0d1117; --code-head: #161b22; --code-text: #e6edf3; --code-border: #21262d;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --top: 60px; --nav: 268px; --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0b0f14; --bg-2: #11161d; --bg-3: #18202a; --text: #e6edf3; --text-2: #a6b3c4; --text-3: #6f7d90;
  --border: #222b36; --brand: #3b9cf0; --brand-soft: #0f2741; --shadow: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); scroll-behavior: smooth; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .86em; background: var(--bg-3); padding: .1em .38em; border-radius: 6px; color: var(--text); }
kbd { font-family: var(--mono); font-size: .7rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; color: var(--text-3); background: var(--bg); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--bg); padding: .5rem 1rem; }
[data-theme="light"] .only-dark, [data-theme="dark"] .only-light { display: none; }

/* Top bar */
.d-top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40; display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.8) blur(10px); border-bottom: 1px solid var(--border); }
.d-brand { display: flex; align-items: center; gap: .55rem; flex: none; }
.d-brand:hover { text-decoration: none; }
.d-brand-tag { font-weight: 700; font-size: .8rem; color: var(--text-2); border-left: 1px solid var(--border); padding-left: .55rem; }
.d-search-btn { flex: 1; max-width: 440px; margin: 0 auto; display: flex; align-items: center; gap: .55rem; height: 38px; padding: 0 .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); color: var(--text-3); font: inherit; font-size: .9rem; cursor: pointer; }
.d-search-btn span { flex: 1; text-align: left; }
.d-top-links { display: flex; align-items: center; gap: 1.1rem; font-size: .88rem; font-weight: 600; }
.d-top-links a { color: var(--text-2); }
.d-btn { background: var(--text); color: var(--bg) !important; padding: .45rem .8rem; border-radius: 9px; }
.d-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.05rem; flex: none; }
.d-menu { display: none; }

/* Layout */
.d-shell { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); padding-top: var(--top); }
.d-nav { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg); }
.d-nav-inner { padding: 1.1rem .8rem 2rem; }
.d-nav-group { margin-bottom: .6rem; }
.d-nav-group summary { list-style: none; cursor: pointer; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: .45rem .6rem; display: flex; justify-content: space-between; }
.d-nav-group summary::after { content: "▾"; font-size: .7rem; transition: transform .15s; }
.d-nav-group:not([open]) summary::after { transform: rotate(-90deg); }
.d-nav-group summary::-webkit-details-marker { display: none; }
.d-nav a { display: flex; align-items: center; gap: .5rem; padding: .34rem .6rem; border-radius: 8px; color: var(--text-2); font-size: .88rem; font-weight: 500; line-height: 1.35; }
.d-nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.d-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-method { font-family: var(--mono); font-size: .6rem; font-weight: 700; min-width: 34px; text-align: center; padding: .05rem .2rem; border-radius: 4px; }
.d-nav-foot { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .8rem; }
.d-nav-foot a { font-size: .82rem; }
.d-nav-backdrop { display: none; }
.d-main { min-width: 0; padding: 0 2.25rem 4rem; }

/* Hero */
.d-hero { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.d-pill { display: inline-flex; gap: .35rem; align-items: center; font-size: .75rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: .25rem .6rem; border-radius: 999px; }
.d-hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.12; letter-spacing: -.03em; margin: .7rem 0 .8rem; }
.d-hero p { color: var(--text-2); font-size: 1.04rem; margin: 0 0 1.2rem; max-width: 560px; }
.d-base { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .5rem .45rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); font-size: .85rem; max-width: 100%; }
.d-base span { color: var(--text-3); font-weight: 600; }
.d-base code { background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.d-card { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.d-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.d-card > i { font-size: 1.2rem; color: var(--brand); background: var(--brand-soft); width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.d-card strong { display: block; font-size: .92rem; }
.d-card small { color: var(--text-3); font-size: .8rem; }
.d-lang-bar { position: sticky; top: var(--top); z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: .55rem 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); font-size: .8rem; color: var(--text-3); border-bottom: 1px solid var(--border); }
.d-lang-switch { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.d-lang-switch button { border: 0; background: none; font: inherit; font-size: .78rem; font-weight: 600; color: var(--text-2); padding: .25rem .6rem; border-radius: 7px; cursor: pointer; }
.d-lang-switch button.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Sections */
.d-section { padding: 2.6rem 0; border-bottom: 1px solid var(--border); }
.d-section.is-endpoint { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.d-eyebrow { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); }
.d-section h2 { font-size: 1.55rem; letter-spacing: -.02em; margin: .2rem 0 .8rem; position: relative; }
.d-anchor { position: absolute; left: -1.2rem; opacity: 0; color: var(--text-3); font-weight: 400; }
.d-section h2:hover .d-anchor { opacity: 1; text-decoration: none; }
.d-prose { color: var(--text-2); }
.d-prose p { margin: 0 0 1rem; }
.d-prose strong { color: var(--text); }
.d-prose h3, .d-prose h4 { color: var(--text); margin: 1.4rem 0 .5rem; font-size: 1.05rem; }
.d-prose ul, .d-prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.d-prose li { margin-bottom: .35rem; }
.d-endpoint { display: flex; align-items: center; gap: .55rem; padding: .45rem .5rem .45rem .45rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); margin-bottom: .8rem; max-width: 100%; overflow: hidden; }
.d-endpoint code { background: none; padding: 0; font-size: .92rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.d-noauth { font-size: .7rem; font-weight: 700; color: var(--text-3); border: 1px dashed var(--border); border-radius: 6px; padding: .05rem .4rem; }
.d-summary { font-size: 1.02rem; color: var(--text); margin: 0 0 1rem; }
.method { font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .03em; padding: .18rem .45rem; border-radius: 6px; flex: none; }
.m-get { background: #dcfce7; color: #15803d; } .m-post { background: #dbeafe; color: #1d4ed8; } .m-delete { background: #fee2e2; color: #b91c1c; } .m-put, .m-patch { background: #fef3c7; color: #a16207; }
[data-theme="dark"] .m-get { background: #0f2e1d; color: #4ade80; } [data-theme="dark"] .m-post { background: #10264a; color: #7cb6ff; }
.d-copy { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: .25rem .4rem; border-radius: 6px; font-size: .9rem; flex: none; }
.d-copy:hover { color: var(--text); background: var(--bg-3); }
.d-copy.copied { color: var(--brand-2); }

/* Tables, callouts */
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .87rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap th { background: var(--bg-2); color: var(--text); font-weight: 700; font-size: .78rem; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td { color: var(--text-2); }
.callout { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: var(--radius); margin: 0 0 1.1rem; font-size: .9rem; border: 1px solid; }
.callout > i { font-size: 1.05rem; margin-top: .1rem; }
.callout-note, .callout-tip { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--text); }
.callout-tip > i { color: var(--brand-2); }
.callout-note > i { color: var(--brand); }
.callout-warning { background: color-mix(in srgb, #f59e0b 12%, var(--bg)); border-color: color-mix(in srgb, #f59e0b 35%, transparent); color: var(--text); }
.callout-warning > i { color: #d97706; }
.callout-important { background: color-mix(in srgb, #22c55e 10%, var(--bg)); border-color: color-mix(in srgb, #22c55e 35%, transparent); color: var(--text); }
.callout-important > i { color: #16a34a; }

/* Parameters */
.params, .d-attrs { margin: 1.4rem 0 0; }
.params-title, .d-attrs > summary { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text); padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.params ul, .d-attrs ul { list-style: none; padding: 0; margin: 0; }
.params li, .d-attrs li { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.param-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .2rem; }
.param-name { font-weight: 600; color: var(--text); background: none; padding: 0; font-size: .88rem; }
.param-type { font-family: var(--mono); font-size: .74rem; color: var(--text-3); }
.param-req { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #e11d48; }
.param-opt { font-size: .66rem; font-weight: 700; color: var(--text-3); }
.param-desc { font-size: .88rem; color: var(--text-2); }
.param-children { margin-top: .5rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .8rem; }
.param-children > summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--text-2); padding: .45rem 0; }
.param-children .params { margin: 0 0 .5rem; }
.param-children .params-title { display: none; }
.d-attrs > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.d-attrs > summary::after { content: "+"; font-size: 1rem; color: var(--text-3); }
.d-attrs[open] > summary::after { content: "–"; }
.d-attrs > summary::-webkit-details-marker { display: none; }

/* Code */
.d-code { position: sticky; top: calc(var(--top) + 56px); display: grid; gap: 1rem; min-width: 0; }
.d-panel, .code-box { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); overflow: hidden; }
.d-panel-head, .code-box-head { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem .35rem .85rem; background: var(--code-head); border-bottom: 1px solid var(--code-border); color: #8b949e; font-size: .76rem; }
.d-panel-title { font-family: var(--mono); color: #c9d1d9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: .4rem; }
.d-panel-title .method { font-size: .62rem; padding: .08rem .3rem; }
.d-panel-tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.d-panel-tabs button { border: 0; background: none; color: #8b949e; font: inherit; font-size: .74rem; font-weight: 600; padding: .25rem .5rem; border-radius: 6px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.d-panel-tabs button.active { background: #21262d; color: #e6edf3; }
.d-panel .d-copy, .code-box .code-copy { color: #8b949e; border: 0; background: none; cursor: pointer; padding: .25rem .4rem; border-radius: 6px; }
.d-panel .d-copy:hover, .code-box .code-copy:hover { background: #21262d; color: #e6edf3; }
.code-box-head span { font-family: var(--mono); flex: 1; }
.d-panel pre, .code-box pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; max-height: 520px; font-family: var(--mono); font-size: .8rem; line-height: 1.6; color: var(--code-text); }
.d-panel pre code, .code-box pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.code-box { margin: 0 0 1.2rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.s2 { background: #3fb950; } .status-dot.s4 { background: #f0883e; } .status-dot.s5 { background: #f85149; }
.tk-str { color: #a5d6ff; } .tk-num { color: #79c0ff; } .tk-key { color: #7ee787; } .tk-kw { color: #ff7b72; } .tk-com { color: #8b949e; font-style: italic; } .tk-var { color: #ffa657; } .tk-fn { color: #d2a8ff; } .tk-bool { color: #79c0ff; }

/* Footer */
.d-footer { padding: 2.5rem 0 0; color: var(--text-2); font-size: .88rem; display: grid; gap: .6rem; }
.d-footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.d-footer-copy { color: var(--text-3); font-size: .8rem; }

/* Search */
.d-search { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .5); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 1rem 1rem; }
.d-search[hidden] { display: none; }
.d-search-panel { width: 100%; max-width: 640px; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); overflow: hidden; }
.d-search-input { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-3); }
.d-search-input input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 1.05rem; color: var(--text); }
.d-search-results { list-style: none; margin: 0; padding: .4rem; max-height: 55vh; overflow-y: auto; }
.d-search-results li a { display: block; padding: .6rem .75rem; border-radius: 10px; color: var(--text); }
.d-search-results li a:hover, .d-search-results li.active a { background: var(--brand-soft); text-decoration: none; }
.d-search-results .r-title { font-weight: 700; font-size: .92rem; display: flex; gap: .5rem; align-items: center; }
.d-search-results .r-group { font-size: .7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.d-search-results .r-snip { font-size: .82rem; color: var(--text-2); display: block; margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-search-results mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.d-search-empty { padding: 1.5rem; text-align: center; color: var(--text-3); font-size: .9rem; }
.d-search-foot { display: flex; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--border); font-size: .74rem; color: var(--text-3); }

/* Responsive */
@media (max-width: 1180px) {
  .d-section.is-endpoint { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .d-code { position: static; }
  .d-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .d-shell { grid-template-columns: minmax(0, 1fr); }
  .d-nav { position: fixed; top: var(--top); left: 0; bottom: 0; width: 290px; height: auto; z-index: 45; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  body.nav-open .d-nav { transform: none; }
  .d-nav-backdrop { display: none; }
  body.nav-open .d-nav-backdrop { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 44; background: rgba(2, 6, 23, .35); }
  .d-menu { display: inline-flex; }
  .d-top-links { display: none; }
  .d-main { padding: 0 1rem 3rem; }
  .d-search-btn kbd, .d-brand-tag { display: none; }
  .d-anchor { display: none; }
  .d-cards { grid-template-columns: minmax(0, 1fr); }
  .d-hero { padding-top: 2rem; }
}
@media (max-width: 480px) {
  .d-search-btn span { display: none; }
  .d-search-btn { flex: 0 0 38px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .d-top { gap: .5rem; padding: 0 .75rem; }
}
