/* Developer site of the Origela store API. Same brand kit as the sales site (Coral #F35438, Ink #202326, Cream #FAF9F5,
   Action #C83F28, Inter), tuned for documentation: calmer, denser, code and tables first. Mobile first.
   Theme: follows the system; a choice made with the button is kept in [data-theme] on <html>. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 500; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600 900; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }

:root {
  --bg: #faf9f5; --bg-soft: #f3f0e8; --bg-elev: #ffffff; --text: #202326; --text-soft: #43464b; --muted: #5c5f64;
  --line: #e6e2d9; --line-strong: #d0cabd; --link: #b93822; --accent: #c83f28; --coral: #f35438;
  --code-bg: #f3f0e8; --code-text: #202326; --pre-bg: #25282c; --pre-text: #f3f1ea; --pre-line: #3a3d42; --pre-muted: #c2c0b9;
  --get: #1a6a33; --get-bg: #e6f3ea; --write: #a3311d; --write-bg: #fde8e3; --personal: #6b4a00; --personal-bg: #fbefcf;
  --note-bg: #f3f0e8; --warn-bg: #fdf1d8; --warn-line: #d9a514;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --hdr: 57px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1e21; --bg-soft: #25282c; --bg-elev: #2a2d31; --text: #f3f1ea; --text-soft: #d6d4ce; --muted: #b3b1ab;
    --line: #383b40; --line-strong: #50545a; --link: #ff9077; --accent: #ff8466;
    --code-bg: #2a2d31; --code-text: #f3f1ea; --pre-bg: #131517; --pre-text: #f3f1ea; --pre-line: #383b40; --pre-muted: #b3b1ab;
    --get: #7fdc98; --get-bg: #1c3324; --write: #ff9b85; --write-bg: #3d2420; --personal: #f2cf73; --personal-bg: #3a3017;
    --note-bg: #25282c; --warn-bg: #352b12; --warn-line: #b88a12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1e21; --bg-soft: #25282c; --bg-elev: #2a2d31; --text: #f3f1ea; --text-soft: #d6d4ce; --muted: #b3b1ab;
  --line: #383b40; --line-strong: #50545a; --link: #ff9077; --accent: #ff8466;
  --code-bg: #2a2d31; --code-text: #f3f1ea; --pre-bg: #131517; --pre-text: #f3f1ea; --pre-line: #383b40; --pre-muted: #b3b1ab;
  --get: #7fdc98; --get-bg: #1c3324; --write: #ff9b85; --write-bg: #3d2420; --personal: #f2cf73; --personal-bg: #3a3017;
  --note-bg: #25282c; --warn-bg: #352b12; --warn-line: #b88a12;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.62 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 50; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 10px; }
.copy-area { position: fixed; left: -999px; top: 0; opacity: 0; }

/* Header */
.top { background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1560px; margin: 0 auto; padding: 0 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.logo { display: block; width: 110px; height: 28px; flex: none; }
.logo-d { display: none; }
.brand-tag { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 10px; white-space: nowrap; }
.top-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.top-tools a, .theme { font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.top-tools a:hover, .theme:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.theme { border-color: var(--line-strong); }
.store { display: none !important; }

/* Page list: a strip on small screens, a column on wide ones */
.strip { border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.strip ul, .side ul, .toc ul, .toc-m ul { list-style: none; margin: 0; padding: 0; }
.strip ul { display: flex; gap: 2px; padding: 6px 10px; width: max-content; }
.strip a { display: block; padding: 6px 10px; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--text-soft); text-decoration: none; white-space: nowrap; }
.strip a:hover { background: var(--bg-soft); color: var(--text); }
.strip a[aria-current="page"] { background: var(--bg-soft); color: var(--text); box-shadow: inset 0 -2px 0 var(--coral); }
.side, .toc { display: none; }

.shell { max-width: 1560px; margin: 0 auto; }
main { display: block; min-width: 0; padding: 20px 16px 40px; }
#main:focus { outline: none; }
.doc { max-width: 860px; }

/* "On this page" on small screens: stays at the top while the page scrolls */
.toc-m { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.toc-m summary { cursor: pointer; padding: 10px 16px; font-size: .9rem; font-weight: 600; color: var(--text-soft); }
.toc-m ul { max-height: 60vh; overflow-y: auto; padding: 0 16px 12px; }
.toc-m a, .toc a { display: block; padding: 4px 0; font-size: .88rem; color: var(--text-soft); text-decoration: none; overflow-wrap: anywhere; }
.toc-m a:hover, .toc a:hover { color: var(--link); text-decoration: underline; }
.toc-m .l3, .toc .l3 { padding-left: 12px; }
.toc-m .m, .toc .m { font-size: .66rem; padding: 1px 4px; min-width: 0; margin-right: 2px; }

/* Text */
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4.4vw, 2.4rem); font-weight: 700; letter-spacing: -.03em; margin-bottom: .5em; }
h2 { font-size: 1.42rem; font-weight: 650; margin: 2.2em 0 .6em; padding-top: .9em; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; font-weight: 650; margin: 1.8em 0 .5em; }
h4 { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 1.6em 0 .5em; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .25em 0; }
li > ul, li > ol { margin: .25em 0 .4em; }
.lead { font-size: 1.1rem; line-height: 1.55; color: var(--text-soft); }
.k { font-weight: 600; }
code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); color: var(--code-text); border-radius: 5px; padding: .1em .32em; overflow-wrap: anywhere; }
a code { color: inherit; }
kbd { font-family: var(--mono); font-size: .84em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; }

/* Code blocks: scroll inside themselves */
.code { margin: 0 0 1.2em; border-radius: 10px; background: var(--pre-bg); border: 1px solid var(--pre-line); max-width: 100%; overflow: hidden; }
.code-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--pre-line); }
.code-l { font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pre-muted); }
.copy { font: inherit; font-size: .78rem; font-weight: 600; color: var(--pre-text); background: none; border: 1px solid var(--pre-line); border-radius: 6px; padding: 3px 10px; min-height: 28px; cursor: pointer; }
.copy:hover { background: var(--pre-line); }
.copy:focus-visible, pre:focus-visible { outline-color: #ff9077; }
pre { margin: 0; padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: .84rem; line-height: 1.55; color: var(--pre-text); tab-size: 2; }
pre code { background: none; color: inherit; padding: 0; font-size: 1em; border-radius: 0; overflow-wrap: normal; white-space: pre; }

/* Tables: wide ones scroll inside their own box */
.tablewrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg-soft); white-space: nowrap; }
tbody th { font-weight: 400; }
tbody th code { background: none; padding: 0; font-weight: 600; }
.fields tbody th { min-width: 9.5em; }
.fields td { min-width: 6em; }
.fields td:last-child { min-width: 15em; }
.fields .ty { font-family: var(--mono); font-size: .8rem; color: var(--text-soft); white-space: nowrap; }
.fields .d1 { padding-left: 24px; }
.fields .d2 { padding-left: 36px; }
.status tbody th { min-width: 4.5em; width: 6em; }
.req { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--write); margin-left: 4px; }

/* Callouts */
.callout { margin: 0 0 1.2em; padding: 12px 14px; border-radius: 10px; background: var(--note-bg); border-left: 4px solid var(--line-strong); }
.callout p { margin: 0; }
.callout-warn { background: var(--warn-bg); border-left-color: var(--warn-line); }

/* Reference */
.m { display: inline-block; font-family: var(--mono); font-size: .74rem; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; min-width: 3.4em; text-align: center; vertical-align: middle; background: var(--get-bg); color: var(--get); }
.m-post, .m-put, .m-patch { background: var(--write-bg); color: var(--write); }
.op, .obj, .err { border-top: 1px solid var(--line); margin-top: 1.8em; padding-top: .2em; }
h2 + .op, h2 + .err, p + .obj { border-top: 0; margin-top: 0; }
.op h3, .obj h3, .err h3 { margin-top: 1.1em; }
.op h3 .path { font-size: 1.02rem; background: none; padding: 0; font-weight: 600; }
.op-sum { font-size: 1.04rem; font-weight: 600; margin-bottom: .4em; }
.op-meta { color: var(--text-soft); font-size: .92rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; margin-left: 6px; white-space: nowrap; }
.badge-write { background: var(--write-bg); color: var(--write); }
.badge-personal { background: var(--personal-bg); color: var(--personal); }
.oplink { white-space: nowrap; }
.oplink code { overflow-wrap: normal; }
.err h3 code { background: none; padding: 0; font-size: 1.02rem; }
.st { display: inline-block; font-family: var(--mono); font-size: .76rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--bg-soft); color: var(--text-soft); margin-left: 6px; vertical-align: middle; }
.err-msg { color: var(--text-soft); }
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.4em; margin: 0 0 1em; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: .1em; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--line-strong); font-size: .82rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cards { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cards li { margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); padding: 12px 14px; }
.cards a { font-weight: 600; }
.cards span { display: block; font-size: .9rem; color: var(--text-soft); }

.foot { max-width: 860px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.foot p { margin: 0 0 .4em; }

/* Dark logo */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-l { display: none; }
  :root:not([data-theme="light"]) .logo-d { display: block; }
}
:root[data-theme="dark"] .logo-l { display: none; }
:root[data-theme="dark"] .logo-d { display: block; }

/* Small screens: the header keeps logo, language and theme; tables with three or more columns become stacked rows */
@media (max-width: 479.98px) {
  .brand-tag { display: none; }
}
@media (max-width: 639.98px) {
  th, td { padding: 8px 10px; }
  .fields tbody th { min-width: 5.5em; }
  .fields td:last-child { min-width: 9em; }
  .fields:has(thead th:nth-child(3)),.fields:has(thead th:nth-child(3)) tbody { display: block; }
  .fields:has(thead th:nth-child(3)) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fields:has(thead th:nth-child(3)) tr { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .fields:has(thead th:nth-child(3)) tbody tr:last-child { border-bottom: 0; }
  .fields:has(thead th:nth-child(3)) tbody th, .fields:has(thead th:nth-child(3)) td { display: block; padding: 1px 0; border: 0; min-width: 0; }
  .fields:has(thead th:nth-child(3)) td:empty { display: none; }
  .fields:has(thead th:nth-child(3)) .ty { white-space: normal; }
}
@media (min-width: 480px) {
  .store { display: inline-flex !important; }
}
@media (min-width: 1000px) {
  .top { position: sticky; top: 0; z-index: 30; }
  .top-in { padding: 0 24px; }
  .strip, .toc-m { display: none; }
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; }
  .side { display: block; position: sticky; top: var(--hdr); max-height: calc(100vh - var(--hdr)); overflow-y: auto; padding: 24px 12px 24px 24px; }
  .side a { display: block; padding: 7px 12px; border-radius: 8px; font-size: .93rem; font-weight: 500; color: var(--text-soft); text-decoration: none; }
  .side a:hover { background: var(--bg-soft); color: var(--text); }
  .side a[aria-current="page"] { background: var(--bg-soft); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--coral); }
  main { padding: 32px 32px 56px; }
  html { scroll-padding-top: calc(var(--hdr) + 20px); }
}
@media (min-width: 1000px) and (max-width: 1279.98px) {
  .p-reference .toc-m { display: block; grid-column: 2; top: var(--hdr); margin: 0 32px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
}
@media (min-width: 1280px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr) 264px; }
  main { padding: 36px 48px 64px; }
  .toc { display: block; position: sticky; top: var(--hdr); max-height: calc(100vh - var(--hdr)); overflow-y: auto; padding: 36px 20px 24px 0; }
  .toc-h { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6em; }
}

@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --bg-soft: #f4f4f4; --bg-elev: #fff; --text: #000; --text-soft: #222; --muted: #444; --line: #bbb; --line-strong: #888; --link: #000;
    --code-bg: #f1f1f1; --code-text: #000; --pre-bg: #fff; --pre-text: #000; --pre-line: #888; --pre-muted: #444;
    --get: #000; --get-bg: #fff; --write: #000; --write-bg: #fff; --personal: #000; --personal-bg: #fff; --note-bg: #fff; --warn-bg: #fff;
    color-scheme: light;
  }
  .top, .side, .toc, .toc-m, .skip, .copy, .strip { display: none !important; }
  .shell { display: block; max-width: none; }
  main { padding: 0; }
  .doc, .foot { max-width: none; }
  body { font-size: 10.5pt; line-height: 1.45; }
  a { text-decoration: none; }
  pre { white-space: pre-wrap; overflow: visible; font-size: 8.5pt; }
  pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .tablewrap { overflow: visible; border-radius: 0; }
  table { font-size: 8.5pt; }
  th, td { padding: 3px 6px; }
  .fields .ty { white-space: normal; }
  .m, .badge, .st { border: 1px solid #000; }
  h2, h3, h4 { break-after: avoid; }
  tr, .code, .callout { break-inside: avoid; }
  .op { break-before: auto; }
}
